hibp 0.0.0-dev.9896b89a → 0.0.0-dev.d74e2ad2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/API.md +275 -198
  2. package/CHANGELOG.md +70 -0
  3. package/README.md +20 -22
  4. package/dist/browser/hibp.module.js +1 -1
  5. package/dist/browser/hibp.module.js.map +1 -1
  6. package/dist/browser/hibp.umd.js +1 -1
  7. package/dist/browser/hibp.umd.js.map +1 -1
  8. package/dist/cjs/api/fetch-polyfill.cjs +27 -0
  9. package/dist/cjs/api/fetch-polyfill.cjs.map +1 -0
  10. package/dist/cjs/api/haveibeenpwned/{fetchFromApi.js → fetch-from-api.cjs} +43 -38
  11. package/dist/cjs/api/haveibeenpwned/fetch-from-api.cjs.map +1 -0
  12. package/dist/cjs/api/haveibeenpwned/{responses.js → responses.cjs} +1 -7
  13. package/dist/cjs/api/haveibeenpwned/responses.cjs.map +1 -0
  14. package/dist/cjs/api/haveibeenpwned/types.cjs +2 -0
  15. package/dist/cjs/api/haveibeenpwned/types.cjs.map +1 -0
  16. package/dist/cjs/api/pwnedpasswords/fetch-from-api.cjs +53 -0
  17. package/dist/cjs/api/pwnedpasswords/fetch-from-api.cjs.map +1 -0
  18. package/dist/cjs/api/pwnedpasswords/{responses.js → responses.cjs} +1 -6
  19. package/dist/cjs/api/pwnedpasswords/responses.cjs.map +1 -0
  20. package/dist/cjs/{breach.js → breach.cjs} +14 -13
  21. package/dist/cjs/breach.cjs.map +1 -0
  22. package/dist/cjs/{breachedAccount.js → breached-account.cjs} +56 -56
  23. package/dist/cjs/breached-account.cjs.map +1 -0
  24. package/dist/cjs/{breaches.js → breaches.cjs} +29 -26
  25. package/dist/cjs/breaches.cjs.map +1 -0
  26. package/dist/cjs/{dataClasses.js → data-classes.cjs} +11 -12
  27. package/dist/cjs/data-classes.cjs.map +1 -0
  28. package/dist/cjs/hibp.cjs +23 -0
  29. package/dist/cjs/hibp.cjs.map +1 -0
  30. package/dist/cjs/hibp.d.cts +663 -0
  31. package/dist/cjs/{package.json.js → package.json.cjs} +2 -2
  32. package/dist/cjs/package.json.cjs.map +1 -0
  33. package/dist/cjs/{pasteAccount.js → paste-account.cjs} +28 -22
  34. package/dist/cjs/paste-account.cjs.map +1 -0
  35. package/dist/cjs/{pwnedPasswordRange.js → pwned-password-range.cjs} +44 -25
  36. package/dist/cjs/pwned-password-range.cjs.map +1 -0
  37. package/dist/cjs/{pwnedPassword.js → pwned-password.cjs} +20 -15
  38. package/dist/cjs/pwned-password.cjs.map +1 -0
  39. package/dist/cjs/{search.js → search.cjs} +51 -49
  40. package/dist/cjs/search.cjs.map +1 -0
  41. package/dist/cjs/subscription-status.cjs +56 -0
  42. package/dist/cjs/subscription-status.cjs.map +1 -0
  43. package/dist/esm/api/fetch-polyfill.js +25 -0
  44. package/dist/esm/api/fetch-polyfill.js.map +1 -0
  45. package/dist/esm/api/haveibeenpwned/{fetchFromApi.mjs → fetch-from-api.js} +43 -38
  46. package/dist/esm/api/haveibeenpwned/fetch-from-api.js.map +1 -0
  47. package/dist/esm/api/haveibeenpwned/{responses.mjs → responses.js} +2 -7
  48. package/dist/esm/api/haveibeenpwned/responses.js.map +1 -0
  49. package/dist/esm/api/haveibeenpwned/types.js +2 -0
  50. package/dist/esm/api/haveibeenpwned/types.js.map +1 -0
  51. package/dist/esm/api/pwnedpasswords/fetch-from-api.js +51 -0
  52. package/dist/esm/api/pwnedpasswords/fetch-from-api.js.map +1 -0
  53. package/dist/esm/api/pwnedpasswords/{responses.mjs → responses.js} +2 -6
  54. package/dist/esm/api/pwnedpasswords/responses.js.map +1 -0
  55. package/dist/esm/{breach.mjs → breach.js} +14 -13
  56. package/dist/esm/breach.js.map +1 -0
  57. package/dist/esm/{breachedAccount.mjs → breached-account.js} +56 -56
  58. package/dist/esm/breached-account.js.map +1 -0
  59. package/dist/esm/{breaches.mjs → breaches.js} +29 -26
  60. package/dist/esm/breaches.js.map +1 -0
  61. package/dist/esm/{dataClasses.mjs → data-classes.js} +11 -12
  62. package/dist/esm/data-classes.js.map +1 -0
  63. package/dist/esm/hibp.d.ts +663 -0
  64. package/dist/esm/hibp.js +11 -0
  65. package/dist/{cjs → esm}/hibp.js.map +1 -1
  66. package/dist/esm/package.json.js +4 -0
  67. package/dist/{cjs → esm}/package.json.js.map +1 -1
  68. package/dist/esm/{pasteAccount.mjs → paste-account.js} +28 -22
  69. package/dist/esm/paste-account.js.map +1 -0
  70. package/dist/esm/{pwnedPasswordRange.mjs → pwned-password-range.js} +44 -25
  71. package/dist/esm/pwned-password-range.js.map +1 -0
  72. package/dist/esm/{pwnedPassword.mjs → pwned-password.js} +20 -15
  73. package/dist/esm/pwned-password.js.map +1 -0
  74. package/dist/esm/{search.mjs → search.js} +51 -49
  75. package/dist/esm/search.js.map +1 -0
  76. package/dist/esm/subscription-status.js +54 -0
  77. package/dist/esm/subscription-status.js.map +1 -0
  78. package/example/runkit.js +13 -14
  79. package/package.json +57 -64
  80. package/dist/cjs/api/haveibeenpwned/fetchFromApi.js.map +0 -1
  81. package/dist/cjs/api/haveibeenpwned/index.js +0 -6
  82. package/dist/cjs/api/haveibeenpwned/index.js.map +0 -1
  83. package/dist/cjs/api/haveibeenpwned/responses.js.map +0 -1
  84. package/dist/cjs/api/pwnedpasswords/fetchFromApi.js +0 -44
  85. package/dist/cjs/api/pwnedpasswords/fetchFromApi.js.map +0 -1
  86. package/dist/cjs/api/pwnedpasswords/index.js +0 -5
  87. package/dist/cjs/api/pwnedpasswords/index.js.map +0 -1
  88. package/dist/cjs/api/pwnedpasswords/responses.js.map +0 -1
  89. package/dist/cjs/breach.js.map +0 -1
  90. package/dist/cjs/breachedAccount.js.map +0 -1
  91. package/dist/cjs/breaches.js.map +0 -1
  92. package/dist/cjs/dataClasses.js.map +0 -1
  93. package/dist/cjs/hibp.js +0 -21
  94. package/dist/cjs/pasteAccount.js.map +0 -1
  95. package/dist/cjs/pwnedPassword.js.map +0 -1
  96. package/dist/cjs/pwnedPasswordRange.js.map +0 -1
  97. package/dist/cjs/search.js.map +0 -1
  98. package/dist/esm/api/haveibeenpwned/fetchFromApi.mjs.map +0 -1
  99. package/dist/esm/api/haveibeenpwned/index.mjs +0 -2
  100. package/dist/esm/api/haveibeenpwned/index.mjs.map +0 -1
  101. package/dist/esm/api/haveibeenpwned/responses.mjs.map +0 -1
  102. package/dist/esm/api/pwnedpasswords/fetchFromApi.mjs +0 -42
  103. package/dist/esm/api/pwnedpasswords/fetchFromApi.mjs.map +0 -1
  104. package/dist/esm/api/pwnedpasswords/index.mjs +0 -2
  105. package/dist/esm/api/pwnedpasswords/index.mjs.map +0 -1
  106. package/dist/esm/api/pwnedpasswords/responses.mjs.map +0 -1
  107. package/dist/esm/breach.mjs.map +0 -1
  108. package/dist/esm/breachedAccount.mjs.map +0 -1
  109. package/dist/esm/breaches.mjs.map +0 -1
  110. package/dist/esm/dataClasses.mjs.map +0 -1
  111. package/dist/esm/hibp.mjs +0 -10
  112. package/dist/esm/hibp.mjs.map +0 -1
  113. package/dist/esm/package.json.mjs +0 -4
  114. package/dist/esm/package.json.mjs.map +0 -1
  115. package/dist/esm/pasteAccount.mjs.map +0 -1
  116. package/dist/esm/pwnedPassword.mjs.map +0 -1
  117. package/dist/esm/pwnedPasswordRange.mjs.map +0 -1
  118. package/dist/esm/search.mjs.map +0 -1
  119. package/dist/hibp.d.ts +0 -502
package/CHANGELOG.md CHANGED
@@ -1,5 +1,75 @@
1
1
  # Change Log
2
2
 
3
+ ## 14.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#438](https://github.com/wKovacs64/hibp/pull/438) [`3da8b89`](https://github.com/wKovacs64/hibp/commit/3da8b89dd835be1a059c7e51d41dbe6e542db184) Thanks [@wKovacs64](https://github.com/wKovacs64)! - Restore missing TypeScript declarations that were forgotten in v14.0.2 (PR #436).
8
+
9
+ ## 14.0.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#436](https://github.com/wKovacs64/hibp/pull/436) [`961d6e0`](https://github.com/wKovacs64/hibp/commit/961d6e000e20a4894443fa1c7f98c4224c590ff1) Thanks [@wKovacs64](https://github.com/wKovacs64)! - Fix CommonJS exports that broke in v14.0.0.
14
+
15
+ CommonJS consumers were getting an `ERR_REQUIRE_ESM` error as of v14.0.0 due to changing the project source to ESM in PR #420. This change resolves that by publishing the CommonJS files in `dist/cjs` with a `.cjs` file extension and the ESM files in `dist/esm` with the `.js` file extension.
16
+
17
+ ## 14.0.1
18
+
19
+ ### Patch Changes
20
+
21
+ - [#428](https://github.com/wKovacs64/hibp/pull/428) [`4a69884`](https://github.com/wKovacs64/hibp/commit/4a69884b3268b00bdf17808796d1d03ba9cc801a) Thanks [@wKovacs64](https://github.com/wKovacs64)! - Add descriptions to each config option for a better IDE experience.
22
+
23
+ ## 14.0.0
24
+
25
+ ### Major Changes
26
+
27
+ - [#410](https://github.com/wKovacs64/hibp/pull/410) [`2643a0c`](https://github.com/wKovacs64/hibp/commit/2643a0c6fbe7fba1787563087fa35ff36a9f8e1e) Thanks [@wKovacs64](https://github.com/wKovacs64)! - Drop support for Node.js 16 as it is [end-of-life](https://nodejs.org/en/download/releases), making the new minimum Node.js runtime v18.0.0. Please upgrade your Node.js environment if necessary, or continue using a previous release if you are unable to upgrade your environment.
28
+
29
+ ### Minor Changes
30
+
31
+ - [#425](https://github.com/wKovacs64/hibp/pull/425) [`cee2364`](https://github.com/wKovacs64/hibp/commit/cee236425a96855499b3b2d2b693ed83214efef8) Thanks [@wKovacs64](https://github.com/wKovacs64)! - Add a new `subscriptionStatus` module for retrieving the current subscription status of your HIBP API key. See https://haveibeenpwned.com/API/v3#SubscriptionStatus for more information.
32
+
33
+ - [#426](https://github.com/wKovacs64/hibp/pull/426) [`5ff6e28`](https://github.com/wKovacs64/hibp/commit/5ff6e2893b947c72addd2aec4777b8f863208c61) Thanks [@wKovacs64](https://github.com/wKovacs64)! - Refresh the project logo.
34
+
35
+ - [#422](https://github.com/wKovacs64/hibp/pull/422) [`be78f73`](https://github.com/wKovacs64/hibp/commit/be78f73a4c62bbd7f947a3a2ea1c108811304850) Thanks [@wKovacs64](https://github.com/wKovacs64)! - Add `mode` option to the `pwnedPasswordRange` module to enable support for returning NTLM suffixes.
36
+
37
+ - [#421](https://github.com/wKovacs64/hibp/pull/421) [`174ede4`](https://github.com/wKovacs64/hibp/commit/174ede4c9f8a0d5bf873502f6cfc7d4619f2b7d2) Thanks [@wKovacs64](https://github.com/wKovacs64)! - Add `addPadding` option to `pwnedPassword` and `pwnedPasswordRange` modules. See https://www.troyhunt.com/enhancing-pwned-passwords-privacy-with-padding/ for more information.
38
+
39
+ ### Patch Changes
40
+
41
+ - [#427](https://github.com/wKovacs64/hibp/pull/427) [`173a615`](https://github.com/wKovacs64/hibp/commit/173a6157c6e3e89d27922bea47b9c9da155a37f0) Thanks [@wKovacs64](https://github.com/wKovacs64)! - Fix the `subscriptionStatus` implementation from PR #425 so that it supports a proxy that inserts the `HIBP-API-Key` header (via the `baseUrl` option) in the case where the consumer doesn't have direct access to the API key.
42
+
43
+ - [#424](https://github.com/wKovacs64/hibp/pull/424) [`a512452`](https://github.com/wKovacs64/hibp/commit/a51245292e04d18c16538b9ce266fa1f0619c12c) Thanks [@wKovacs64](https://github.com/wKovacs64)! - Properly merge consumer-provided options with internal defaults.
44
+
45
+ - [#419](https://github.com/wKovacs64/hibp/pull/419) [`799669b`](https://github.com/wKovacs64/hibp/commit/799669b89e7fe58bfd781e0023c6bef92ee6e811) Thanks [@wKovacs64](https://github.com/wKovacs64)! - Update the `Breach` model to include the `IsMalware` and `IsSubscriptionFree` fields.
46
+
47
+ ## 13.0.0
48
+
49
+ ### Major Changes
50
+
51
+ - [#383](https://github.com/wKovacs64/hibp/pull/383) [`b837a57`](https://github.com/wKovacs64/hibp/commit/b837a57abf29bcc00d4d3a14bbfe38d4f80ca97d) Thanks [@wKovacs64](https://github.com/wKovacs64)! - Drop support for Node.js 14 as it is [end-of-life](https://nodejs.org/en/about/releases/), making the new minimum Node.js runtime v16.0.0. Please upgrade your Node.js environment if necessary, or continue using a previous release if you are unable to upgrade your environment.
52
+
53
+ - [#381](https://github.com/wKovacs64/hibp/pull/381) [`6711b59`](https://github.com/wKovacs64/hibp/commit/6711b5924d0f8bf2c8ba03462b305af1bf901b3f) Thanks [@wKovacs64](https://github.com/wKovacs64)! - Drop support for browsers without native Promise implementations. In reality, this likely didn't change anything.
54
+
55
+ ## 12.0.1
56
+
57
+ ### Patch Changes
58
+
59
+ - [#372](https://github.com/wKovacs64/hibp/pull/372) [`d2fb74f`](https://github.com/wKovacs64/hibp/commit/d2fb74f076e5f1873adc3e99f9894f77f3a64317) Thanks [@wKovacs64](https://github.com/wKovacs64)! - Publish types next to their CJS/ESM source files.
60
+
61
+ For reference, see the following Twitter thread from Andrew Branch: https://mobile.twitter.com/atcb/status/1634653474041503744?t=8RVawwsEHrxnCD8BaITckg
62
+
63
+ ## 12.0.0
64
+
65
+ ### Major Changes
66
+
67
+ - [#368](https://github.com/wKovacs64/hibp/pull/368) [`91909c1`](https://github.com/wKovacs64/hibp/commit/91909c19ec97ad8f444512943290e5dff88a0e06) Thanks [@wKovacs64](https://github.com/wKovacs64)! - Drop support for Node.js 12 as it is [end-of-life](https://nodejs.org/en/about/releases/), making the new minimum Node.js runtime v14.13.1. Please upgrade your Node.js environment if necessary, or continue using a previous release if you are unable to upgrade your environment.
68
+
69
+ ### Patch Changes
70
+
71
+ - [#367](https://github.com/wKovacs64/hibp/pull/367) [`95d6217`](https://github.com/wKovacs64/hibp/commit/95d6217d3290fc4f132384d61cefe4624b64cdaf) Thanks [@wKovacs64](https://github.com/wKovacs64)! - Replace the underlying `fetch` library. This shouldn't be noticeable to consumers, but replacing `isomorphic-unfetch` with our own conditional wrapper around `@remix-run/web-fetch` resolves a few compatibility issues the project has been facing.
72
+
3
73
  ## 11.1.1
4
74
 
5
75
  ### Patch Changes
package/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  # hibp
12
12
 
13
- _A Promise-based client for [Troy Hunt][troy]'s [Have I been
13
+ _An unofficial TypeScript SDK for [Troy Hunt][troy]'s [Have I been
14
14
  pwned?][haveibeenpwned] service._
15
15
 
16
16
  [![npm Version][npm-image]][npm-url] [![Build Status][ci-image]][ci-url]
@@ -25,11 +25,11 @@ In Node.js:
25
25
  npm install hibp
26
26
  ```
27
27
 
28
- In [Deno][deno] (via [Skypack][skypack]):
28
+ In [Deno][deno]:
29
29
 
30
30
  ```ts
31
- // Replace x.y.z with the desired hibp version ↓ ↓ ↓
32
- import * as hibp from 'https://cdn.skypack.dev/hibp@x.y.z?dts';
31
+ // Replace x.y.z with the desired hibp version
32
+ import * as hibp from 'npm:hibp@x.y.z';
33
33
  ```
34
34
 
35
35
  See the [browser](#using-in-the-browser) section below for information on how to
@@ -44,8 +44,9 @@ use it in the browser.
44
44
  - Get all pastes for an account 🔑
45
45
  - [Securely][search-by-range] check a password to see if it has been exposed in
46
46
  a data breach
47
- - Check a SHA-1 prefix to see if it has been exposed in a data breach
47
+ - Check a SHA-1 or NTLM prefix to see if it has been exposed in a data breach
48
48
  - Search for an account in both breaches and pastes at the same time 🔑
49
+ - Get your subscription status 🔑
49
50
  - All queries return a Promise
50
51
  - Available server-side (Node.js) and client-side (browser)
51
52
  - Written in TypeScript, so all modules come fully typed
@@ -80,6 +81,7 @@ The following modules are available:
80
81
  - [pwnedPassword](API.md#pwnedpassword)
81
82
  - [pwnedPasswordRange](API.md#pwnedpasswordrange)
82
83
  - [search](API.md#search)
84
+ - [subscriptionStatus](API.md#subscriptionstatus)
83
85
 
84
86
  Please see the [API reference](API.md) for more detailed usage information and
85
87
  examples.
@@ -89,8 +91,9 @@ examples.
89
91
  ```javascript
90
92
  import { search } from 'hibp';
91
93
 
92
- search('someAccountOrEmail', { apiKey: 'my-api-key' })
93
- .then((data) => {
94
+ async function main() {
95
+ try {
96
+ const data = await search('someAccountOrEmail', { apiKey: 'my-api-key' });
94
97
  if (data.breaches || data.pastes) {
95
98
  // Bummer...
96
99
  console.log(data);
@@ -98,11 +101,13 @@ search('someAccountOrEmail', { apiKey: 'my-api-key' })
98
101
  // Phew! We're clear.
99
102
  console.log('Good news — no pwnage found!');
100
103
  }
101
- })
102
- .catch((err) => {
104
+ } catch (err) {
103
105
  // Something went wrong.
104
106
  console.log(err.message);
105
- });
107
+ }
108
+ }
109
+
110
+ main();
106
111
  ```
107
112
 
108
113
  #### Rate Limiting
@@ -116,20 +121,13 @@ happen).
116
121
 
117
122
  #### Using in the browser
118
123
 
119
- **Prerequisite:** This module requires a Promise implementation to exist in the
120
- global namespace prior to being loaded. Therefore, to facilitate usage in
121
- [browsers without native Promise support][caniuse-promise], you are responsible
122
- for providing a polyfill. I recommend [es6-promise][es6-promise].
123
-
124
124
  You have several options for using this library in a browser environment:
125
125
 
126
126
  1. Bundled
127
127
 
128
128
  The most efficient and recommended method is to bundle it with client-side
129
- code using a module bundler like [webpack][webpack]. If your build process
130
- honors the `module` field in `package.json`, you can import the ECMAScript
131
- module as described [above](#usage). Otherwise, the `main` field resolves to
132
- the CommonJS module version.
129
+ code using a module bundler like [webpack][webpack] or, more likely, whatever
130
+ your framework of choice uses under the hood.
133
131
 
134
132
  1. UMD
135
133
 
@@ -182,6 +180,9 @@ You have several options for using this library in a browser environment:
182
180
  pwned?][haveibeenpwned]' service
183
181
  - [Password Lense][pwl] - a static web application to reveal character types in
184
182
  a password
183
+ - [Plasmic](https://www.plasmic.app/) - the open-source visual builder for your
184
+ tech stack
185
+ - [Medplum](https://www.medplum.com/) - fast and easy healthcare dev
185
186
  - [Hasura Backend Plus](https://nhost.github.io/hasura-backend-plus/) -
186
187
  Authentication & Storage for Hasura
187
188
  - [Staart API](https://staart.js.org/api/) - a Node.js backend starter for SaaS
@@ -204,7 +205,6 @@ This module is distributed under the [MIT License][license].
204
205
  https://img.shields.io/codecov/c/github/wKovacs64/hibp/main.svg?style=flat-square
205
206
  [coverage-url]: https://codecov.io/gh/wKovacs64/hibp/branch/main
206
207
  [deno]: https://deno.land/
207
- [skypack]: https://www.skypack.dev/
208
208
  [troy]: https://www.troyhunt.com
209
209
  [haveibeenpwned]: https://haveibeenpwned.com
210
210
  [haveibeenpwned-rate-limiting]: https://haveibeenpwned.com/API/v3#RateLimiting
@@ -217,8 +217,6 @@ This module is distributed under the [MIT License][license].
217
217
  [caniuse-esm]: https://caniuse.com/#feat=es6-module
218
218
  [js-modules]: https://v8.dev/features/modules#browser
219
219
  [webpack]: https://webpack.js.org
220
- [caniuse-promise]: https://caniuse.com/#search=promise
221
- [es6-promise]: https://github.com/stefanpenner/es6-promise
222
220
  [runkit]: https://runkit.com/npm/hibp
223
221
  [pwned]: https://github.com/wKovacs64/pwned
224
222
  [pulls]: https://github.com/wKovacs64/hibp/pulls
@@ -1,2 +1,2 @@
1
- var t=globalThis.fetch;new Map;const e=400,n="Bad request — the account does not comply with an acceptable format.",r=401,s=403,o="Forbidden - access denied.",i=404,u=(new Map([["retry-after","2"]]),429);class h extends Error{retryAfterSeconds;constructor(t,e,n){super(e,n),this.name=this.constructor.name,this.retryAfterSeconds="string"==typeof t?Number.parseInt(t,10):void 0}}function a(a,{apiKey:c,baseUrl:f="https://haveibeenpwned.com/api/v3",userAgent:l}={}){const p={};c&&(p["HIBP-API-Key"]=c),l&&(p["User-Agent"]=l),l||"undefined"!=typeof navigator||(p["User-Agent"]="hibp 0.0.0-dev.9896b89a");const d={headers:p},g=`${f.replace(/\/$/g,"")}${a}`;return t(g,d).then((t=>{if(t.ok)return t.json();switch(t.status){case e:throw Error(n);case r:return t.json().then((t=>{throw Error(t.message)}));case s:{const e=t.headers.get("cf-ray");if(e)throw Error(function(t){return`Request blocked, contact haveibeenpwned.com if this continues (Ray ID: ${t})`}(e));throw Error(o)}case i:return null;case u:return t.json().then((e=>{const n=t.headers.get("retry-after");throw new h(n,e.message)}));default:throw Error(t.statusText)}}))}function c(t,e={}){return a("/breach/"+encodeURIComponent(t),e)}function f(t,e={includeUnverified:!0,truncate:!0}){const n=`/breachedaccount/${encodeURIComponent(t)}?`,r=[];return e.domain&&r.push("domain="+encodeURIComponent(e.domain)),!1===e.includeUnverified&&r.push("includeUnverified=false"),!1===e.truncate&&r.push("truncateResponse=false"),a(`${n}${r.join("&")}`,{apiKey:e.apiKey,baseUrl:e.baseUrl,userAgent:e.userAgent})}function l(t={}){const e=[];return t.domain&&e.push("domain="+encodeURIComponent(t.domain)),a("/breaches?"+e.join("&"),{baseUrl:t.baseUrl,userAgent:t.userAgent})}function p(t={}){return a("/dataclasses",t)}function d(t,e={}){return a("/pasteaccount/"+encodeURIComponent(t),{apiKey:e.apiKey,baseUrl:e.baseUrl,userAgent:e.userAgent})}const g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function A(t,e,n,r){let s,o,i;const u=e||[0],h=(n=n||0)>>>3,a=-1===r?3:0;for(s=0;t.length>s;s+=1)i=s+h,o=i>>>2,o>=u.length&&u.push(0),u[o]|=t[s]<<8*(a+r*(i%4));return{value:u,binLen:8*t.length+n}}function m(t,e,n){switch(e){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(t){case"HEX":return function(t,e,r){return function(t,e,n,r){let s,o,i,u;if(0!=t.length%2)throw Error("String of HEX type must be in byte increments");const h=e||[0],a=(n=n||0)>>>3,c=-1===r?3:0;for(s=0;t.length>s;s+=2){if(o=parseInt(t.substr(s,2),16),isNaN(o))throw Error("String of HEX type contains invalid characters");for(u=(s>>>1)+a,i=u>>>2;i>=h.length;)h.push(0);h[i]|=o<<8*(c+r*(u%4))}return{value:h,binLen:4*t.length+n}}(t,e,r,n)};case"TEXT":return function(t,r,s){return function(t,e,n,r,s){let o,i,u,h,a,c,f,l,p=0;const d=n||[0],g=(r=r||0)>>>3;if("UTF8"===e)for(f=-1===s?3:0,u=0;t.length>u;u+=1)for(o=t.charCodeAt(u),i=[],128>o?i.push(o):2048>o?(i.push(192|o>>>6),i.push(128|63&o)):55296>o||o>=57344?i.push(224|o>>>12,128|o>>>6&63,128|63&o):(u+=1,o=65536+((1023&o)<<10|1023&t.charCodeAt(u)),i.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),h=0;i.length>h;h+=1){for(c=p+g,a=c>>>2;a>=d.length;)d.push(0);d[a]|=i[h]<<8*(f+s*(c%4)),p+=1}else for(f=-1===s?2:0,l="UTF16LE"===e&&1!==s||"UTF16LE"!==e&&1===s,u=0;t.length>u;u+=1){for(o=t.charCodeAt(u),!0===l&&(h=255&o,o=h<<8|o>>>8),c=p+g,a=c>>>2;a>=d.length;)d.push(0);d[a]|=o<<8*(f+s*(c%4)),p+=2}return{value:d,binLen:8*p+r}}(t,e,r,s,n)};case"B64":return function(t,e,r){return function(t,e,n,r){let s,o,i,u,h,a,c,f=0;const l=e||[0],p=(n=n||0)>>>3,d=-1===r?3:0,A=t.indexOf("=");if(-1===t.search(/^[a-zA-Z0-9=+/]+$/))throw Error("Invalid character in base-64 string");if(t=t.replace(/=/g,""),-1!==A&&t.length>A)throw Error("Invalid '=' found in base-64 string");for(o=0;t.length>o;o+=4){for(h=t.substr(o,4),u=0,i=0;h.length>i;i+=1)s=g.indexOf(h.charAt(i)),u|=s<<18-6*i;for(i=0;h.length-1>i;i+=1){for(c=f+p,a=c>>>2;a>=l.length;)l.push(0);l[a]|=(u>>>16-8*i&255)<<8*(d+r*(c%4)),f+=1}}return{value:l,binLen:8*f+n}}(t,e,r,n)};case"BYTES":return function(t,e,r){return function(t,e,n,r){let s,o,i,u;const h=e||[0],a=(n=n||0)>>>3,c=-1===r?3:0;for(o=0;t.length>o;o+=1)s=t.charCodeAt(o),u=o+a,i=u>>>2,i>=h.length&&h.push(0),h[i]|=s<<8*(c+r*(u%4));return{value:h,binLen:8*t.length+n}}(t,e,r,n)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(t){throw Error("ARRAYBUFFER not supported by this environment")}return function(t,e,r){return function(t,e,n,r){return A(new Uint8Array(t),e,n,r)}(t,e,r,n)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(t){throw Error("UINT8ARRAY not supported by this environment")}return function(t,e,r){return A(t,e,r,n)};default:throw Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function U(t,e,n,r){switch(t){case"HEX":return function(t){return function(t,e,n,r){const s="0123456789abcdef";let o,i,u="";const h=e/8,a=-1===n?3:0;for(o=0;h>o;o+=1)i=t[o>>>2]>>>8*(a+n*(o%4)),u+=s.charAt(i>>>4&15)+s.charAt(15&i);return r.outputUpper?u.toUpperCase():u}(t,e,n,r)};case"B64":return function(t){return function(t,e,n,r){let s,o,i,u,h,a="";const c=e/8,f=-1===n?3:0;for(s=0;c>s;s+=3)for(u=c>s+1?t[s+1>>>2]:0,h=c>s+2?t[s+2>>>2]:0,i=(t[s>>>2]>>>8*(f+n*(s%4))&255)<<16|(u>>>8*(f+n*((s+1)%4))&255)<<8|h>>>8*(f+n*((s+2)%4))&255,o=0;4>o;o+=1)a+=8*s+6*o>e?r.b64Pad:g.charAt(i>>>6*(3-o)&63);return a}(t,e,n,r)};case"BYTES":return function(t){return function(t,e,n){let r,s,o="";const i=e/8,u=-1===n?3:0;for(r=0;i>r;r+=1)s=t[r>>>2]>>>8*(u+n*(r%4))&255,o+=String.fromCharCode(s);return o}(t,e,n)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(t){throw Error("ARRAYBUFFER not supported by this environment")}return function(t){return function(t,e,n){let r;const s=e/8,o=new ArrayBuffer(s),i=new Uint8Array(o),u=-1===n?3:0;for(r=0;s>r;r+=1)i[r]=t[r>>>2]>>>8*(u+n*(r%4))&255;return o}(t,e,n)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(t){throw Error("UINT8ARRAY not supported by this environment")}return function(t){return function(t,e,n){let r;const s=e/8,o=-1===n?3:0,i=new Uint8Array(s);for(r=0;s>r;r+=1)i[r]=t[r>>>2]>>>8*(o+n*(r%4))&255;return i}(t,e,n)};default:throw Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function E(t){const e={outputUpper:!1,b64Pad:"=",outputLen:-1},n=t||{},r="Output length must be a multiple of 8";if(e.outputUpper=n.outputUpper||!1,n.b64Pad&&(e.b64Pad=n.b64Pad),n.outputLen){if(n.outputLen%8!=0)throw Error(r);e.outputLen=n.outputLen}else if(n.shakeLen){if(n.shakeLen%8!=0)throw Error(r);e.outputLen=n.shakeLen}if("boolean"!=typeof e.outputUpper)throw Error("Invalid outputUpper formatting option");if("string"!=typeof e.b64Pad)throw Error("Invalid b64Pad formatting option");return e}function b(t,e){return t<<e|t>>>32-e}function w(t,e,n){return t^e^n}function R(t,e,n){return t&e^t&n^e&n}function y(t,e){const n=(65535&t)+(65535&e);return(65535&(t>>>16)+(e>>>16)+(n>>>16))<<16|65535&n}function v(t,e,n,r,s){const o=(65535&t)+(65535&e)+(65535&n)+(65535&r)+(65535&s);return(65535&(t>>>16)+(e>>>16)+(n>>>16)+(r>>>16)+(s>>>16)+(o>>>16))<<16|65535&o}function T(t){return[1732584193,4023233417,2562383102,271733878,3285377520]}function C(t,e){let n,r,s,o,i,u,h;const a=[];for(n=e[0],r=e[1],s=e[2],o=e[3],i=e[4],h=0;80>h;h+=1)a[h]=16>h?t[h]:b(a[h-3]^a[h-8]^a[h-14]^a[h-16],1),u=20>h?v(b(n,5),(c=r)&s^~c&o,i,1518500249,a[h]):40>h?v(b(n,5),w(r,s,o),i,1859775393,a[h]):60>h?v(b(n,5),R(r,s,o),i,2400959708,a[h]):v(b(n,5),w(r,s,o),i,3395469782,a[h]),i=o,o=s,s=b(r,30),r=n,n=u;var c;return e[0]=y(n,e[0]),e[1]=y(r,e[1]),e[2]=y(s,e[2]),e[3]=y(o,e[3]),e[4]=y(i,e[4]),e}function B(t,e,n,r){let s;const o=15+(e+65>>>9<<4),i=e+n;for(;o>=t.length;)t.push(0);for(t[e>>>5]|=128<<24-e%32,t[o]=4294967295&i,t[o-1]=i/4294967296|0,s=0;t.length>s;s+=16)r=C(t.slice(s,s+16),r);return r}class F extends class{constructor(t,e,n){const r=n||{};if(this.t=e,this.i=r.encoding||"UTF8",this.numRounds=r.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw Error("numRounds must a integer >= 1");this.o=t,this.h=[],this.u=0,this.l=!1,this.A=0,this.p=!1,this.R=[],this.U=[]}update(t){let e,n=0;const r=this.T>>>5,s=this.F(t,this.h,this.u),o=s.binLen,i=s.value,u=o>>>5;for(e=0;u>e;e+=r)o>=n+this.T&&(this.m=this.g(i.slice(e,e+r),this.m),n+=this.T);return this.A+=n,this.h=i.slice(n>>>5),this.u=o%this.T,this.l=!0,this}getHash(t,e){let n,r,s=this.B;const o=E(e);if(this.v){if(-1===o.outputLen)throw Error("Output length must be specified in options");s=o.outputLen}const i=U(t,s,this.Y,o);if(this.p&&this.H)return i(this.H(o));for(r=this.C(this.h.slice(),this.u,this.A,this.I(this.m),s),n=1;this.numRounds>n;n+=1)this.v&&s%32!=0&&(r[r.length-1]&=16777215>>>24-s%32),r=this.C(r,s,0,this.L(this.o),s);return i(r)}setHMACKey(t,e,n){if(!this.M)throw Error("Variant does not support HMAC");if(this.l)throw Error("Cannot set MAC key after calling update");const r=m(e,(n||{}).encoding||"UTF8",this.Y);this.N(r(t))}N(t){const e=this.T>>>3,n=e/4-1;let r;if(1!==this.numRounds)throw Error("Cannot set numRounds with MAC");if(this.p)throw Error("MAC key already set");for(t.binLen/8>e&&(t.value=this.C(t.value,t.binLen,0,this.L(this.o),this.B));n>=t.value.length;)t.value.push(0);for(r=0;n>=r;r+=1)this.R[r]=909522486^t.value[r],this.U[r]=1549556828^t.value[r];this.m=this.g(this.R,this.m),this.A=this.T,this.p=!0}getHMAC(t,e){const n=E(e);return U(t,this.B,this.Y,n)(this.S())}S(){let t;if(!this.p)throw Error("Cannot call getHMAC without first setting MAC key");const e=this.C(this.h.slice(),this.u,this.A,this.I(this.m),this.B);return t=this.g(this.U,this.L(this.o)),t=this.C(e,this.B,this.T,t,this.B),t}}{constructor(t,e,n){if("SHA-1"!==t)throw Error("Chosen SHA variant is not supported");super(t,e,n);const r=n||{};this.M=!0,this.H=this.S,this.Y=-1,this.F=m(this.t,this.i,this.Y),this.g=C,this.I=function(t){return t.slice()},this.L=T,this.C=B,this.m=[1732584193,4023233417,2562383102,271733878,3285377520],this.T=512,this.B=160,this.v=!1,r.hmacKey&&this.N(function(t,e,n,r){const s="hmacKey must include a value and format";if(!e)throw Error(s);if(void 0===e.value||!e.format)throw Error(s);return m(e.format,e.encoding||"UTF8",n)(e.value)}(0,r.hmacKey,this.Y))}}const L=400;function I(e,n={}){return function(e,{baseUrl:n="https://api.pwnedpasswords.com",userAgent:r}={}){const s=Object.assign({},r?{headers:{"User-Agent":r}}:{}),o=`${n.replace(/\/$/g,"")}${e}`;return t(o,s).then((t=>{if(t.ok)return t.text();if(t.status===L)return t.text().then((t=>{throw Error(t)}));throw Error(t.statusText)}))}("/range/"+encodeURIComponent(e),n).then((t=>t.split("\n").filter(Boolean))).then((t=>t.reduce(((t,e)=>{const[n,r]=e.split(":");return t[n]=parseInt(r,10),t}),{})))}function Y(t,e={}){const n=new F("SHA-1","TEXT");n.update(t);const r=n.getHash("HEX",{outputUpper:!0}),s=r.slice(0,5),o=r.slice(5);return I(s,e).then((t=>t[o]||0))}function H(t,e={truncate:!0}){const{apiKey:n,baseUrl:r,userAgent:s}=e;return Promise.all([f(t,e),/^.+@.+$/.test(t)?d(t,{apiKey:n,baseUrl:r,userAgent:s}):null]).then((t=>({breaches:t[0],pastes:t[1]})))}export{h as RateLimitError,c as breach,f as breachedAccount,l as breaches,p as dataClasses,d as pasteAccount,Y as pwnedPassword,I as pwnedPasswordRange,H as search};
1
+ const t="hibp",e="0.0.0-dev.d74e2ad2";function n(){if("undefined"!=typeof process&&process.versions.node.startsWith("18.")){const{File:t,fetch:e,FormData:n,Headers:r,Request:s,Response:o}=require("undici");global.File=t,global.Headers=r,global.Request=s,global.Response=o,global.fetch=e,global.FormData=n}}const r=new Map,s={headers:r,status:400,statusText:"Bad request — the account does not comply with an acceptable format."},o={headers:r,status:401,body:{statusCode:401,message:"Access denied due to missing hibp-api-key."}},i={headers:r,status:403,statusText:"Forbidden - access denied."},u={headers:r,status:404},a={headers:new Map([["retry-after","2"]]),status:429,body:{statusCode:429,message:"Rate limit is exceeded. Try again in 2 seconds."}};n();class h extends Error{retryAfterSeconds;constructor(t,e,n){super(e,n),this.name=this.constructor.name,this.retryAfterSeconds="string"==typeof t?Number.parseInt(t,10):void 0}}async function c(n,r={}){const{apiKey:c,baseUrl:f="https://haveibeenpwned.com/api/v3",userAgent:d}=r,l={};c&&(l["HIBP-API-Key"]=c),d&&(l["User-Agent"]=d),d||"undefined"!=typeof navigator||(l["User-Agent"]=`${t} ${e}`);const p={headers:l},g=`${f.replace(/\/$/g,"")}${n}`,m=await fetch(g,p);if(m.ok)return m.json();switch(m.status){case s.status:throw Error(s.statusText);case o.status:{const t=await m.json();throw Error(t.message)}case i.status:{const t=m.headers.get("cf-ray");if(t)throw Error(function(t){return`Request blocked, contact haveibeenpwned.com if this continues (Ray ID: ${t})`}(t));throw Error(i.statusText)}case u.status:return null;case a.status:{const t=await m.json(),e=m.headers.get("retry-after");throw new h(e,t.message)}default:throw Error(m.statusText)}}function f(t,e={}){return c("/breach/"+encodeURIComponent(t),e)}function d(t,e={}){const{apiKey:n,domain:r,includeUnverified:s=!0,truncate:o=!0,baseUrl:i,userAgent:u}=e,a=`/breachedaccount/${encodeURIComponent(t)}?`,h=[];return r&&h.push("domain="+encodeURIComponent(r)),s||h.push("includeUnverified=false"),o||h.push("truncateResponse=false"),c(`${a}${h.join("&")}`,{apiKey:n,baseUrl:i,userAgent:u})}function l(t={}){const{domain:e,baseUrl:n,userAgent:r}=t,s=[];return e&&s.push("domain="+encodeURIComponent(e)),c("/breaches?"+s.join("&"),{baseUrl:n,userAgent:r})}function p(t={}){return c("/dataclasses",t)}function g(t,e={}){return c("/pasteaccount/"+encodeURIComponent(t),e)}const m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A="ARRAYBUFFER not supported by this environment",b="UINT8ARRAY not supported by this environment";function w(t,e,n,r){let s,o,i;const u=e||[0],a=(n=n||0)>>>3,h=-1===r?3:0;for(s=0;t.length>s;s+=1)i=s+a,o=i>>>2,o>=u.length&&u.push(0),u[o]|=t[s]<<8*(h+r*(i%4));return{value:u,binLen:8*t.length+n}}function U(t,e,n){switch(e){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(t){case"HEX":return function(t,e,r){return function(t,e,n,r){let s,o,i,u;if(0!=t.length%2)throw Error("String of HEX type must be in byte increments");const a=e||[0],h=(n=n||0)>>>3,c=-1===r?3:0;for(s=0;t.length>s;s+=2){if(o=parseInt(t.substr(s,2),16),isNaN(o))throw Error("String of HEX type contains invalid characters");for(u=(s>>>1)+h,i=u>>>2;i>=a.length;)a.push(0);a[i]|=o<<8*(c+r*(u%4))}return{value:a,binLen:4*t.length+n}}(t,e,r,n)};case"TEXT":return function(t,r,s){return function(t,e,n,r,s){let o,i,u,a,h,c,f,d,l=0;const p=n||[0],g=(r=r||0)>>>3;if("UTF8"===e)for(f=-1===s?3:0,u=0;t.length>u;u+=1)for(o=t.charCodeAt(u),i=[],128>o?i.push(o):2048>o?(i.push(192|o>>>6),i.push(128|63&o)):55296>o||o>=57344?i.push(224|o>>>12,128|o>>>6&63,128|63&o):(u+=1,o=65536+((1023&o)<<10|1023&t.charCodeAt(u)),i.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),a=0;i.length>a;a+=1){for(c=l+g,h=c>>>2;h>=p.length;)p.push(0);p[h]|=i[a]<<8*(f+s*(c%4)),l+=1}else for(f=-1===s?2:0,d="UTF16LE"===e&&1!==s||"UTF16LE"!==e&&1===s,u=0;t.length>u;u+=1){for(o=t.charCodeAt(u),!0===d&&(a=255&o,o=a<<8|o>>>8),c=l+g,h=c>>>2;h>=p.length;)p.push(0);p[h]|=o<<8*(f+s*(c%4)),l+=2}return{value:p,binLen:8*l+r}}(t,e,r,s,n)};case"B64":return function(t,e,r){return function(t,e,n,r){let s,o,i,u,a,h,c,f=0;const d=e||[0],l=(n=n||0)>>>3,p=-1===r?3:0,g=t.indexOf("=");if(-1===t.search(/^[a-zA-Z0-9=+/]+$/))throw Error("Invalid character in base-64 string");if(t=t.replace(/=/g,""),-1!==g&&t.length>g)throw Error("Invalid '=' found in base-64 string");for(o=0;t.length>o;o+=4){for(a=t.substr(o,4),u=0,i=0;a.length>i;i+=1)s=m.indexOf(a.charAt(i)),u|=s<<18-6*i;for(i=0;a.length-1>i;i+=1){for(c=f+l,h=c>>>2;h>=d.length;)d.push(0);d[h]|=(u>>>16-8*i&255)<<8*(p+r*(c%4)),f+=1}}return{value:d,binLen:8*f+n}}(t,e,r,n)};case"BYTES":return function(t,e,r){return function(t,e,n,r){let s,o,i,u;const a=e||[0],h=(n=n||0)>>>3,c=-1===r?3:0;for(o=0;t.length>o;o+=1)s=t.charCodeAt(o),u=o+h,i=u>>>2,i>=a.length&&a.push(0),a[i]|=s<<8*(c+r*(u%4));return{value:a,binLen:8*t.length+n}}(t,e,r,n)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(t){throw Error(A)}return function(t,e,r){return function(t,e,n,r){return w(new Uint8Array(t),e,n,r)}(t,e,r,n)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(t){throw Error(b)}return function(t,e,r){return w(t,e,r,n)};default:throw Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function E(t,e,n,r){switch(t){case"HEX":return function(t){return function(t,e,n,r){const s="0123456789abcdef";let o,i,u="";const a=e/8,h=-1===n?3:0;for(o=0;a>o;o+=1)i=t[o>>>2]>>>8*(h+n*(o%4)),u+=s.charAt(i>>>4&15)+s.charAt(15&i);return r.outputUpper?u.toUpperCase():u}(t,e,n,r)};case"B64":return function(t){return function(t,e,n,r){let s,o,i,u,a,h="";const c=e/8,f=-1===n?3:0;for(s=0;c>s;s+=3)for(u=c>s+1?t[s+1>>>2]:0,a=c>s+2?t[s+2>>>2]:0,i=(t[s>>>2]>>>8*(f+n*(s%4))&255)<<16|(u>>>8*(f+n*((s+1)%4))&255)<<8|a>>>8*(f+n*((s+2)%4))&255,o=0;4>o;o+=1)h+=8*s+6*o>e?r.b64Pad:m.charAt(i>>>6*(3-o)&63);return h}(t,e,n,r)};case"BYTES":return function(t){return function(t,e,n){let r,s,o="";const i=e/8,u=-1===n?3:0;for(r=0;i>r;r+=1)s=t[r>>>2]>>>8*(u+n*(r%4))&255,o+=String.fromCharCode(s);return o}(t,e,n)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(t){throw Error(A)}return function(t){return function(t,e,n){let r;const s=e/8,o=new ArrayBuffer(s),i=new Uint8Array(o),u=-1===n?3:0;for(r=0;s>r;r+=1)i[r]=t[r>>>2]>>>8*(u+n*(r%4))&255;return o}(t,e,n)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(t){throw Error(b)}return function(t){return function(t,e,n){let r;const s=e/8,o=-1===n?3:0,i=new Uint8Array(s);for(r=0;s>r;r+=1)i[r]=t[r>>>2]>>>8*(o+n*(r%4))&255;return i}(t,e,n)};default:throw Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function y(t){const e={outputUpper:!1,b64Pad:"=",outputLen:-1},n=t||{},r="Output length must be a multiple of 8";if(e.outputUpper=n.outputUpper||!1,n.b64Pad&&(e.b64Pad=n.b64Pad),n.outputLen){if(n.outputLen%8!=0)throw Error(r);e.outputLen=n.outputLen}else if(n.shakeLen){if(n.shakeLen%8!=0)throw Error(r);e.outputLen=n.shakeLen}if("boolean"!=typeof e.outputUpper)throw Error("Invalid outputUpper formatting option");if("string"!=typeof e.b64Pad)throw Error("Invalid b64Pad formatting option");return e}class R{constructor(t,e,n){const r=n||{};if(this.t=e,this.i=r.encoding||"UTF8",this.numRounds=r.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw Error("numRounds must a integer >= 1");this.o=t,this.h=[],this.u=0,this.l=!1,this.A=0,this.p=!1,this.U=[],this.R=[]}update(t){let e,n=0;const r=this.T>>>5,s=this.F(t,this.h,this.u),o=s.binLen,i=s.value,u=o>>>5;for(e=0;u>e;e+=r)o>=n+this.T&&(this.m=this.g(i.slice(e,e+r),this.m),n+=this.T);return this.A+=n,this.h=i.slice(n>>>5),this.u=o%this.T,this.l=!0,this}getHash(t,e){let n,r,s=this.B;const o=y(e);if(this.v){if(-1===o.outputLen)throw Error("Output length must be specified in options");s=o.outputLen}const i=E(t,s,this.H,o);if(this.p&&this.C)return i(this.C(o));for(r=this.Y(this.h.slice(),this.u,this.A,this.I(this.m),s),n=1;this.numRounds>n;n+=1)this.v&&s%32!=0&&(r[r.length-1]&=16777215>>>24-s%32),r=this.Y(r,s,0,this.L(this.o),s);return i(r)}setHMACKey(t,e,n){if(!this.M)throw Error("Variant does not support HMAC");if(this.l)throw Error("Cannot set MAC key after calling update");const r=U(e,(n||{}).encoding||"UTF8",this.H);this.N(r(t))}N(t){const e=this.T>>>3,n=e/4-1;let r;if(1!==this.numRounds)throw Error("Cannot set numRounds with MAC");if(this.p)throw Error("MAC key already set");for(t.binLen/8>e&&(t.value=this.Y(t.value,t.binLen,0,this.L(this.o),this.B));n>=t.value.length;)t.value.push(0);for(r=0;n>=r;r+=1)this.U[r]=909522486^t.value[r],this.R[r]=1549556828^t.value[r];this.m=this.g(this.U,this.m),this.A=this.T,this.p=!0}getHMAC(t,e){const n=y(e);return E(t,this.B,this.H,n)(this.S())}S(){let t;if(!this.p)throw Error("Cannot call getHMAC without first setting MAC key");const e=this.Y(this.h.slice(),this.u,this.A,this.I(this.m),this.B);return t=this.g(this.R,this.L(this.o)),t=this.Y(e,this.B,this.T,t,this.B),t}}function T(t,e){return t<<e|t>>>32-e}function v(t,e,n){return t^e^n}function C(t,e,n){return t&e^t&n^e&n}function F(t,e){const n=(65535&t)+(65535&e);return(65535&(t>>>16)+(e>>>16)+(n>>>16))<<16|65535&n}function B(t,e,n,r,s){const o=(65535&t)+(65535&e)+(65535&n)+(65535&r)+(65535&s);return(65535&(t>>>16)+(e>>>16)+(n>>>16)+(r>>>16)+(s>>>16)+(o>>>16))<<16|65535&o}function L(t){return[1732584193,4023233417,2562383102,271733878,3285377520]}function H(t,e){let n,r,s,o,i,u,a;const h=[];for(n=e[0],r=e[1],s=e[2],o=e[3],i=e[4],a=0;80>a;a+=1)h[a]=16>a?t[a]:T(h[a-3]^h[a-8]^h[a-14]^h[a-16],1),u=20>a?B(T(n,5),(c=r)&s^~c&o,i,1518500249,h[a]):40>a?B(T(n,5),v(r,s,o),i,1859775393,h[a]):60>a?B(T(n,5),C(r,s,o),i,2400959708,h[a]):B(T(n,5),v(r,s,o),i,3395469782,h[a]),i=o,o=s,s=T(r,30),r=n,n=u;var c;return e[0]=F(n,e[0]),e[1]=F(r,e[1]),e[2]=F(s,e[2]),e[3]=F(o,e[3]),e[4]=F(i,e[4]),e}function I(t,e,n,r){let s;const o=15+(e+65>>>9<<4),i=e+n;for(;o>=t.length;)t.push(0);for(t[e>>>5]|=128<<24-e%32,t[o]=4294967295&i,t[o-1]=i/4294967296|0,s=0;t.length>s;s+=16)r=H(t.slice(s,s+16),r);return r}class Y extends R{constructor(t,e,n){if("SHA-1"!==t)throw Error("Chosen SHA variant is not supported");super(t,e,n);const r=n||{};this.M=!0,this.C=this.S,this.H=-1,this.F=U(this.t,this.i,this.H),this.g=H,this.I=function(t){return t.slice()},this.L=L,this.Y=I,this.m=[1732584193,4023233417,2562383102,271733878,3285377520],this.T=512,this.B=160,this.v=!1,r.hmacKey&&this.N(function(t,e,n,r){const s="hmacKey must include a value and format";if(!e)throw Error(s);if(void 0===e.value||!e.format)throw Error(s);return U(e.format,e.encoding||"UTF8",n)(e.value)}(0,r.hmacKey,this.H))}}const x={status:400,body:"The hash prefix was not in a valid format"};async function S(t,e={}){const{baseUrl:n,userAgent:r,addPadding:s=!1,mode:o="sha1"}=e,i=await async function(t,e={}){const{baseUrl:n="https://api.pwnedpasswords.com",userAgent:r,addPadding:s=!1,mode:o="sha1"}=e,i=Object.assign({},r?{headers:{"User-Agent":r}}:{},s?{headers:{"Add-Padding":"true"}}:{}),u=`${n.replace(/\/$/g,"")}${t}?mode=${o}`,a=await fetch(u,i);if(a.ok)return a.text();if(a.status===x.status){const t=await a.text();throw Error(t)}throw Error(a.statusText)}("/range/"+encodeURIComponent(t),{baseUrl:n,userAgent:r,addPadding:s,mode:o});return i.split("\n").filter(Boolean).reduce(((t,e)=>{const[n,r]=e.split(":");return t[n]=Number.parseInt(r,10),t}),{})}async function N(t,e={}){const n=new Y("SHA-1","TEXT");n.update(t);const r=n.getHash("HEX",{outputUpper:!0}),s=r.slice(0,5),o=r.slice(5);return(await S(s,e))[o]||0}async function P(t,e={}){const{apiKey:n,domain:r,truncate:s=!0,baseUrl:o,userAgent:i}=e,[u,a]=await Promise.all([d(t,{apiKey:n,domain:r,truncate:s,baseUrl:o,userAgent:i}),/^.+@.+$/.test(t)?g(t,{apiKey:n,baseUrl:o,userAgent:i}):null]);return{breaches:u,pastes:a}}async function $(t={}){return c("/subscription/status",t)}n();export{h as RateLimitError,f as breach,d as breachedAccount,l as breaches,p as dataClasses,g as pasteAccount,N as pwnedPassword,S as pwnedPasswordRange,P as search,$ as subscriptionStatus};
2
2
  //# sourceMappingURL=hibp.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hibp.module.js","sources":["../../node_modules/@remix-run/web-fetch/src/lib.js","../../src/api/haveibeenpwned/responses.ts","../../src/api/haveibeenpwned/fetchFromApi.ts","../../src/breach.ts","../../src/breachedAccount.ts","../../src/breaches.ts","../../src/dataClasses.ts","../../src/pasteAccount.ts","../../node_modules/jssha/dist/sha1.mjs","../../src/api/pwnedpasswords/responses.ts","../../src/pwnedPasswordRange.ts","../../src/api/pwnedpasswords/fetchFromApi.ts","../../src/pwnedPassword.ts","../../src/search.ts"],"sourcesContent":["\n\n// On the web we just export native fetch implementation\nexport { ReadableStream, Blob, FormData } from './package.js';\nexport const { Headers, Request, Response } = globalThis;\nexport default globalThis.fetch\n\n","/**\n * Known potential responses from the remote API.\n *\n * Unfortunately, the API does not send a decent human-readable message back\n * with each response, but they are documented on the website:\n * https://haveibeenpwned.com/api/v3#ResponseCodes\n *\n * These objects simply provide a mapping between the HTTP response status code\n * and the corresponding human-readable message so we can throw a more\n * descriptive error for the consumer. (They are also leveraged in our tests.)\n */\n\nimport type { ResponseBody } from './types';\n\n/** @internal */\nexport interface HaveIBeenPwnedApiResponse {\n headers: Map<string, string>;\n status: number;\n statusText?: string;\n body?: ResponseBody;\n}\n\nconst emptyHeaders = new Map<string, string>();\n\n/** @internal */\nexport const OK: HaveIBeenPwnedApiResponse = {\n headers: emptyHeaders,\n status: 200,\n};\n\n/** @internal */\nexport const BAD_REQUEST: HaveIBeenPwnedApiResponse = {\n headers: emptyHeaders,\n status: 400,\n statusText:\n 'Bad request — the account does not comply with an acceptable format.',\n};\n\n/**\n * This response has unique behavior. For some reason, the API includes an\n * object in the response body for this one, containing a human-readable\n * message. Manually populating the message here purely for use in tests.\n *\n * @internal\n */\nexport const UNAUTHORIZED: HaveIBeenPwnedApiResponse = {\n headers: emptyHeaders,\n status: 401,\n body: {\n statusCode: 401,\n message: 'Access denied due to missing hibp-api-key.',\n },\n};\n\n/** @internal */\nexport const FORBIDDEN: HaveIBeenPwnedApiResponse = {\n headers: emptyHeaders,\n status: 403,\n statusText: 'Forbidden - access denied.',\n};\n\n/** @internal */\nexport const BLOCKED: HaveIBeenPwnedApiResponse = {\n headers: new Map([['cf-ray', 'someRayId']]),\n status: 403,\n};\n\n/** @internal */\nexport const NOT_FOUND: HaveIBeenPwnedApiResponse = {\n headers: emptyHeaders,\n status: 404,\n};\n\n/**\n * This response has unique behavior. For some reason, the API includes an\n * object in the response body for this one, containing a human-readable\n * message. Manually populating the message here purely for use in tests.\n *\n * @internal\n */\nexport const TOO_MANY_REQUESTS: HaveIBeenPwnedApiResponse = {\n headers: new Map([['retry-after', '2']]),\n status: 429,\n body: {\n statusCode: 429,\n message: 'Rate limit is exceeded. Try again in 2 seconds.',\n },\n};\n","import fetch from '@remix-run/web-fetch';\nimport { name, version } from '../../../package.json';\nimport {\n BAD_REQUEST,\n UNAUTHORIZED,\n FORBIDDEN,\n NOT_FOUND,\n TOO_MANY_REQUESTS,\n} from './responses';\nimport type { ApiData, ErrorData } from './types';\n\n/**\n * Custom error thrown when the haveibeenpwned.com API responds with 429 Too\n * Many Requests. See the `retryAfterSeconds` property for the number of seconds\n * to wait before attempting the request again.\n *\n * @see https://haveibeenpwned.com/API/v3#RateLimiting\n */\nexport class RateLimitError extends Error {\n /**\n * The number of seconds to wait before attempting the request again. May be\n * `undefined` if the API does not provide a `retry-after` header, but this\n * should never happen.\n */\n public retryAfterSeconds: number | undefined;\n\n constructor(\n retryAfter: ReturnType<Headers['get']>,\n message: string | undefined,\n options?: ErrorOptions,\n ) {\n super(message, options);\n this.name = this.constructor.name;\n this.retryAfterSeconds =\n typeof retryAfter === 'string'\n ? Number.parseInt(retryAfter, 10) /* c8 ignore start */\n : undefined;\n }\n}\n/* c8 ignore stop */\n\nfunction blockedWithRayId(rayId: string) {\n return `Request blocked, contact haveibeenpwned.com if this continues (Ray ID: ${rayId})`;\n}\n\n/**\n * Fetches data from the supplied API endpoint.\n *\n * HTTP status code 200 returns an Object (data found).\n * HTTP status code 404 returns null (no data found).\n * HTTP status code 400 throws an Error (bad request).\n * HTTP status code 401 throws an Error (unauthorized).\n * HTTP status code 403 throws an Error (forbidden).\n * HTTP status code 429 throws an Error (too many requests).\n *\n * @internal\n * @private\n * @param {string} endpoint the API endpoint to query\n * @param {object} [options] a configuration object\n * @param {string} [options.apiKey] an API key from\n * https://haveibeenpwned.com/API/Key\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {Promise<ApiData>} a Promise which resolves to the data resulting\n * from the query (or null for 404 Not Found responses), or rejects with an\n * Error\n */\nexport function fetchFromApi(\n endpoint: string,\n {\n apiKey,\n baseUrl = 'https://haveibeenpwned.com/api/v3',\n userAgent,\n }: { apiKey?: string; baseUrl?: string; userAgent?: string } = {},\n): Promise<ApiData> {\n const headers: Record<string, string> = {};\n\n if (apiKey) {\n headers['HIBP-API-Key'] = apiKey;\n }\n\n if (userAgent) {\n headers['User-Agent'] = userAgent;\n }\n\n // Provide a default User-Agent when running outside the browser\n if (!userAgent && typeof navigator === 'undefined') {\n headers['User-Agent'] = `${name} ${version}`;\n }\n\n const config = { headers };\n const url = `${baseUrl.replace(/\\/$/g, '')}${endpoint}`;\n\n return fetch(url, config).then((res) => {\n if (res.ok) return res.json() as Promise<ApiData>;\n\n switch (res.status) {\n case BAD_REQUEST.status:\n throw new Error(BAD_REQUEST.statusText);\n case UNAUTHORIZED.status:\n return res.json().then((body: ErrorData) => {\n throw new Error(body.message);\n });\n case FORBIDDEN.status: {\n const rayId = res.headers.get('cf-ray');\n if (rayId) {\n throw new Error(blockedWithRayId(rayId));\n }\n throw new Error(FORBIDDEN.statusText);\n }\n case NOT_FOUND.status:\n return null;\n case TOO_MANY_REQUESTS.status:\n return res.json().then((body: ErrorData) => {\n const retryAfter = res.headers.get('retry-after');\n throw new RateLimitError(retryAfter, body.message);\n });\n default:\n throw new Error(res.statusText);\n }\n });\n}\n","import type { Breach } from './api/haveibeenpwned/types';\nimport { fetchFromApi } from './api/haveibeenpwned';\n\n/**\n * An object representing a breach.\n *\n * @typedef {object} Breach\n * @property {string} Name\n * @property {string} Title\n * @property {string} Domain\n * @property {string} BreachDate\n * @property {string} AddedDate\n * @property {string} ModifiedDate\n * @property {number} PwnCount\n * @property {string} Description\n * @property {string} LogoPath\n * @property {string[]} DataClasses\n * @property {boolean} IsVerified\n * @property {boolean} IsFabricated\n * @property {boolean} IsSensitive\n * @property {boolean} IsRetired\n * @property {boolean} IsSpamList\n */\n\n/**\n * Fetches data for a specific breach event.\n *\n * @param {string} breachName the name of a breach in the system\n * @param {object} [options] a configuration object\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {(Promise<Breach>|Promise<null>)} a Promise which resolves to an\n * object representing a breach (or null if no breach was found), or rejects\n * with an Error\n * @example\n * breach('Adobe')\n * .then(data => {\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * })\n * .catch(err => {\n * // ...\n * });\n */\nexport function breach(\n breachName: string,\n options: { baseUrl?: string; userAgent?: string } = {},\n): Promise<Breach | null> {\n return fetchFromApi(\n `/breach/${encodeURIComponent(breachName)}`,\n options,\n ) as Promise<Breach | null>;\n}\n","import type { Breach } from './api/haveibeenpwned/types';\nimport { fetchFromApi } from './api/haveibeenpwned';\n\n/**\n * Fetches breach data for a specific account.\n *\n * ***Warning (July 18, 2019):***\n *\n * `haveibeenpwned.com` now requires an API key from\n * https://haveibeenpwned.com/API/Key for the `breachedaccount` endpoint. The\n * `apiKey` option here is not explicitly required, but direct requests made\n * without it (that is, without specifying a `baseUrl` to a proxy that inserts a\n * valid API key on your behalf) will fail.\n *\n * @param {string} account a username or email address\n * @param {object} [options] a configuration object\n * @param {string} [options.apiKey] an API key from\n * https://haveibeenpwned.com/API/Key (default: undefined)\n * @param {string} [options.domain] a domain by which to filter the results\n * (default: all domains)\n * @param {boolean} [options.includeUnverified] include \"unverified\" breaches in\n * the results (default: true)\n * @param {boolean} [options.truncate] truncate the results to only include\n * the name of each breach (default: true)\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {(Promise<Breach[]> | Promise<null>)} a Promise which resolves to an\n * array of breach objects (or null if no breaches were found), or rejects with\n * an Error\n * @example\n * breachedAccount('foo', { apiKey: 'my-api-key' })\n * .then(data => {\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * })\n * .catch(err => {\n * // ...\n * });\n * @example\n * breachedAccount('bar', {\n * includeUnverified: false,\n * baseUrl: 'https://my-hibp-proxy:8080',\n * })\n * .then(data => {\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * })\n * .catch(err => {\n * // ...\n * });\n * @example\n * breachedAccount('baz', {\n * apiKey: 'my-api-key',\n * domain: 'adobe.com',\n * truncate: false,\n * userAgent: 'my-app 1.0'\n * })\n * .then(data => {\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * })\n * .catch(err => {\n * // ...\n * });\n */\nexport function breachedAccount(\n account: string,\n options: {\n apiKey?: string;\n domain?: string;\n includeUnverified?: boolean;\n truncate?: boolean;\n baseUrl?: string;\n userAgent?: string;\n } = {\n includeUnverified: true,\n truncate: true,\n },\n): Promise<Breach[] | null> {\n const endpoint = `/breachedaccount/${encodeURIComponent(account)}?`;\n const params: Array<string> = [];\n if (options.domain) {\n params.push(`domain=${encodeURIComponent(options.domain)}`);\n }\n if (options.includeUnverified === false) {\n params.push('includeUnverified=false');\n }\n if (options.truncate === false) {\n params.push('truncateResponse=false');\n }\n return fetchFromApi(`${endpoint}${params.join('&')}`, {\n apiKey: options.apiKey,\n baseUrl: options.baseUrl,\n userAgent: options.userAgent,\n }) as Promise<Breach[] | null>;\n}\n","import type { Breach } from './api/haveibeenpwned/types';\nimport { fetchFromApi } from './api/haveibeenpwned';\n\n/**\n * Fetches all breach events in the system.\n *\n * @param {object} [options] a configuration object\n * @param {string} [options.domain] a domain by which to filter the results\n * (default: all domains)\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {Promise<Breach[]>} a Promise which resolves to an array of breach\n * objects (an empty array if no breaches were found), or rejects with an Error\n * @example\n * breaches()\n * .then(data => {\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * })\n * .catch(err => {\n * // ...\n * });\n * @example\n * breaches({ domain: 'adobe.com' })\n * .then(data => {\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * })\n * .catch(err => {\n * // ...\n * });\n */\nexport function breaches(\n options: {\n domain?: string;\n baseUrl?: string;\n userAgent?: string;\n } = {},\n): Promise<Breach[]> {\n const endpoint = '/breaches?';\n const params: Array<string> = [];\n if (options.domain) {\n params.push(`domain=${encodeURIComponent(options.domain)}`);\n }\n return fetchFromApi(`${endpoint}${params.join('&')}`, {\n baseUrl: options.baseUrl,\n userAgent: options.userAgent,\n }) as Promise<Breach[]>;\n}\n","import { fetchFromApi } from './api/haveibeenpwned';\n\n/**\n * Fetches all data classes in the system.\n *\n * @param {object} [options] a configuration object\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {(Promise<string[]> | Promise<null>)} a Promise which resolves to an\n * array of strings (or null if no data classes were found), or rejects with an\n * Error\n * @example\n * dataClasses()\n * .then(data => {\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * })\n * .catch(err => {\n * // ...\n * });\n */\nexport function dataClasses(\n options: { baseUrl?: string; userAgent?: string } = {},\n): Promise<string[] | null> {\n return fetchFromApi('/dataclasses', options) as Promise<string[] | null>;\n}\n","import type { Paste } from './api/haveibeenpwned/types';\nimport { fetchFromApi } from './api/haveibeenpwned';\n\n/**\n * An object representing a paste.\n *\n * @typedef {object} Paste\n * @property {string} Id\n * @property {string} Source\n * @property {string} Title\n * @property {string} Date\n * @property {number} EmailCount\n */\n\n/**\n * Fetches paste data for a specific account (email address).\n *\n * ***Warning (July 18, 2019):***\n *\n * `haveibeenpwned.com` now requires an API key from\n * https://haveibeenpwned.com/API/Key for the `pasteaccount` endpoint. The\n * `apiKey` option here is not explicitly required, but direct requests made\n * without it (that is, without specifying a `baseUrl` to a proxy that inserts a\n * valid API key on your behalf) will fail.\n *\n * @param {string} email the email address to query\n * @param {object} [options] a configuration object\n * @param {string} [options.apiKey] an API key from\n * https://haveibeenpwned.com/API/Key\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {(Promise<Paste[]> | Promise<null>)} a Promise which resolves to an\n * array of paste objects (or null if no pastes were found), or rejects with an\n * Error\n * @example\n * pasteAccount('foo@bar.com', { apiKey: 'my-api-key' })\n * .then(data => {\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * })\n * .catch(err => {\n * // ...\n * });\n */\nexport function pasteAccount(\n email: string,\n options: { apiKey?: string; baseUrl?: string; userAgent?: string } = {},\n): Promise<Paste[] | null> {\n return fetchFromApi(`/pasteaccount/${encodeURIComponent(email)}`, {\n apiKey: options.apiKey,\n baseUrl: options.baseUrl,\n userAgent: options.userAgent,\n }) as Promise<Paste[] | null>;\n}\n","/**\n * A JavaScript implementation of the SHA family of hashes - defined in FIPS PUB 180-4, FIPS PUB 202,\n * and SP 800-185 - as well as the corresponding HMAC implementation as defined in FIPS PUB 198-1.\n *\n * Copyright 2008-2022 Brian Turek, 1998-2009 Paul Johnston & Contributors\n * Distributed under the BSD License\n * See http://caligatio.github.com/jsSHA/ for more information\n */\nconst t=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";function r(t,r,n,i){let e,s,o;const h=r||[0],u=(n=n||0)>>>3,f=-1===i?3:0;for(e=0;e<t.length;e+=1)o=e+u,s=o>>>2,h.length<=s&&h.push(0),h[s]|=t[e]<<8*(f+i*(o%4));return{value:h,binLen:8*t.length+n}}function n(n,i,e){switch(i){case\"UTF8\":case\"UTF16BE\":case\"UTF16LE\":break;default:throw new Error(\"encoding must be UTF8, UTF16BE, or UTF16LE\")}switch(n){case\"HEX\":return function(t,r,n){return function(t,r,n,i){let e,s,o,h;if(0!=t.length%2)throw new Error(\"String of HEX type must be in byte increments\");const u=r||[0],f=(n=n||0)>>>3,c=-1===i?3:0;for(e=0;e<t.length;e+=2){if(s=parseInt(t.substr(e,2),16),isNaN(s))throw new Error(\"String of HEX type contains invalid characters\");for(h=(e>>>1)+f,o=h>>>2;u.length<=o;)u.push(0);u[o]|=s<<8*(c+i*(h%4))}return{value:u,binLen:4*t.length+n}}(t,r,n,e)};case\"TEXT\":return function(t,r,n){return function(t,r,n,i,e){let s,o,h,u,f,c,a,w,E=0;const l=n||[0],A=(i=i||0)>>>3;if(\"UTF8\"===r)for(a=-1===e?3:0,h=0;h<t.length;h+=1)for(s=t.charCodeAt(h),o=[],128>s?o.push(s):2048>s?(o.push(192|s>>>6),o.push(128|63&s)):55296>s||57344<=s?o.push(224|s>>>12,128|s>>>6&63,128|63&s):(h+=1,s=65536+((1023&s)<<10|1023&t.charCodeAt(h)),o.push(240|s>>>18,128|s>>>12&63,128|s>>>6&63,128|63&s)),u=0;u<o.length;u+=1){for(c=E+A,f=c>>>2;l.length<=f;)l.push(0);l[f]|=o[u]<<8*(a+e*(c%4)),E+=1}else for(a=-1===e?2:0,w=\"UTF16LE\"===r&&1!==e||\"UTF16LE\"!==r&&1===e,h=0;h<t.length;h+=1){for(s=t.charCodeAt(h),!0===w&&(u=255&s,s=u<<8|s>>>8),c=E+A,f=c>>>2;l.length<=f;)l.push(0);l[f]|=s<<8*(a+e*(c%4)),E+=2}return{value:l,binLen:8*E+i}}(t,i,r,n,e)};case\"B64\":return function(r,n,i){return function(r,n,i,e){let s,o,h,u,f,c,a,w=0;const E=n||[0],l=(i=i||0)>>>3,A=-1===e?3:0,p=r.indexOf(\"=\");if(-1===r.search(/^[a-zA-Z0-9=+/]+$/))throw new Error(\"Invalid character in base-64 string\");if(r=r.replace(/=/g,\"\"),-1!==p&&p<r.length)throw new Error(\"Invalid '=' found in base-64 string\");for(o=0;o<r.length;o+=4){for(f=r.substr(o,4),u=0,h=0;h<f.length;h+=1)s=t.indexOf(f.charAt(h)),u|=s<<18-6*h;for(h=0;h<f.length-1;h+=1){for(a=w+l,c=a>>>2;E.length<=c;)E.push(0);E[c]|=(u>>>16-8*h&255)<<8*(A+e*(a%4)),w+=1}}return{value:E,binLen:8*w+i}}(r,n,i,e)};case\"BYTES\":return function(t,r,n){return function(t,r,n,i){let e,s,o,h;const u=r||[0],f=(n=n||0)>>>3,c=-1===i?3:0;for(s=0;s<t.length;s+=1)e=t.charCodeAt(s),h=s+f,o=h>>>2,u.length<=o&&u.push(0),u[o]|=e<<8*(c+i*(h%4));return{value:u,binLen:8*t.length+n}}(t,r,n,e)};case\"ARRAYBUFFER\":try{new ArrayBuffer(0)}catch(t){throw new Error(\"ARRAYBUFFER not supported by this environment\")}return function(t,n,i){return function(t,n,i,e){return r(new Uint8Array(t),n,i,e)}(t,n,i,e)};case\"UINT8ARRAY\":try{new Uint8Array(0)}catch(t){throw new Error(\"UINT8ARRAY not supported by this environment\")}return function(t,n,i){return r(t,n,i,e)};default:throw new Error(\"format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY\")}}function i(r,n,i,e){switch(r){case\"HEX\":return function(t){return function(t,r,n,i){const e=\"0123456789abcdef\";let s,o,h=\"\";const u=r/8,f=-1===n?3:0;for(s=0;s<u;s+=1)o=t[s>>>2]>>>8*(f+n*(s%4)),h+=e.charAt(o>>>4&15)+e.charAt(15&o);return i.outputUpper?h.toUpperCase():h}(t,n,i,e)};case\"B64\":return function(r){return function(r,n,i,e){let s,o,h,u,f,c=\"\";const a=n/8,w=-1===i?3:0;for(s=0;s<a;s+=3)for(u=s+1<a?r[s+1>>>2]:0,f=s+2<a?r[s+2>>>2]:0,h=(r[s>>>2]>>>8*(w+i*(s%4))&255)<<16|(u>>>8*(w+i*((s+1)%4))&255)<<8|f>>>8*(w+i*((s+2)%4))&255,o=0;o<4;o+=1)c+=8*s+6*o<=n?t.charAt(h>>>6*(3-o)&63):e.b64Pad;return c}(r,n,i,e)};case\"BYTES\":return function(t){return function(t,r,n){let i,e,s=\"\";const o=r/8,h=-1===n?3:0;for(i=0;i<o;i+=1)e=t[i>>>2]>>>8*(h+n*(i%4))&255,s+=String.fromCharCode(e);return s}(t,n,i)};case\"ARRAYBUFFER\":try{new ArrayBuffer(0)}catch(t){throw new Error(\"ARRAYBUFFER not supported by this environment\")}return function(t){return function(t,r,n){let i;const e=r/8,s=new ArrayBuffer(e),o=new Uint8Array(s),h=-1===n?3:0;for(i=0;i<e;i+=1)o[i]=t[i>>>2]>>>8*(h+n*(i%4))&255;return s}(t,n,i)};case\"UINT8ARRAY\":try{new Uint8Array(0)}catch(t){throw new Error(\"UINT8ARRAY not supported by this environment\")}return function(t){return function(t,r,n){let i;const e=r/8,s=-1===n?3:0,o=new Uint8Array(e);for(i=0;i<e;i+=1)o[i]=t[i>>>2]>>>8*(s+n*(i%4))&255;return o}(t,n,i)};default:throw new Error(\"format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY\")}}function e(t){const r={outputUpper:!1,b64Pad:\"=\",outputLen:-1},n=t||{},i=\"Output length must be a multiple of 8\";if(r.outputUpper=n.outputUpper||!1,n.b64Pad&&(r.b64Pad=n.b64Pad),n.outputLen){if(n.outputLen%8!=0)throw new Error(i);r.outputLen=n.outputLen}else if(n.shakeLen){if(n.shakeLen%8!=0)throw new Error(i);r.outputLen=n.shakeLen}if(\"boolean\"!=typeof r.outputUpper)throw new Error(\"Invalid outputUpper formatting option\");if(\"string\"!=typeof r.b64Pad)throw new Error(\"Invalid b64Pad formatting option\");return r}function s(t,r){return t<<r|t>>>32-r}function o(t,r,n){return t^r^n}function h(t,r,n){return t&r^t&n^r&n}function u(t,r){const n=(65535&t)+(65535&r);return(65535&(t>>>16)+(r>>>16)+(n>>>16))<<16|65535&n}function f(t,r,n,i,e){const s=(65535&t)+(65535&r)+(65535&n)+(65535&i)+(65535&e);return(65535&(t>>>16)+(r>>>16)+(n>>>16)+(i>>>16)+(e>>>16)+(s>>>16))<<16|65535&s}function c(t){return[1732584193,4023233417,2562383102,271733878,3285377520]}function a(t,r){let n,i,e,c,a,w,E;const l=[];for(n=r[0],i=r[1],e=r[2],c=r[3],a=r[4],E=0;E<80;E+=1)l[E]=E<16?t[E]:s(l[E-3]^l[E-8]^l[E-14]^l[E-16],1),w=E<20?f(s(n,5),(A=i)&e^~A&c,a,1518500249,l[E]):E<40?f(s(n,5),o(i,e,c),a,1859775393,l[E]):E<60?f(s(n,5),h(i,e,c),a,2400959708,l[E]):f(s(n,5),o(i,e,c),a,3395469782,l[E]),a=c,c=e,e=s(i,30),i=n,n=w;var A;return r[0]=u(n,r[0]),r[1]=u(i,r[1]),r[2]=u(e,r[2]),r[3]=u(c,r[3]),r[4]=u(a,r[4]),r}function w(t,r,n,i){let e;const s=15+(r+65>>>9<<4),o=r+n;for(;t.length<=s;)t.push(0);for(t[r>>>5]|=128<<24-r%32,t[s]=4294967295&o,t[s-1]=o/4294967296|0,e=0;e<t.length;e+=16)i=a(t.slice(e,e+16),i);return i}class E extends class{constructor(t,r,n){const i=n||{};if(this.t=r,this.i=i.encoding||\"UTF8\",this.numRounds=i.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error(\"numRounds must a integer >= 1\");this.o=t,this.h=[],this.u=0,this.l=!1,this.A=0,this.p=!1,this.R=[],this.U=[]}update(t){let r,n=0;const i=this.T>>>5,e=this.F(t,this.h,this.u),s=e.binLen,o=e.value,h=s>>>5;for(r=0;r<h;r+=i)n+this.T<=s&&(this.m=this.g(o.slice(r,r+i),this.m),n+=this.T);return this.A+=n,this.h=o.slice(n>>>5),this.u=s%this.T,this.l=!0,this}getHash(t,r){let n,s,o=this.B;const h=e(r);if(this.v){if(-1===h.outputLen)throw new Error(\"Output length must be specified in options\");o=h.outputLen}const u=i(t,o,this.Y,h);if(this.p&&this.H)return u(this.H(h));for(s=this.C(this.h.slice(),this.u,this.A,this.I(this.m),o),n=1;n<this.numRounds;n+=1)this.v&&o%32!=0&&(s[s.length-1]&=16777215>>>24-o%32),s=this.C(s,o,0,this.L(this.o),o);return u(s)}setHMACKey(t,r,i){if(!this.M)throw new Error(\"Variant does not support HMAC\");if(this.l)throw new Error(\"Cannot set MAC key after calling update\");const e=n(r,(i||{}).encoding||\"UTF8\",this.Y);this.N(e(t))}N(t){const r=this.T>>>3,n=r/4-1;let i;if(1!==this.numRounds)throw new Error(\"Cannot set numRounds with MAC\");if(this.p)throw new Error(\"MAC key already set\");for(r<t.binLen/8&&(t.value=this.C(t.value,t.binLen,0,this.L(this.o),this.B));t.value.length<=n;)t.value.push(0);for(i=0;i<=n;i+=1)this.R[i]=909522486^t.value[i],this.U[i]=1549556828^t.value[i];this.m=this.g(this.R,this.m),this.A=this.T,this.p=!0}getHMAC(t,r){const n=e(r);return i(t,this.B,this.Y,n)(this.S())}S(){let t;if(!this.p)throw new Error(\"Cannot call getHMAC without first setting MAC key\");const r=this.C(this.h.slice(),this.u,this.A,this.I(this.m),this.B);return t=this.g(this.U,this.L(this.o)),t=this.C(r,this.B,this.T,t,this.B),t}}{constructor(t,r,i){if(\"SHA-1\"!==t)throw new Error(\"Chosen SHA variant is not supported\");super(t,r,i);const e=i||{};this.M=!0,this.H=this.S,this.Y=-1,this.F=n(this.t,this.i,this.Y),this.g=a,this.I=function(t){return t.slice()},this.L=c,this.C=w,this.m=[1732584193,4023233417,2562383102,271733878,3285377520],this.T=512,this.B=160,this.v=!1,e.hmacKey&&this.N(function(t,r,i,e){const s=t+\" must include a value and format\";if(!r){if(!e)throw new Error(s);return e}if(void 0===r.value||!r.format)throw new Error(s);return n(r.format,r.encoding||\"UTF8\",i)(r.value)}(\"hmacKey\",e.hmacKey,this.Y))}}export{E as default};\n","/**\n * Known potential responses from the remote API.\n *\n * https://haveibeenpwned.com/api/v3#PwnedPasswords\n *\n */\n\n/** @internal */\nexport interface PwnedPasswordsApiResponse {\n status: number;\n body?: string;\n}\n\n/** @internal */\nexport const OK: PwnedPasswordsApiResponse = {\n status: 200,\n};\n\n/** @internal */\nexport const BAD_REQUEST: PwnedPasswordsApiResponse = {\n status: 400,\n body: 'The hash prefix was not in a valid format',\n};\n","import { fetchFromApi } from './api/pwnedpasswords';\n\nexport interface PwnedPasswordSuffixes {\n [suffix: string]: number;\n}\n\n/**\n * An object mapping an exposed password hash suffix (corresponding to a given\n * hash prefix) to how many times it occurred in the Pwned Passwords repository.\n *\n * @typedef {Object.<string, number>} PwnedPasswordSuffixes\n */\n\n/**\n * Fetches the SHA-1 hash suffixes for the given 5-character SHA-1 hash prefix.\n *\n * When a password hash with the same first 5 characters is found in the Pwned\n * Passwords repository, the API will respond with an HTTP 200 and include the\n * suffix of every hash beginning with the specified prefix, followed by a count\n * of how many times it appears in the data set. This function parses the\n * response and returns a more structured format.\n *\n * @param {string} prefix the first 5 characters of a SHA-1 password hash (case\n * insensitive)\n * @param {object} [options] a configuration object\n * @param {string} [options.baseUrl] a custom base URL for the\n * pwnedpasswords.com API endpoints (default: `https://api.pwnedpasswords.com`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {Promise<PwnedPasswordSuffixes>} a Promise which resolves to an\n * object mapping the `suffix` that when matched with the prefix composes the\n * complete hash, to the `count` of how many times it appears in the breached\n * password data set, or rejects with an Error\n *\n * @example\n * pwnedPasswordRange('5BAA6')\n * .then(results => {\n * // results will have the following shape:\n * // {\n * // \"003D68EB55068C33ACE09247EE4C639306B\": 3,\n * // \"012C192B2F16F82EA0EB9EF18D9D539B0DD\": 1,\n * // ...\n * // }\n * })\n * @example\n * const suffix = '1E4C9B93F3F0682250B6CF8331B7EE68FD8';\n * pwnedPasswordRange('5BAA6')\n * .then(results => (results[suffix] || 0))\n * .catch(err => {\n * // ...\n * });\n * @see https://haveibeenpwned.com/api/v3#SearchingPwnedPasswordsByRange\n */\nexport function pwnedPasswordRange(\n prefix: string,\n options: { baseUrl?: string; userAgent?: string } = {},\n): Promise<PwnedPasswordSuffixes> {\n return (\n fetchFromApi(`/range/${encodeURIComponent(prefix)}`, options)\n // create array from lines of text in response body\n .then((data) => data.split('\\n').filter(Boolean))\n // convert into an object mapping suffix to count for each line\n .then((results) =>\n results.reduce<PwnedPasswordSuffixes>((acc, row) => {\n const [suffix, countString] = row.split(':');\n acc[suffix] = parseInt(countString, 10);\n return acc;\n }, {}),\n )\n );\n}\n","import fetch from '@remix-run/web-fetch';\nimport { BAD_REQUEST } from './responses';\n\n/**\n * Fetches data from the supplied API endpoint.\n *\n * HTTP status code 200 returns plain text (data found).\n * HTTP status code 400 throws an Error (bad request).\n *\n * @internal\n * @private\n * @param {string} endpoint the API endpoint to query\n * @param {object} [options] a configuration object\n * @param {string} [options.baseUrl] a custom base URL for the\n * pwnedpasswords.com API endpoints (default: `https://api.pwnedpasswords.com`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {Promise<string>} a Promise which resolves to the data resulting\n * from the query, or rejects with an Error\n */\nexport function fetchFromApi(\n endpoint: string,\n {\n baseUrl = 'https://api.pwnedpasswords.com',\n userAgent,\n }: { baseUrl?: string; userAgent?: string } = {},\n): Promise<string> {\n const config = Object.assign(\n {},\n userAgent\n ? {\n headers: {\n 'User-Agent': userAgent,\n },\n }\n : {},\n );\n\n const url = `${baseUrl.replace(/\\/$/g, '')}${endpoint}`;\n\n return fetch(url, config).then((res) => {\n if (res.ok) return res.text();\n\n if (res.status === BAD_REQUEST.status) {\n return res.text().then((text) => {\n throw new Error(text);\n });\n }\n\n throw new Error(res.statusText);\n });\n}\n","import JSSHA from 'jssha/dist/sha1';\nimport { pwnedPasswordRange } from './pwnedPasswordRange';\n\n/**\n * Fetches the number of times the the given password has been exposed in a\n * breach (0 indicating no exposure). The password is given in plain text, but\n * only the first 5 characters of its SHA-1 hash will be submitted to the API.\n *\n * @param {string} password a password in plain text\n * @param {object} [options] a configuration object\n * @param {string} [options.baseUrl] a custom base URL for the\n * pwnedpasswords.com API endpoints (default: `https://api.pwnedpasswords.com`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {Promise<number>} a Promise which resolves to the number of times\n * the password has been exposed in a breach, or rejects with an Error\n * @example\n * pwnedPassword('f00b4r')\n * .then(numPwns => {\n * // truthy check or numeric condition\n * if (numPwns) {\n * // ...\n * } else {\n * // ...\n * }\n * })\n * .catch(err => {\n * // ...\n * });\n * @see https://haveibeenpwned.com/api/v3#PwnedPasswords\n */\nexport function pwnedPassword(\n password: string,\n options: { baseUrl?: string; userAgent?: string } = {},\n): Promise<number> {\n const sha1 = new JSSHA('SHA-1', 'TEXT');\n sha1.update(password);\n const hash = sha1.getHash('HEX', { outputUpper: true });\n const prefix = hash.slice(0, 5);\n const suffix = hash.slice(5);\n\n return pwnedPasswordRange(prefix, options).then(\n (range) => range[suffix] || 0,\n );\n}\n","import type { Breach, Paste } from './api/haveibeenpwned/types';\nimport { breachedAccount } from './breachedAccount';\nimport { pasteAccount } from './pasteAccount';\n\nexport interface SearchResults {\n breaches: Breach[] | null;\n pastes: Paste[] | null;\n}\n\n/**\n * An object representing search results.\n *\n * @typedef {object} SearchResults\n * @property {(Breach[] | null)} breaches\n * @property {(Paste[] | null)} pastes\n */\n\n/**\n * Fetches all breaches and all pastes associated with the provided account\n * (email address or username). Note that the remote API does not support\n * querying pastes by username (only email addresses), so in the event the\n * provided account is not a valid email address, only breach data is queried\n * and the \"pastes\" field of the resulting object will always be null. This is\n * exactly how searching via the current web interface behaves, which this\n * convenience method is designed to mimic.\n *\n * ***Warning (July 18, 2019):***\n *\n * `haveibeenpwned.com` now requires an API key from\n * https://haveibeenpwned.com/API/Key for the `breachedaccount` and\n * `pasteaccount` endpoints. The `apiKey` option here is not explicitly\n * required, but direct requests made without it (that is, without specifying a\n * `baseUrl` to a proxy that inserts a valid API key on your behalf) will fail.\n *\n * @param {string} account an email address or username\n * @param {object} [breachOptions] a configuration object pertaining to breach\n * queries\n * @param {string} [breachOptions.apiKey] an API key from\n * https://haveibeenpwned.com/API/Key\n * @param {string} [breachOptions.domain] a domain by which to filter the\n * results (default: all domains)\n * @param {boolean} [breachOptions.truncate] truncate the results to only\n * include the name of each breach (default: true)\n * @param {string} [breachOptions.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {string} [breachOptions.userAgent] a custom string to send as the\n * User-Agent field in the request headers (default: `hibp <version>`)\n * @returns {Promise<SearchResults>} a Promise which resolves to an object\n * containing a \"breaches\" key (which can be null or an array of breach objects)\n * and a \"pastes\" key (which can be null or an array of paste objects), or\n * rejects with an Error\n * @example\n * search('foo', { apiKey: 'my-api-key' })\n * .then(data => {\n * if (data.breaches || data.pastes) {\n * // ...\n * } else {\n * // ...\n * }\n * })\n * .catch(err => {\n * // ...\n * });\n * @example\n * search('nobody@nowhere.com', { apiKey: 'my-api-key', truncate: false })\n * .then(data => {\n * if (data.breaches || data.pastes) {\n * // ...\n * } else {\n * // ...\n * }\n * })\n * .catch(err => {\n * // ...\n * });\n *\n * @see https://haveibeenpwned.com/\n */\nexport function search(\n account: string,\n breachOptions: {\n apiKey?: string;\n domain?: string;\n truncate?: boolean;\n baseUrl?: string;\n userAgent?: string;\n } = {\n truncate: true,\n },\n): Promise<SearchResults> {\n const { apiKey, baseUrl, userAgent } = breachOptions;\n\n return Promise.all([\n breachedAccount(account, breachOptions),\n // This email regex is garbage but it seems to be what the API uses:\n /^.+@.+$/.test(account)\n ? pasteAccount(account, { apiKey, baseUrl, userAgent })\n : null,\n ]).then(\n // Avoid array destructuring here to prevent need for Babel helpers\n (promises) => ({\n breaches: promises[0],\n pastes: promises[1],\n }),\n );\n}\n"],"names":["fetch","globalThis","Map","BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","TOO_MANY_REQUESTS","RateLimitError","Error","retryAfterSeconds","constructor","retryAfter","message","options","super","this","name","Number","parseInt","undefined","fetchFromApi","endpoint","apiKey","baseUrl","userAgent","headers","navigator","config","url","replace","then","res","ok","json","status","body","rayId","get","blockedWithRayId","statusText","breach","breachName","encodeURIComponent","breachedAccount","account","includeUnverified","truncate","params","domain","push","join","breaches","dataClasses","pasteAccount","email","t","r","n","i","e","s","o","h","u","f","length","value","binLen","c","substr","isNaN","a","w","E","l","A","charCodeAt","p","indexOf","search","charAt","ArrayBuffer","Uint8Array","outputUpper","toUpperCase","b64Pad","String","fromCharCode","outputLen","shakeLen","slice","encoding","numRounds","R","U","update","T","F","m","g","getHash","B","v","Y","H","C","I","L","setHMACKey","M","N","getHMAC","S","hmacKey","format","pwnedPasswordRange","prefix","Object","assign","text","data","split","filter","Boolean","results","reduce","acc","row","suffix","countString","pwnedPassword","password","sha1","JSSHA","hash","range","breachOptions","Promise","all","test","promises","pastes"],"mappings":"AAKA,IAAAA,EAAeC,WAAWD,MCiBL,IAAIE,UASZC,EAEH,IAFGA,EAIT,uEAUSC,EAEH,IAQGC,EAEH,IAFGA,EAGC,6BAUDC,EAEH,IAUGC,GACF,IAAIL,IAAI,CAAC,CAAC,cAAe,OAC1B,KChEJ,MAAOM,UAAuBC,MAM3BC,kBAEPC,YACEC,EACAC,EACAC,GAEAC,MAAMF,EAASC,GACfE,KAAKC,KAAOD,KAAKL,YAAYM,KAC7BD,KAAKN,kBACmB,iBAAfE,EACHM,OAAOC,SAASP,EAAY,SAC5BQ,CACP,EAiCa,SAAAC,EACdC,GACAC,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MP,IAAW,GAEhC,CCmCgB,SAAAjD,EACdnC,EACA4F,EAMI,CACF1F,UAAU,IAGZ,MAAMxB,OAAEA,EAAMC,QAAEA,EAAOC,UAAEA,GAAcgH,EAEvC,OAAOC,QAAQC,IAAI,CACjB/F,EAAgBC,EAAS4F,GAEzB,UAAUG,KAAK/F,GACXS,EAAaT,EAAS,CAAEtB,SAAQC,UAASC,cACzC,OACHM,MAEA8G,IAAc,CACbzF,SAAUyF,EAAS,GACnBC,OAAQD,EAAS,MAGvB"}
1
+ {"version":3,"file":"hibp.module.js","sources":["../../src/api/fetch-polyfill.ts","../../src/api/haveibeenpwned/responses.ts","../../src/api/haveibeenpwned/fetch-from-api.ts","../../src/breach.ts","../../src/breached-account.ts","../../src/breaches.ts","../../src/data-classes.ts","../../src/paste-account.ts","../../node_modules/jssha/dist/sha1.mjs","../../src/api/pwnedpasswords/responses.ts","../../src/pwned-password-range.ts","../../src/api/pwnedpasswords/fetch-from-api.ts","../../src/pwned-password.ts","../../src/search.ts","../../src/subscription-status.ts"],"sourcesContent":["/* eslint-disable global-require */\n/* eslint-disable @typescript-eslint/no-var-requires */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n\n// This can probably be removed in favor of Node's native fetch once we drop\n// support for v18. https://x.com/ebey_jacob/status/1709975146939973909?s=20\n\nexport function installUndiciOnNode18() {\n if (\n typeof process !== 'undefined' &&\n process.versions.node.startsWith('18.')\n ) {\n const {\n File: UndiciFile,\n fetch: undiciFetch,\n FormData: UndiciFormData,\n Headers: UndiciHeaders,\n Request: UndiciRequest,\n Response: UndiciResponse,\n } = require('undici');\n global.File = UndiciFile as unknown as typeof File;\n global.Headers = UndiciHeaders;\n global.Request = UndiciRequest;\n global.Response = UndiciResponse;\n global.fetch = undiciFetch;\n global.FormData = UndiciFormData;\n }\n}\n","/**\n * Known potential responses from the remote API.\n *\n * Unfortunately, the API does not send a decent human-readable message back\n * with each response, but they are documented on the website:\n * https://haveibeenpwned.com/api/v3#ResponseCodes\n *\n * These objects simply provide a mapping between the HTTP response status code\n * and the corresponding human-readable message so we can throw a more\n * descriptive error for the consumer. (They are also leveraged in our tests.)\n */\n\nimport type { ResponseBody } from './types.js';\n\n/** @internal */\nexport interface HaveIBeenPwnedApiResponse {\n headers: Map<string, string>;\n status: number;\n statusText?: string;\n body?: ResponseBody;\n}\n\nconst emptyHeaders = new Map<string, string>();\n\n/** @internal */\nexport const BAD_REQUEST: HaveIBeenPwnedApiResponse = {\n headers: emptyHeaders,\n status: 400,\n statusText:\n 'Bad request — the account does not comply with an acceptable format.',\n};\n\n/**\n * This response has unique behavior. For some reason, the API includes an\n * object in the response body for this one, containing a human-readable\n * message. Manually populating the message here purely for use in tests.\n *\n * @internal\n */\nexport const UNAUTHORIZED: HaveIBeenPwnedApiResponse = {\n headers: emptyHeaders,\n status: 401,\n body: {\n statusCode: 401,\n message: 'Access denied due to missing hibp-api-key.',\n },\n};\n\n/** @internal */\nexport const FORBIDDEN: HaveIBeenPwnedApiResponse = {\n headers: emptyHeaders,\n status: 403,\n statusText: 'Forbidden - access denied.',\n};\n\n/** @internal */\nexport const BLOCKED: HaveIBeenPwnedApiResponse = {\n headers: new Map([['cf-ray', 'someRayId']]),\n status: 403,\n};\n\n/** @internal */\nexport const NOT_FOUND: HaveIBeenPwnedApiResponse = {\n headers: emptyHeaders,\n status: 404,\n};\n\n/**\n * This response has unique behavior. For some reason, the API includes an\n * object in the response body for this one, containing a human-readable\n * message. Manually populating the message here purely for use in tests.\n *\n * @internal\n */\nexport const TOO_MANY_REQUESTS: HaveIBeenPwnedApiResponse = {\n headers: new Map([['retry-after', '2']]),\n status: 429,\n body: {\n statusCode: 429,\n message: 'Rate limit is exceeded. Try again in 2 seconds.',\n },\n};\n","import { name, version } from '../../../package.json';\nimport { installUndiciOnNode18 } from '../fetch-polyfill.js';\nimport {\n BAD_REQUEST,\n UNAUTHORIZED,\n FORBIDDEN,\n NOT_FOUND,\n TOO_MANY_REQUESTS,\n} from './responses.js';\nimport type { ApiData, ErrorData } from './types.js';\n\ninstallUndiciOnNode18();\n\n/**\n * Custom error thrown when the haveibeenpwned.com API responds with 429 Too\n * Many Requests. See the `retryAfterSeconds` property for the number of seconds\n * to wait before attempting the request again.\n *\n * @see https://haveibeenpwned.com/API/v3#RateLimiting\n */\nexport class RateLimitError extends Error {\n /**\n * The number of seconds to wait before attempting the request again. May be\n * `undefined` if the API does not provide a `retry-after` header, but this\n * should never happen.\n */\n public retryAfterSeconds: number | undefined;\n\n constructor(\n retryAfter: ReturnType<Headers['get']>,\n message: string | undefined,\n options?: ErrorOptions,\n ) {\n super(message, options);\n this.name = this.constructor.name;\n this.retryAfterSeconds =\n typeof retryAfter === 'string'\n ? Number.parseInt(retryAfter, 10) /* c8 ignore start */\n : undefined; /* c8 ignore stop */\n }\n}\n\nfunction blockedWithRayId(rayId: string) {\n return `Request blocked, contact haveibeenpwned.com if this continues (Ray ID: ${rayId})`;\n}\n\n/**\n * Fetches data from the supplied API endpoint.\n *\n * HTTP status code 200 returns an Object (data found).\n * HTTP status code 404 returns null (no data found).\n * HTTP status code 400 throws an Error (bad request).\n * HTTP status code 401 throws an Error (unauthorized).\n * HTTP status code 403 throws an Error (forbidden).\n * HTTP status code 429 throws an Error (too many requests).\n *\n * @internal\n * @private\n * @param {string} endpoint the API endpoint to query\n * @param {object} [options] a configuration object\n * @param {string} [options.apiKey] an API key from\n * https://haveibeenpwned.com/API/Key\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {Promise<ApiData>} a Promise which resolves to the data resulting\n * from the query (or null for 404 Not Found responses), or rejects with an\n * Error\n */\nexport async function fetchFromApi(\n endpoint: string,\n options: {\n apiKey?: string;\n baseUrl?: string;\n userAgent?: string;\n } = {},\n): Promise<ApiData> {\n const {\n apiKey,\n baseUrl = 'https://haveibeenpwned.com/api/v3',\n userAgent,\n } = options;\n const headers: Record<string, string> = {};\n\n if (apiKey) {\n headers['HIBP-API-Key'] = apiKey;\n }\n\n if (userAgent) {\n headers['User-Agent'] = userAgent;\n }\n\n // Provide a default User-Agent when running outside the browser\n if (!userAgent && typeof navigator === 'undefined') {\n headers['User-Agent'] = `${name} ${version}`;\n }\n\n const config = { headers };\n const url = `${baseUrl.replace(/\\/$/g, '')}${endpoint}`;\n const response = await fetch(url, config);\n\n if (response.ok) return response.json() as Promise<ApiData>;\n\n switch (response.status) {\n case BAD_REQUEST.status: {\n throw new Error(BAD_REQUEST.statusText);\n }\n case UNAUTHORIZED.status: {\n const body = (await response.json()) as unknown as ErrorData;\n throw new Error(body.message);\n }\n case FORBIDDEN.status: {\n const rayId = response.headers.get('cf-ray');\n if (rayId) throw new Error(blockedWithRayId(rayId));\n throw new Error(FORBIDDEN.statusText);\n }\n case NOT_FOUND.status: {\n return null;\n }\n case TOO_MANY_REQUESTS.status: {\n const body = (await response.json()) as unknown as ErrorData;\n const retryAfter = response.headers.get('retry-after');\n throw new RateLimitError(retryAfter, body.message);\n }\n default: {\n throw new Error(response.statusText);\n }\n }\n}\n","import type { Breach } from './api/haveibeenpwned/types.js';\nimport { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';\n\n/**\n * An object representing a breach.\n *\n * @typedef {object} Breach\n * @property {string} Name\n * @property {string} Title\n * @property {string} Domain\n * @property {string} BreachDate\n * @property {string} AddedDate\n * @property {string} ModifiedDate\n * @property {number} PwnCount\n * @property {string} Description\n * @property {string[]} DataClasses\n * @property {boolean} IsVerified\n * @property {boolean} IsFabricated\n * @property {boolean} IsSensitive\n * @property {boolean} IsRetired\n * @property {boolean} IsSpamList\n * @property {boolean} IsMalware\n * @property {boolean} IsSubscriptionFree\n * @property {string} LogoPath\n */\n\n/**\n * Fetches data for a specific breach event.\n *\n * @param {string} breachName the name of a breach in the system\n * @param {object} [options] a configuration object\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {(Promise<Breach>|Promise<null>)} a Promise which resolves to an\n * object representing a breach (or null if no breach was found), or rejects\n * with an Error\n * @example\n * try {\n * const data = await breach(\"Adobe\");\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n */\nexport function breach(\n breachName: string,\n options: {\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n): Promise<Breach | null> {\n return fetchFromApi(\n `/breach/${encodeURIComponent(breachName)}`,\n options,\n ) as Promise<Breach | null>;\n}\n","import type { Breach } from './api/haveibeenpwned/types.js';\nimport { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';\n\n/**\n * Fetches breach data for a specific account.\n *\n * 🔑 `haveibeenpwned.com` requires an API key from\n * https://haveibeenpwned.com/API/Key for the `breachedaccount` endpoint. The\n * `apiKey` option here is not explicitly required, but direct requests made\n * without it will fail (unless you specify a `baseUrl` to a proxy that inserts\n * a valid API key on your behalf).\n *\n * @param {string} account a username or email address\n * @param {object} [options] a configuration object\n * @param {string} [options.apiKey] an API key from\n * https://haveibeenpwned.com/API/Key (default: undefined)\n * @param {string} [options.domain] a domain by which to filter the results\n * (default: all domains)\n * @param {boolean} [options.includeUnverified] include \"unverified\" breaches in\n * the results (default: true)\n * @param {boolean} [options.truncate] truncate the results to only include\n * the name of each breach (default: true)\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {(Promise<Breach[]> | Promise<null>)} a Promise which resolves to an\n * array of breach objects (or null if no breaches were found), or rejects with\n * an Error\n * @example\n * try {\n * const data = await breachedAccount(\"foo\", { apiKey: \"my-api-key\" });\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n * @example\n * try {\n * const data = await breachedAccount(\"bar\", {\n * includeUnverified: false,\n * baseUrl: \"https://my-hibp-proxy:8080\",\n * });\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n * @example\n * try {\n * const data = await breachedAccount(\"baz\", {\n * apiKey: \"my-api-key\",\n * domain: \"adobe.com\",\n * truncate: false,\n * userAgent: \"my-app 1.0\",\n * });\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n */\nexport function breachedAccount(\n account: string,\n options: {\n /**\n * an API key from https://haveibeenpwned.com/API/Key (default: undefined)\n */\n apiKey?: string;\n /**\n * a domain by which to filter the results (default: all domains)\n */\n domain?: string;\n /**\n * include \"unverified\" breaches in the results (default: true)\n */\n includeUnverified?: boolean;\n /**\n * truncate the results to only include the name of each breach (default:\n * true)\n */\n truncate?: boolean;\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n): Promise<Breach[] | null> {\n const {\n apiKey,\n domain,\n includeUnverified = true,\n truncate = true,\n baseUrl,\n userAgent,\n } = options;\n const endpoint = `/breachedaccount/${encodeURIComponent(account)}?`;\n const params: string[] = [];\n\n if (domain) {\n params.push(`domain=${encodeURIComponent(domain)}`);\n }\n\n if (!includeUnverified) {\n params.push('includeUnverified=false');\n }\n\n if (!truncate) {\n params.push('truncateResponse=false');\n }\n\n return fetchFromApi(`${endpoint}${params.join('&')}`, {\n apiKey,\n baseUrl,\n userAgent,\n }) as Promise<Breach[] | null>;\n}\n","import type { Breach } from './api/haveibeenpwned/types.js';\nimport { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';\n\n/**\n * Fetches all breach events in the system.\n *\n * @param {object} [options] a configuration object\n * @param {string} [options.domain] a domain by which to filter the results\n * (default: all domains)\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {Promise<Breach[]>} a Promise which resolves to an array of breach\n * objects (an empty array if no breaches were found), or rejects with an Error\n * @example\n * try {\n * const data = await breaches();\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n * @example\n * try {\n * const data = await breaches({ domain: \"adobe.com\" });\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n */\nexport function breaches(\n options: {\n /**\n * a domain by which to filter the results (default: all domains)\n */\n domain?: string;\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n): Promise<Breach[]> {\n const { domain, baseUrl, userAgent } = options;\n const endpoint = '/breaches?';\n const params: string[] = [];\n\n if (domain) {\n params.push(`domain=${encodeURIComponent(domain)}`);\n }\n\n return fetchFromApi(`${endpoint}${params.join('&')}`, {\n baseUrl,\n userAgent,\n }) as Promise<Breach[]>;\n}\n","import { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';\n\n/**\n * Fetches all data classes in the system.\n *\n * @param {object} [options] a configuration object\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {(Promise<string[]> | Promise<null>)} a Promise which resolves to an\n * array of strings (or null if no data classes were found), or rejects with an\n * Error\n * @example\n * try {\n * const data = await dataClasses();\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n */\nexport function dataClasses(\n options: {\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n): Promise<string[] | null> {\n return fetchFromApi('/dataclasses', options) as Promise<string[] | null>;\n}\n","import type { Paste } from './api/haveibeenpwned/types.js';\nimport { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';\n\n/**\n * An object representing a paste.\n *\n * @typedef {object} Paste\n * @property {string} Id\n * @property {string} Source\n * @property {string} Title\n * @property {string} Date\n * @property {number} EmailCount\n */\n\n/**\n * Fetches paste data for a specific account (email address).\n *\n * 🔑 `haveibeenpwned.com` requires an API key from\n * https://haveibeenpwned.com/API/Key for the `pasteaccount` endpoint. The\n * `apiKey` option here is not explicitly required, but direct requests made\n * without it will fail (unless you specify a `baseUrl` to a proxy that inserts\n * a valid API key on your behalf).\n *\n * @param {string} email the email address to query\n * @param {object} [options] a configuration object\n * @param {string} [options.apiKey] an API key from\n * https://haveibeenpwned.com/API/Key (default: undefined)\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {(Promise<Paste[]> | Promise<null>)} a Promise which resolves to an\n * array of paste objects (or null if no pastes were found), or rejects with an\n * Error\n * @example\n * try {\n * const data = await pasteAccount(\"foo@bar.com\", { apiKey: \"my-api-key\" });\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n * @example\n * try {\n * const data = await pasteAccount(\"foo@bar.com\", {\n * baseUrl: \"https://my-hibp-proxy:8080\",\n * });\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n */\nexport function pasteAccount(\n email: string,\n options: {\n /**\n * an API key from https://haveibeenpwned.com/API/Key (default: undefined)\n */\n apiKey?: string;\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n): Promise<Paste[] | null> {\n return fetchFromApi(\n `/pasteaccount/${encodeURIComponent(email)}`,\n options,\n ) as Promise<Paste[] | null>;\n}\n","/**\n * A JavaScript implementation of the SHA family of hashes - defined in FIPS PUB 180-4, FIPS PUB 202,\n * and SP 800-185 - as well as the corresponding HMAC implementation as defined in FIPS PUB 198-1.\n *\n * Copyright 2008-2023 Brian Turek, 1998-2009 Paul Johnston & Contributors\n * Distributed under the BSD License\n * See http://caligatio.github.com/jsSHA/ for more information\n */\nconst t=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",r=\"ARRAYBUFFER not supported by this environment\",n=\"UINT8ARRAY not supported by this environment\";function i(t,r,n,i){let e,s,o;const h=r||[0],u=(n=n||0)>>>3,f=-1===i?3:0;for(e=0;e<t.length;e+=1)o=e+u,s=o>>>2,h.length<=s&&h.push(0),h[s]|=t[e]<<8*(f+i*(o%4));return{value:h,binLen:8*t.length+n}}function e(e,s,o){switch(s){case\"UTF8\":case\"UTF16BE\":case\"UTF16LE\":break;default:throw new Error(\"encoding must be UTF8, UTF16BE, or UTF16LE\")}switch(e){case\"HEX\":return function(t,r,n){return function(t,r,n,i){let e,s,o,h;if(0!=t.length%2)throw new Error(\"String of HEX type must be in byte increments\");const u=r||[0],f=(n=n||0)>>>3,c=-1===i?3:0;for(e=0;e<t.length;e+=2){if(s=parseInt(t.substr(e,2),16),isNaN(s))throw new Error(\"String of HEX type contains invalid characters\");for(h=(e>>>1)+f,o=h>>>2;u.length<=o;)u.push(0);u[o]|=s<<8*(c+i*(h%4))}return{value:u,binLen:4*t.length+n}}(t,r,n,o)};case\"TEXT\":return function(t,r,n){return function(t,r,n,i,e){let s,o,h,u,f,c,a,w,E=0;const l=n||[0],A=(i=i||0)>>>3;if(\"UTF8\"===r)for(a=-1===e?3:0,h=0;h<t.length;h+=1)for(s=t.charCodeAt(h),o=[],128>s?o.push(s):2048>s?(o.push(192|s>>>6),o.push(128|63&s)):55296>s||57344<=s?o.push(224|s>>>12,128|s>>>6&63,128|63&s):(h+=1,s=65536+((1023&s)<<10|1023&t.charCodeAt(h)),o.push(240|s>>>18,128|s>>>12&63,128|s>>>6&63,128|63&s)),u=0;u<o.length;u+=1){for(c=E+A,f=c>>>2;l.length<=f;)l.push(0);l[f]|=o[u]<<8*(a+e*(c%4)),E+=1}else for(a=-1===e?2:0,w=\"UTF16LE\"===r&&1!==e||\"UTF16LE\"!==r&&1===e,h=0;h<t.length;h+=1){for(s=t.charCodeAt(h),!0===w&&(u=255&s,s=u<<8|s>>>8),c=E+A,f=c>>>2;l.length<=f;)l.push(0);l[f]|=s<<8*(a+e*(c%4)),E+=2}return{value:l,binLen:8*E+i}}(t,s,r,n,o)};case\"B64\":return function(r,n,i){return function(r,n,i,e){let s,o,h,u,f,c,a,w=0;const E=n||[0],l=(i=i||0)>>>3,A=-1===e?3:0,p=r.indexOf(\"=\");if(-1===r.search(/^[a-zA-Z0-9=+/]+$/))throw new Error(\"Invalid character in base-64 string\");if(r=r.replace(/=/g,\"\"),-1!==p&&p<r.length)throw new Error(\"Invalid '=' found in base-64 string\");for(o=0;o<r.length;o+=4){for(f=r.substr(o,4),u=0,h=0;h<f.length;h+=1)s=t.indexOf(f.charAt(h)),u|=s<<18-6*h;for(h=0;h<f.length-1;h+=1){for(a=w+l,c=a>>>2;E.length<=c;)E.push(0);E[c]|=(u>>>16-8*h&255)<<8*(A+e*(a%4)),w+=1}}return{value:E,binLen:8*w+i}}(r,n,i,o)};case\"BYTES\":return function(t,r,n){return function(t,r,n,i){let e,s,o,h;const u=r||[0],f=(n=n||0)>>>3,c=-1===i?3:0;for(s=0;s<t.length;s+=1)e=t.charCodeAt(s),h=s+f,o=h>>>2,u.length<=o&&u.push(0),u[o]|=e<<8*(c+i*(h%4));return{value:u,binLen:8*t.length+n}}(t,r,n,o)};case\"ARRAYBUFFER\":try{new ArrayBuffer(0)}catch(t){throw new Error(r)}return function(t,r,n){return function(t,r,n,e){return i(new Uint8Array(t),r,n,e)}(t,r,n,o)};case\"UINT8ARRAY\":try{new Uint8Array(0)}catch(t){throw new Error(n)}return function(t,r,n){return i(t,r,n,o)};default:throw new Error(\"format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY\")}}function s(i,e,s,o){switch(i){case\"HEX\":return function(t){return function(t,r,n,i){const e=\"0123456789abcdef\";let s,o,h=\"\";const u=r/8,f=-1===n?3:0;for(s=0;s<u;s+=1)o=t[s>>>2]>>>8*(f+n*(s%4)),h+=e.charAt(o>>>4&15)+e.charAt(15&o);return i.outputUpper?h.toUpperCase():h}(t,e,s,o)};case\"B64\":return function(r){return function(r,n,i,e){let s,o,h,u,f,c=\"\";const a=n/8,w=-1===i?3:0;for(s=0;s<a;s+=3)for(u=s+1<a?r[s+1>>>2]:0,f=s+2<a?r[s+2>>>2]:0,h=(r[s>>>2]>>>8*(w+i*(s%4))&255)<<16|(u>>>8*(w+i*((s+1)%4))&255)<<8|f>>>8*(w+i*((s+2)%4))&255,o=0;o<4;o+=1)c+=8*s+6*o<=n?t.charAt(h>>>6*(3-o)&63):e.b64Pad;return c}(r,e,s,o)};case\"BYTES\":return function(t){return function(t,r,n){let i,e,s=\"\";const o=r/8,h=-1===n?3:0;for(i=0;i<o;i+=1)e=t[i>>>2]>>>8*(h+n*(i%4))&255,s+=String.fromCharCode(e);return s}(t,e,s)};case\"ARRAYBUFFER\":try{new ArrayBuffer(0)}catch(t){throw new Error(r)}return function(t){return function(t,r,n){let i;const e=r/8,s=new ArrayBuffer(e),o=new Uint8Array(s),h=-1===n?3:0;for(i=0;i<e;i+=1)o[i]=t[i>>>2]>>>8*(h+n*(i%4))&255;return s}(t,e,s)};case\"UINT8ARRAY\":try{new Uint8Array(0)}catch(t){throw new Error(n)}return function(t){return function(t,r,n){let i;const e=r/8,s=-1===n?3:0,o=new Uint8Array(e);for(i=0;i<e;i+=1)o[i]=t[i>>>2]>>>8*(s+n*(i%4))&255;return o}(t,e,s)};default:throw new Error(\"format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY\")}}function o(t){const r={outputUpper:!1,b64Pad:\"=\",outputLen:-1},n=t||{},i=\"Output length must be a multiple of 8\";if(r.outputUpper=n.outputUpper||!1,n.b64Pad&&(r.b64Pad=n.b64Pad),n.outputLen){if(n.outputLen%8!=0)throw new Error(i);r.outputLen=n.outputLen}else if(n.shakeLen){if(n.shakeLen%8!=0)throw new Error(i);r.outputLen=n.shakeLen}if(\"boolean\"!=typeof r.outputUpper)throw new Error(\"Invalid outputUpper formatting option\");if(\"string\"!=typeof r.b64Pad)throw new Error(\"Invalid b64Pad formatting option\");return r}class h{constructor(t,r,n){const i=n||{};if(this.t=r,this.i=i.encoding||\"UTF8\",this.numRounds=i.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error(\"numRounds must a integer >= 1\");this.o=t,this.h=[],this.u=0,this.l=!1,this.A=0,this.p=!1,this.U=[],this.R=[]}update(t){let r,n=0;const i=this.T>>>5,e=this.F(t,this.h,this.u),s=e.binLen,o=e.value,h=s>>>5;for(r=0;r<h;r+=i)n+this.T<=s&&(this.m=this.g(o.slice(r,r+i),this.m),n+=this.T);return this.A+=n,this.h=o.slice(n>>>5),this.u=s%this.T,this.l=!0,this}getHash(t,r){let n,i,e=this.B;const h=o(r);if(this.v){if(-1===h.outputLen)throw new Error(\"Output length must be specified in options\");e=h.outputLen}const u=s(t,e,this.H,h);if(this.p&&this.C)return u(this.C(h));for(i=this.Y(this.h.slice(),this.u,this.A,this.I(this.m),e),n=1;n<this.numRounds;n+=1)this.v&&e%32!=0&&(i[i.length-1]&=16777215>>>24-e%32),i=this.Y(i,e,0,this.L(this.o),e);return u(i)}setHMACKey(t,r,n){if(!this.M)throw new Error(\"Variant does not support HMAC\");if(this.l)throw new Error(\"Cannot set MAC key after calling update\");const i=e(r,(n||{}).encoding||\"UTF8\",this.H);this.N(i(t))}N(t){const r=this.T>>>3,n=r/4-1;let i;if(1!==this.numRounds)throw new Error(\"Cannot set numRounds with MAC\");if(this.p)throw new Error(\"MAC key already set\");for(r<t.binLen/8&&(t.value=this.Y(t.value,t.binLen,0,this.L(this.o),this.B));t.value.length<=n;)t.value.push(0);for(i=0;i<=n;i+=1)this.U[i]=909522486^t.value[i],this.R[i]=1549556828^t.value[i];this.m=this.g(this.U,this.m),this.A=this.T,this.p=!0}getHMAC(t,r){const n=o(r);return s(t,this.B,this.H,n)(this.S())}S(){let t;if(!this.p)throw new Error(\"Cannot call getHMAC without first setting MAC key\");const r=this.Y(this.h.slice(),this.u,this.A,this.I(this.m),this.B);return t=this.g(this.R,this.L(this.o)),t=this.Y(r,this.B,this.T,t,this.B),t}}function u(t,r){return t<<r|t>>>32-r}function f(t,r,n){return t^r^n}function c(t,r,n){return t&r^t&n^r&n}function a(t,r){const n=(65535&t)+(65535&r);return(65535&(t>>>16)+(r>>>16)+(n>>>16))<<16|65535&n}function w(t,r,n,i,e){const s=(65535&t)+(65535&r)+(65535&n)+(65535&i)+(65535&e);return(65535&(t>>>16)+(r>>>16)+(n>>>16)+(i>>>16)+(e>>>16)+(s>>>16))<<16|65535&s}function E(t){return[1732584193,4023233417,2562383102,271733878,3285377520]}function l(t,r){let n,i,e,s,o,h,E;const l=[];for(n=r[0],i=r[1],e=r[2],s=r[3],o=r[4],E=0;E<80;E+=1)l[E]=E<16?t[E]:u(l[E-3]^l[E-8]^l[E-14]^l[E-16],1),h=E<20?w(u(n,5),(A=i)&e^~A&s,o,1518500249,l[E]):E<40?w(u(n,5),f(i,e,s),o,1859775393,l[E]):E<60?w(u(n,5),c(i,e,s),o,2400959708,l[E]):w(u(n,5),f(i,e,s),o,3395469782,l[E]),o=s,s=e,e=u(i,30),i=n,n=h;var A;return r[0]=a(n,r[0]),r[1]=a(i,r[1]),r[2]=a(e,r[2]),r[3]=a(s,r[3]),r[4]=a(o,r[4]),r}function A(t,r,n,i){let e;const s=15+(r+65>>>9<<4),o=r+n;for(;t.length<=s;)t.push(0);for(t[r>>>5]|=128<<24-r%32,t[s]=4294967295&o,t[s-1]=o/4294967296|0,e=0;e<t.length;e+=16)i=l(t.slice(e,e+16),i);return i}class p extends h{constructor(t,r,n){if(\"SHA-1\"!==t)throw new Error(\"Chosen SHA variant is not supported\");super(t,r,n);const i=n||{};this.M=!0,this.C=this.S,this.H=-1,this.F=e(this.t,this.i,this.H),this.g=l,this.I=function(t){return t.slice()},this.L=E,this.Y=A,this.m=[1732584193,4023233417,2562383102,271733878,3285377520],this.T=512,this.B=160,this.v=!1,i.hmacKey&&this.N(function(t,r,n,i){const s=t+\" must include a value and format\";if(!r){if(!i)throw new Error(s);return i}if(void 0===r.value||!r.format)throw new Error(s);return e(r.format,r.encoding||\"UTF8\",n)(r.value)}(\"hmacKey\",i.hmacKey,this.H))}}export{p as default};\n","/**\n * Known potential responses from the remote API.\n *\n * https://haveibeenpwned.com/api/v3#PwnedPasswords\n *\n */\n\n/** @internal */\nexport interface PwnedPasswordsApiResponse {\n status: number;\n body?: string;\n}\n\n/** @internal */\nexport const BAD_REQUEST: PwnedPasswordsApiResponse = {\n status: 400,\n body: 'The hash prefix was not in a valid format',\n};\n","import { fetchFromApi } from './api/pwnedpasswords/fetch-from-api.js';\n\nexport type PwnedPasswordSuffixes = Record<string, number>;\n\n/**\n * An object mapping an exposed password hash suffix (corresponding to a given\n * hash prefix) to how many times it occurred in the Pwned Passwords repository.\n *\n * @typedef {Object.<string, number>} PwnedPasswordSuffixes\n */\n\n/**\n * Fetches the SHA-1 or NTLM hash suffixes for the given 5-character hash\n * prefix.\n *\n * When a password hash with the same first 5 characters is found in the Pwned\n * Passwords repository, the API will respond with an HTTP 200 and include the\n * suffix of every hash beginning with the specified prefix, followed by a count\n * of how many times it appears in the data set. This function parses the\n * response and returns a more structured format.\n *\n * @param {string} prefix the first 5 characters of a password hash (case\n * insensitive)\n * @param {object} [options] a configuration object\n * @param {boolean} [options.addPadding] ask the remote API to add padding to\n * the response to obscure the password prefix (default: `false`)\n * @param {'sha1' | 'ntlm'} [options.mode] return SHA-1 or NTLM hashes\n * (default: `sha1`)\n * @param {string} [options.baseUrl] a custom base URL for the\n * pwnedpasswords.com API endpoints (default: `https://api.pwnedpasswords.com`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {Promise<PwnedPasswordSuffixes>} a Promise which resolves to an\n * object mapping the `suffix` that when matched with the prefix composes the\n * complete hash, to the `count` of how many times it appears in the breached\n * password data set, or rejects with an Error\n *\n * @example\n * try {\n * const results = await pwnedPasswordRange(\"5BAA6\");\n * // results will have the following shape:\n * // {\n * // \"003D68EB55068C33ACE09247EE4C639306B\": 3,\n * // \"012C192B2F16F82EA0EB9EF18D9D539B0DD\": 1,\n * // ...\n * // }\n * } catch (err) {\n * // ...\n * }\n * @example\n * try {\n * const suffix = \"1E4C9B93F3F0682250B6CF8331B7EE68FD8\";\n * const results = await pwnedPasswordRange(\"5BAA6\");\n * const numPwns = results[suffix] || 0;\n * } catch (err) {\n * // ...\n * }\n * @see https://haveibeenpwned.com/api/v3#SearchingPwnedPasswordsByRange\n */\nexport async function pwnedPasswordRange(\n prefix: string,\n options: {\n /**\n * ask the remote API to add padding to the response to obscure the password\n * prefix (default: `false`)\n */\n addPadding?: boolean;\n /**\n * return SHA-1 or NTLM hashes (default: `sha1`)\n */\n mode?: 'sha1' | 'ntlm';\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n): Promise<PwnedPasswordSuffixes> {\n const { baseUrl, userAgent, addPadding = false, mode = 'sha1' } = options;\n\n const data = await fetchFromApi(`/range/${encodeURIComponent(prefix)}`, {\n baseUrl,\n userAgent,\n addPadding,\n mode,\n });\n\n // create array from lines of text in response body\n const results = data.split('\\n').filter(Boolean);\n\n // convert into an object mapping suffix to count for each line\n return results.reduce<PwnedPasswordSuffixes>((acc, row) => {\n const [suffix, countString] = row.split(':');\n acc[suffix] = Number.parseInt(countString, 10);\n return acc;\n }, {});\n}\n","import { installUndiciOnNode18 } from '../fetch-polyfill.js';\nimport { BAD_REQUEST } from './responses.js';\n\ninstallUndiciOnNode18();\n\n/**\n * Fetches data from the supplied API endpoint.\n *\n * HTTP status code 200 returns plain text (data found).\n * HTTP status code 400 throws an Error (bad request).\n *\n * @internal\n * @private\n * @param {string} endpoint the API endpoint to query\n * @param {object} [options] a configuration object\n * @param {string} [options.baseUrl] a custom base URL for the\n * pwnedpasswords.com API endpoints (default: `https://api.pwnedpasswords.com`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @param {boolean} [options.addPadding] ask the remote API to add padding to\n * the response to obscure the password prefix (default: `false`)\n * @param {'sha1' | 'ntlm'} [options.mode] return SHA-1 or NTLM hashes\n * (default: `sha1`)\n * @returns {Promise<string>} a Promise which resolves to the data resulting\n * from the query, or rejects with an Error\n */\nexport async function fetchFromApi(\n endpoint: string,\n options: {\n baseUrl?: string;\n userAgent?: string;\n addPadding?: boolean;\n mode?: 'sha1' | 'ntlm';\n } = {},\n): Promise<string> {\n const {\n baseUrl = 'https://api.pwnedpasswords.com',\n userAgent,\n addPadding = false,\n mode = 'sha1',\n } = options;\n\n const config = Object.assign(\n {},\n userAgent ? { headers: { 'User-Agent': userAgent } } : {},\n addPadding ? { headers: { 'Add-Padding': 'true' } } : {},\n );\n const url = `${baseUrl.replace(/\\/$/g, '')}${endpoint}?mode=${mode}`;\n const response = await fetch(url, config);\n\n if (response.ok) return response.text();\n\n if (response.status === BAD_REQUEST.status) {\n const text = await response.text();\n throw new Error(text);\n }\n\n throw new Error(response.statusText);\n}\n","import JSSHA from 'jssha/dist/sha1';\nimport { pwnedPasswordRange } from './pwned-password-range.js';\n\n/**\n * Fetches the number of times the the given password has been exposed in a\n * breach (0 indicating no exposure). The password is given in plain text, but\n * only the first 5 characters of its SHA-1 hash will be submitted to the API.\n *\n * @param {string} password a password in plain text\n * @param {object} [options] a configuration object\n * @param {boolean} [options.addPadding] ask the remote API to add padding to\n * the response to obscure the password prefix (default: `false`)\n * @param {string} [options.baseUrl] a custom base URL for the\n * pwnedpasswords.com API endpoints (default: `https://api.pwnedpasswords.com`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {Promise<number>} a Promise which resolves to the number of times\n * the password has been exposed in a breach, or rejects with an Error\n * @example\n * try {\n * const numPwns = await pwnedPassword(\"f00b4r\");\n * // truthy check or numeric condition\n * if (numPwns) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n * @see https://haveibeenpwned.com/api/v3#PwnedPasswords\n */\nexport async function pwnedPassword(\n password: string,\n options: {\n /**\n * ask the remote API to add padding to the response to obscure the password\n * prefix (default: `false`)\n */\n addPadding?: boolean;\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n): Promise<number> {\n /* eslint-disable */\n // @ts-expect-error: JSSHA types are busted\n const sha1 = new JSSHA('SHA-1', 'TEXT');\n sha1.update(password);\n const hash = sha1.getHash('HEX', { outputUpper: true });\n const prefix = hash.slice(0, 5);\n const suffix = hash.slice(5);\n\n const range = await pwnedPasswordRange(prefix, options);\n return range[suffix] || 0;\n /* eslint-enable */\n}\n","import type { Breach, Paste } from './api/haveibeenpwned/types.js';\nimport { breachedAccount } from './breached-account.js';\nimport { pasteAccount } from './paste-account.js';\n\nexport interface SearchResults {\n breaches: Breach[] | null;\n pastes: Paste[] | null;\n}\n\n/**\n * An object representing search results.\n *\n * @typedef {object} SearchResults\n * @property {(Breach[] | null)} breaches\n * @property {(Paste[] | null)} pastes\n */\n\n/**\n * Fetches all breaches and all pastes associated with the provided account\n * (email address or username). Note that the remote API does not support\n * querying pastes by username (only email addresses), so in the event the\n * provided account is not a valid email address, only breach data is queried\n * and the \"pastes\" field of the resulting object will always be null. This is\n * exactly how searching via the current web interface behaves, which this\n * convenience method is designed to mimic.\n *\n * 🔑 `haveibeenpwned.com` requires an API key from\n * https://haveibeenpwned.com/API/Key for the `breachedaccount` and\n * `pasteaccount` endpoints. The `apiKey` option here is not explicitly\n * required, but direct requests made without it will fail (unless you specify a\n * `baseUrl` to a proxy that inserts a valid API key on your behalf).\n *\n * @param {string} account an email address or username\n * @param {object} [options] a configuration object\n * @param {string} [options.apiKey] an API key from\n * https://haveibeenpwned.com/API/Key (default: undefined)\n * @param {string} [options.domain] a domain by which to filter the breach\n * results (default: all domains)\n * @param {boolean} [options.truncate] truncate the breach results to only\n * include the name of each breach (default: true)\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {string} [options.userAgent] a custom string to send as the\n * User-Agent field in the request headers (default: `hibp <version>`)\n * @returns {Promise<SearchResults>} a Promise which resolves to an object\n * containing a \"breaches\" key (which can be null or an array of breach objects)\n * and a \"pastes\" key (which can be null or an array of paste objects), or\n * rejects with an Error\n * @example\n * try {\n * const data = await search(\"foo\", { apiKey: \"my-api-key\" });\n * if (data.breaches || data.pastes) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n * @example\n * try {\n * const data = await search(\"nobody@nowhere.com\", {\n * baseUrl: \"https://my-hibp-proxy:8080\",\n * truncate: false,\n * });\n * if (data.breaches || data.pastes) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n * @see https://haveibeenpwned.com/\n */\nexport async function search(\n account: string,\n options: {\n /**\n * an API key from https://haveibeenpwned.com/API/Key (default: undefined)\n */\n apiKey?: string;\n /**\n * a domain by which to filter the results (default: all domains)\n */\n domain?: string;\n /**\n * truncate the results to only include the name of each breach (default:\n * true)\n */\n truncate?: boolean;\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n): Promise<SearchResults> {\n const { apiKey, domain, truncate = true, baseUrl, userAgent } = options;\n\n const [breaches, pastes] = await Promise.all([\n breachedAccount(account, { apiKey, domain, truncate, baseUrl, userAgent }),\n // This email regex is garbage but it seems to be what the API uses:\n /^.+@.+$/.test(account)\n ? pasteAccount(account, { apiKey, baseUrl, userAgent })\n : null,\n ]);\n\n return { breaches, pastes };\n}\n","import type { SubscriptionStatus } from './api/haveibeenpwned/types.js';\nimport { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';\n\n/**\n * An object representing the status of your HIBP subscription.\n *\n * @typedef {object} SubscriptionStatus\n * @property {string} SubscriptionName\n * @property {string} Description\n * @property {string} SubscribedUntil\n * @property {number} Rpm\n * @property {number} DomainSearchMaxBreachedAccounts\n */\n\n/**\n * Fetches the current status of your HIBP subscription (API key).\n *\n * 🔑 `haveibeenpwned.com` requires an API key from\n * https://haveibeenpwned.com/API/Key for the `subscription/status` endpoint.\n * The `apiKey` option here is not explicitly required, but direct requests made\n * without it will fail (unless you specify a `baseUrl` to a proxy that inserts\n * a valid API key on your behalf).\n *\n * @param {object} [options] a configuration object\n * @param {string} [options.apiKey] an API key from\n * https://haveibeenpwned.com/API/Key (default: undefined)\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {Promise<SubscriptionStatus>} a Promise which resolves to a\n * subscription status object, or rejects with an Error\n * @example\n * try {\n * const data = await subscriptionStatus({ apiKey: \"my-api-key\" });\n * // ...\n * } catch (err) {\n * // ...\n * }\n * @example\n * try {\n * const data = await subscriptionStatus({\n * baseUrl: \"https://my-hibp-proxy:8080\",\n * });\n * // ...\n * } catch (err) {\n * // ...\n * }\n */\nexport async function subscriptionStatus(\n options: {\n /**\n * an API key from https://haveibeenpwned.com/API/Key (default: undefined)\n */\n apiKey?: string;\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n) {\n const endpoint = '/subscription/status';\n\n return fetchFromApi(endpoint, options) as Promise<SubscriptionStatus>;\n}\n"],"names":["installUndiciOnNode18","process","versions","node","startsWith","File","UndiciFile","fetch","undiciFetch","FormData","UndiciFormData","Headers","UndiciHeaders","Request","UndiciRequest","Response","UndiciResponse","require","global","emptyHeaders","Map","BAD_REQUEST","headers","status","statusText","UNAUTHORIZED","body","statusCode","message","FORBIDDEN","NOT_FOUND","TOO_MANY_REQUESTS","RateLimitError","Error","retryAfterSeconds","constructor","retryAfter","options","super","this","name","Number","parseInt","undefined","async","fetchFromApi","endpoint","apiKey","baseUrl","userAgent","navigator","version","config","url","replace","response","ok","json","rayId","get","blockedWithRayId","breach","breachName","encodeURIComponent","breachedAccount","account","domain","includeUnverified","truncate","params","push","join","breaches","dataClasses","pasteAccount","email","t","r","n","i","e","s","o","h","u","f","length","value","binLen","c","substr","isNaN","a","w","E","l","A","charCodeAt","p","indexOf","search","charAt","ArrayBuffer","Uint8Array","outputUpper","toUpperCase","b64Pad","String","fromCharCode","outputLen","shakeLen","encoding","numRounds","U","R","update","T","F","m","g","slice","getHash","B","v","H","C","Y","I","L","setHMACKey","M","N","getHMAC","S","hmacKey","format","pwnedPasswordRange","prefix","addPadding","mode","data","Object","assign","text","split","filter","Boolean","reduce","acc","row","suffix","countString","pwnedPassword","password","sha1","JSSHA","hash","pastes","Promise","all","test","subscriptionStatus"],"mappings":"+CAOgBA,IACd,GACqB,oBAAZC,SACPA,QAAQC,SAASC,KAAKC,WAAW,OACjC,CACA,MACEC,KAAMC,EACNC,MAAOC,EACPC,SAAUC,EACVC,QAASC,EACTC,QAASC,EACTC,SAAUC,GACRC,QAAQ,UACZC,OAAOb,KAAOC,EACdY,OAAOP,QAAUC,EACjBM,OAAOL,QAAUC,EACjBI,OAAOH,SAAWC,EAClBE,OAAOX,MAAQC,EACfU,OAAOT,SAAWC,CACnB,CACH,CCLA,MAAMS,EAAe,IAAIC,IAGZC,EAAyC,CACpDC,QAASH,EACTI,OAAQ,IACRC,WACE,wEAUSC,EAA0C,CACrDH,QAASH,EACTI,OAAQ,IACRG,KAAM,CACJC,WAAY,IACZC,QAAS,+CAKAC,EAAuC,CAClDP,QAASH,EACTI,OAAQ,IACRC,WAAY,8BAUDM,EAAuC,CAClDR,QAASH,EACTI,OAAQ,KAUGQ,EAA+C,CAC1DT,QAAS,IAAIF,IAAI,CAAC,CAAC,cAAe,OAClCG,OAAQ,IACRG,KAAM,CACJC,WAAY,IACZC,QAAS,oDCpEb5B,IASM,MAAOgC,UAAuBC,MAM3BC,kBAEPC,YACEC,EACAR,EACAS,GAEAC,MAAMV,EAASS,GACfE,KAAKC,KAAOD,KAAKJ,YAAYK,KAC7BD,KAAKL,kBACmB,iBAAfE,EACHK,OAAOC,SAASN,EAAY,SAC5BO,CACP,EAgCIC,eAAeC,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