ipfs-unixfs-importer 9.0.8 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/README.md +33 -17
  2. package/dist/index.min.js +24 -0
  3. package/dist/src/dag-builder/file/buffer-importer.d.ts +1 -1
  4. package/dist/src/dag-builder/file/buffer-importer.d.ts.map +1 -1
  5. package/dist/src/dag-builder/file/index.d.ts +1 -1
  6. package/dist/src/dag-builder/file/index.d.ts.map +1 -1
  7. package/dist/src/dag-builder/index.d.ts +1 -1
  8. package/dist/src/dag-builder/index.d.ts.map +1 -1
  9. package/dist/src/dir-flat.d.ts +8 -0
  10. package/dist/src/dir-flat.d.ts.map +1 -1
  11. package/dist/src/dir-sharded.d.ts +5 -1
  12. package/dist/src/dir-sharded.d.ts.map +1 -1
  13. package/dist/src/dir.d.ts +2 -2
  14. package/dist/src/dir.d.ts.map +1 -1
  15. package/dist/src/index.d.ts +1 -1
  16. package/dist/src/tree-builder.d.ts +1 -1
  17. package/dist/src/tree-builder.d.ts.map +1 -1
  18. package/package.json +37 -49
  19. package/src/chunker/fixed-size.js +43 -0
  20. package/src/chunker/rabin.js +87 -0
  21. package/src/dag-builder/dir.js +31 -0
  22. package/src/dag-builder/file/balanced.js +31 -0
  23. package/src/dag-builder/file/buffer-importer.js +51 -0
  24. package/src/dag-builder/file/flat.js +10 -0
  25. package/src/dag-builder/file/index.js +208 -0
  26. package/src/dag-builder/file/trickle.js +199 -0
  27. package/src/dag-builder/index.js +121 -0
  28. package/{esm/src → src}/dag-builder/validate-chunks.js +19 -9
  29. package/src/dir-flat.js +129 -0
  30. package/src/dir-sharded.js +185 -0
  31. package/src/dir.js +71 -0
  32. package/src/flat-to-shard.js +69 -0
  33. package/src/index.js +67 -0
  34. package/src/options.js +64 -0
  35. package/src/tree-builder.js +118 -0
  36. package/src/types.ts +135 -0
  37. package/src/utils/persist.js +39 -0
  38. package/src/utils/to-path-components.js +9 -0
  39. package/LICENSE-APACHE +0 -5
  40. package/LICENSE-MIT +0 -19
  41. package/cjs/src/chunker/fixed-size.js +0 -36
  42. package/cjs/src/chunker/rabin.js +0 -63
  43. package/cjs/src/dag-builder/dir.js +0 -24
  44. package/cjs/src/dag-builder/file/balanced.js +0 -23
  45. package/cjs/src/dag-builder/file/buffer-importer.js +0 -62
  46. package/cjs/src/dag-builder/file/flat.js +0 -13
  47. package/cjs/src/dag-builder/file/index.js +0 -153
  48. package/cjs/src/dag-builder/file/trickle.js +0 -111
  49. package/cjs/src/dag-builder/index.js +0 -81
  50. package/cjs/src/dag-builder/validate-chunks.js +0 -27
  51. package/cjs/src/dir-flat.js +0 -82
  52. package/cjs/src/dir-sharded.js +0 -125
  53. package/cjs/src/dir.js +0 -30
  54. package/cjs/src/flat-to-shard.js +0 -44
  55. package/cjs/src/index.js +0 -44
  56. package/cjs/src/options.js +0 -48
  57. package/cjs/src/tree-builder.js +0 -82
  58. package/cjs/src/utils/persist.js +0 -48
  59. package/cjs/src/utils/to-path-components.js +0 -7
  60. package/dist/test/benchmark.spec.d.ts +0 -2
  61. package/dist/test/benchmark.spec.d.ts.map +0 -1
  62. package/dist/test/builder-balanced.spec.d.ts +0 -2
  63. package/dist/test/builder-balanced.spec.d.ts.map +0 -1
  64. package/dist/test/builder-flat.spec.d.ts +0 -2
  65. package/dist/test/builder-flat.spec.d.ts.map +0 -1
  66. package/dist/test/builder-only-hash.spec.d.ts +0 -2
  67. package/dist/test/builder-only-hash.spec.d.ts.map +0 -1
  68. package/dist/test/builder-trickle-dag.spec.d.ts +0 -2
  69. package/dist/test/builder-trickle-dag.spec.d.ts.map +0 -1
  70. package/dist/test/builder.spec.d.ts +0 -2
  71. package/dist/test/builder.spec.d.ts.map +0 -1
  72. package/dist/test/chunker-custom.spec.d.ts +0 -2
  73. package/dist/test/chunker-custom.spec.d.ts.map +0 -1
  74. package/dist/test/chunker-fixed-size.spec.d.ts +0 -2
  75. package/dist/test/chunker-fixed-size.spec.d.ts.map +0 -1
  76. package/dist/test/chunker-rabin.spec.d.ts +0 -2
  77. package/dist/test/chunker-rabin.spec.d.ts.map +0 -1
  78. package/dist/test/hash-parity-with-go-ipfs.spec.d.ts +0 -2
  79. package/dist/test/hash-parity-with-go-ipfs.spec.d.ts.map +0 -1
  80. package/dist/test/helpers/as-async-iterable.d.ts +0 -6
  81. package/dist/test/helpers/as-async-iterable.d.ts.map +0 -1
  82. package/dist/test/helpers/block.d.ts +0 -7
  83. package/dist/test/helpers/block.d.ts.map +0 -1
  84. package/dist/test/helpers/finite-pseudorandom-byte-stream.d.ts +0 -7
  85. package/dist/test/helpers/finite-pseudorandom-byte-stream.d.ts.map +0 -1
  86. package/dist/test/helpers/random-byte-stream.d.ts +0 -6
  87. package/dist/test/helpers/random-byte-stream.d.ts.map +0 -1
  88. package/dist/test/utils.spec.d.ts +0 -2
  89. package/dist/test/utils.spec.d.ts.map +0 -1
  90. package/esm/package.json +0 -4
  91. package/esm/src/chunker/fixed-size.js +0 -28
  92. package/esm/src/chunker/rabin.js +0 -54
  93. package/esm/src/dag-builder/dir.js +0 -23
  94. package/esm/src/dag-builder/file/balanced.js +0 -15
  95. package/esm/src/dag-builder/file/buffer-importer.js +0 -37
  96. package/esm/src/dag-builder/file/flat.js +0 -5
  97. package/esm/src/dag-builder/file/index.js +0 -128
  98. package/esm/src/dag-builder/file/trickle.js +0 -103
  99. package/esm/src/dag-builder/index.js +0 -73
  100. package/esm/src/dir-flat.js +0 -81
  101. package/esm/src/dir-sharded.js +0 -127
  102. package/esm/src/dir.js +0 -27
  103. package/esm/src/flat-to-shard.js +0 -40
  104. package/esm/src/index.js +0 -33
  105. package/esm/src/options.js +0 -39
  106. package/esm/src/tree-builder.js +0 -78
  107. package/esm/src/utils/persist.js +0 -24
  108. package/esm/src/utils/to-path-components.js +0 -4
  109. package/index.js +0 -1
  110. package/index.min.js +0 -24
  111. package/types/src/chunker/fixed-size.d.ts +0 -6
  112. package/types/src/chunker/fixed-size.d.ts.map +0 -1
  113. package/types/src/chunker/rabin.d.ts +0 -21
  114. package/types/src/chunker/rabin.d.ts.map +0 -1
  115. package/types/src/dag-builder/dir.d.ts +0 -10
  116. package/types/src/dag-builder/dir.d.ts.map +0 -1
  117. package/types/src/dag-builder/file/balanced.d.ts +0 -10
  118. package/types/src/dag-builder/file/balanced.d.ts.map +0 -1
  119. package/types/src/dag-builder/file/buffer-importer.d.ts +0 -10
  120. package/types/src/dag-builder/file/buffer-importer.d.ts.map +0 -1
  121. package/types/src/dag-builder/file/flat.d.ts +0 -6
  122. package/types/src/dag-builder/file/flat.d.ts.map +0 -1
  123. package/types/src/dag-builder/file/index.d.ts +0 -12
  124. package/types/src/dag-builder/file/index.d.ts.map +0 -1
  125. package/types/src/dag-builder/file/trickle.d.ts +0 -20
  126. package/types/src/dag-builder/file/trickle.d.ts.map +0 -1
  127. package/types/src/dag-builder/index.d.ts +0 -11
  128. package/types/src/dag-builder/index.d.ts.map +0 -1
  129. package/types/src/dag-builder/validate-chunks.d.ts +0 -10
  130. package/types/src/dag-builder/validate-chunks.d.ts.map +0 -1
  131. package/types/src/dir-flat.d.ts +0 -28
  132. package/types/src/dir-flat.d.ts.map +0 -1
  133. package/types/src/dir-sharded.d.ts +0 -25
  134. package/types/src/dir-sharded.d.ts.map +0 -1
  135. package/types/src/dir.d.ts +0 -82
  136. package/types/src/dir.d.ts.map +0 -1
  137. package/types/src/flat-to-shard.d.ts +0 -17
  138. package/types/src/flat-to-shard.d.ts.map +0 -1
  139. package/types/src/index.d.ts +0 -43
  140. package/types/src/index.d.ts.map +0 -1
  141. package/types/src/options.d.ts +0 -5
  142. package/types/src/options.d.ts.map +0 -1
  143. package/types/src/tree-builder.d.ts +0 -11
  144. package/types/src/tree-builder.d.ts.map +0 -1
  145. package/types/src/types.d.ts +0 -145
  146. package/types/src/types.d.ts.map +0 -1
  147. package/types/src/utils/persist.d.ts +0 -9
  148. package/types/src/utils/persist.d.ts.map +0 -1
  149. package/types/src/utils/to-path-components.d.ts +0 -3
  150. package/types/src/utils/to-path-components.d.ts.map +0 -1
  151. package/types/test/benchmark.spec.d.ts +0 -2
  152. package/types/test/benchmark.spec.d.ts.map +0 -1
  153. package/types/test/builder-balanced.spec.d.ts +0 -2
  154. package/types/test/builder-balanced.spec.d.ts.map +0 -1
  155. package/types/test/builder-flat.spec.d.ts +0 -2
  156. package/types/test/builder-flat.spec.d.ts.map +0 -1
  157. package/types/test/builder-only-hash.spec.d.ts +0 -2
  158. package/types/test/builder-only-hash.spec.d.ts.map +0 -1
  159. package/types/test/builder-trickle-dag.spec.d.ts +0 -2
  160. package/types/test/builder-trickle-dag.spec.d.ts.map +0 -1
  161. package/types/test/builder.spec.d.ts +0 -2
  162. package/types/test/builder.spec.d.ts.map +0 -1
  163. package/types/test/chunker-custom.spec.d.ts +0 -2
  164. package/types/test/chunker-custom.spec.d.ts.map +0 -1
  165. package/types/test/chunker-fixed-size.spec.d.ts +0 -2
  166. package/types/test/chunker-fixed-size.spec.d.ts.map +0 -1
  167. package/types/test/chunker-rabin.spec.d.ts +0 -2
  168. package/types/test/chunker-rabin.spec.d.ts.map +0 -1
  169. package/types/test/hash-parity-with-go-ipfs.spec.d.ts +0 -2
  170. package/types/test/hash-parity-with-go-ipfs.spec.d.ts.map +0 -1
  171. package/types/test/helpers/as-async-iterable.d.ts +0 -6
  172. package/types/test/helpers/as-async-iterable.d.ts.map +0 -1
  173. package/types/test/helpers/block.d.ts +0 -7
  174. package/types/test/helpers/block.d.ts.map +0 -1
  175. package/types/test/helpers/finite-pseudorandom-byte-stream.d.ts +0 -7
  176. package/types/test/helpers/finite-pseudorandom-byte-stream.d.ts.map +0 -1
  177. package/types/test/helpers/random-byte-stream.d.ts +0 -6
  178. package/types/test/helpers/random-byte-stream.d.ts.map +0 -1
  179. package/types/test/utils.spec.d.ts +0 -2
  180. package/types/test/utils.spec.d.ts.map +0 -1
package/README.md CHANGED
@@ -1,34 +1,36 @@
1
1
  # ipfs-unixfs-importer <!-- omit in toc -->
2
2
 
3
- [![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
4
- [![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)
5
- [![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
6
- [![Build Status](https://flat.badgen.net/travis/ipfs/js-ipfs-unixfs)](https://travis-ci.com/ipfs/js-ipfs-unixfs)
7
- [![Codecov](https://codecov.io/gh/ipfs/js-ipfs-unixfs/branch/master/graph/badge.svg)](https://codecov.io/gh/ipfs/js-ipfs-unixfs)
3
+ [![ipfs.io](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io)
4
+ [![IRC](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
5
+ [![Discord](https://img.shields.io/discord/806902334369824788?style=flat-square)](https://discord.gg/ipfs)
6
+ [![codecov](https://img.shields.io/codecov/c/github/ipfs/js-ipfs-unixfs.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-ipfs-unixfs)
7
+ [![CI](https://img.shields.io/github/workflow/status/ipfs/js-ipfs-unixfs/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/ipfs/js-ipfs-unixfs/actions/workflows/js-test-and-release.yml)
8
8
 
9
- > JavaScript implementation of the layout and chunking mechanisms used by IPFS to handle Files
9
+ > JavaScript implementation of the UnixFs importer used by IPFS
10
10
 
11
- ## Lead Maintainer <!-- omit in toc -->
12
-
13
- [Alex Potsides](https://github.com/achingbrain)
14
-
15
- ## Table of Contents <!-- omit in toc -->
11
+ ## Table of contents <!-- omit in toc -->
16
12
 
17
13
  - [Install](#install)
14
+ - [Lead Maintainer <!-- omit in toc -->](#lead-maintainer----omit-in-toc---)
18
15
  - [Usage](#usage)
19
16
  - [Example](#example)
20
17
  - [API](#api)
21
- - [const stream = importer(source, blockstore [, options])](#const-stream--importersource-blockstore--options)
18
+ - [const stream = importer(source, blockstore \[, options\])](#const-stream--importersource-blockstore--options)
22
19
  - [Overriding internals](#overriding-internals)
23
20
  - [Contribute](#contribute)
24
21
  - [License](#license)
22
+ - [Contribute](#contribute-1)
25
23
 
26
24
  ## Install
27
25
 
28
- ```
29
- > npm install ipfs-unixfs-importer
26
+ ```console
27
+ $ npm i ipfs-unixfs-importer
30
28
  ```
31
29
 
30
+ ## Lead Maintainer <!-- omit in toc -->
31
+
32
+ [Alex Potsides](https://github.com/achingbrain)
33
+
32
34
  ## Usage
33
35
 
34
36
  ### Example
@@ -96,7 +98,7 @@ When run, metadata about DAGNodes in the created tree is printed until the root:
96
98
  import { importer } from 'ipfs-unixfs-importer'
97
99
  ```
98
100
 
99
- #### const stream = importer(source, blockstore [, options])
101
+ #### const stream = importer(source, blockstore \[, options])
100
102
 
101
103
  The `importer` function returns an async iterator takes a source async iterator that yields objects of the form:
102
104
 
@@ -137,7 +139,7 @@ The input's file paths and directory structure will be preserved in the [`dag-pb
137
139
  - `progress` (function): a function that will be called with the byte length of chunks as a file is added to ipfs.
138
140
  - `onlyHash` (boolean, defaults to false): Only chunk and hash - do not write to disk
139
141
  - `hashAlg` (string): multihash hashing algorithm to use
140
- - `cidVersion` (integer, default 0): the CID version to use when storing the data (storage keys are based on the CID, _including_ it's version)
142
+ - `cidVersion` (integer, default 0): the CID version to use when storing the data (storage keys are based on the CID, *including* it's version)
141
143
  - `rawLeaves` (boolean, defaults to false): When a file would span multiple DAGNodes, if this is true the leaf nodes will not be wrapped in `UnixFS` protobufs and will instead contain the raw file bytes
142
144
  - `leafType` (string, defaults to `'file'`) what type of UnixFS node leaves should be - can be `'file'` or `'raw'` (ignored when `rawLeaves` is `true`)
143
145
  - `blockWriteConcurrency` (positive integer, defaults to 10) How many blocks to hash and write to the block store concurrently. For small numbers of large files this should be high (e.g. 50).
@@ -166,8 +168,11 @@ Several aspects of the importer are overridable by specifying functions as part
166
168
  - It should yield an object with the properties `{ cid, path, unixfs, size }` where `cid` is a `CID`, `path` is a string, `unixfs` is a UnixFS entry and `size` is a `Number`.
167
169
 
168
170
  [blockstore]: https://github.com/ipfs/js-ipfs-interfaces/tree/master/packages/interface-blockstore#readme
171
+
169
172
  [UnixFS]: https://github.com/ipfs/specs/tree/master/unixfs
173
+
170
174
  [IPLD]: https://github.com/ipld/js-ipld
175
+
171
176
  [CID]: https://github.com/multiformats/js-cid
172
177
 
173
178
  ## Contribute
@@ -180,4 +185,15 @@ This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/c
180
185
 
181
186
  ## License
182
187
 
183
- [MIT](LICENSE)
188
+ Licensed under either of
189
+
190
+ - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
191
+ - MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
192
+
193
+ ## Contribute
194
+
195
+ Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/js-ipfs-unixfs-importer/issues)!
196
+
197
+ This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
198
+
199
+ [![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)
@@ -0,0 +1,24 @@
1
+ "use strict";(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.IpfsUnixfsImporter = factory()}(typeof self !== 'undefined' ? self : this, function () {
2
+ var IpfsUnixfsImporter=(()=>{var rs=Object.create;var ne=Object.defineProperty;var ns=Object.getOwnPropertyDescriptor;var is=Object.getOwnPropertyNames;var os=Object.getPrototypeOf,ss=Object.prototype.hasOwnProperty;var I=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),V=(r,t)=>{for(var e in t)ne(r,e,{get:t[e],enumerable:!0})},Mr=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of is(t))!ss.call(r,i)&&i!==e&&ne(r,i,{get:()=>t[i],enumerable:!(n=ns(t,i))||n.enumerable});return r};var M=(r,t,e)=>(e=r!=null?rs(os(r)):{},Mr(t||!r||!r.__esModule?ne(e,"default",{value:r,enumerable:!0}):e,r)),as=r=>Mr(ne({},"__esModule",{value:!0}),r);var ie=I((xu,jr)=>{"use strict";async function*us(r,t=1){let e=[];t<1&&(t=1);for await(let n of r)for(e.push(n);e.length>=t;)yield e.slice(0,t),e=e.slice(t);for(;e.length;)yield e.slice(0,t),e=e.slice(t)}jr.exports=us});var Se=I((Au,Vr)=>{"use strict";var cs=ie();async function*fs(r,t=1){for await(let e of cs(r,t)){let n=e.map(i=>i().then(o=>({ok:!0,value:o}),o=>({ok:!1,err:o})));for(let i=0;i<n.length;i++){let o=await n[i];if(o.ok)yield o.value;else throw o.err}}}Vr.exports=fs});var $r=I((Bu,Hr)=>{"use strict";Hr.exports=r=>{if(Object.prototype.toString.call(r)!=="[object Object]")return!1;let t=Object.getPrototypeOf(r);return t===null||t===Object.prototype}});var Jr=I((Yr,Kr)=>{"use strict";var oe=$r(),{hasOwnProperty:qr}=Object.prototype,{propertyIsEnumerable:hs}=Object,xt=(r,t,e)=>Object.defineProperty(r,t,{value:e,writable:!0,enumerable:!0,configurable:!0}),ls=Yr,Gr={concatArrays:!1,ignoreUndefined:!1},se=r=>{let t=[];for(let e in r)qr.call(r,e)&&t.push(e);if(Object.getOwnPropertySymbols){let e=Object.getOwnPropertySymbols(r);for(let n of e)hs.call(r,n)&&t.push(n)}return t};function At(r){return Array.isArray(r)?ps(r):oe(r)?ds(r):r}function ps(r){let t=r.slice(0,0);return se(r).forEach(e=>{xt(t,e,At(r[e]))}),t}function ds(r){let t=Object.getPrototypeOf(r)===null?Object.create(null):{};return se(r).forEach(e=>{xt(t,e,At(r[e]))}),t}var Wr=(r,t,e,n)=>(e.forEach(i=>{typeof t[i]>"u"&&n.ignoreUndefined||(i in r&&r[i]!==Object.getPrototypeOf(r)?xt(r,i,Ce(r[i],t[i],n)):xt(r,i,At(t[i])))}),r),ys=(r,t,e)=>{let n=r.slice(0,0),i=0;return[r,t].forEach(o=>{let s=[];for(let u=0;u<o.length;u++)!qr.call(o,u)||(s.push(String(u)),o===r?xt(n,i++,o[u]):xt(n,i++,At(o[u])));n=Wr(n,o,se(o).filter(u=>!s.includes(u)),e)}),n};function Ce(r,t,e){return e.concatArrays&&Array.isArray(r)&&Array.isArray(t)?ys(r,t,e):!oe(t)||!oe(r)?At(t):Wr(r,t,se(t),e)}Kr.exports=function(...r){let t=Ce(At(Gr),this!==ls&&this||{},Gr),e={_:{}};for(let n of r)if(n!==void 0){if(!oe(n))throw new TypeError("`"+n+"` is not an Option Object");e=Ce(e,{_:n},t)}return e._}});var ln=I((Gt,fe)=>{(function(r,t){"use strict";var e={version:"3.0.0",x86:{},x64:{},inputValidation:!0};function n(c){if(!Array.isArray(c)&&!ArrayBuffer.isView(c))return!1;for(var p=0;p<c.length;p++)if(!Number.isInteger(c[p])||c[p]<0||c[p]>255)return!1;return!0}function i(c,p){return(c&65535)*p+(((c>>>16)*p&65535)<<16)}function o(c,p){return c<<p|c>>>32-p}function s(c){return c^=c>>>16,c=i(c,2246822507),c^=c>>>13,c=i(c,3266489909),c^=c>>>16,c}function u(c,p){c=[c[0]>>>16,c[0]&65535,c[1]>>>16,c[1]&65535],p=[p[0]>>>16,p[0]&65535,p[1]>>>16,p[1]&65535];var g=[0,0,0,0];return g[3]+=c[3]+p[3],g[2]+=g[3]>>>16,g[3]&=65535,g[2]+=c[2]+p[2],g[1]+=g[2]>>>16,g[2]&=65535,g[1]+=c[1]+p[1],g[0]+=g[1]>>>16,g[1]&=65535,g[0]+=c[0]+p[0],g[0]&=65535,[g[0]<<16|g[1],g[2]<<16|g[3]]}function a(c,p){c=[c[0]>>>16,c[0]&65535,c[1]>>>16,c[1]&65535],p=[p[0]>>>16,p[0]&65535,p[1]>>>16,p[1]&65535];var g=[0,0,0,0];return g[3]+=c[3]*p[3],g[2]+=g[3]>>>16,g[3]&=65535,g[2]+=c[2]*p[3],g[1]+=g[2]>>>16,g[2]&=65535,g[2]+=c[3]*p[2],g[1]+=g[2]>>>16,g[2]&=65535,g[1]+=c[1]*p[3],g[0]+=g[1]>>>16,g[1]&=65535,g[1]+=c[2]*p[2],g[0]+=g[1]>>>16,g[1]&=65535,g[1]+=c[3]*p[1],g[0]+=g[1]>>>16,g[1]&=65535,g[0]+=c[0]*p[3]+c[1]*p[2]+c[2]*p[1]+c[3]*p[0],g[0]&=65535,[g[0]<<16|g[1],g[2]<<16|g[3]]}function h(c,p){return p%=64,p===32?[c[1],c[0]]:p<32?[c[0]<<p|c[1]>>>32-p,c[1]<<p|c[0]>>>32-p]:(p-=32,[c[1]<<p|c[0]>>>32-p,c[0]<<p|c[1]>>>32-p])}function f(c,p){return p%=64,p===0?c:p<32?[c[0]<<p|c[1]>>>32-p,c[1]<<p]:[c[1]<<p-32,0]}function d(c,p){return[c[0]^p[0],c[1]^p[1]]}function A(c){return c=d(c,[0,c[0]>>>1]),c=a(c,[4283543511,3981806797]),c=d(c,[0,c[0]>>>1]),c=a(c,[3301882366,444984403]),c=d(c,[0,c[0]>>>1]),c}e.x86.hash32=function(c,p){if(e.inputValidation&&!n(c))return t;p=p||0;for(var g=c.length%4,k=c.length-g,m=p,D=0,b=3432918353,_=461845907,F=0;F<k;F=F+4)D=c[F]|c[F+1]<<8|c[F+2]<<16|c[F+3]<<24,D=i(D,b),D=o(D,15),D=i(D,_),m^=D,m=o(m,13),m=i(m,5)+3864292196;switch(D=0,g){case 3:D^=c[F+2]<<16;case 2:D^=c[F+1]<<8;case 1:D^=c[F],D=i(D,b),D=o(D,15),D=i(D,_),m^=D}return m^=c.length,m=s(m),m>>>0},e.x86.hash128=function(c,p){if(e.inputValidation&&!n(c))return t;p=p||0;for(var g=c.length%16,k=c.length-g,m=p,D=p,b=p,_=p,F=0,w=0,y=0,E=0,S=597399067,N=2869860233,v=951274213,W=2716044179,C=0;C<k;C=C+16)F=c[C]|c[C+1]<<8|c[C+2]<<16|c[C+3]<<24,w=c[C+4]|c[C+5]<<8|c[C+6]<<16|c[C+7]<<24,y=c[C+8]|c[C+9]<<8|c[C+10]<<16|c[C+11]<<24,E=c[C+12]|c[C+13]<<8|c[C+14]<<16|c[C+15]<<24,F=i(F,S),F=o(F,15),F=i(F,N),m^=F,m=o(m,19),m+=D,m=i(m,5)+1444728091,w=i(w,N),w=o(w,16),w=i(w,v),D^=w,D=o(D,17),D+=b,D=i(D,5)+197830471,y=i(y,v),y=o(y,17),y=i(y,W),b^=y,b=o(b,15),b+=_,b=i(b,5)+2530024501,E=i(E,W),E=o(E,18),E=i(E,S),_^=E,_=o(_,13),_+=m,_=i(_,5)+850148119;switch(F=0,w=0,y=0,E=0,g){case 15:E^=c[C+14]<<16;case 14:E^=c[C+13]<<8;case 13:E^=c[C+12],E=i(E,W),E=o(E,18),E=i(E,S),_^=E;case 12:y^=c[C+11]<<24;case 11:y^=c[C+10]<<16;case 10:y^=c[C+9]<<8;case 9:y^=c[C+8],y=i(y,v),y=o(y,17),y=i(y,W),b^=y;case 8:w^=c[C+7]<<24;case 7:w^=c[C+6]<<16;case 6:w^=c[C+5]<<8;case 5:w^=c[C+4],w=i(w,N),w=o(w,16),w=i(w,v),D^=w;case 4:F^=c[C+3]<<24;case 3:F^=c[C+2]<<16;case 2:F^=c[C+1]<<8;case 1:F^=c[C],F=i(F,S),F=o(F,15),F=i(F,N),m^=F}return m^=c.length,D^=c.length,b^=c.length,_^=c.length,m+=D,m+=b,m+=_,D+=m,b+=m,_+=m,m=s(m),D=s(D),b=s(b),_=s(_),m+=D,m+=b,m+=_,D+=m,b+=m,_+=m,("00000000"+(m>>>0).toString(16)).slice(-8)+("00000000"+(D>>>0).toString(16)).slice(-8)+("00000000"+(b>>>0).toString(16)).slice(-8)+("00000000"+(_>>>0).toString(16)).slice(-8)},e.x64.hash128=function(c,p){if(e.inputValidation&&!n(c))return t;p=p||0;for(var g=c.length%16,k=c.length-g,m=[0,p],D=[0,p],b=[0,0],_=[0,0],F=[2277735313,289559509],w=[1291169091,658871167],y=0;y<k;y=y+16)b=[c[y+4]|c[y+5]<<8|c[y+6]<<16|c[y+7]<<24,c[y]|c[y+1]<<8|c[y+2]<<16|c[y+3]<<24],_=[c[y+12]|c[y+13]<<8|c[y+14]<<16|c[y+15]<<24,c[y+8]|c[y+9]<<8|c[y+10]<<16|c[y+11]<<24],b=a(b,F),b=h(b,31),b=a(b,w),m=d(m,b),m=h(m,27),m=u(m,D),m=u(a(m,[0,5]),[0,1390208809]),_=a(_,w),_=h(_,33),_=a(_,F),D=d(D,_),D=h(D,31),D=u(D,m),D=u(a(D,[0,5]),[0,944331445]);switch(b=[0,0],_=[0,0],g){case 15:_=d(_,f([0,c[y+14]],48));case 14:_=d(_,f([0,c[y+13]],40));case 13:_=d(_,f([0,c[y+12]],32));case 12:_=d(_,f([0,c[y+11]],24));case 11:_=d(_,f([0,c[y+10]],16));case 10:_=d(_,f([0,c[y+9]],8));case 9:_=d(_,[0,c[y+8]]),_=a(_,w),_=h(_,33),_=a(_,F),D=d(D,_);case 8:b=d(b,f([0,c[y+7]],56));case 7:b=d(b,f([0,c[y+6]],48));case 6:b=d(b,f([0,c[y+5]],40));case 5:b=d(b,f([0,c[y+4]],32));case 4:b=d(b,f([0,c[y+3]],24));case 3:b=d(b,f([0,c[y+2]],16));case 2:b=d(b,f([0,c[y+1]],8));case 1:b=d(b,[0,c[y]]),b=a(b,F),b=h(b,31),b=a(b,w),m=d(m,b)}return m=d(m,[0,c.length]),D=d(D,[0,c.length]),m=u(m,D),D=u(D,m),m=A(m),D=A(D),m=u(m,D),D=u(D,m),("00000000"+(m[0]>>>0).toString(16)).slice(-8)+("00000000"+(m[1]>>>0).toString(16)).slice(-8)+("00000000"+(D[0]>>>0).toString(16)).slice(-8)+("00000000"+(D[1]>>>0).toString(16)).slice(-8)},typeof Gt<"u"?(typeof fe<"u"&&fe.exports&&(Gt=fe.exports=e),Gt.murmurHash3=e):typeof define=="function"&&define.amd?define([],function(){return e}):(e._murmurHash3=r.murmurHash3,e.noConflict=function(){return r.murmurHash3=e._murmurHash3,e._murmurHash3=t,e.noConflict=t,e},r.murmurHash3=e)})(Gt)});var dn=I((Hu,pn)=>{pn.exports=ln()});var Lt=I((Xu,Dn)=>{"use strict";function gn(r,t){for(let e in t)Object.defineProperty(r,e,{value:t[e],enumerable:!0,configurable:!0});return r}function u1(r,t,e){if(!r||typeof r=="string")throw new TypeError("Please pass an Error to err-code");e||(e={}),typeof t=="object"&&(e=t,t=""),t&&(e.code=t);try{return gn(r,e)}catch{e.message=r.message,e.stack=r.stack;let i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(r)),gn(new i,e)}}Dn.exports=u1});var bn=I((Qu,wn)=>{"use strict";wn.exports=c1;function c1(r,t){for(var e=new Array(arguments.length-1),n=0,i=2,o=!0;i<arguments.length;)e[n++]=arguments[i++];return new Promise(function(u,a){e[n]=function(f){if(o)if(o=!1,f)a(f);else{for(var d=new Array(arguments.length-1),A=0;A<d.length;)d[A++]=arguments[A];u.apply(null,d)}};try{r.apply(t||null,e)}catch(h){o&&(o=!1,a(h))}})}});var An=I(xn=>{"use strict";var he=xn;he.length=function(t){var e=t.length;if(!e)return 0;for(var n=0;--e%4>1&&t.charAt(e)==="=";)++n;return Math.ceil(t.length*3)/4-n};var Nt=new Array(64),En=new Array(123);for(Q=0;Q<64;)En[Nt[Q]=Q<26?Q+65:Q<52?Q+71:Q<62?Q-4:Q-59|43]=Q++;var Q;he.encode=function(t,e,n){for(var i=null,o=[],s=0,u=0,a;e<n;){var h=t[e++];switch(u){case 0:o[s++]=Nt[h>>2],a=(h&3)<<4,u=1;break;case 1:o[s++]=Nt[a|h>>4],a=(h&15)<<2,u=2;break;case 2:o[s++]=Nt[a|h>>6],o[s++]=Nt[h&63],u=0;break}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),s=0)}return u&&(o[s++]=Nt[a],o[s++]=61,u===1&&(o[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,o.slice(0,s))),i.join("")):String.fromCharCode.apply(String,o.slice(0,s))};var _n="invalid encoding";he.decode=function(t,e,n){for(var i=n,o=0,s,u=0;u<t.length;){var a=t.charCodeAt(u++);if(a===61&&o>1)break;if((a=En[a])===void 0)throw Error(_n);switch(o){case 0:s=a,o=1;break;case 1:e[n++]=s<<2|(a&48)>>4,s=a,o=2;break;case 2:e[n++]=(s&15)<<4|(a&60)>>2,s=a,o=3;break;case 3:e[n++]=(s&3)<<6|a,o=0;break}}if(o===1)throw Error(_n);return n-i};he.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}});var Fn=I((e0,Bn)=>{"use strict";Bn.exports=le;function le(){this._listeners={}}le.prototype.on=function(t,e,n){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:e,ctx:n||this}),this};le.prototype.off=function(t,e){if(t===void 0)this._listeners={};else if(e===void 0)this._listeners[t]=[];else for(var n=this._listeners[t],i=0;i<n.length;)n[i].fn===e?n.splice(i,1):++i;return this};le.prototype.emit=function(t){var e=this._listeners[t];if(e){for(var n=[],i=1;i<arguments.length;)n.push(arguments[i++]);for(i=0;i<e.length;)e[i].fn.apply(e[i++].ctx,n)}return this}});var Nn=I((r0,Ln)=>{"use strict";Ln.exports=Sn(Sn);function Sn(r){return typeof Float32Array<"u"?function(){var t=new Float32Array([-0]),e=new Uint8Array(t.buffer),n=e[3]===128;function i(a,h,f){t[0]=a,h[f]=e[0],h[f+1]=e[1],h[f+2]=e[2],h[f+3]=e[3]}function o(a,h,f){t[0]=a,h[f]=e[3],h[f+1]=e[2],h[f+2]=e[1],h[f+3]=e[0]}r.writeFloatLE=n?i:o,r.writeFloatBE=n?o:i;function s(a,h){return e[0]=a[h],e[1]=a[h+1],e[2]=a[h+2],e[3]=a[h+3],t[0]}function u(a,h){return e[3]=a[h],e[2]=a[h+1],e[1]=a[h+2],e[0]=a[h+3],t[0]}r.readFloatLE=n?s:u,r.readFloatBE=n?u:s}():function(){function t(n,i,o,s){var u=i<0?1:0;if(u&&(i=-i),i===0)n(1/i>0?0:2147483648,o,s);else if(isNaN(i))n(2143289344,o,s);else if(i>34028234663852886e22)n((u<<31|2139095040)>>>0,o,s);else if(i<11754943508222875e-54)n((u<<31|Math.round(i/1401298464324817e-60))>>>0,o,s);else{var a=Math.floor(Math.log(i)/Math.LN2),h=Math.round(i*Math.pow(2,-a)*8388608)&8388607;n((u<<31|a+127<<23|h)>>>0,o,s)}}r.writeFloatLE=t.bind(null,Cn),r.writeFloatBE=t.bind(null,In);function e(n,i,o){var s=n(i,o),u=(s>>31)*2+1,a=s>>>23&255,h=s&8388607;return a===255?h?NaN:u*(1/0):a===0?u*1401298464324817e-60*h:u*Math.pow(2,a-150)*(h+8388608)}r.readFloatLE=e.bind(null,Tn),r.readFloatBE=e.bind(null,kn)}(),typeof Float64Array<"u"?function(){var t=new Float64Array([-0]),e=new Uint8Array(t.buffer),n=e[7]===128;function i(a,h,f){t[0]=a,h[f]=e[0],h[f+1]=e[1],h[f+2]=e[2],h[f+3]=e[3],h[f+4]=e[4],h[f+5]=e[5],h[f+6]=e[6],h[f+7]=e[7]}function o(a,h,f){t[0]=a,h[f]=e[7],h[f+1]=e[6],h[f+2]=e[5],h[f+3]=e[4],h[f+4]=e[3],h[f+5]=e[2],h[f+6]=e[1],h[f+7]=e[0]}r.writeDoubleLE=n?i:o,r.writeDoubleBE=n?o:i;function s(a,h){return e[0]=a[h],e[1]=a[h+1],e[2]=a[h+2],e[3]=a[h+3],e[4]=a[h+4],e[5]=a[h+5],e[6]=a[h+6],e[7]=a[h+7],t[0]}function u(a,h){return e[7]=a[h],e[6]=a[h+1],e[5]=a[h+2],e[4]=a[h+3],e[3]=a[h+4],e[2]=a[h+5],e[1]=a[h+6],e[0]=a[h+7],t[0]}r.readDoubleLE=n?s:u,r.readDoubleBE=n?u:s}():function(){function t(n,i,o,s,u,a){var h=s<0?1:0;if(h&&(s=-s),s===0)n(0,u,a+i),n(1/s>0?0:2147483648,u,a+o);else if(isNaN(s))n(0,u,a+i),n(2146959360,u,a+o);else if(s>17976931348623157e292)n(0,u,a+i),n((h<<31|2146435072)>>>0,u,a+o);else{var f;if(s<22250738585072014e-324)f=s/5e-324,n(f>>>0,u,a+i),n((h<<31|f/4294967296)>>>0,u,a+o);else{var d=Math.floor(Math.log(s)/Math.LN2);d===1024&&(d=1023),f=s*Math.pow(2,-d),n(f*4503599627370496>>>0,u,a+i),n((h<<31|d+1023<<20|f*1048576&1048575)>>>0,u,a+o)}}}r.writeDoubleLE=t.bind(null,Cn,0,4),r.writeDoubleBE=t.bind(null,In,4,0);function e(n,i,o,s,u){var a=n(s,u+i),h=n(s,u+o),f=(h>>31)*2+1,d=h>>>20&2047,A=4294967296*(h&1048575)+a;return d===2047?A?NaN:f*(1/0):d===0?f*5e-324*A:f*Math.pow(2,d-1075)*(A+4503599627370496)}r.readDoubleLE=e.bind(null,Tn,0,4),r.readDoubleBE=e.bind(null,kn,4,0)}(),r}function Cn(r,t,e){t[e]=r&255,t[e+1]=r>>>8&255,t[e+2]=r>>>16&255,t[e+3]=r>>>24}function In(r,t,e){t[e]=r>>>24,t[e+1]=r>>>16&255,t[e+2]=r>>>8&255,t[e+3]=r&255}function Tn(r,t){return(r[t]|r[t+1]<<8|r[t+2]<<16|r[t+3]<<24)>>>0}function kn(r,t){return(r[t]<<24|r[t+1]<<16|r[t+2]<<8|r[t+3])>>>0}});var Un=I((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(r){}return null}});var zn=I(On=>{"use strict";var Ve=On;Ve.length=function(t){for(var e=0,n=0,i=0;i<t.length;++i)n=t.charCodeAt(i),n<128?e+=1:n<2048?e+=2:(n&64512)===55296&&(t.charCodeAt(i+1)&64512)===56320?(++i,e+=4):e+=3;return e};Ve.read=function(t,e,n){var i=n-e;if(i<1)return"";for(var o=null,s=[],u=0,a;e<n;)a=t[e++],a<128?s[u++]=a:a>191&&a<224?s[u++]=(a&31)<<6|t[e++]&63:a>239&&a<365?(a=((a&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,s[u++]=55296+(a>>10),s[u++]=56320+(a&1023)):s[u++]=(a&15)<<12|(t[e++]&63)<<6|t[e++]&63,u>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),u=0);return o?(u&&o.push(String.fromCharCode.apply(String,s.slice(0,u))),o.join("")):String.fromCharCode.apply(String,s.slice(0,u))};Ve.write=function(t,e,n){for(var i=n,o,s,u=0;u<t.length;++u)o=t.charCodeAt(u),o<128?e[n++]=o:o<2048?(e[n++]=o>>6|192,e[n++]=o&63|128):(o&64512)===55296&&((s=t.charCodeAt(u+1))&64512)===56320?(o=65536+((o&1023)<<10)+(s&1023),++u,e[n++]=o>>18|240,e[n++]=o>>12&63|128,e[n++]=o>>6&63|128,e[n++]=o&63|128):(e[n++]=o>>12|224,e[n++]=o>>6&63|128,e[n++]=o&63|128);return n-i}});var Pn=I((i0,vn)=>{"use strict";vn.exports=f1;function f1(r,t,e){var n=e||8192,i=n>>>1,o=null,s=n;return function(a){if(a<1||a>i)return r(a);s+a>n&&(o=r(n),s=0);var h=t.call(o,s,s+=a);return s&7&&(s=(s|7)+1),h}}});var Mn=I((o0,Rn)=>{"use strict";Rn.exports=P;var qt=pt();function P(r,t){this.lo=r>>>0,this.hi=t>>>0}var wt=P.zero=new P(0,0);wt.toNumber=function(){return 0};wt.zzEncode=wt.zzDecode=function(){return this};wt.length=function(){return 1};var h1=P.zeroHash="\0\0\0\0\0\0\0\0";P.fromNumber=function(t){if(t===0)return wt;var e=t<0;e&&(t=-t);var n=t>>>0,i=(t-n)/4294967296>>>0;return e&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new P(n,i)};P.from=function(t){if(typeof t=="number")return P.fromNumber(t);if(qt.isString(t))if(qt.Long)t=qt.Long.fromString(t);else return P.fromNumber(parseInt(t,10));return t.low||t.high?new P(t.low>>>0,t.high>>>0):wt};P.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var e=~this.lo+1>>>0,n=~this.hi>>>0;return e||(n=n+1>>>0),-(e+n*4294967296)}return this.lo+this.hi*4294967296};P.prototype.toLong=function(t){return qt.Long?new qt.Long(this.lo|0,this.hi|0,Boolean(t)):{low:this.lo|0,high:this.hi|0,unsigned:Boolean(t)}};var lt=String.prototype.charCodeAt;P.fromHash=function(t){return t===h1?wt:new P((lt.call(t,0)|lt.call(t,1)<<8|lt.call(t,2)<<16|lt.call(t,3)<<24)>>>0,(lt.call(t,4)|lt.call(t,5)<<8|lt.call(t,6)<<16|lt.call(t,7)<<24)>>>0)};P.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};P.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this};P.prototype.zzDecode=function(){var t=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this};P.prototype.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?e===0?t<16384?t<128?1:2:t<2097152?3:4:e<16384?e<128?5:6:e<2097152?7:8:n<128?9:10}});var pt=I(He=>{"use strict";var x=He;x.asPromise=bn();x.base64=An();x.EventEmitter=Fn();x.float=Nn();x.inquire=Un();x.utf8=zn();x.pool=Pn();x.LongBits=Mn();x.isNode=Boolean(typeof globalThis<"u"&&globalThis&&globalThis.process&&globalThis.process.versions&&globalThis.process.versions.node);x.global=x.isNode&&globalThis||typeof window<"u"&&window||typeof self<"u"&&self||He;x.emptyArray=Object.freeze?Object.freeze([]):[];x.emptyObject=Object.freeze?Object.freeze({}):{};x.isInteger=Number.isInteger||function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t};x.isString=function(t){return typeof t=="string"||t instanceof String};x.isObject=function(t){return t&&typeof t=="object"};x.isset=x.isSet=function(t,e){var n=t[e];return n!=null&&t.hasOwnProperty(e)?typeof n!="object"||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1};x.Buffer=function(){try{var r=x.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}}();x._Buffer_from=null;x._Buffer_allocUnsafe=null;x.newBuffer=function(t){return typeof t=="number"?x.Buffer?x._Buffer_allocUnsafe(t):new x.Array(t):x.Buffer?x._Buffer_from(t):typeof Uint8Array>"u"?t:new Uint8Array(t)};x.Array=typeof Uint8Array<"u"?Uint8Array:Array;x.Long=x.global.dcodeIO&&x.global.dcodeIO.Long||x.global.Long||x.inquire("long");x.key2Re=/^true|false|0|1$/;x.key32Re=/^-?(?:0|[1-9][0-9]*)$/;x.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;x.longToHash=function(t){return t?x.LongBits.from(t).toHash():x.LongBits.zeroHash};x.longFromHash=function(t,e){var n=x.LongBits.fromHash(t);return x.Long?x.Long.fromBits(n.lo,n.hi,e):n.toNumber(Boolean(e))};function jn(r,t,e){for(var n=Object.keys(t),i=0;i<n.length;++i)(r[n[i]]===void 0||!e)&&(r[n[i]]=t[n[i]]);return r}x.merge=jn;x.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)};function Vn(r){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&jn(this,n)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}x.newError=Vn;x.ProtocolError=Vn("ProtocolError");x.oneOfGetter=function(t){for(var e={},n=0;n<t.length;++n)e[t[n]]=1;return function(){for(var i=Object.keys(this),o=i.length-1;o>-1;--o)if(e[i[o]]===1&&this[i[o]]!==void 0&&this[i[o]]!==null)return i[o]}};x.oneOfSetter=function(t){return function(e){for(var n=0;n<t.length;++n)t[n]!==e&&delete this[t[n]]}};x.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};x._configure=function(){var r=x.Buffer;if(!r){x._Buffer_from=x._Buffer_allocUnsafe=null;return}x._Buffer_from=r.from!==Uint8Array.from&&r.from||function(e,n){return new r(e,n)},x._Buffer_allocUnsafe=r.allocUnsafe||function(e){return new r(e)}}});var Je=I((a0,qn)=>{"use strict";qn.exports=T;var K=pt(),$e,pe=K.LongBits,Hn=K.base64,$n=K.utf8;function Wt(r,t,e){this.fn=r,this.len=t,this.next=void 0,this.val=e}function qe(){}function l1(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function T(){this.len=0,this.head=new Wt(qe,0,0),this.tail=this.head,this.states=null}var Gn=function(){return K.Buffer?function(){return(T.create=function(){return new $e})()}:function(){return new T}};T.create=Gn();T.alloc=function(t){return new K.Array(t)};K.Array!==Array&&(T.alloc=K.pool(T.alloc,K.Array.prototype.subarray));T.prototype._push=function(t,e,n){return this.tail=this.tail.next=new Wt(t,e,n),this.len+=e,this};function We(r,t,e){t[e]=r&255}function p1(r,t,e){for(;r>127;)t[e++]=r&127|128,r>>>=7;t[e]=r}function Ye(r,t){this.len=r,this.next=void 0,this.val=t}Ye.prototype=Object.create(Wt.prototype);Ye.prototype.fn=p1;T.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new Ye((t=t>>>0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this};T.prototype.int32=function(t){return t<0?this._push(Ke,10,pe.fromNumber(t)):this.uint32(t)};T.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)};function Ke(r,t,e){for(;r.hi;)t[e++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)t[e++]=r.lo&127|128,r.lo=r.lo>>>7;t[e++]=r.lo}T.prototype.uint64=function(t){var e=pe.from(t);return this._push(Ke,e.length(),e)};T.prototype.int64=T.prototype.uint64;T.prototype.sint64=function(t){var e=pe.from(t).zzEncode();return this._push(Ke,e.length(),e)};T.prototype.bool=function(t){return this._push(We,1,t?1:0)};function Ge(r,t,e){t[e]=r&255,t[e+1]=r>>>8&255,t[e+2]=r>>>16&255,t[e+3]=r>>>24}T.prototype.fixed32=function(t){return this._push(Ge,4,t>>>0)};T.prototype.sfixed32=T.prototype.fixed32;T.prototype.fixed64=function(t){var e=pe.from(t);return this._push(Ge,4,e.lo)._push(Ge,4,e.hi)};T.prototype.sfixed64=T.prototype.fixed64;T.prototype.float=function(t){return this._push(K.float.writeFloatLE,4,t)};T.prototype.double=function(t){return this._push(K.float.writeDoubleLE,8,t)};var d1=K.Array.prototype.set?function(t,e,n){e.set(t,n)}:function(t,e,n){for(var i=0;i<t.length;++i)e[n+i]=t[i]};T.prototype.bytes=function(t){var e=t.length>>>0;if(!e)return this._push(We,1,0);if(K.isString(t)){var n=T.alloc(e=Hn.length(t));Hn.decode(t,n,0),t=n}return this.uint32(e)._push(d1,e,t)};T.prototype.string=function(t){var e=$n.length(t);return e?this.uint32(e)._push($n.write,e,t):this._push(We,1,0)};T.prototype.fork=function(){return this.states=new l1(this),this.head=this.tail=new Wt(qe,0,0),this.len=0,this};T.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Wt(qe,0,0),this.len=0),this};T.prototype.ldelim=function(){var t=this.head,e=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=t.next,this.tail=e,this.len+=n),this};T.prototype.finish=function(){for(var t=this.head.next,e=this.constructor.alloc(this.len),n=0;t;)t.fn(t.val,e,n),n+=t.len,t=t.next;return e};T._configure=function(r){$e=r,T.create=Gn(),$e._configure()}});var Kn=I((u0,Yn)=>{"use strict";Yn.exports=it;var Wn=Je();(it.prototype=Object.create(Wn.prototype)).constructor=it;var dt=pt();function it(){Wn.call(this)}it._configure=function(){it.alloc=dt._Buffer_allocUnsafe,it.writeBytesBuffer=dt.Buffer&&dt.Buffer.prototype instanceof Uint8Array&&dt.Buffer.prototype.set.name==="set"?function(t,e,n){e.set(t,n)}:function(t,e,n){if(t.copy)t.copy(e,n,0,t.length);else for(var i=0;i<t.length;)e[n++]=t[i++]}};it.prototype.bytes=function(t){dt.isString(t)&&(t=dt._Buffer_from(t,"base64"));var e=t.length>>>0;return this.uint32(e),e&&this._push(it.writeBytesBuffer,e,t),this};function y1(r,t,e){r.length<40?dt.utf8.write(r,t,e):t.utf8Write?t.utf8Write(r,e):t.write(r,e)}it.prototype.string=function(t){var e=dt.Buffer.byteLength(t);return this.uint32(e),e&&this._push(y1,e,t),this};it._configure()});var Qe=I((c0,ti)=>{"use strict";ti.exports=z;var ot=pt(),Xe,Xn=ot.LongBits,m1=ot.utf8;function tt(r,t){return RangeError("index out of range: "+r.pos+" + "+(t||1)+" > "+r.len)}function z(r){this.buf=r,this.pos=0,this.len=r.length}var Jn=typeof Uint8Array<"u"?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new z(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new z(t);throw Error("illegal buffer")},Qn=function(){return ot.Buffer?function(e){return(z.create=function(i){return ot.Buffer.isBuffer(i)?new Xe(i):Jn(i)})(e)}:Jn};z.create=Qn();z.prototype._slice=ot.Array.prototype.subarray||ot.Array.prototype.slice;z.prototype.uint32=function(){var t=4294967295;return function(){if(t=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(t=(t|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,tt(this,10);return t}}();z.prototype.int32=function(){return this.uint32()|0};z.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(t&1)|0};function Ze(){var r=new Xn(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(r.lo=(r.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return r;if(r.lo=(r.lo|(this.buf[this.pos]&127)<<28)>>>0,r.hi=(r.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return r;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw tt(this);if(r.lo=(r.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return r}return r.lo=(r.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,r}if(this.len-this.pos>4){for(;t<5;++t)if(r.hi=(r.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return r}else for(;t<5;++t){if(this.pos>=this.len)throw tt(this);if(r.hi=(r.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return r}throw Error("invalid varint encoding")}z.prototype.bool=function(){return this.uint32()!==0};function de(r,t){return(r[t-4]|r[t-3]<<8|r[t-2]<<16|r[t-1]<<24)>>>0}z.prototype.fixed32=function(){if(this.pos+4>this.len)throw tt(this,4);return de(this.buf,this.pos+=4)};z.prototype.sfixed32=function(){if(this.pos+4>this.len)throw tt(this,4);return de(this.buf,this.pos+=4)|0};function Zn(){if(this.pos+8>this.len)throw tt(this,8);return new Xn(de(this.buf,this.pos+=4),de(this.buf,this.pos+=4))}z.prototype.float=function(){if(this.pos+4>this.len)throw tt(this,4);var t=ot.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t};z.prototype.double=function(){if(this.pos+8>this.len)throw tt(this,4);var t=ot.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t};z.prototype.bytes=function(){var t=this.uint32(),e=this.pos,n=this.pos+t;if(n>this.len)throw tt(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(e,n):e===n?new this.buf.constructor(0):this._slice.call(this.buf,e,n)};z.prototype.string=function(){var t=this.bytes();return m1.read(t,0,t.length)};z.prototype.skip=function(t){if(typeof t=="number"){if(this.pos+t>this.len)throw tt(this,t);this.pos+=t}else do if(this.pos>=this.len)throw tt(this);while(this.buf[this.pos++]&128);return this};z.prototype.skipType=function(r){switch(r){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(r=this.uint32()&7)!==4;)this.skipType(r);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+r+" at offset "+this.pos)}return this};z._configure=function(r){Xe=r,z.create=Qn(),Xe._configure();var t=ot.Long?"toLong":"toNumber";ot.merge(z.prototype,{int64:function(){return Ze.call(this)[t](!1)},uint64:function(){return Ze.call(this)[t](!0)},sint64:function(){return Ze.call(this).zzDecode()[t](!1)},fixed64:function(){return Zn.call(this)[t](!0)},sfixed64:function(){return Zn.call(this)[t](!1)}})}});var ii=I((f0,ni)=>{"use strict";ni.exports=bt;var ri=Qe();(bt.prototype=Object.create(ri.prototype)).constructor=bt;var ei=pt();function bt(r){ri.call(this,r)}bt._configure=function(){ei.Buffer&&(bt.prototype._slice=ei.Buffer.prototype.slice)};bt.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))};bt._configure()});var si=I((h0,oi)=>{"use strict";oi.exports=Yt;var tr=pt();(Yt.prototype=Object.create(tr.EventEmitter.prototype)).constructor=Yt;function Yt(r,t,e){if(typeof r!="function")throw TypeError("rpcImpl must be a function");tr.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(e)}Yt.prototype.rpcCall=function r(t,e,n,i,o){if(!i)throw TypeError("request must be specified");var s=this;if(!o)return tr.asPromise(r,s,t,e,n,i);if(!s.rpcImpl){setTimeout(function(){o(Error("already ended"))},0);return}try{return s.rpcImpl(t,e[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(a,h){if(a)return s.emit("error",a,t),o(a);if(h===null){s.end(!0);return}if(!(h instanceof n))try{h=n[s.responseDelimited?"decodeDelimited":"decode"](h)}catch(f){return s.emit("error",f,t),o(f)}return s.emit("data",h,t),o(null,h)})}catch(u){s.emit("error",u,t),setTimeout(function(){o(u)},0);return}};Yt.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var ui=I(ai=>{"use strict";var g1=ai;g1.Service=si()});var fi=I((p0,ci)=>{"use strict";ci.exports={}});var pi=I(li=>{"use strict";var G=li;G.build="minimal";G.Writer=Je();G.BufferWriter=Kn();G.Reader=Qe();G.BufferReader=ii();G.util=pt();G.rpc=ui();G.roots=fi();G.configure=hi;function hi(){G.util._configure(),G.Writer._configure(G.BufferWriter),G.Reader._configure(G.BufferReader)}hi()});var yi=I((y0,di)=>{"use strict";di.exports=pi()});var Ni=I((O0,Li)=>{"use strict";var P1=async r=>{let t=[];for await(let e of r)t.push(e);return t};Li.exports=P1});var Wi=I(we=>{"use strict";we.byteLength=Y1;we.toByteArray=J1;we.fromByteArray=Q1;var st=[],X=[],W1=typeof Uint8Array<"u"?Uint8Array:Array,ar="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(_t=0,Gi=ar.length;_t<Gi;++_t)st[_t]=ar[_t],X[ar.charCodeAt(_t)]=_t;var _t,Gi;X["-".charCodeAt(0)]=62;X["_".charCodeAt(0)]=63;function qi(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");e===-1&&(e=t);var n=e===t?0:4-e%4;return[e,n]}function Y1(r){var t=qi(r),e=t[0],n=t[1];return(e+n)*3/4-n}function K1(r,t,e){return(t+e)*3/4-e}function J1(r){var t,e=qi(r),n=e[0],i=e[1],o=new W1(K1(r,n,i)),s=0,u=i>0?n-4:n,a;for(a=0;a<u;a+=4)t=X[r.charCodeAt(a)]<<18|X[r.charCodeAt(a+1)]<<12|X[r.charCodeAt(a+2)]<<6|X[r.charCodeAt(a+3)],o[s++]=t>>16&255,o[s++]=t>>8&255,o[s++]=t&255;return i===2&&(t=X[r.charCodeAt(a)]<<2|X[r.charCodeAt(a+1)]>>4,o[s++]=t&255),i===1&&(t=X[r.charCodeAt(a)]<<10|X[r.charCodeAt(a+1)]<<4|X[r.charCodeAt(a+2)]>>2,o[s++]=t>>8&255,o[s++]=t&255),o}function Z1(r){return st[r>>18&63]+st[r>>12&63]+st[r>>6&63]+st[r&63]}function X1(r,t,e){for(var n,i=[],o=t;o<e;o+=3)n=(r[o]<<16&16711680)+(r[o+1]<<8&65280)+(r[o+2]&255),i.push(Z1(n));return i.join("")}function Q1(r){for(var t,e=r.length,n=e%3,i=[],o=16383,s=0,u=e-n;s<u;s+=o)i.push(X1(r,s,s+o>u?u:s+o));return n===1?(t=r[e-1],i.push(st[t>>2]+st[t<<4&63]+"==")):n===2&&(t=(r[e-2]<<8)+r[e-1],i.push(st[t>>10]+st[t>>4&63]+st[t<<2&63]+"=")),i.join("")}});var Yi=I(ur=>{ur.read=function(r,t,e,n,i){var o,s,u=i*8-n-1,a=(1<<u)-1,h=a>>1,f=-7,d=e?i-1:0,A=e?-1:1,c=r[t+d];for(d+=A,o=c&(1<<-f)-1,c>>=-f,f+=u;f>0;o=o*256+r[t+d],d+=A,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=s*256+r[t+d],d+=A,f-=8);if(o===0)o=1-h;else{if(o===a)return s?NaN:(c?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-h}return(c?-1:1)*s*Math.pow(2,o-n)};ur.write=function(r,t,e,n,i,o){var s,u,a,h=o*8-i-1,f=(1<<h)-1,d=f>>1,A=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,c=n?0:o-1,p=n?1:-1,g=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(a=Math.pow(2,-s))<1&&(s--,a*=2),s+d>=1?t+=A/a:t+=A*Math.pow(2,1-d),t*a>=2&&(s++,a/=2),s+d>=f?(u=0,s=f):s+d>=1?(u=(t*a-1)*Math.pow(2,i),s=s+d):(u=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;r[e+c]=u&255,c+=p,u/=256,i-=8);for(s=s<<i|u,h+=i;h>0;r[e+c]=s&255,c+=p,s/=256,h-=8);r[e+c-p]|=g*128}});var ho=I(Rt=>{"use strict";var cr=Wi(),vt=Yi(),Ki=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Rt.Buffer=l;Rt.SlowBuffer=oa;Rt.INSPECT_MAX_BYTES=50;var be=2147483647;Rt.kMaxLength=be;l.TYPED_ARRAY_SUPPORT=ta();!l.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ta(){try{let r=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(r,t),r.foo()===42}catch{return!1}}Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(!!l.isBuffer(this))return this.buffer}});Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(!!l.isBuffer(this))return this.byteOffset}});function ft(r){if(r>be)throw new RangeError('The value "'+r+'" is invalid for option "size"');let t=new Uint8Array(r);return Object.setPrototypeOf(t,l.prototype),t}function l(r,t,e){if(typeof r=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return pr(r)}return Qi(r,t,e)}l.poolSize=8192;function Qi(r,t,e){if(typeof r=="string")return ra(r,t);if(ArrayBuffer.isView(r))return na(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(at(r,ArrayBuffer)||r&&at(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(at(r,SharedArrayBuffer)||r&&at(r.buffer,SharedArrayBuffer)))return hr(r,t,e);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return l.from(n,t,e);let i=ia(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return l.from(r[Symbol.toPrimitive]("string"),t,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}l.from=function(r,t,e){return Qi(r,t,e)};Object.setPrototypeOf(l.prototype,Uint8Array.prototype);Object.setPrototypeOf(l,Uint8Array);function to(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function ea(r,t,e){return to(r),r<=0?ft(r):t!==void 0?typeof e=="string"?ft(r).fill(t,e):ft(r).fill(t):ft(r)}l.alloc=function(r,t,e){return ea(r,t,e)};function pr(r){return to(r),ft(r<0?0:dr(r)|0)}l.allocUnsafe=function(r){return pr(r)};l.allocUnsafeSlow=function(r){return pr(r)};function ra(r,t){if((typeof t!="string"||t==="")&&(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let e=eo(r,t)|0,n=ft(e),i=n.write(r,t);return i!==e&&(n=n.slice(0,i)),n}function fr(r){let t=r.length<0?0:dr(r.length)|0,e=ft(t);for(let n=0;n<t;n+=1)e[n]=r[n]&255;return e}function na(r){if(at(r,Uint8Array)){let t=new Uint8Array(r);return hr(t.buffer,t.byteOffset,t.byteLength)}return fr(r)}function hr(r,t,e){if(t<0||r.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<t+(e||0))throw new RangeError('"length" is outside of buffer bounds');let n;return t===void 0&&e===void 0?n=new Uint8Array(r):e===void 0?n=new Uint8Array(r,t):n=new Uint8Array(r,t,e),Object.setPrototypeOf(n,l.prototype),n}function ia(r){if(l.isBuffer(r)){let t=dr(r.length)|0,e=ft(t);return e.length===0||r.copy(e,0,0,t),e}if(r.length!==void 0)return typeof r.length!="number"||mr(r.length)?ft(0):fr(r);if(r.type==="Buffer"&&Array.isArray(r.data))return fr(r.data)}function dr(r){if(r>=be)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+be.toString(16)+" bytes");return r|0}function oa(r){return+r!=r&&(r=0),l.alloc(+r)}l.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==l.prototype};l.compare=function(t,e){if(at(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),at(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,i=e.length;for(let o=0,s=Math.min(n,i);o<s;++o)if(t[o]!==e[o]){n=t[o],i=e[o];break}return n<i?-1:i<n?1:0};l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};l.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return l.alloc(0);let n;if(e===void 0)for(e=0,n=0;n<t.length;++n)e+=t[n].length;let i=l.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){let s=t[n];if(at(s,Uint8Array))o+s.length>i.length?(l.isBuffer(s)||(s=l.from(s)),s.copy(i,o)):Uint8Array.prototype.set.call(i,s,o);else if(l.isBuffer(s))s.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=s.length}return i};function eo(r,t){if(l.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||at(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);let e=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&e===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return lr(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return fo(r).length;default:if(i)return n?-1:lr(r).length;t=(""+t).toLowerCase(),i=!0}}l.byteLength=eo;function sa(r,t,e){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(r||(r="utf8");;)switch(r){case"hex":return ma(this,t,e);case"utf8":case"utf-8":return no(this,t,e);case"ascii":return da(this,t,e);case"latin1":case"binary":return ya(this,t,e);case"base64":return la(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ga(this,t,e);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}l.prototype._isBuffer=!0;function Et(r,t,e){let n=r[t];r[t]=r[e],r[e]=n}l.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)Et(this,e,e+1);return this};l.prototype.swap32=function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)Et(this,e,e+3),Et(this,e+1,e+2);return this};l.prototype.swap64=function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)Et(this,e,e+7),Et(this,e+1,e+6),Et(this,e+2,e+5),Et(this,e+3,e+4);return this};l.prototype.toString=function(){let t=this.length;return t===0?"":arguments.length===0?no(this,0,t):sa.apply(this,arguments)};l.prototype.toLocaleString=l.prototype.toString;l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:l.compare(this,t)===0};l.prototype.inspect=function(){let t="",e=Rt.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"};Ki&&(l.prototype[Ki]=l.prototype.inspect);l.prototype.compare=function(t,e,n,i,o){if(at(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(e===void 0&&(e=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===t)return 0;let s=o-i,u=n-e,a=Math.min(s,u),h=this.slice(i,o),f=t.slice(e,n);for(let d=0;d<a;++d)if(h[d]!==f[d]){s=h[d],u=f[d];break}return s<u?-1:u<s?1:0};function ro(r,t,e,n,i){if(r.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,mr(e)&&(e=i?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(i)return-1;e=r.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof t=="string"&&(t=l.from(t,n)),l.isBuffer(t))return t.length===0?-1:Ji(r,t,e,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):Ji(r,[t],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Ji(r,t,e,n,i){let o=1,s=r.length,u=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||t.length<2)return-1;o=2,s/=2,u/=2,e/=2}function a(f,d){return o===1?f[d]:f.readUInt16BE(d*o)}let h;if(i){let f=-1;for(h=e;h<s;h++)if(a(r,h)===a(t,f===-1?0:h-f)){if(f===-1&&(f=h),h-f+1===u)return f*o}else f!==-1&&(h-=h-f),f=-1}else for(e+u>s&&(e=s-u),h=e;h>=0;h--){let f=!0;for(let d=0;d<u;d++)if(a(r,h+d)!==a(t,d)){f=!1;break}if(f)return h}return-1}l.prototype.includes=function(t,e,n){return this.indexOf(t,e,n)!==-1};l.prototype.indexOf=function(t,e,n){return ro(this,t,e,n,!0)};l.prototype.lastIndexOf=function(t,e,n){return ro(this,t,e,n,!1)};function aa(r,t,e,n){e=Number(e)||0;let i=r.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;let o=t.length;n>o/2&&(n=o/2);let s;for(s=0;s<n;++s){let u=parseInt(t.substr(s*2,2),16);if(mr(u))return s;r[e+s]=u}return s}function ua(r,t,e,n){return _e(lr(t,r.length-e),r,e,n)}function ca(r,t,e,n){return _e(_a(t),r,e,n)}function fa(r,t,e,n){return _e(fo(t),r,e,n)}function ha(r,t,e,n){return _e(Ea(t,r.length-e),r,e,n)}l.prototype.write=function(t,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-e;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let s=!1;for(;;)switch(i){case"hex":return aa(this,t,e,n);case"utf8":case"utf-8":return ua(this,t,e,n);case"ascii":case"latin1":case"binary":return ca(this,t,e,n);case"base64":return fa(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ha(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function la(r,t,e){return t===0&&e===r.length?cr.fromByteArray(r):cr.fromByteArray(r.slice(t,e))}function no(r,t,e){e=Math.min(r.length,e);let n=[],i=t;for(;i<e;){let o=r[i],s=null,u=o>239?4:o>223?3:o>191?2:1;if(i+u<=e){let a,h,f,d;switch(u){case 1:o<128&&(s=o);break;case 2:a=r[i+1],(a&192)===128&&(d=(o&31)<<6|a&63,d>127&&(s=d));break;case 3:a=r[i+1],h=r[i+2],(a&192)===128&&(h&192)===128&&(d=(o&15)<<12|(a&63)<<6|h&63,d>2047&&(d<55296||d>57343)&&(s=d));break;case 4:a=r[i+1],h=r[i+2],f=r[i+3],(a&192)===128&&(h&192)===128&&(f&192)===128&&(d=(o&15)<<18|(a&63)<<12|(h&63)<<6|f&63,d>65535&&d<1114112&&(s=d))}}s===null?(s=65533,u=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=u}return pa(n)}var Zi=4096;function pa(r){let t=r.length;if(t<=Zi)return String.fromCharCode.apply(String,r);let e="",n=0;for(;n<t;)e+=String.fromCharCode.apply(String,r.slice(n,n+=Zi));return e}function da(r,t,e){let n="";e=Math.min(r.length,e);for(let i=t;i<e;++i)n+=String.fromCharCode(r[i]&127);return n}function ya(r,t,e){let n="";e=Math.min(r.length,e);for(let i=t;i<e;++i)n+=String.fromCharCode(r[i]);return n}function ma(r,t,e){let n=r.length;(!t||t<0)&&(t=0),(!e||e<0||e>n)&&(e=n);let i="";for(let o=t;o<e;++o)i+=xa[r[o]];return i}function ga(r,t,e){let n=r.slice(t,e),i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}l.prototype.slice=function(t,e){let n=this.length;t=~~t,e=e===void 0?n:~~e,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<t&&(e=t);let i=this.subarray(t,e);return Object.setPrototypeOf(i,l.prototype),i};function R(r,t,e){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+t>e)throw new RangeError("Trying to access beyond buffer length")}l.prototype.readUintLE=l.prototype.readUIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||R(t,e,this.length);let i=this[t],o=1,s=0;for(;++s<e&&(o*=256);)i+=this[t+s]*o;return i};l.prototype.readUintBE=l.prototype.readUIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||R(t,e,this.length);let i=this[t+--e],o=1;for(;e>0&&(o*=256);)i+=this[t+--e]*o;return i};l.prototype.readUint8=l.prototype.readUInt8=function(t,e){return t=t>>>0,e||R(t,1,this.length),this[t]};l.prototype.readUint16LE=l.prototype.readUInt16LE=function(t,e){return t=t>>>0,e||R(t,2,this.length),this[t]|this[t+1]<<8};l.prototype.readUint16BE=l.prototype.readUInt16BE=function(t,e){return t=t>>>0,e||R(t,2,this.length),this[t]<<8|this[t+1]};l.prototype.readUint32LE=l.prototype.readUInt32LE=function(t,e){return t=t>>>0,e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};l.prototype.readUint32BE=l.prototype.readUInt32BE=function(t,e){return t=t>>>0,e||R(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};l.prototype.readBigUInt64LE=mt(function(t){t=t>>>0,Pt(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&Zt(t,this.length-8);let i=e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,o=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(i)+(BigInt(o)<<BigInt(32))});l.prototype.readBigUInt64BE=mt(function(t){t=t>>>0,Pt(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&Zt(t,this.length-8);let i=e*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],o=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(o)});l.prototype.readIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||R(t,e,this.length);let i=this[t],o=1,s=0;for(;++s<e&&(o*=256);)i+=this[t+s]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};l.prototype.readIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||R(t,e,this.length);let i=e,o=1,s=this[t+--i];for(;i>0&&(o*=256);)s+=this[t+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*e)),s};l.prototype.readInt8=function(t,e){return t=t>>>0,e||R(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};l.prototype.readInt16LE=function(t,e){t=t>>>0,e||R(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};l.prototype.readInt16BE=function(t,e){t=t>>>0,e||R(t,2,this.length);let n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};l.prototype.readInt32LE=function(t,e){return t=t>>>0,e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};l.prototype.readInt32BE=function(t,e){return t=t>>>0,e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};l.prototype.readBigInt64LE=mt(function(t){t=t>>>0,Pt(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&Zt(t,this.length-8);let i=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)});l.prototype.readBigInt64BE=mt(function(t){t=t>>>0,Pt(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&Zt(t,this.length-8);let i=(e<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(i)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)});l.prototype.readFloatLE=function(t,e){return t=t>>>0,e||R(t,4,this.length),vt.read(this,t,!0,23,4)};l.prototype.readFloatBE=function(t,e){return t=t>>>0,e||R(t,4,this.length),vt.read(this,t,!1,23,4)};l.prototype.readDoubleLE=function(t,e){return t=t>>>0,e||R(t,8,this.length),vt.read(this,t,!0,52,8)};l.prototype.readDoubleBE=function(t,e){return t=t>>>0,e||R(t,8,this.length),vt.read(this,t,!1,52,8)};function q(r,t,e,n,i,o){if(!l.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(e+n>r.length)throw new RangeError("Index out of range")}l.prototype.writeUintLE=l.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e=e>>>0,n=n>>>0,!i){let u=Math.pow(2,8*n)-1;q(this,t,e,n,u,0)}let o=1,s=0;for(this[e]=t&255;++s<n&&(o*=256);)this[e+s]=t/o&255;return e+n};l.prototype.writeUintBE=l.prototype.writeUIntBE=function(t,e,n,i){if(t=+t,e=e>>>0,n=n>>>0,!i){let u=Math.pow(2,8*n)-1;q(this,t,e,n,u,0)}let o=n-1,s=1;for(this[e+o]=t&255;--o>=0&&(s*=256);)this[e+o]=t/s&255;return e+n};l.prototype.writeUint8=l.prototype.writeUInt8=function(t,e,n){return t=+t,e=e>>>0,n||q(this,t,e,1,255,0),this[e]=t&255,e+1};l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||q(this,t,e,2,65535,0),this[e]=t&255,this[e+1]=t>>>8,e+2};l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||q(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=t&255,e+2};l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||q(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255,e+4};l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||q(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};function io(r,t,e,n,i){co(t,n,i,r,e,7);let o=Number(t&BigInt(4294967295));r[e++]=o,o=o>>8,r[e++]=o,o=o>>8,r[e++]=o,o=o>>8,r[e++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return r[e++]=s,s=s>>8,r[e++]=s,s=s>>8,r[e++]=s,s=s>>8,r[e++]=s,e}function oo(r,t,e,n,i){co(t,n,i,r,e,7);let o=Number(t&BigInt(4294967295));r[e+7]=o,o=o>>8,r[e+6]=o,o=o>>8,r[e+5]=o,o=o>>8,r[e+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return r[e+3]=s,s=s>>8,r[e+2]=s,s=s>>8,r[e+1]=s,s=s>>8,r[e]=s,e+8}l.prototype.writeBigUInt64LE=mt(function(t,e=0){return io(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))});l.prototype.writeBigUInt64BE=mt(function(t,e=0){return oo(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))});l.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e=e>>>0,!i){let a=Math.pow(2,8*n-1);q(this,t,e,n,a-1,-a)}let o=0,s=1,u=0;for(this[e]=t&255;++o<n&&(s*=256);)t<0&&u===0&&this[e+o-1]!==0&&(u=1),this[e+o]=(t/s>>0)-u&255;return e+n};l.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e=e>>>0,!i){let a=Math.pow(2,8*n-1);q(this,t,e,n,a-1,-a)}let o=n-1,s=1,u=0;for(this[e+o]=t&255;--o>=0&&(s*=256);)t<0&&u===0&&this[e+o+1]!==0&&(u=1),this[e+o]=(t/s>>0)-u&255;return e+n};l.prototype.writeInt8=function(t,e,n){return t=+t,e=e>>>0,n||q(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=t&255,e+1};l.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||q(this,t,e,2,32767,-32768),this[e]=t&255,this[e+1]=t>>>8,e+2};l.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||q(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=t&255,e+2};l.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||q(this,t,e,4,2147483647,-2147483648),this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4};l.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||q(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};l.prototype.writeBigInt64LE=mt(function(t,e=0){return io(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});l.prototype.writeBigInt64BE=mt(function(t,e=0){return oo(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function so(r,t,e,n,i,o){if(e+n>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ao(r,t,e,n,i){return t=+t,e=e>>>0,i||so(r,t,e,4,34028234663852886e22,-34028234663852886e22),vt.write(r,t,e,n,23,4),e+4}l.prototype.writeFloatLE=function(t,e,n){return ao(this,t,e,!0,n)};l.prototype.writeFloatBE=function(t,e,n){return ao(this,t,e,!1,n)};function uo(r,t,e,n,i){return t=+t,e=e>>>0,i||so(r,t,e,8,17976931348623157e292,-17976931348623157e292),vt.write(r,t,e,n,52,8),e+8}l.prototype.writeDoubleLE=function(t,e,n){return uo(this,t,e,!0,n)};l.prototype.writeDoubleBE=function(t,e,n){return uo(this,t,e,!1,n)};l.prototype.copy=function(t,e,n,i){if(!l.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-n&&(i=t.length-e+n);let o=i-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,n,i):Uint8Array.prototype.set.call(t,this.subarray(n,i),e),o};l.prototype.fill=function(t,e,n,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!l.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){let s=t.charCodeAt(0);(i==="utf8"&&s<128||i==="latin1")&&(t=s)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let o;if(typeof t=="number")for(o=e;o<n;++o)this[o]=t;else{let s=l.isBuffer(t)?t:l.from(t,i),u=s.length;if(u===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<n-e;++o)this[o+e]=s[o%u]}return this};var zt={};function yr(r,t,e){zt[r]=class extends e{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}yr("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);yr("ERR_INVALID_ARG_TYPE",function(r,t){return`The "${r}" argument must be of type number. Received type ${typeof t}`},TypeError);yr("ERR_OUT_OF_RANGE",function(r,t,e){let n=`The value of "${r}" is out of range.`,i=e;return Number.isInteger(e)&&Math.abs(e)>2**32?i=Xi(String(e)):typeof e=="bigint"&&(i=String(e),(e>BigInt(2)**BigInt(32)||e<-(BigInt(2)**BigInt(32)))&&(i=Xi(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function Xi(r){let t="",e=r.length,n=r[0]==="-"?1:0;for(;e>=n+4;e-=3)t=`_${r.slice(e-3,e)}${t}`;return`${r.slice(0,e)}${t}`}function Da(r,t,e){Pt(t,"offset"),(r[t]===void 0||r[t+e]===void 0)&&Zt(t,r.length-(e+1))}function co(r,t,e,n,i,o){if(r>e||r<t){let s=typeof t=="bigint"?"n":"",u;throw o>3?t===0||t===BigInt(0)?u=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:u=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:u=`>= ${t}${s} and <= ${e}${s}`,new zt.ERR_OUT_OF_RANGE("value",u,r)}Da(n,i,o)}function Pt(r,t){if(typeof r!="number")throw new zt.ERR_INVALID_ARG_TYPE(t,"number",r)}function Zt(r,t,e){throw Math.floor(r)!==r?(Pt(r,e),new zt.ERR_OUT_OF_RANGE(e||"offset","an integer",r)):t<0?new zt.ERR_BUFFER_OUT_OF_BOUNDS:new zt.ERR_OUT_OF_RANGE(e||"offset",`>= ${e?1:0} and <= ${t}`,r)}var wa=/[^+/0-9A-Za-z-_]/g;function ba(r){if(r=r.split("=")[0],r=r.trim().replace(wa,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function lr(r,t){t=t||1/0;let e,n=r.length,i=null,o=[];for(let s=0;s<n;++s){if(e=r.charCodeAt(s),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((t-=1)<0)break;o.push(e)}else if(e<2048){if((t-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function _a(r){let t=[];for(let e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}function Ea(r,t){let e,n,i,o=[];for(let s=0;s<r.length&&!((t-=2)<0);++s)e=r.charCodeAt(s),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function fo(r){return cr.toByteArray(ba(r))}function _e(r,t,e,n){let i;for(i=0;i<n&&!(i+e>=t.length||i>=r.length);++i)t[i+e]=r[i];return i}function at(r,t){return r instanceof t||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===t.name}function mr(r){return r!==r}var xa=function(){let r="0123456789abcdef",t=new Array(256);for(let e=0;e<16;++e){let n=e*16;for(let i=0;i<16;++i)t[n+i]=r[e]+r[i]}return t}();function mt(r){return typeof BigInt>"u"?Aa:r}function Aa(){throw new Error("BigInt not supported")}});var gr=I((tc,po)=>{"use strict";var{Buffer:rt}=ho(),lo=Symbol.for("BufferList");function U(r){if(!(this instanceof U))return new U(r);U._init.call(this,r)}U._init=function(t){Object.defineProperty(this,lo,{value:!0}),this._bufs=[],this.length=0,t&&this.append(t)};U.prototype._new=function(t){return new U(t)};U.prototype._offset=function(t){if(t===0)return[0,0];let e=0;for(let n=0;n<this._bufs.length;n++){let i=e+this._bufs[n].length;if(t<i||n===this._bufs.length-1)return[n,t-e];e=i}};U.prototype._reverseOffset=function(r){let t=r[0],e=r[1];for(let n=0;n<t;n++)e+=this._bufs[n].length;return e};U.prototype.get=function(t){if(t>this.length||t<0)return;let e=this._offset(t);return this._bufs[e[0]][e[1]]};U.prototype.slice=function(t,e){return typeof t=="number"&&t<0&&(t+=this.length),typeof e=="number"&&e<0&&(e+=this.length),this.copy(null,0,t,e)};U.prototype.copy=function(t,e,n,i){if((typeof n!="number"||n<0)&&(n=0),(typeof i!="number"||i>this.length)&&(i=this.length),n>=this.length||i<=0)return t||rt.alloc(0);let o=!!t,s=this._offset(n),u=i-n,a=u,h=o&&e||0,f=s[1];if(n===0&&i===this.length){if(!o)return this._bufs.length===1?this._bufs[0]:rt.concat(this._bufs,this.length);for(let d=0;d<this._bufs.length;d++)this._bufs[d].copy(t,h),h+=this._bufs[d].length;return t}if(a<=this._bufs[s[0]].length-f)return o?this._bufs[s[0]].copy(t,e,f,f+a):this._bufs[s[0]].slice(f,f+a);o||(t=rt.allocUnsafe(u));for(let d=s[0];d<this._bufs.length;d++){let A=this._bufs[d].length-f;if(a>A)this._bufs[d].copy(t,h,f),h+=A;else{this._bufs[d].copy(t,h,f,f+a),h+=A;break}a-=A,f&&(f=0)}return t.length>h?t.slice(0,h):t};U.prototype.shallowSlice=function(t,e){if(t=t||0,e=typeof e!="number"?this.length:e,t<0&&(t+=this.length),e<0&&(e+=this.length),t===e)return this._new();let n=this._offset(t),i=this._offset(e),o=this._bufs.slice(n[0],i[0]+1);return i[1]===0?o.pop():o[o.length-1]=o[o.length-1].slice(0,i[1]),n[1]!==0&&(o[0]=o[0].slice(n[1])),this._new(o)};U.prototype.toString=function(t,e,n){return this.slice(e,n).toString(t)};U.prototype.consume=function(t){if(t=Math.trunc(t),Number.isNaN(t)||t<=0)return this;for(;this._bufs.length;)if(t>=this._bufs[0].length)t-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(t),this.length-=t;break}return this};U.prototype.duplicate=function(){let t=this._new();for(let e=0;e<this._bufs.length;e++)t.append(this._bufs[e]);return t};U.prototype.append=function(t){if(t==null)return this;if(t.buffer)this._appendBuffer(rt.from(t.buffer,t.byteOffset,t.byteLength));else if(Array.isArray(t))for(let e=0;e<t.length;e++)this.append(t[e]);else if(this._isBufferList(t))for(let e=0;e<t._bufs.length;e++)this.append(t._bufs[e]);else typeof t=="number"&&(t=t.toString()),this._appendBuffer(rt.from(t));return this};U.prototype._appendBuffer=function(t){this._bufs.push(t),this.length+=t.length};U.prototype.indexOf=function(r,t,e){if(e===void 0&&typeof t=="string"&&(e=t,t=void 0),typeof r=="function"||Array.isArray(r))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof r=="number"?r=rt.from([r]):typeof r=="string"?r=rt.from(r,e):this._isBufferList(r)?r=r.slice():Array.isArray(r.buffer)?r=rt.from(r.buffer,r.byteOffset,r.byteLength):rt.isBuffer(r)||(r=rt.from(r)),t=Number(t||0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),r.length===0)return t>this.length?this.length:t;let n=this._offset(t),i=n[0],o=n[1];for(;i<this._bufs.length;i++){let s=this._bufs[i];for(;o<s.length;)if(s.length-o>=r.length){let a=s.indexOf(r,o);if(a!==-1)return this._reverseOffset([i,a]);o=s.length-r.length+1}else{let a=this._reverseOffset([i,o]);if(this._match(a,r))return a;o++}o=0}return-1};U.prototype._match=function(r,t){if(this.length-r<t.length)return!1;for(let e=0;e<t.length;e++)if(this.get(r+e)!==t[e])return!1;return!0};(function(){let r={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let t in r)(function(e){r[e]===null?U.prototype[e]=function(n,i){return this.slice(n,n+i)[e](0,i)}:U.prototype[e]=function(n=0){return this.slice(n,n+r[e])[e](0)}})(t)})();U.prototype._isBufferList=function(t){return t instanceof U||U.isBufferList(t)};U.isBufferList=function(t){return t!=null&&t[lo]};po.exports=U});var mo=I((ec,yo)=>{var Dr=class{constructor(t,e=12,n=8*1024,i=32*1024,o=64,s){this.bits=e,this.min=n,this.max=i,this.asModule=t,this.rabin=new t.Rabin(e,n,i,o,s),this.polynomial=s}fingerprint(t){let{__retain:e,__release:n,__allocArray:i,__getInt32Array:o,Int32Array_ID:s,Uint8Array_ID:u}=this.asModule,a=new Int32Array(Math.ceil(t.length/this.min)),h=e(i(s,a)),f=e(i(u,t)),d=this.rabin.fingerprint(f,h),A=o(d);n(f),n(h);let c=A.indexOf(0);return c>=0?A.subarray(0,c):A}};yo.exports=Dr});var Eo=I(te=>{"use strict";var Ba=typeof BigUint64Array<"u",Xt=Symbol(),Qt=1024;function go(r,t){let e=new Uint32Array(r),n=new Uint16Array(r);var i=e[t+-4>>>2]>>>1,o=t>>>1;if(i<=Qt)return String.fromCharCode.apply(String,n.subarray(o,o+i));let s=[];do{let u=n[o+Qt-1],a=u>=55296&&u<56320?Qt-1:Qt;s.push(String.fromCharCode.apply(String,n.subarray(o,o+=a))),i-=a}while(i>Qt);return s.join("")+String.fromCharCode.apply(String,n.subarray(o,o+i))}function wr(r){let t={};function e(i,o){return i?go(i.buffer,o):"<yet unknown>"}let n=r.env=r.env||{};return n.abort=n.abort||function(o,s,u,a){let h=t.memory||n.memory;throw Error("abort: "+e(h,o)+" at "+e(h,s)+":"+u+":"+a)},n.trace=n.trace||function(o,s){let u=t.memory||n.memory;console.log("trace: "+e(u,o)+(s?" ":"")+Array.prototype.slice.call(arguments,2,2+s).join(", "))},r.Math=r.Math||Math,r.Date=r.Date||Date,t}function br(r,t){let e=t.exports,n=e.memory,i=e.table,o=e.__alloc,s=e.__retain,u=e.__rtti_base||-1;function a(w){let y=new Uint32Array(n.buffer),E=y[u>>>2];if((w>>>=0)>=E)throw Error("invalid id: "+w);return y[(u+4>>>2)+w*2]}function h(w){let y=new Uint32Array(n.buffer),E=y[u>>>2];if((w>>>=0)>=E)throw Error("invalid id: "+w);return y[(u+4>>>2)+w*2+1]}function f(w){return 31-Math.clz32(w>>>5&31)}function d(w){return 31-Math.clz32(w>>>14&31)}function A(w){let y=w.length,E=o(y<<1,1),S=new Uint16Array(n.buffer);for(var N=0,v=E>>>1;N<y;++N)S[v+N]=w.charCodeAt(N);return E}r.__allocString=A;function c(w){let y=n.buffer;if(new Uint32Array(y)[w+-8>>>2]!==1)throw Error("not a string: "+w);return go(y,w)}r.__getString=c;function p(w,y,E){let S=n.buffer;if(E)switch(w){case 2:return new Float32Array(S);case 3:return new Float64Array(S)}else switch(w){case 0:return new(y?Int8Array:Uint8Array)(S);case 1:return new(y?Int16Array:Uint16Array)(S);case 2:return new(y?Int32Array:Uint32Array)(S);case 3:return new(y?BigInt64Array:BigUint64Array)(S)}throw Error("unsupported align: "+w)}function g(w,y){let E=a(w);if(!(E&3))throw Error("not an array: "+w+" @ "+E);let S=f(E),N=y.length,v=o(N<<S,0),W=o(E&2?16:12,w),C=new Uint32Array(n.buffer);C[W+0>>>2]=s(v),C[W+4>>>2]=v,C[W+8>>>2]=N<<S,E&2&&(C[W+12>>>2]=N);let Rr=p(S,E&1024,E&2048);if(E&8192)for(let re=0;re<N;++re)Rr[(v>>>S)+re]=s(y[re]);else Rr.set(y,v>>>S);return W}r.__allocArray=g;function k(w){let y=new Uint32Array(n.buffer),E=y[w+-8>>>2],S=a(E);if(!(S&1))throw Error("not an array: "+E);let N=f(S);var v=y[w+4>>>2];let W=S&2?y[w+12>>>2]:y[v+-4>>>2]>>>N;return p(N,S&1024,S&2048).subarray(v>>>=N,v+W)}r.__getArrayView=k;function m(w){let y=k(w),E=y.length,S=new Array(E);for(let N=0;N<E;N++)S[N]=y[N];return S}r.__getArray=m;function D(w){let y=n.buffer,E=new Uint32Array(y)[w+-4>>>2];return y.slice(w,w+E)}r.__getArrayBuffer=D;function b(w,y,E){return new w(_(w,y,E))}function _(w,y,E){let S=n.buffer,N=new Uint32Array(S),v=N[E+4>>>2];return new w(S,v,N[v+-4>>>2]>>>y)}r.__getInt8Array=b.bind(null,Int8Array,0),r.__getInt8ArrayView=_.bind(null,Int8Array,0),r.__getUint8Array=b.bind(null,Uint8Array,0),r.__getUint8ArrayView=_.bind(null,Uint8Array,0),r.__getUint8ClampedArray=b.bind(null,Uint8ClampedArray,0),r.__getUint8ClampedArrayView=_.bind(null,Uint8ClampedArray,0),r.__getInt16Array=b.bind(null,Int16Array,1),r.__getInt16ArrayView=_.bind(null,Int16Array,1),r.__getUint16Array=b.bind(null,Uint16Array,1),r.__getUint16ArrayView=_.bind(null,Uint16Array,1),r.__getInt32Array=b.bind(null,Int32Array,2),r.__getInt32ArrayView=_.bind(null,Int32Array,2),r.__getUint32Array=b.bind(null,Uint32Array,2),r.__getUint32ArrayView=_.bind(null,Uint32Array,2),Ba&&(r.__getInt64Array=b.bind(null,BigInt64Array,3),r.__getInt64ArrayView=_.bind(null,BigInt64Array,3),r.__getUint64Array=b.bind(null,BigUint64Array,3),r.__getUint64ArrayView=_.bind(null,BigUint64Array,3)),r.__getFloat32Array=b.bind(null,Float32Array,2),r.__getFloat32ArrayView=_.bind(null,Float32Array,2),r.__getFloat64Array=b.bind(null,Float64Array,3),r.__getFloat64ArrayView=_.bind(null,Float64Array,3);function F(w,y){let E=new Uint32Array(n.buffer);var S=E[w+-8>>>2];if(S<=E[u>>>2])do if(S==y)return!0;while(S=h(S));return!1}return r.__instanceof=F,r.memory=r.memory||n,r.table=r.table||i,_o(e,r)}function Do(r){return typeof Response<"u"&&r instanceof Response}async function wo(r,t){return Do(r=await r)?bo(r,t):br(wr(t||(t={})),await WebAssembly.instantiate(r instanceof WebAssembly.Module?r:await WebAssembly.compile(r),t))}te.instantiate=wo;function Fa(r,t){return br(wr(t||(t={})),new WebAssembly.Instance(r instanceof WebAssembly.Module?r:new WebAssembly.Module(r),t))}te.instantiateSync=Fa;async function bo(r,t){return WebAssembly.instantiateStreaming?br(wr(t||(t={})),(await WebAssembly.instantiateStreaming(r,t)).instance):wo(Do(r=await r)?r.arrayBuffer():r,t)}te.instantiateStreaming=bo;function _o(r,t){var e=t?Object.create(t):{},n=r.__argumentsLength?function(i){r.__argumentsLength.value=i}:r.__setArgumentsLength||r.__setargc||function(){};for(let i in r){if(!Object.prototype.hasOwnProperty.call(r,i))continue;let o=r[i],s=i.split("."),u=e;for(;s.length>1;){let f=s.shift();Object.prototype.hasOwnProperty.call(u,f)||(u[f]={}),u=u[f]}let a=s[0],h=a.indexOf("#");if(h>=0){let f=a.substring(0,h),d=u[f];if(typeof d>"u"||!d.prototype){let A=function(...c){return A.wrap(A.prototype.constructor(0,...c))};A.prototype={valueOf:function(){return this[Xt]}},A.wrap=function(c){return Object.create(A.prototype,{[Xt]:{value:c,writable:!1}})},d&&Object.getOwnPropertyNames(d).forEach(c=>Object.defineProperty(A,c,Object.getOwnPropertyDescriptor(d,c))),u[f]=A}if(a=a.substring(h+1),u=u[f].prototype,/^(get|set):/.test(a)){if(!Object.prototype.hasOwnProperty.call(u,a=a.substring(4))){let A=r[i.replace("set:","get:")],c=r[i.replace("get:","set:")];Object.defineProperty(u,a,{get:function(){return A(this[Xt])},set:function(p){c(this[Xt],p)},enumerable:!0})}}else a==="constructor"?(u[a]=(...A)=>(n(A.length),o(...A))).original=o:(u[a]=function(...A){return n(A.length),o(this[Xt],...A)}).original=o}else/^(get|set):/.test(a)?Object.prototype.hasOwnProperty.call(u,a=a.substring(4))||Object.defineProperty(u,a,{get:r[i.replace("set:","get:")],set:r[i.replace("get:","set:")],enumerable:!0}):typeof o=="function"&&o!==n?(u[a]=(...f)=>(n(f.length),o(...f))).original=o:u[a]=o}return e}te.demangle=_o});var Ao=I((nc,xo)=>{var{instantiate:Sa}=Eo();_r.supported=typeof WebAssembly<"u";function _r(r={}){if(!_r.supported)return null;var t=new Uint8Array([0,97,115,109,1,0,0,0,1,78,14,96,2,127,126,0,96,1,127,1,126,96,2,127,127,0,96,1,127,1,127,96,1,127,0,96,2,127,127,1,127,96,3,127,127,127,1,127,96,0,0,96,3,127,127,127,0,96,0,1,127,96,4,127,127,127,127,0,96,5,127,127,127,127,127,1,127,96,1,126,1,127,96,2,126,126,1,126,2,13,1,3,101,110,118,5,97,98,111,114,116,0,10,3,54,53,2,2,8,9,3,5,2,8,6,5,3,4,2,6,9,12,13,2,5,11,3,2,3,2,3,2,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,6,7,7,4,4,5,3,1,0,1,6,47,9,127,1,65,0,11,127,1,65,0,11,127,0,65,3,11,127,0,65,4,11,127,1,65,0,11,127,1,65,0,11,127,1,65,0,11,127,0,65,240,2,11,127,0,65,6,11,7,240,5,41,6,109,101,109,111,114,121,2,0,7,95,95,97,108,108,111,99,0,10,8,95,95,114,101,116,97,105,110,0,11,9,95,95,114,101,108,101,97,115,101,0,12,9,95,95,99,111,108,108,101,99,116,0,51,11,95,95,114,116,116,105,95,98,97,115,101,3,7,13,73,110,116,51,50,65,114,114,97,121,95,73,68,3,2,13,85,105,110,116,56,65,114,114,97,121,95,73,68,3,3,6,100,101,103,114,101,101,0,16,3,109,111,100,0,17,5,82,97,98,105,110,3,8,16,82,97,98,105,110,35,103,101,116,58,119,105,110,100,111,119,0,21,16,82,97,98,105,110,35,115,101,116,58,119,105,110,100,111,119,0,22,21,82,97,98,105,110,35,103,101,116,58,119,105,110,100,111,119,95,115,105,122,101,0,23,21,82,97,98,105,110,35,115,101,116,58,119,105,110,100,111,119,95,115,105,122,101,0,24,14,82,97,98,105,110,35,103,101,116,58,119,112,111,115,0,25,14,82,97,98,105,110,35,115,101,116,58,119,112,111,115,0,26,15,82,97,98,105,110,35,103,101,116,58,99,111,117,110,116,0,27,15,82,97,98,105,110,35,115,101,116,58,99,111,117,110,116,0,28,13,82,97,98,105,110,35,103,101,116,58,112,111,115,0,29,13,82,97,98,105,110,35,115,101,116,58,112,111,115,0,30,15,82,97,98,105,110,35,103,101,116,58,115,116,97,114,116,0,31,15,82,97,98,105,110,35,115,101,116,58,115,116,97,114,116,0,32,16,82,97,98,105,110,35,103,101,116,58,100,105,103,101,115,116,0,33,16,82,97,98,105,110,35,115,101,116,58,100,105,103,101,115,116,0,34,21,82,97,98,105,110,35,103,101,116,58,99,104,117,110,107,95,115,116,97,114,116,0,35,21,82,97,98,105,110,35,115,101,116,58,99,104,117,110,107,95,115,116,97,114,116,0,36,22,82,97,98,105,110,35,103,101,116,58,99,104,117,110,107,95,108,101,110,103,116,104,0,37,22,82,97,98,105,110,35,115,101,116,58,99,104,117,110,107,95,108,101,110,103,116,104,0,38,31,82,97,98,105,110,35,103,101,116,58,99,104,117,110,107,95,99,117,116,95,102,105,110,103,101,114,112,114,105,110,116,0,39,31,82,97,98,105,110,35,115,101,116,58,99,104,117,110,107,95,99,117,116,95,102,105,110,103,101,114,112,114,105,110,116,0,40,20,82,97,98,105,110,35,103,101,116,58,112,111,108,121,110,111,109,105,97,108,0,41,20,82,97,98,105,110,35,115,101,116,58,112,111,108,121,110,111,109,105,97,108,0,42,17,82,97,98,105,110,35,103,101,116,58,109,105,110,115,105,122,101,0,43,17,82,97,98,105,110,35,115,101,116,58,109,105,110,115,105,122,101,0,44,17,82,97,98,105,110,35,103,101,116,58,109,97,120,115,105,122,101,0,45,17,82,97,98,105,110,35,115,101,116,58,109,97,120,115,105,122,101,0,46,14,82,97,98,105,110,35,103,101,116,58,109,97,115,107,0,47,14,82,97,98,105,110,35,115,101,116,58,109,97,115,107,0,48,17,82,97,98,105,110,35,99,111,110,115,116,114,117,99,116,111,114,0,20,17,82,97,98,105,110,35,102,105,110,103,101,114,112,114,105,110,116,0,49,8,1,50,10,165,31,53,199,1,1,4,127,32,1,40,2,0,65,124,113,34,2,65,128,2,73,4,127,32,2,65,4,118,33,4,65,0,5,32,2,65,31,32,2,103,107,34,3,65,4,107,118,65,16,115,33,4,32,3,65,7,107,11,33,3,32,1,40,2,20,33,2,32,1,40,2,16,34,5,4,64,32,5,32,2,54,2,20,11,32,2,4,64,32,2,32,5,54,2,16,11,32,1,32,0,32,4,32,3,65,4,116,106,65,2,116,106,40,2,96,70,4,64,32,0,32,4,32,3,65,4,116,106,65,2,116,106,32,2,54,2,96,32,2,69,4,64,32,0,32,3,65,2,116,106,32,0,32,3,65,2,116,106,40,2,4,65,1,32,4,116,65,127,115,113,34,1,54,2,4,32,1,69,4,64,32,0,32,0,40,2,0,65,1,32,3,116,65,127,115,113,54,2,0,11,11,11,11,226,2,1,6,127,32,1,40,2,0,33,3,32,1,65,16,106,32,1,40,2,0,65,124,113,106,34,4,40,2,0,34,5,65,1,113,4,64,32,3,65,124,113,65,16,106,32,5,65,124,113,106,34,2,65,240,255,255,255,3,73,4,64,32,0,32,4,16,1,32,1,32,2,32,3,65,3,113,114,34,3,54,2,0,32,1,65,16,106,32,1,40,2,0,65,124,113,106,34,4,40,2,0,33,5,11,11,32,3,65,2,113,4,64,32,1,65,4,107,40,2,0,34,2,40,2,0,34,6,65,124,113,65,16,106,32,3,65,124,113,106,34,7,65,240,255,255,255,3,73,4,64,32,0,32,2,16,1,32,2,32,7,32,6,65,3,113,114,34,3,54,2,0,32,2,33,1,11,11,32,4,32,5,65,2,114,54,2,0,32,4,65,4,107,32,1,54,2,0,32,0,32,3,65,124,113,34,2,65,128,2,73,4,127,32,2,65,4,118,33,4,65,0,5,32,2,65,31,32,2,103,107,34,2,65,4,107,118,65,16,115,33,4,32,2,65,7,107,11,34,3,65,4,116,32,4,106,65,2,116,106,40,2,96,33,2,32,1,65,0,54,2,16,32,1,32,2,54,2,20,32,2,4,64,32,2,32,1,54,2,16,11,32,0,32,4,32,3,65,4,116,106,65,2,116,106,32,1,54,2,96,32,0,32,0,40,2,0,65,1,32,3,116,114,54,2,0,32,0,32,3,65,2,116,106,32,0,32,3,65,2,116,106,40,2,4,65,1,32,4,116,114,54,2,4,11,119,1,1,127,32,2,2,127,32,0,40,2,160,12,34,2,4,64,32,2,32,1,65,16,107,70,4,64,32,2,40,2,0,33,3,32,1,65,16,107,33,1,11,11,32,1,11,107,34,2,65,48,73,4,64,15,11,32,1,32,3,65,2,113,32,2,65,32,107,65,1,114,114,54,2,0,32,1,65,0,54,2,16,32,1,65,0,54,2,20,32,1,32,2,106,65,16,107,34,2,65,2,54,2,0,32,0,32,2,54,2,160,12,32,0,32,1,16,2,11,155,1,1,3,127,35,0,34,0,69,4,64,65,1,63,0,34,0,74,4,127,65,1,32,0,107,64,0,65,0,72,5,65,0,11,4,64,0,11,65,176,3,34,0,65,0,54,2,0,65,208,15,65,0,54,2,0,3,64,32,1,65,23,73,4,64,32,1,65,2,116,65,176,3,106,65,0,54,2,4,65,0,33,2,3,64,32,2,65,16,73,4,64,32,1,65,4,116,32,2,106,65,2,116,65,176,3,106,65,0,54,2,96,32,2,65,1,106,33,2,12,1,11,11,32,1,65,1,106,33,1,12,1,11,11,65,176,3,65,224,15,63,0,65,16,116,16,3,65,176,3,36,0,11,32,0,11,45,0,32,0,65,240,255,255,255,3,79,4,64,65,32,65,224,0,65,201,3,65,29,16,0,0,11,32,0,65,15,106,65,112,113,34,0,65,16,32,0,65,16,75,27,11,169,1,1,1,127,32,0,32,1,65,128,2,73,4,127,32,1,65,4,118,33,1,65,0,5,32,1,65,248,255,255,255,1,73,4,64,32,1,65,1,65,27,32,1,103,107,116,106,65,1,107,33,1,11,32,1,65,31,32,1,103,107,34,2,65,4,107,118,65,16,115,33,1,32,2,65,7,107,11,34,2,65,2,116,106,40,2,4,65,127,32,1,116,113,34,1,4,127,32,0,32,1,104,32,2,65,4,116,106,65,2,116,106,40,2,96,5,32,0,40,2,0,65,127,32,2,65,1,106,116,113,34,1,4,127,32,0,32,0,32,1,104,34,0,65,2,116,106,40,2,4,104,32,0,65,4,116,106,65,2,116,106,40,2,96,5,65,0,11,11,11,111,1,1,127,63,0,34,2,32,1,65,248,255,255,255,1,73,4,127,32,1,65,1,65,27,32,1,103,107,116,65,1,107,106,5,32,1,11,65,16,32,0,40,2,160,12,32,2,65,16,116,65,16,107,71,116,106,65,255,255,3,106,65,128,128,124,113,65,16,118,34,1,32,2,32,1,74,27,64,0,65,0,72,4,64,32,1,64,0,65,0,72,4,64,0,11,11,32,0,32,2,65,16,116,63,0,65,16,116,16,3,11,113,1,2,127,32,1,40,2,0,34,3,65,124,113,32,2,107,34,4,65,32,79,4,64,32,1,32,2,32,3,65,2,113,114,54,2,0,32,2,32,1,65,16,106,106,34,1,32,4,65,16,107,65,1,114,54,2,0,32,0,32,1,16,2,5,32,1,32,3,65,126,113,54,2,0,32,1,65,16,106,32,1,40,2,0,65,124,113,106,32,1,65,16,106,32,1,40,2,0,65,124,113,106,40,2,0,65,125,113,54,2,0,11,11,91,1,2,127,32,0,32,1,16,5,34,4,16,6,34,3,69,4,64,65,1,36,1,65,0,36,1,32,0,32,4,16,6,34,3,69,4,64,32,0,32,4,16,7,32,0,32,4,16,6,33,3,11,11,32,3,65,0,54,2,4,32,3,32,2,54,2,8,32,3,32,1,54,2,12,32,0,32,3,16,1,32,0,32,3,32,4,16,8,32,3,11,13,0,16,4,32,0,32,1,16,9,65,16,106,11,33,1,1,127,32,0,65,172,3,75,4,64,32,0,65,16,107,34,1,32,1,40,2,4,65,1,106,54,2,4,11,32,0,11,18,0,32,0,65,172,3,75,4,64,32,0,65,16,107,16,52,11,11,140,3,1,1,127,2,64,32,1,69,13,0,32,0,65,0,58,0,0,32,0,32,1,106,65,1,107,65,0,58,0,0,32,1,65,2,77,13,0,32,0,65,1,106,65,0,58,0,0,32,0,65,2,106,65,0,58,0,0,32,0,32,1,106,34,2,65,2,107,65,0,58,0,0,32,2,65,3,107,65,0,58,0,0,32,1,65,6,77,13,0,32,0,65,3,106,65,0,58,0,0,32,0,32,1,106,65,4,107,65,0,58,0,0,32,1,65,8,77,13,0,32,1,65,0,32,0,107,65,3,113,34,1,107,33,2,32,0,32,1,106,34,0,65,0,54,2,0,32,0,32,2,65,124,113,34,1,106,65,4,107,65,0,54,2,0,32,1,65,8,77,13,0,32,0,65,4,106,65,0,54,2,0,32,0,65,8,106,65,0,54,2,0,32,0,32,1,106,34,2,65,12,107,65,0,54,2,0,32,2,65,8,107,65,0,54,2,0,32,1,65,24,77,13,0,32,0,65,12,106,65,0,54,2,0,32,0,65,16,106,65,0,54,2,0,32,0,65,20,106,65,0,54,2,0,32,0,65,24,106,65,0,54,2,0,32,0,32,1,106,34,2,65,28,107,65,0,54,2,0,32,2,65,24,107,65,0,54,2,0,32,2,65,20,107,65,0,54,2,0,32,2,65,16,107,65,0,54,2,0,32,0,32,0,65,4,113,65,24,106,34,2,106,33,0,32,1,32,2,107,33,1,3,64,32,1,65,32,79,4,64,32,0,66,0,55,3,0,32,0,65,8,106,66,0,55,3,0,32,0,65,16,106,66,0,55,3,0,32,0,65,24,106,66,0,55,3,0,32,1,65,32,107,33,1,32,0,65,32,106,33,0,12,1,11,11,11,11,178,1,1,3,127,32,1,65,240,255,255,255,3,32,2,118,75,4,64,65,144,1,65,192,1,65,23,65,56,16,0,0,11,32,1,32,2,116,34,3,65,0,16,10,34,2,32,3,16,13,32,0,69,4,64,65,12,65,2,16,10,34,0,65,172,3,75,4,64,32,0,65,16,107,34,1,32,1,40,2,4,65,1,106,54,2,4,11,11,32,0,65,0,54,2,0,32,0,65,0,54,2,4,32,0,65,0,54,2,8,32,2,34,1,32,0,40,2,0,34,4,71,4,64,32,1,65,172,3,75,4,64,32,1,65,16,107,34,5,32,5,40,2,4,65,1,106,54,2,4,11,32,4,16,12,11,32,0,32,1,54,2,0,32,0,32,2,54,2,4,32,0,32,3,54,2,8,32,0,11,46,1,2,127,65,12,65,5,16,10,34,0,65,172,3,75,4,64,32,0,65,16,107,34,1,32,1,40,2,4,65,1,106,54,2,4,11,32,0,65,128,2,65,3,16,14,11,9,0,65,63,32,0,121,167,107,11,49,1,2,127,65,63,32,1,121,167,107,33,2,3,64,65,63,32,0,121,167,107,32,2,107,34,3,65,0,78,4,64,32,0,32,1,32,3,172,134,133,33,0,12,1,11,11,32,0,11,40,0,32,1,32,0,40,2,8,79,4,64,65,128,2,65,192,2,65,163,1,65,44,16,0,0,11,32,1,32,0,40,2,4,106,65,0,58,0,0,11,38,0,32,1,32,0,40,2,8,79,4,64,65,128,2,65,192,2,65,152,1,65,44,16,0,0,11,32,1,32,0,40,2,4,106,45,0,0,11,254,5,2,1,127,4,126,32,0,69,4,64,65,232,0,65,6,16,10,34,0,65,172,3,75,4,64,32,0,65,16,107,34,5,32,5,40,2,4,65,1,106,54,2,4,11,11,32,0,65,0,54,2,0,32,0,65,0,54,2,4,32,0,65,0,54,2,8,32,0,66,0,55,3,16,32,0,66,0,55,3,24,32,0,66,0,55,3,32,32,0,66,0,55,3,40,32,0,66,0,55,3,48,32,0,66,0,55,3,56,32,0,66,0,55,3,64,32,0,66,0,55,3,72,32,0,66,0,55,3,80,32,0,66,0,55,3,88,32,0,66,0,55,3,96,32,0,32,2,173,55,3,80,32,0,32,3,173,55,3,88,65,12,65,4,16,10,34,2,65,172,3,75,4,64,32,2,65,16,107,34,3,32,3,40,2,4,65,1,106,54,2,4,11,32,2,32,4,65,0,16,14,33,2,32,0,40,2,0,16,12,32,0,32,2,54,2,0,32,0,32,4,54,2,4,32,0,66,1,32,1,173,134,66,1,125,55,3,96,32,0,66,243,130,183,218,216,230,232,30,55,3,72,35,4,69,4,64,65,0,33,2,3,64,32,2,65,128,2,72,4,64,32,2,65,255,1,113,173,33,6,32,0,41,3,72,34,7,33,8,65,63,32,7,121,167,107,33,1,3,64,65,63,32,6,121,167,107,32,1,107,34,3,65,0,78,4,64,32,6,32,8,32,3,172,134,133,33,6,12,1,11,11,65,0,33,4,3,64,32,4,32,0,40,2,4,65,1,107,72,4,64,32,6,66,8,134,33,6,32,0,41,3,72,34,7,33,8,65,63,32,7,121,167,107,33,1,3,64,65,63,32,6,121,167,107,32,1,107,34,3,65,0,78,4,64,32,6,32,8,32,3,172,134,133,33,6,12,1,11,11,32,4,65,1,106,33,4,12,1,11,11,35,6,40,2,4,32,2,65,3,116,106,32,6,55,3,0,32,2,65,1,106,33,2,12,1,11,11,65,63,32,0,41,3,72,121,167,107,172,33,7,65,0,33,2,3,64,32,2,65,128,2,72,4,64,35,5,33,1,32,2,172,32,7,134,34,8,33,6,65,63,32,0,41,3,72,34,9,121,167,107,33,3,3,64,65,63,32,6,121,167,107,32,3,107,34,4,65,0,78,4,64,32,6,32,9,32,4,172,134,133,33,6,12,1,11,11,32,1,40,2,4,32,2,65,3,116,106,32,6,32,8,132,55,3,0,32,2,65,1,106,33,2,12,1,11,11,65,1,36,4,11,32,0,66,0,55,3,24,32,0,66,0,55,3,32,65,0,33,2,3,64,32,2,32,0,40,2,4,72,4,64,32,0,40,2,0,32,2,16,18,32,2,65,1,106,33,2,12,1,11,11,32,0,66,0,55,3,40,32,0,65,0,54,2,8,32,0,66,0,55,3,16,32,0,66,0,55,3,40,32,0,40,2,0,32,0,40,2,8,16,19,33,1,32,0,40,2,8,32,0,40,2,0,40,2,4,106,65,1,58,0,0,32,0,32,0,41,3,40,35,6,40,2,4,32,1,65,3,116,106,41,3,0,133,55,3,40,32,0,32,0,40,2,8,65,1,106,32,0,40,2,4,111,54,2,8,32,0,35,5,40,2,4,32,0,41,3,40,34,6,66,45,136,167,65,3,116,106,41,3,0,32,6,66,8,134,66,1,132,133,55,3,40,32,0,11,38,1,1,127,32,0,40,2,0,34,0,65,172,3,75,4,64,32,0,65,16,107,34,1,32,1,40,2,4,65,1,106,54,2,4,11,32,0,11,55,1,2,127,32,1,32,0,40,2,0,34,2,71,4,64,32,1,65,172,3,75,4,64,32,1,65,16,107,34,3,32,3,40,2,4,65,1,106,54,2,4,11,32,2,16,12,11,32,0,32,1,54,2,0,11,7,0,32,0,40,2,4,11,9,0,32,0,32,1,54,2,4,11,7,0,32,0,40,2,8,11,9,0,32,0,32,1,54,2,8,11,7,0,32,0,41,3,16,11,9,0,32,0,32,1,55,3,16,11,7,0,32,0,41,3,24,11,9,0,32,0,32,1,55,3,24,11,7,0,32,0,41,3,32,11,9,0,32,0,32,1,55,3,32,11,7,0,32,0,41,3,40,11,9,0,32,0,32,1,55,3,40,11,7,0,32,0,41,3,48,11,9,0,32,0,32,1,55,3,48,11,7,0,32,0,41,3,56,11,9,0,32,0,32,1,55,3,56,11,7,0,32,0,41,3,64,11,9,0,32,0,32,1,55,3,64,11,7,0,32,0,41,3,72,11,9,0,32,0,32,1,55,3,72,11,7,0,32,0,41,3,80,11,9,0,32,0,32,1,55,3,80,11,7,0,32,0,41,3,88,11,9,0,32,0,32,1,55,3,88,11,7,0,32,0,41,3,96,11,9,0,32,0,32,1,55,3,96,11,172,4,2,5,127,1,126,32,2,65,172,3,75,4,64,32,2,65,16,107,34,4,32,4,40,2,4,65,1,106,54,2,4,11,32,2,33,4,65,0,33,2,32,1,40,2,8,33,5,32,1,40,2,4,33,6,3,64,2,127,65,0,33,3,3,64,32,3,32,5,72,4,64,32,3,32,6,106,45,0,0,33,1,32,0,40,2,0,32,0,40,2,8,16,19,33,7,32,0,40,2,8,32,0,40,2,0,40,2,4,106,32,1,58,0,0,32,0,32,0,41,3,40,35,6,40,2,4,32,7,65,3,116,106,41,3,0,133,55,3,40,32,0,32,0,40,2,8,65,1,106,32,0,40,2,4,111,54,2,8,32,0,35,5,40,2,4,32,0,41,3,40,34,8,66,45,136,167,65,3,116,106,41,3,0,32,1,173,32,8,66,8,134,132,133,55,3,40,32,0,32,0,41,3,16,66,1,124,55,3,16,32,0,32,0,41,3,24,66,1,124,55,3,24,32,0,41,3,16,32,0,41,3,80,90,4,127,32,0,41,3,40,32,0,41,3,96,131,80,5,65,0,11,4,127,65,1,5,32,0,41,3,16,32,0,41,3,88,90,11,4,64,32,0,32,0,41,3,32,55,3,48,32,0,32,0,41,3,16,55,3,56,32,0,32,0,41,3,40,55,3,64,65,0,33,1,3,64,32,1,32,0,40,2,4,72,4,64,32,0,40,2,0,32,1,16,18,32,1,65,1,106,33,1,12,1,11,11,32,0,66,0,55,3,40,32,0,65,0,54,2,8,32,0,66,0,55,3,16,32,0,66,0,55,3,40,32,0,40,2,0,32,0,40,2,8,16,19,33,1,32,0,40,2,8,32,0,40,2,0,40,2,4,106,65,1,58,0,0,32,0,32,0,41,3,40,35,6,40,2,4,32,1,65,3,116,106,41,3,0,133,55,3,40,32,0,32,0,40,2,8,65,1,106,32,0,40,2,4,111,54,2,8,32,0,35,5,40,2,4,32,0,41,3,40,34,8,66,45,136,167,65,3,116,106,41,3,0,32,8,66,8,134,66,1,132,133,55,3,40,32,3,65,1,106,12,3,11,32,3,65,1,106,33,3,12,1,11,11,65,127,11,34,1,65,0,78,4,64,32,5,32,1,107,33,5,32,1,32,6,106,33,6,32,2,34,1,65,1,106,33,2,32,4,40,2,4,32,1,65,2,116,106,32,0,41,3,56,62,2,0,12,1,11,11,32,4,11,10,0,16,15,36,5,16,15,36,6,11,3,0,1,11,73,1,2,127,32,0,40,2,4,34,1,65,255,255,255,255,0,113,34,2,65,1,70,4,64,32,0,65,16,106,16,53,32,0,32,0,40,2,0,65,1,114,54,2,0,35,0,32,0,16,2,5,32,0,32,2,65,1,107,32,1,65,128,128,128,128,127,113,114,54,2,4,11,11,58,0,2,64,2,64,2,64,32,0,65,8,107,40,2,0,14,7,0,0,1,1,1,1,1,2,11,15,11,32,0,40,2,0,34,0,4,64,32,0,65,172,3,79,4,64,32,0,65,16,107,16,52,11,11,15,11,0,11,11,137,3,7,0,65,16,11,55,40,0,0,0,1,0,0,0,1,0,0,0,40,0,0,0,97,0,108,0,108,0,111,0,99,0,97,0,116,0,105,0,111,0,110,0,32,0,116,0,111,0,111,0,32,0,108,0,97,0,114,0,103,0,101,0,65,208,0,11,45,30,0,0,0,1,0,0,0,1,0,0,0,30,0,0,0,126,0,108,0,105,0,98,0,47,0,114,0,116,0,47,0,116,0,108,0,115,0,102,0,46,0,116,0,115,0,65,128,1,11,43,28,0,0,0,1,0,0,0,1,0,0,0,28,0,0,0,73,0,110,0,118,0,97,0,108,0,105,0,100,0,32,0,108,0,101,0,110,0,103,0,116,0,104,0,65,176,1,11,53,38,0,0,0,1,0,0,0,1,0,0,0,38,0,0,0,126,0,108,0,105,0,98,0,47,0,97,0,114,0,114,0,97,0,121,0,98,0,117,0,102,0,102,0,101,0,114,0,46,0,116,0,115,0,65,240,1,11,51,36,0,0,0,1,0,0,0,1,0,0,0,36,0,0,0,73,0,110,0,100,0,101,0,120,0,32,0,111,0,117,0,116,0,32,0,111,0,102,0,32,0,114,0,97,0,110,0,103,0,101,0,65,176,2,11,51,36,0,0,0,1,0,0,0,1,0,0,0,36,0,0,0,126,0,108,0,105,0,98,0,47,0,116,0,121,0,112,0,101,0,100,0,97,0,114,0,114,0,97,0,121,0,46,0,116,0,115,0,65,240,2,11,53,7,0,0,0,16,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,145,4,0,0,2,0,0,0,49,0,0,0,2,0,0,0,17,1,0,0,2,0,0,0,16,0,34,16,115,111,117,114,99,101,77,97,112,112,105,110,103,85,82,76,16,46,47,114,97,98,105,110,46,119,97,115,109,46,109,97,112]);return Sa(new Response(new Blob([t],{type:"application/wasm"})),r)}xo.exports=_r});var So=I((ic,Fo)=>{var Bo=mo(),Ca=Ao(),Ia=async(r,t,e,n,i)=>{let o=await Ca();return new Bo(o,r,t,e,n,i)};Fo.exports={Rabin:Bo,create:Ia}});var Vo=I((Hc,jo)=>{"use strict";jo.exports=class{constructor(){this._bitArrays=[],this._data=[],this._length=0,this._changedLength=!1,this._changedData=!1}set(t,e){let n=this._internalPositionFor(t,!1);if(e===void 0)n!==-1&&(this._unsetInternalPos(n),this._unsetBit(t),this._changedLength=!0,this._changedData=!0);else{let i=!1;n===-1?(n=this._data.length,this._setBit(t),this._changedData=!0):i=!0,this._setInternalPos(n,t,e,i),this._changedLength=!0}}unset(t){this.set(t,void 0)}get(t){this._sortData();let e=this._internalPositionFor(t,!0);if(e!==-1)return this._data[e][1]}push(t){return this.set(this.length,t),this.length}get length(){if(this._sortData(),this._changedLength){let t=this._data[this._data.length-1];this._length=t?t[0]+1:0,this._changedLength=!1}return this._length}forEach(t){let e=0;for(;e<this.length;)t(this.get(e),e,this),e++}map(t){let e=0,n=new Array(this.length);for(;e<this.length;)n[e]=t(this.get(e),e,this),e++;return n}reduce(t,e){let n=0,i=e;for(;n<this.length;){let o=this.get(n);i=t(i,o,n),n++}return i}find(t){let e=0,n,i;for(;e<this.length&&!n;)i=this.get(e),n=t(i),e++;return n?i:void 0}_internalPositionFor(t,e){let n=this._bytePosFor(t,e);if(n>=this._bitArrays.length)return-1;let i=this._bitArrays[n],o=t-n*7;if(!((i&1<<o)>0))return-1;let u=this._bitArrays.slice(0,n).reduce(su,0),a=~(4294967295<<o+1),h=Mo(i&a);return u+h-1}_bytePosFor(t,e){let n=Math.floor(t/7),i=n+1;for(;!e&&this._bitArrays.length<i;)this._bitArrays.push(0);return n}_setBit(t){let e=this._bytePosFor(t,!1);this._bitArrays[e]|=1<<t-e*7}_unsetBit(t){let e=this._bytePosFor(t,!1);this._bitArrays[e]&=~(1<<t-e*7)}_setInternalPos(t,e,n,i){let o=this._data,s=[e,n];if(i)this._sortData(),o[t]=s;else{if(o.length)if(o[o.length-1][0]>=e)o.push(s);else if(o[0][0]<=e)o.unshift(s);else{let u=Math.round(o.length/2);this._data=o.slice(0,u).concat(s).concat(o.slice(u))}else this._data.push(s);this._changedData=!0,this._changedLength=!0}}_unsetInternalPos(t){this._data.splice(t,1)}_sortData(){this._changedData&&this._data.sort(au),this._changedData=!1}bitField(){let t=[],e=8,n=0,i=0,o,s=this._bitArrays.slice();for(;s.length||n;){n===0&&(o=s.shift(),n=7);let a=Math.min(n,e),h=~(255<<a);i|=(o&h)<<8-e,o=o>>>a,n-=a,e-=a,(!e||!n&&!s.length)&&(t.push(i),i=0,e=8)}for(var u=t.length-1;u>0&&t[u]===0;u--)t.pop();return t}compactArray(){return this._sortData(),this._data.map(uu)}};function su(r,t){return r+Mo(t)}function Mo(r){let t=r;return t=t-(t>>1&1431655765),t=(t&858993459)+(t>>2&858993459),(t+(t>>4)&252645135)*16843009>>24}function au(r,t){return r[0]-t[0]}function uu(r){return r[1]}});var _u={};V(_u,{importer:()=>bu});var es=M(Se(),1);var Zr=M(Jr(),1),Xr=Zr.default;var Ue={};V(Ue,{sha256:()=>It,sha512:()=>vs});var Mt={};V(Mt,{coerce:()=>Y,empty:()=>Qr,equals:()=>Ie,fromHex:()=>gs,fromString:()=>Te,isBinary:()=>Ds,toHex:()=>ms,toString:()=>ke});var Qr=new Uint8Array(0),ms=r=>r.reduce((t,e)=>t+e.toString(16).padStart(2,"0"),""),gs=r=>{let t=r.match(/../g);return t?new Uint8Array(t.map(e=>parseInt(e,16))):Qr},Ie=(r,t)=>{if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;e<r.byteLength;e++)if(r[e]!==t[e])return!1;return!0},Y=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},Ds=r=>r instanceof ArrayBuffer||ArrayBuffer.isView(r),Te=r=>new TextEncoder().encode(r),ke=r=>new TextDecoder().decode(r);var ws=rn,tn=128,bs=127,_s=~bs,Es=Math.pow(2,31);function rn(r,t,e){t=t||[],e=e||0;for(var n=e;r>=Es;)t[e++]=r&255|tn,r/=128;for(;r&_s;)t[e++]=r&255|tn,r>>>=7;return t[e]=r|0,rn.bytes=e-n+1,t}var xs=Le,As=128,en=127;function Le(r,n){var e=0,n=n||0,i=0,o=n,s,u=r.length;do{if(o>=u)throw Le.bytes=0,new RangeError("Could not decode varint");s=r[o++],e+=i<28?(s&en)<<i:(s&en)*Math.pow(2,i),i+=7}while(s>=As);return Le.bytes=o-n,e}var Bs=Math.pow(2,7),Fs=Math.pow(2,14),Ss=Math.pow(2,21),Cs=Math.pow(2,28),Is=Math.pow(2,35),Ts=Math.pow(2,42),ks=Math.pow(2,49),Ls=Math.pow(2,56),Ns=Math.pow(2,63),Us=function(r){return r<Bs?1:r<Fs?2:r<Ss?3:r<Cs?4:r<Is?5:r<Ts?6:r<ks?7:r<Ls?8:r<Ns?9:10},Os={encode:ws,decode:xs,encodingLength:Us},zs=Os,jt=zs;var Vt=r=>[jt.decode(r),jt.decode.bytes],Bt=(r,t,e=0)=>(jt.encode(r,t,e),t),Ft=r=>jt.encodingLength(r);var Dt=(r,t)=>{let e=t.byteLength,n=Ft(r),i=n+Ft(e),o=new Uint8Array(i+e);return Bt(r,o,0),Bt(e,o,n),o.set(t,i),new St(r,e,t,o)},nn=r=>{let t=Y(r),[e,n]=Vt(t),[i,o]=Vt(t.subarray(n)),s=t.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new St(e,i,s,t)},on=(r,t)=>r===t?!0:r.code===t.code&&r.size===t.size&&Ie(r.bytes,t.bytes),St=class{constructor(t,e,n,i){this.code=t,this.size=e,this.digest=n,this.bytes=i}};var Ct=({name:r,code:t,encode:e})=>new Ne(r,t,e),Ne=class{constructor(t,e,n){this.name=t,this.code=e,this.encode=n}digest(t){if(t instanceof Uint8Array){let e=this.encode(t);return e instanceof Uint8Array?Dt(this.code,e):e.then(n=>Dt(this.code,n))}else throw Error("Unknown type, must be binary type")}};var an=r=>async t=>new Uint8Array(await crypto.subtle.digest(r,t)),It=Ct({name:"sha2-256",code:18,encode:an("SHA-256")}),vs=Ct({name:"sha2-512",code:19,encode:an("SHA-512")});var Re={};V(Re,{base58btc:()=>nt,base58flickr:()=>Hs});function Ps(r,t){if(r.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),n=0;n<e.length;n++)e[n]=255;for(var i=0;i<r.length;i++){var o=r.charAt(i),s=o.charCodeAt(0);if(e[s]!==255)throw new TypeError(o+" is ambiguous");e[s]=i}var u=r.length,a=r.charAt(0),h=Math.log(u)/Math.log(256),f=Math.log(256)/Math.log(u);function d(p){if(p instanceof Uint8Array||(ArrayBuffer.isView(p)?p=new Uint8Array(p.buffer,p.byteOffset,p.byteLength):Array.isArray(p)&&(p=Uint8Array.from(p))),!(p instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(p.length===0)return"";for(var g=0,k=0,m=0,D=p.length;m!==D&&p[m]===0;)m++,g++;for(var b=(D-m)*f+1>>>0,_=new Uint8Array(b);m!==D;){for(var F=p[m],w=0,y=b-1;(F!==0||w<k)&&y!==-1;y--,w++)F+=256*_[y]>>>0,_[y]=F%u>>>0,F=F/u>>>0;if(F!==0)throw new Error("Non-zero carry");k=w,m++}for(var E=b-k;E!==b&&_[E]===0;)E++;for(var S=a.repeat(g);E<b;++E)S+=r.charAt(_[E]);return S}function A(p){if(typeof p!="string")throw new TypeError("Expected String");if(p.length===0)return new Uint8Array;var g=0;if(p[g]!==" "){for(var k=0,m=0;p[g]===a;)k++,g++;for(var D=(p.length-g)*h+1>>>0,b=new Uint8Array(D);p[g];){var _=e[p.charCodeAt(g)];if(_===255)return;for(var F=0,w=D-1;(_!==0||F<m)&&w!==-1;w--,F++)_+=u*b[w]>>>0,b[w]=_%256>>>0,_=_/256>>>0;if(_!==0)throw new Error("Non-zero carry");m=F,g++}if(p[g]!==" "){for(var y=D-m;y!==D&&b[y]===0;)y++;for(var E=new Uint8Array(k+(D-y)),S=k;y!==D;)E[S++]=b[y++];return E}}}function c(p){var g=A(p);if(g)return g;throw new Error(`Non-${t} character`)}return{encode:d,decodeUnsafe:A,decode:c}}var Rs=Ps,Ms=Rs,un=Ms;var Oe=class{constructor(t,e,n){this.name=t,this.prefix=e,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},ze=class{constructor(t,e,n){if(this.name=t,this.prefix=e,e.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return cn(this,t)}},ve=class{constructor(t){this.decoders=t}or(t){return cn(this,t)}decode(t){let e=t[0],n=this.decoders[e];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},cn=(r,t)=>new ve({...r.decoders||{[r.prefix]:r},...t.decoders||{[t.prefix]:t}}),Pe=class{constructor(t,e,n,i){this.name=t,this.prefix=e,this.baseEncode=n,this.baseDecode=i,this.encoder=new Oe(t,e,n),this.decoder=new ze(t,e,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}},Tt=({name:r,prefix:t,encode:e,decode:n})=>new Pe(r,t,e,n),ht=({prefix:r,name:t,alphabet:e})=>{let{encode:n,decode:i}=un(e,t);return Tt({prefix:r,name:t,encode:n,decode:o=>Y(i(o))})},js=(r,t,e,n)=>{let i={};for(let f=0;f<t.length;++f)i[t[f]]=f;let o=r.length;for(;r[o-1]==="=";)--o;let s=new Uint8Array(o*e/8|0),u=0,a=0,h=0;for(let f=0;f<o;++f){let d=i[r[f]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);a=a<<e|d,u+=e,u>=8&&(u-=8,s[h++]=255&a>>u)}if(u>=e||255&a<<8-u)throw new SyntaxError("Unexpected end of data");return s},Vs=(r,t,e)=>{let n=t[t.length-1]==="=",i=(1<<e)-1,o="",s=0,u=0;for(let a=0;a<r.length;++a)for(u=u<<8|r[a],s+=8;s>e;)s-=e,o+=t[i&u>>s];if(s&&(o+=t[i&u<<e-s]),n)for(;o.length*e&7;)o+="=";return o},O=({name:r,prefix:t,bitsPerChar:e,alphabet:n})=>Tt({prefix:t,name:r,encode(i){return Vs(i,n,e)},decode(i){return js(i,n,e,r)}});var nt=ht({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Hs=ht({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Me={};V(Me,{base32:()=>kt,base32hex:()=>Ws,base32hexpad:()=>Ks,base32hexpadupper:()=>Js,base32hexupper:()=>Ys,base32pad:()=>Gs,base32padupper:()=>qs,base32upper:()=>$s,base32z:()=>Zs});var kt=O({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),$s=O({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Gs=O({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),qs=O({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Ws=O({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Ys=O({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Ks=O({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Js=O({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Zs=O({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var L=class{constructor(t,e,n,i){this.code=e,this.version=t,this.multihash=n,this.bytes=i,this.byteOffset=i.byteOffset,this.byteLength=i.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:ce,byteLength:ce,code:ue,version:ue,multihash:ue,bytes:ue,_baseCache:ce,asCID:ce})}toV0(){switch(this.version){case 0:return this;default:{let{code:t,multihash:e}=this;if(t!==$t)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(e.code!==e1)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return L.createV0(e)}}}toV1(){switch(this.version){case 0:{let{code:t,digest:e}=this.multihash,n=Dt(t,e);return L.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(t){return t&&this.code===t.code&&this.version===t.version&&on(this.multihash,t.multihash)}toString(t){let{bytes:e,version:n,_baseCache:i}=this;switch(n){case 0:return Qs(e,i,t||nt.encoder);default:return t1(e,i,t||kt.encoder)}}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(t){return n1(/^0\.0/,i1),!!(t&&(t[hn]||t.asCID===t))}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(t){if(t instanceof L)return t;if(t!=null&&t.asCID===t){let{version:e,code:n,multihash:i,bytes:o}=t;return new L(e,n,i,o||fn(e,n,i.bytes))}else if(t!=null&&t[hn]===!0){let{version:e,multihash:n,code:i}=t,o=nn(n);return L.create(e,i,o)}else return null}static create(t,e,n){if(typeof e!="number")throw new Error("String codecs are no longer supported");switch(t){case 0:{if(e!==$t)throw new Error(`Version 0 CID must use dag-pb (code: ${$t}) block encoding`);return new L(t,e,n,n.bytes)}case 1:{let i=fn(t,e,n.bytes);return new L(t,e,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return L.create(0,$t,t)}static createV1(t,e){return L.create(1,t,e)}static decode(t){let[e,n]=L.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return e}static decodeFirst(t){let e=L.inspectBytes(t),n=e.size-e.multihashSize,i=Y(t.subarray(n,n+e.multihashSize));if(i.byteLength!==e.multihashSize)throw new Error("Incorrect length");let o=i.subarray(e.multihashSize-e.digestSize),s=new St(e.multihashCode,e.digestSize,o,i);return[e.version===0?L.createV0(s):L.createV1(e.codec,s),t.subarray(e.size)]}static inspectBytes(t){let e=0,n=()=>{let[d,A]=Vt(t.subarray(e));return e+=A,d},i=n(),o=$t;if(i===18?(i=0,e=0):i===1&&(o=n()),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=e,u=n(),a=n(),h=e+a,f=h-s;return{version:i,codec:o,multihashCode:u,digestSize:a,multihashSize:f,size:h}}static parse(t,e){let[n,i]=Xs(t,e),o=L.decode(i);return o._baseCache.set(n,t),o}},Xs=(r,t)=>{switch(r[0]){case"Q":{let e=t||nt;return[nt.prefix,e.decode(`${nt.prefix}${r}`)]}case nt.prefix:{let e=t||nt;return[nt.prefix,e.decode(r)]}case kt.prefix:{let e=t||kt;return[kt.prefix,e.decode(r)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],t.decode(r)]}}},Qs=(r,t,e)=>{let{prefix:n}=e;if(n!==nt.prefix)throw Error(`Cannot string encode V0 in ${e.name} encoding`);let i=t.get(n);if(i==null){let o=e.encode(r).slice(1);return t.set(n,o),o}else return i},t1=(r,t,e)=>{let{prefix:n}=e,i=t.get(n);if(i==null){let o=e.encode(r);return t.set(n,o),o}else return i},$t=112,e1=18,fn=(r,t,e)=>{let n=Ft(r),i=n+Ft(t),o=new Uint8Array(i+e.byteLength);return Bt(r,o,0),Bt(t,o,n),o.set(e,i),o},hn=Symbol.for("@ipld/js-cid/CID"),ue={writable:!1,configurable:!1,enumerable:!0},ce={writable:!1,enumerable:!1,configurable:!1},r1="0.0.0-dev",n1=(r,t)=>{if(r.test(r1))console.warn(t);else throw new Error(t)},i1=`CID.isCID(v) is deprecated and will be removed in the next major release.
3
+ Following code pattern:
4
+
5
+ if (CID.isCID(value)) {
6
+ doSomethingWithCID(value)
7
+ }
8
+
9
+ Is replaced with:
10
+
11
+ const cid = CID.asCID(value)
12
+ if (cid) {
13
+ // Make sure to use cid instead of value
14
+ doSomethingWithCID(cid)
15
+ }
16
+ `;var je=M(dn(),1);function o1(r){let t=new Array(4);for(let e=0;e<4;e++)t[e]=r&255,r=r>>8;return new Uint8Array(t)}var qu=Ct({name:"murmur3-32",code:35,encode:r=>o1(je.default.x86.hash32(r))}),yn=Ct({name:"murmur3-128",code:34,encode:r=>Mt.fromHex(je.default.x64.hash128(r))});async function s1(r){return(await yn.encode(r)).slice(0,8).reverse()}var a1={chunker:"fixed",strategy:"balanced",rawLeaves:!1,onlyHash:!1,reduceSingleLeafToSelf:!0,hasher:It,leafType:"file",cidVersion:0,progress:()=>()=>{},shardSplitThreshold:1e3,fileImportConcurrency:50,blockWriteConcurrency:10,minChunkSize:262144,maxChunkSize:262144,avgChunkSize:262144,window:16,polynomial:0x3df305dfb2a804,maxChildrenPerNode:174,layerRepeat:4,wrapWithDirectory:!1,recursive:!1,hidden:!1,timeout:void 0,hamtHashFn:s1,hamtHashCode:34,hamtBucketBits:8},mn=(r={})=>Xr.bind({ignoreUndefined:!0})(a1,r);var ye=M(Lt(),1);var ut=M(yi(),1),Ut=ut.default.Reader,er=ut.default.Writer,B=ut.default.util,j=ut.default.roots["ipfs-unixfs"]||(ut.default.roots["ipfs-unixfs"]={}),mi=j.Data=(()=>{function r(t){if(this.blocksizes=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)t[e[n]]!=null&&(this[e[n]]=t[e[n]])}return r.prototype.Type=0,r.prototype.Data=B.newBuffer([]),r.prototype.filesize=B.Long?B.Long.fromBits(0,0,!0):0,r.prototype.blocksizes=B.emptyArray,r.prototype.hashType=B.Long?B.Long.fromBits(0,0,!0):0,r.prototype.fanout=B.Long?B.Long.fromBits(0,0,!0):0,r.prototype.mode=0,r.prototype.mtime=null,r.encode=function(e,n){if(n||(n=er.create()),n.uint32(8).int32(e.Type),e.Data!=null&&Object.hasOwnProperty.call(e,"Data")&&n.uint32(18).bytes(e.Data),e.filesize!=null&&Object.hasOwnProperty.call(e,"filesize")&&n.uint32(24).uint64(e.filesize),e.blocksizes!=null&&e.blocksizes.length)for(var i=0;i<e.blocksizes.length;++i)n.uint32(32).uint64(e.blocksizes[i]);return e.hashType!=null&&Object.hasOwnProperty.call(e,"hashType")&&n.uint32(40).uint64(e.hashType),e.fanout!=null&&Object.hasOwnProperty.call(e,"fanout")&&n.uint32(48).uint64(e.fanout),e.mode!=null&&Object.hasOwnProperty.call(e,"mode")&&n.uint32(56).uint32(e.mode),e.mtime!=null&&Object.hasOwnProperty.call(e,"mtime")&&j.UnixTime.encode(e.mtime,n.uint32(66).fork()).ldelim(),n},r.decode=function(e,n){e instanceof Ut||(e=Ut.create(e));for(var i=n===void 0?e.len:e.pos+n,o=new j.Data;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.Type=e.int32();break;case 2:o.Data=e.bytes();break;case 3:o.filesize=e.uint64();break;case 4:if(o.blocksizes&&o.blocksizes.length||(o.blocksizes=[]),(s&7)===2)for(var u=e.uint32()+e.pos;e.pos<u;)o.blocksizes.push(e.uint64());else o.blocksizes.push(e.uint64());break;case 5:o.hashType=e.uint64();break;case 6:o.fanout=e.uint64();break;case 7:o.mode=e.uint32();break;case 8:o.mtime=j.UnixTime.decode(e,e.uint32());break;default:e.skipType(s&7);break}}if(!o.hasOwnProperty("Type"))throw B.ProtocolError("missing required 'Type'",{instance:o});return o},r.fromObject=function(e){if(e instanceof j.Data)return e;var n=new j.Data;switch(e.Type){case"Raw":case 0:n.Type=0;break;case"Directory":case 1:n.Type=1;break;case"File":case 2:n.Type=2;break;case"Metadata":case 3:n.Type=3;break;case"Symlink":case 4:n.Type=4;break;case"HAMTShard":case 5:n.Type=5;break}if(e.Data!=null&&(typeof e.Data=="string"?B.base64.decode(e.Data,n.Data=B.newBuffer(B.base64.length(e.Data)),0):e.Data.length&&(n.Data=e.Data)),e.filesize!=null&&(B.Long?(n.filesize=B.Long.fromValue(e.filesize)).unsigned=!0:typeof e.filesize=="string"?n.filesize=parseInt(e.filesize,10):typeof e.filesize=="number"?n.filesize=e.filesize:typeof e.filesize=="object"&&(n.filesize=new B.LongBits(e.filesize.low>>>0,e.filesize.high>>>0).toNumber(!0))),e.blocksizes){if(!Array.isArray(e.blocksizes))throw TypeError(".Data.blocksizes: array expected");n.blocksizes=[];for(var i=0;i<e.blocksizes.length;++i)B.Long?(n.blocksizes[i]=B.Long.fromValue(e.blocksizes[i])).unsigned=!0:typeof e.blocksizes[i]=="string"?n.blocksizes[i]=parseInt(e.blocksizes[i],10):typeof e.blocksizes[i]=="number"?n.blocksizes[i]=e.blocksizes[i]:typeof e.blocksizes[i]=="object"&&(n.blocksizes[i]=new B.LongBits(e.blocksizes[i].low>>>0,e.blocksizes[i].high>>>0).toNumber(!0))}if(e.hashType!=null&&(B.Long?(n.hashType=B.Long.fromValue(e.hashType)).unsigned=!0:typeof e.hashType=="string"?n.hashType=parseInt(e.hashType,10):typeof e.hashType=="number"?n.hashType=e.hashType:typeof e.hashType=="object"&&(n.hashType=new B.LongBits(e.hashType.low>>>0,e.hashType.high>>>0).toNumber(!0))),e.fanout!=null&&(B.Long?(n.fanout=B.Long.fromValue(e.fanout)).unsigned=!0:typeof e.fanout=="string"?n.fanout=parseInt(e.fanout,10):typeof e.fanout=="number"?n.fanout=e.fanout:typeof e.fanout=="object"&&(n.fanout=new B.LongBits(e.fanout.low>>>0,e.fanout.high>>>0).toNumber(!0))),e.mode!=null&&(n.mode=e.mode>>>0),e.mtime!=null){if(typeof e.mtime!="object")throw TypeError(".Data.mtime: object expected");n.mtime=j.UnixTime.fromObject(e.mtime)}return n},r.toObject=function(e,n){n||(n={});var i={};if((n.arrays||n.defaults)&&(i.blocksizes=[]),n.defaults){if(i.Type=n.enums===String?"Raw":0,n.bytes===String?i.Data="":(i.Data=[],n.bytes!==Array&&(i.Data=B.newBuffer(i.Data))),B.Long){var o=new B.Long(0,0,!0);i.filesize=n.longs===String?o.toString():n.longs===Number?o.toNumber():o}else i.filesize=n.longs===String?"0":0;if(B.Long){var o=new B.Long(0,0,!0);i.hashType=n.longs===String?o.toString():n.longs===Number?o.toNumber():o}else i.hashType=n.longs===String?"0":0;if(B.Long){var o=new B.Long(0,0,!0);i.fanout=n.longs===String?o.toString():n.longs===Number?o.toNumber():o}else i.fanout=n.longs===String?"0":0;i.mode=0,i.mtime=null}if(e.Type!=null&&e.hasOwnProperty("Type")&&(i.Type=n.enums===String?j.Data.DataType[e.Type]:e.Type),e.Data!=null&&e.hasOwnProperty("Data")&&(i.Data=n.bytes===String?B.base64.encode(e.Data,0,e.Data.length):n.bytes===Array?Array.prototype.slice.call(e.Data):e.Data),e.filesize!=null&&e.hasOwnProperty("filesize")&&(typeof e.filesize=="number"?i.filesize=n.longs===String?String(e.filesize):e.filesize:i.filesize=n.longs===String?B.Long.prototype.toString.call(e.filesize):n.longs===Number?new B.LongBits(e.filesize.low>>>0,e.filesize.high>>>0).toNumber(!0):e.filesize),e.blocksizes&&e.blocksizes.length){i.blocksizes=[];for(var s=0;s<e.blocksizes.length;++s)typeof e.blocksizes[s]=="number"?i.blocksizes[s]=n.longs===String?String(e.blocksizes[s]):e.blocksizes[s]:i.blocksizes[s]=n.longs===String?B.Long.prototype.toString.call(e.blocksizes[s]):n.longs===Number?new B.LongBits(e.blocksizes[s].low>>>0,e.blocksizes[s].high>>>0).toNumber(!0):e.blocksizes[s]}return e.hashType!=null&&e.hasOwnProperty("hashType")&&(typeof e.hashType=="number"?i.hashType=n.longs===String?String(e.hashType):e.hashType:i.hashType=n.longs===String?B.Long.prototype.toString.call(e.hashType):n.longs===Number?new B.LongBits(e.hashType.low>>>0,e.hashType.high>>>0).toNumber(!0):e.hashType),e.fanout!=null&&e.hasOwnProperty("fanout")&&(typeof e.fanout=="number"?i.fanout=n.longs===String?String(e.fanout):e.fanout:i.fanout=n.longs===String?B.Long.prototype.toString.call(e.fanout):n.longs===Number?new B.LongBits(e.fanout.low>>>0,e.fanout.high>>>0).toNumber(!0):e.fanout),e.mode!=null&&e.hasOwnProperty("mode")&&(i.mode=e.mode),e.mtime!=null&&e.hasOwnProperty("mtime")&&(i.mtime=j.UnixTime.toObject(e.mtime,n)),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,ut.default.util.toJSONOptions)},r.DataType=function(){let t={},e=Object.create(t);return e[t[0]="Raw"]=0,e[t[1]="Directory"]=1,e[t[2]="File"]=2,e[t[3]="Metadata"]=3,e[t[4]="Symlink"]=4,e[t[5]="HAMTShard"]=5,e}(),r})(),m0=j.UnixTime=(()=>{function r(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)t[e[n]]!=null&&(this[e[n]]=t[e[n]])}return r.prototype.Seconds=B.Long?B.Long.fromBits(0,0,!1):0,r.prototype.FractionalNanoseconds=0,r.encode=function(e,n){return n||(n=er.create()),n.uint32(8).int64(e.Seconds),e.FractionalNanoseconds!=null&&Object.hasOwnProperty.call(e,"FractionalNanoseconds")&&n.uint32(21).fixed32(e.FractionalNanoseconds),n},r.decode=function(e,n){e instanceof Ut||(e=Ut.create(e));for(var i=n===void 0?e.len:e.pos+n,o=new j.UnixTime;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.Seconds=e.int64();break;case 2:o.FractionalNanoseconds=e.fixed32();break;default:e.skipType(s&7);break}}if(!o.hasOwnProperty("Seconds"))throw B.ProtocolError("missing required 'Seconds'",{instance:o});return o},r.fromObject=function(e){if(e instanceof j.UnixTime)return e;var n=new j.UnixTime;return e.Seconds!=null&&(B.Long?(n.Seconds=B.Long.fromValue(e.Seconds)).unsigned=!1:typeof e.Seconds=="string"?n.Seconds=parseInt(e.Seconds,10):typeof e.Seconds=="number"?n.Seconds=e.Seconds:typeof e.Seconds=="object"&&(n.Seconds=new B.LongBits(e.Seconds.low>>>0,e.Seconds.high>>>0).toNumber())),e.FractionalNanoseconds!=null&&(n.FractionalNanoseconds=e.FractionalNanoseconds>>>0),n},r.toObject=function(e,n){n||(n={});var i={};if(n.defaults){if(B.Long){var o=new B.Long(0,0,!1);i.Seconds=n.longs===String?o.toString():n.longs===Number?o.toNumber():o}else i.Seconds=n.longs===String?"0":0;i.FractionalNanoseconds=0}return e.Seconds!=null&&e.hasOwnProperty("Seconds")&&(typeof e.Seconds=="number"?i.Seconds=n.longs===String?String(e.Seconds):e.Seconds:i.Seconds=n.longs===String?B.Long.prototype.toString.call(e.Seconds):n.longs===Number?new B.LongBits(e.Seconds.low>>>0,e.Seconds.high>>>0).toNumber():e.Seconds),e.FractionalNanoseconds!=null&&e.hasOwnProperty("FractionalNanoseconds")&&(i.FractionalNanoseconds=e.FractionalNanoseconds),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,ut.default.util.toJSONOptions)},r})(),g0=j.Metadata=(()=>{function r(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)t[e[n]]!=null&&(this[e[n]]=t[e[n]])}return r.prototype.MimeType="",r.encode=function(e,n){return n||(n=er.create()),e.MimeType!=null&&Object.hasOwnProperty.call(e,"MimeType")&&n.uint32(10).string(e.MimeType),n},r.decode=function(e,n){e instanceof Ut||(e=Ut.create(e));for(var i=n===void 0?e.len:e.pos+n,o=new j.Metadata;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.MimeType=e.string();break;default:e.skipType(s&7);break}}return o},r.fromObject=function(e){if(e instanceof j.Metadata)return e;var n=new j.Metadata;return e.MimeType!=null&&(n.MimeType=String(e.MimeType)),n},r.toObject=function(e,n){n||(n={});var i={};return n.defaults&&(i.MimeType=""),e.MimeType!=null&&e.hasOwnProperty("MimeType")&&(i.MimeType=e.MimeType),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,ut.default.util.toJSONOptions)},r})();var ct=mi,gi=["raw","directory","file","metadata","symlink","hamt-sharded-directory"],w1=["directory","hamt-sharded-directory"],Di=parseInt("0644",8),wi=parseInt("0755",8);function rr(r){if(r!=null)return typeof r=="number"?r&4095:(r=r.toString(),r.substring(0,1)==="0"?parseInt(r,8)&4095:parseInt(r,10)&4095)}function bi(r){if(r==null)return;let t;if(r.secs!=null&&(t={secs:r.secs,nsecs:r.nsecs}),r.Seconds!=null&&(t={secs:r.Seconds,nsecs:r.FractionalNanoseconds}),Array.isArray(r)&&(t={secs:r[0],nsecs:r[1]}),r instanceof Date){let e=r.getTime(),n=Math.floor(e/1e3);t={secs:n,nsecs:(e-n*1e3)*1e3}}if(!!Object.prototype.hasOwnProperty.call(t,"secs")){if(t!=null&&t.nsecs!=null&&(t.nsecs<0||t.nsecs>999999999))throw(0,ye.default)(new Error("mtime-nsecs must be within the range [0,999999999]"),"ERR_INVALID_MTIME_NSECS");return t}}var H=class{static unmarshal(t){let e=ct.decode(t),n=ct.toObject(e,{defaults:!1,arrays:!0,longs:Number,objects:!1}),i=new H({type:gi[n.Type],data:n.Data,blockSizes:n.blocksizes,mode:n.mode,mtime:n.mtime?{secs:n.mtime.Seconds,nsecs:n.mtime.FractionalNanoseconds}:void 0});return i._originalMode=n.mode||0,i}constructor(t={type:"file"}){let{type:e,data:n,blockSizes:i,hashType:o,fanout:s,mtime:u,mode:a}=t;if(e&&!gi.includes(e))throw(0,ye.default)(new Error("Type: "+e+" is not valid"),"ERR_INVALID_TYPE");this.type=e||"file",this.data=n,this.hashType=o,this.fanout=s,this.blockSizes=i||[],this._originalMode=0,this.mode=rr(a),u&&(this.mtime=bi(u),this.mtime&&!this.mtime.nsecs&&(this.mtime.nsecs=0))}set mode(t){this._mode=this.isDirectory()?wi:Di;let e=rr(t);e!==void 0&&(this._mode=e)}get mode(){return this._mode}isDirectory(){return Boolean(this.type&&w1.includes(this.type))}addBlockSize(t){this.blockSizes.push(t)}removeBlockSize(t){this.blockSizes.splice(t,1)}fileSize(){if(this.isDirectory())return 0;let t=0;return this.blockSizes.forEach(e=>{t+=e}),this.data&&(t+=this.data.length),t}marshal(){let t;switch(this.type){case"raw":t=ct.DataType.Raw;break;case"directory":t=ct.DataType.Directory;break;case"file":t=ct.DataType.File;break;case"metadata":t=ct.DataType.Metadata;break;case"symlink":t=ct.DataType.Symlink;break;case"hamt-sharded-directory":t=ct.DataType.HAMTShard;break;default:throw(0,ye.default)(new Error("Type: "+t+" is not valid"),"ERR_INVALID_TYPE")}let e=this.data;(!this.data||!this.data.length)&&(e=void 0);let n;this.mode!=null&&(n=this._originalMode&4294963200|(rr(this.mode)||0),n===Di&&!this.isDirectory()&&(n=void 0),n===wi&&this.isDirectory()&&(n=void 0));let i;if(this.mtime!=null){let s=bi(this.mtime);s&&(i={Seconds:s.secs,FractionalNanoseconds:s.nsecs},i.FractionalNanoseconds===0&&delete i.FractionalNanoseconds)}let o={Type:t,Data:e,filesize:this.isDirectory()?void 0:this.fileSize(),blocksizes:this.blockSizes,hashType:this.hashType,fanout:this.fanout,mode:n,mtime:i};return ct.encode(o).finish()}};var yt={};V(yt,{code:()=>k1,createLink:()=>Ti,createNode:()=>Ii,decode:()=>L1,encode:()=>Z,name:()=>T1,prepare:()=>J,validate:()=>or});var b1=new TextDecoder;function nr(r,t){let e=0;for(let n=0;;n+=7){if(n>=64)throw new Error("protobuf: varint overflow");if(t>=r.length)throw new Error("protobuf: unexpected end of data");let i=r[t++];if(e+=n<28?(i&127)<<n:(i&127)*2**n,i<128)break}return[e,t]}function me(r,t){let e;[e,t]=nr(r,t);let n=t+e;if(e<0||n<0)throw new Error("protobuf: invalid length");if(n>r.length)throw new Error("protobuf: unexpected end of data");return[r.subarray(t,n),n]}function _i(r,t){let e;return[e,t]=nr(r,t),[e&7,e>>3,t]}function _1(r){let t={},e=r.length,n=0;for(;n<e;){let i,o;if([i,o,n]=_i(r,n),o===1){if(t.Hash)throw new Error("protobuf: (PBLink) duplicate Hash section");if(i!==2)throw new Error(`protobuf: (PBLink) wrong wireType (${i}) for Hash`);if(t.Name!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Name before Hash");if(t.Tsize!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Tsize before Hash");[t.Hash,n]=me(r,n)}else if(o===2){if(t.Name!==void 0)throw new Error("protobuf: (PBLink) duplicate Name section");if(i!==2)throw new Error(`protobuf: (PBLink) wrong wireType (${i}) for Name`);if(t.Tsize!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Tsize before Name");let s;[s,n]=me(r,n),t.Name=b1.decode(s)}else if(o===3){if(t.Tsize!==void 0)throw new Error("protobuf: (PBLink) duplicate Tsize section");if(i!==0)throw new Error(`protobuf: (PBLink) wrong wireType (${i}) for Tsize`);[t.Tsize,n]=nr(r,n)}else throw new Error(`protobuf: (PBLink) invalid fieldNumber, expected 1, 2 or 3, got ${o}`)}if(n>e)throw new Error("protobuf: (PBLink) unexpected end of data");return t}function Ei(r){let t=r.length,e=0,n,i=!1,o;for(;e<t;){let u,a;if([u,a,e]=_i(r,e),u!==2)throw new Error(`protobuf: (PBNode) invalid wireType, expected 2, got ${u}`);if(a===1){if(o)throw new Error("protobuf: (PBNode) duplicate Data section");[o,e]=me(r,e),n&&(i=!0)}else if(a===2){if(i)throw new Error("protobuf: (PBNode) duplicate Links section");n||(n=[]);let h;[h,e]=me(r,e),n.push(_1(h))}else throw new Error(`protobuf: (PBNode) invalid fieldNumber, expected 1 or 2, got ${a}`)}if(e>t)throw new Error("protobuf: (PBNode) unexpected end of data");let s={};return o&&(s.Data=o),s.Links=n||[],s}var Ai=new TextEncoder,xi=2**32,E1=2**31;function x1(r,t){let e=t.length;if(typeof r.Tsize=="number"){if(r.Tsize<0)throw new Error("Tsize cannot be negative");if(!Number.isSafeInteger(r.Tsize))throw new Error("Tsize too large for encoding");e=Kt(t,e,r.Tsize)-1,t[e]=24}if(typeof r.Name=="string"){let n=Ai.encode(r.Name);e-=n.length,t.set(n,e),e=Kt(t,e,n.length)-1,t[e]=18}return r.Hash&&(e-=r.Hash.length,t.set(r.Hash,e),e=Kt(t,e,r.Hash.length)-1,t[e]=10),t.length-e}function Bi(r){let t=B1(r),e=new Uint8Array(t),n=t;if(r.Data&&(n-=r.Data.length,e.set(r.Data,n),n=Kt(e,n,r.Data.length)-1,e[n]=10),r.Links)for(let i=r.Links.length-1;i>=0;i--){let o=x1(r.Links[i],e.subarray(0,n));n-=o,n=Kt(e,n,o)-1,e[n]=18}return e}function A1(r){let t=0;if(r.Hash){let e=r.Hash.length;t+=1+e+Ot(e)}if(typeof r.Name=="string"){let e=Ai.encode(r.Name).length;t+=1+e+Ot(e)}return typeof r.Tsize=="number"&&(t+=1+Ot(r.Tsize)),t}function B1(r){let t=0;if(r.Data){let e=r.Data.length;t+=1+e+Ot(e)}if(r.Links)for(let e of r.Links){let n=A1(e);t+=1+n+Ot(n)}return t}function Kt(r,t,e){t-=Ot(e);let n=t;for(;e>=E1;)r[t++]=e&127|128,e/=128;for(;e>=128;)r[t++]=e&127|128,e>>>=7;return r[t]=e,n}function Ot(r){return r%2===0&&r++,Math.floor((F1(r)+6)/7)}function F1(r){let t=0;return r>=xi&&(r=Math.floor(r/xi),t=32),r>=1<<16&&(r>>>=16,t+=16),r>=1<<8&&(r>>>=8,t+=8),t+S1[r]}var S1=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8];var C1=["Data","Links"],I1=["Hash","Name","Tsize"],ir=new TextEncoder;function Si(r,t){if(r===t)return 0;let e=r.Name?ir.encode(r.Name):[],n=t.Name?ir.encode(t.Name):[],i=e.length,o=n.length;for(let s=0,u=Math.min(i,o);s<u;++s)if(e[s]!==n[s]){i=e[s],o=n[s];break}return i<o?-1:o<i?1:0}function Fi(r,t){return!Object.keys(r).some(e=>!t.includes(e))}function Ci(r){if(typeof r.asCID=="object"){let e=L.asCID(r);if(!e)throw new TypeError("Invalid DAG-PB form");return{Hash:e}}if(typeof r!="object"||Array.isArray(r))throw new TypeError("Invalid DAG-PB form");let t={};if(r.Hash){let e=L.asCID(r.Hash);try{e||(typeof r.Hash=="string"?e=L.parse(r.Hash):r.Hash instanceof Uint8Array&&(e=L.decode(r.Hash)))}catch(n){throw new TypeError(`Invalid DAG-PB form: ${n.message}`)}e&&(t.Hash=e)}if(!t.Hash)throw new TypeError("Invalid DAG-PB form");return typeof r.Name=="string"&&(t.Name=r.Name),typeof r.Tsize=="number"&&(t.Tsize=r.Tsize),t}function J(r){if((r instanceof Uint8Array||typeof r=="string")&&(r={Data:r}),typeof r!="object"||Array.isArray(r))throw new TypeError("Invalid DAG-PB form");let t={};if(r.Data!==void 0)if(typeof r.Data=="string")t.Data=ir.encode(r.Data);else if(r.Data instanceof Uint8Array)t.Data=r.Data;else throw new TypeError("Invalid DAG-PB form");if(r.Links!==void 0)if(Array.isArray(r.Links))t.Links=r.Links.map(Ci),t.Links.sort(Si);else throw new TypeError("Invalid DAG-PB form");else t.Links=[];return t}function or(r){if(!r||typeof r!="object"||Array.isArray(r))throw new TypeError("Invalid DAG-PB form");if(!Fi(r,C1))throw new TypeError("Invalid DAG-PB form (extraneous properties)");if(r.Data!==void 0&&!(r.Data instanceof Uint8Array))throw new TypeError("Invalid DAG-PB form (Data must be a Uint8Array)");if(!Array.isArray(r.Links))throw new TypeError("Invalid DAG-PB form (Links must be an array)");for(let t=0;t<r.Links.length;t++){let e=r.Links[t];if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError("Invalid DAG-PB form (bad link object)");if(!Fi(e,I1))throw new TypeError("Invalid DAG-PB form (extraneous properties on link object)");if(!e.Hash)throw new TypeError("Invalid DAG-PB form (link must have a Hash)");if(e.Hash.asCID!==e.Hash)throw new TypeError("Invalid DAG-PB form (link Hash must be a CID)");if(e.Name!==void 0&&typeof e.Name!="string")throw new TypeError("Invalid DAG-PB form (link Name must be a string)");if(e.Tsize!==void 0&&(typeof e.Tsize!="number"||e.Tsize%1!==0))throw new TypeError("Invalid DAG-PB form (link Tsize must be an integer)");if(t>0&&Si(e,r.Links[t-1])===-1)throw new TypeError("Invalid DAG-PB form (links must be sorted by Name bytes)")}}function Ii(r,t=[]){return J({Data:r,Links:t})}function Ti(r,t,e){return Ci({Hash:e,Name:r,Tsize:t})}var T1="dag-pb",k1=112;function Z(r){or(r);let t={};return r.Links&&(t.Links=r.Links.map(e=>{let n={};return e.Hash&&(n.Hash=e.Hash.bytes),e.Name!==void 0&&(n.Name=e.Name),e.Tsize!==void 0&&(n.Tsize=e.Tsize),n})),r.Data&&(t.Data=r.Data),Bi(t)}function L1(r){let t=Ei(r),e={};return t.Data&&(e.Data=t.Data),t.Links&&(e.Links=t.Links.map(n=>{let i={};try{i.Hash=L.decode(n.Hash)}catch{}if(!i.Hash)throw new Error("Invalid Hash field found in link, expected CID");return n.Name!==void 0&&(i.Name=n.Name),n.Tsize!==void 0&&(i.Tsize=n.Tsize),i})),e}var N1=async(r,t,e)=>{e.codec||(e.codec=yt),e.hasher||(e.hasher=It),e.cidVersion===void 0&&(e.cidVersion=1),e.codec===yt&&e.hasher!==It&&(e.cidVersion=1);let n=await e.hasher.digest(r),i=L.create(e.cidVersion,e.codec.code,n);return e.onlyHash||await t.put(i,r,{signal:e.signal}),i},et=N1;var U1=async(r,t,e)=>{let n=new H({type:"directory",mtime:r.mtime,mode:r.mode}),i=Z(J({Data:n.marshal()})),o=await et(i,t,e),s=r.path;return{cid:o,path:s,unixfs:n,size:i.length}},ki=U1;var Vi=M(Lt(),1);var Hi=M(Se(),1);var Jt={};V(Jt,{code:()=>ge,decode:()=>v1,encode:()=>z1,name:()=>O1});var O1="raw",ge=85,z1=r=>Y(r),v1=r=>Y(r);var Ui=M(Ni(),1);async function R1(r,t){return t(await(0,Ui.default)(r))}var Oi=R1;var zi=M(ie(),1);function M1(r,t,e){return vi(r,t,e)}async function vi(r,t,e){let n=[];for await(let i of(0,zi.default)(r,e.maxChildrenPerNode))n.push(await t(i));return n.length>1?vi(n,t,e):n[0]}var Pi=M1;var Ri=M(ie(),1);async function j1(r,t,e){let n=new sr(e.layerRepeat),i=0,o=1,s=n;for await(let u of(0,Ri.default)(r,e.maxChildrenPerNode))s.isFull()&&(s!==n&&n.addChild(await s.reduce(t)),i&&i%e.layerRepeat===0&&o++,s=new De(o,e.layerRepeat,i),i++),s.append(u);return s&&s!==n&&n.addChild(await s.reduce(t)),n.reduce(t)}var Mi=j1,De=class{constructor(t,e,n=0){this.maxDepth=t,this.layerRepeat=e,this.currentDepth=1,this.iteration=n,this.root=this.node=this.parent={children:[],depth:this.currentDepth,maxDepth:t,maxChildren:(this.maxDepth-this.currentDepth)*this.layerRepeat}}isFull(){if(!this.root.data)return!1;if(this.currentDepth<this.maxDepth&&this.node.maxChildren)return this._addNextNodeToParent(this.node),!1;let t=this._findParent(this.node,this.currentDepth);return t?(this._addNextNodeToParent(t),!1):!0}_addNextNodeToParent(t){this.parent=t;let e={children:[],depth:t.depth+1,parent:t,maxDepth:this.maxDepth,maxChildren:Math.floor(t.children.length/this.layerRepeat)*this.layerRepeat};t.children.push(e),this.currentDepth=e.depth,this.node=e}append(t){this.node.data=t}reduce(t){return this._reduce(this.root,t)}async _reduce(t,e){let n=[];return t.children.length&&(n=await Promise.all(t.children.filter(i=>i.data).map(i=>this._reduce(i,e)))),e((t.data||[]).concat(n))}_findParent(t,e){let n=t.parent;if(!(!n||n.depth===0))return n.children.length===n.maxChildren||!n.maxChildren?this._findParent(n,e):n}},sr=class extends De{constructor(t){super(0,t),this.root.depth=0,this.currentDepth=1}addChild(t){this.root.children.push(t)}reduce(t){return t((this.root.data||[]).concat(this.root.children))}};async function*V1(r,t,e){for await(let n of r.content)yield async()=>{e.progress(n.length,r.path);let i,o={codec:yt,cidVersion:e.cidVersion,hasher:e.hasher,onlyHash:e.onlyHash};return e.rawLeaves?(o.codec=Jt,o.cidVersion=1):(i=new H({type:e.leafType,data:n}),n=Z({Data:i.marshal(),Links:[]})),{cid:await et(n,t,o),unixfs:i,size:n.length}}}var ji=V1;var H1={flat:Oi,balanced:Pi,trickle:Mi};async function*$1(r,t,e){let n=-1,i,o;typeof e.bufferImporter=="function"?o=e.bufferImporter:o=ji;for await(let s of(0,Hi.default)(o(r,t,e),e.blockWriteConcurrency)){if(n++,n===0){i=s;continue}else n===1&&i&&(yield i,i=null);yield s}i&&(i.single=!0,yield i)}var G1=(r,t,e)=>{async function n(i){if(i.length===1&&i[0].single&&e.reduceSingleLeafToSelf){let f=i[0];if(r.mtime!==void 0||r.mode!==void 0){let d=await t.get(f.cid);f.unixfs=new H({type:"file",mtime:r.mtime,mode:r.mode,data:d}),d=Z(J({Data:f.unixfs.marshal()})),f.cid=await et(d,t,{...e,codec:yt,hasher:e.hasher,cidVersion:e.cidVersion}),f.size=d.length}return{cid:f.cid,path:r.path,unixfs:f.unixfs,size:f.size}}let o=new H({type:"file",mtime:r.mtime,mode:r.mode}),s=i.filter(f=>f.cid.code===ge&&f.size||f.unixfs&&!f.unixfs.data&&f.unixfs.fileSize()?!0:Boolean(f.unixfs&&f.unixfs.data&&f.unixfs.data.length)).map(f=>f.cid.code===ge?(o.addBlockSize(f.size),{Name:"",Tsize:f.size,Hash:f.cid}):(!f.unixfs||!f.unixfs.data?o.addBlockSize(f.unixfs&&f.unixfs.fileSize()||0):o.addBlockSize(f.unixfs.data.length),{Name:"",Tsize:f.size,Hash:f.cid})),u={Data:o.marshal(),Links:s},a=Z(J(u));return{cid:await et(a,t,e),path:r.path,unixfs:o,size:a.length+u.Links.reduce((f,d)=>f+d.Tsize,0)}}return n};function q1(r,t,e){let n=H1[e.strategy];if(!n)throw(0,Vi.default)(new Error(`Unknown importer build strategy name: ${e.strategy}`),"ERR_BAD_STRATEGY");return n($1(r,t,e),G1(r,t,e),e)}var $i=q1;var Or=M(Lt(),1);var Co=M(gr(),1),Io=M(So(),1),Er=M(Lt(),1);async function*Ta(r,t){let e,n,i;if(t.minChunkSize&&t.maxChunkSize&&t.avgChunkSize)i=t.avgChunkSize,e=t.minChunkSize,n=t.maxChunkSize;else if(t.avgChunkSize)i=t.avgChunkSize,e=i/3,n=i+i/2;else throw(0,Er.default)(new Error("please specify an average chunk size"),"ERR_INVALID_AVG_CHUNK_SIZE");if(e<16)throw(0,Er.default)(new Error("rabin min must be greater than 16"),"ERR_INVALID_MIN_CHUNK_SIZE");n<e&&(n=e),i<e&&(i=e);let o=Math.floor(Math.log2(i));for await(let s of ka(r,{min:e,max:n,bits:o,window:t.window,polynomial:t.polynomial}))yield s}var To=Ta;async function*ka(r,t){let e=await(0,Io.create)(t.bits,t.min,t.max,t.window),n=new Co.default;for await(let i of r){n.append(i);let o=e.fingerprint(i);for(let s=0;s<o.length;s++){let u=o[s],a=n.slice(0,u);n.consume(u),yield a}}n.length&&(yield n.slice(0))}var Ee=M(gr(),1);async function*La(r,t){let e=new Ee.default,n=0,i=!1,o=t.maxChunkSize;for await(let s of r)for(e.append(s),n+=s.length;n>=o;)if(yield e.slice(0,o),i=!0,o===e.length)e=new Ee.default,n=0;else{let u=new Ee.default;u.append(e.shallowSlice(o)),e=u,n-=o}(!i||n)&&(yield e.slice(0,n))}var ko=La;var Ur=M(Lt(),1);var xr={};V(xr,{identity:()=>Na});var Na=Tt({prefix:"\0",name:"identity",encode:r=>ke(r),decode:r=>Te(r)});var Ar={};V(Ar,{base2:()=>Ua});var Ua=O({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Br={};V(Br,{base8:()=>Oa});var Oa=O({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Fr={};V(Fr,{base10:()=>za});var za=ht({prefix:"9",name:"base10",alphabet:"0123456789"});var Sr={};V(Sr,{base16:()=>va,base16upper:()=>Pa});var va=O({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Pa=O({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Cr={};V(Cr,{base36:()=>Ra,base36upper:()=>Ma});var Ra=ht({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Ma=ht({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Ir={};V(Ir,{base64:()=>ja,base64pad:()=>Va,base64url:()=>Ha,base64urlpad:()=>$a});var ja=O({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Va=O({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Ha=O({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),$a=O({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Tr={};V(Tr,{base256emoji:()=>Ka});var Lo=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Ga=Lo.reduce((r,t,e)=>(r[e]=t,r),[]),qa=Lo.reduce((r,t,e)=>(r[t.codePointAt(0)]=e,r),[]);function Wa(r){return r.reduce((t,e)=>(t+=Ga[e],t),"")}function Ya(r){let t=[];for(let e of r){let n=qa[e.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${e}`);t.push(n)}return new Uint8Array(t)}var Ka=Tt({prefix:"\u{1F680}",name:"base256emoji",encode:Wa,decode:Ya});var kr={};V(kr,{identity:()=>Xa});var No=0,Ja="identity",Uo=Y,Za=r=>Dt(No,Uo(r)),Xa={code:No,name:Ja,encode:Uo,digest:Za};var gc=new TextEncoder,Dc=new TextDecoder;var Lr={...xr,...Ar,...Br,...Fr,...Sr,...Me,...Cr,...Re,...Ir,...Tr},bc={...Ue,...kr};function xe(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(r):new Uint8Array(r)}function zo(r,t,e,n){return{name:r,prefix:t,encoder:{name:r,prefix:t,encode:e},decoder:{decode:n}}}var Oo=zo("utf8","u",r=>{let t=new TextDecoder("utf8");return"u"+t.decode(r)},r=>new TextEncoder().encode(r.substring(1))),Nr=zo("ascii","a",r=>{let t="a";for(let e=0;e<r.length;e++)t+=String.fromCharCode(r[e]);return t},r=>{r=r.substring(1);let t=xe(r.length);for(let e=0;e<r.length;e++)t[e]=r.charCodeAt(e);return t}),tu={utf8:Oo,"utf-8":Oo,hex:Lr.base16,latin1:Nr,ascii:Nr,binary:Nr,...Lr},vo=tu;function Ae(r,t="utf8"){let e=vo[t];if(!e)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r,"utf8"):e.decoder.decode(`${e.prefix}${r}`)}async function*eu(r){for await(let t of r){if(t.length===void 0)throw(0,Ur.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT");if(typeof t=="string"||t instanceof String)yield Ae(t.toString());else if(Array.isArray(t))yield Uint8Array.from(t);else if(t instanceof Uint8Array)yield t;else throw(0,Ur.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}}var Po=eu;function ru(r){return Symbol.iterator in r}function nu(r){return Symbol.asyncIterator in r}function iu(r){try{if(r instanceof Uint8Array)return async function*(){yield r}();if(ru(r))return async function*(){yield*r}();if(nu(r))return r}catch{throw(0,Or.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}throw(0,Or.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}async function*ou(r,t,e){for await(let n of r)if(n.path&&(n.path.substring(0,2)==="./"&&(e.wrapWithDirectory=!0),n.path=n.path.split("/").filter(i=>i&&i!==".").join("/")),n.content){let i;typeof e.chunker=="function"?i=e.chunker:e.chunker==="rabin"?i=To:i=ko;let o;typeof e.chunkValidator=="function"?o=e.chunkValidator:o=Po;let s={path:n.path,mtime:n.mtime,mode:n.mode,content:i(o(iu(n.content),e),e)};yield()=>$i(s,t,e)}else if(n.path){let i={path:n.path,mtime:n.mtime,mode:n.mode};yield()=>ki(i,t,e)}else throw new Error("Import candidate must have content or path or both")}var Ro=ou;var zr=class{constructor(t,e){this.options=e||{},this.root=t.root,this.dir=t.dir,this.path=t.path,this.dirty=t.dirty,this.flat=t.flat,this.parent=t.parent,this.parentKey=t.parentKey,this.unixfs=t.unixfs,this.mode=t.mode,this.mtime=t.mtime,this.cid=void 0,this.size=void 0}async put(t,e){}get(t){return Promise.resolve(this)}async*eachChildSeries(){}async*flush(t){}},gt=zr;var vr=class extends gt{constructor(t,e){super(t,e),this._children={}}async put(t,e){this.cid=void 0,this.size=void 0,this._children[t]=e}get(t){return Promise.resolve(this._children[t])}childCount(){return Object.keys(this._children).length}directChildrenCount(){return this.childCount()}onlyChild(){return this._children[Object.keys(this._children)[0]]}async*eachChildSeries(){let t=Object.keys(this._children);for(let e=0;e<t.length;e++){let n=t[e];yield{key:n,child:this._children[n]}}}async*flush(t){let e=Object.keys(this._children),n=[];for(let h=0;h<e.length;h++){let f=this._children[e[h]];if(f instanceof gt)for await(let d of f.flush(t))f=d,yield f;f.size!=null&&f.cid&&n.push({Name:e[h],Tsize:f.size,Hash:f.cid})}let i=new H({type:"directory",mtime:this.mtime,mode:this.mode}),o={Data:i.marshal(),Links:n},s=Z(J(o)),u=await et(s,t,this.options),a=s.length+o.Links.reduce((h,f)=>h+(f.Tsize==null?0:f.Tsize),0);this.cid=u,this.size=a,yield{cid:u,unixfs:i,path:this.path,size:a}}},ee=vr;var Ho=M(Vo(),1);var $=class{constructor(t,e,n=0){this._options=t,this._popCount=0,this._parent=e,this._posAtParent=n,this._children=new Ho.default,this.key=null}async put(t,e){let n=await this._findNewBucketAndPos(t);await n.bucket._putAt(n,t,e)}async get(t){let e=await this._findChild(t);if(e!=null)return e.value}async del(t){let e=await this._findPlace(t),n=e.bucket._at(e.pos);n!=null&&n.key===t&&e.bucket._delAt(e.pos)}leafCount(){return this._children.compactArray().reduce((e,n)=>n instanceof $?e+n.leafCount():e+1,0)}childrenCount(){return this._children.length}onlyChild(){return this._children.get(0)}*eachLeafSeries(){let t=this._children.compactArray();for(let e of t)e instanceof $?yield*e.eachLeafSeries():yield e}serialize(t,e){let n=[];return e(this._children.reduce((i,o,s)=>(o!=null&&(o instanceof $?i.push(o.serialize(t,e)):i.push(t(o,s))),i),n))}async asyncTransform(t,e){return await $o(this,t,e)}toJSON(){return this.serialize(fu,hu)}prettyPrint(){return JSON.stringify(this.toJSON(),null," ")}tableSize(){return Math.pow(2,this._options.bits)}async _findChild(t){let e=await this._findPlace(t),n=e.bucket._at(e.pos);if(!(n instanceof $)&&n!=null&&n.key===t)return n}async _findPlace(t){let e=this._options.hash(typeof t=="string"?Ae(t):t),n=await e.take(this._options.bits),i=this._children.get(n);return i instanceof $?await i._findPlace(e):{bucket:this,pos:n,hash:e,existingChild:i}}async _findNewBucketAndPos(t){let e=await this._findPlace(t);if(e.existingChild!=null&&e.existingChild.key!==t){let n=new $(this._options,e.bucket,e.pos);e.bucket._putObjectAt(e.pos,n);let i=await n._findPlace(e.existingChild.hash);return i.bucket._putAt(i,e.existingChild.key,e.existingChild.value),await n._findNewBucketAndPos(e.hash)}return e}_putAt(t,e,n){this._putObjectAt(t.pos,{key:e,value:n,hash:t.hash})}_putObjectAt(t,e){this._children.get(t)==null&&this._popCount++,this._children.set(t,e)}_delAt(t){if(t===-1)throw new Error("Invalid position");this._children.get(t)!=null&&this._popCount--,this._children.unset(t),this._level()}_level(){if(this._parent!=null&&this._popCount<=1)if(this._popCount===1){let t=this._children.find(cu);if(t!=null&&!(t instanceof $)){let e=t.hash;e.untake(this._options.bits);let n={pos:this._posAtParent,hash:e,bucket:this._parent};this._parent._putAt(n,t.key,t.value)}}else this._parent._delAt(this._posAtParent)}_at(t){return this._children.get(t)}};function cu(r){return Boolean(r)}function fu(r,t){return r.key}function hu(r){return r}async function $o(r,t,e){let n=[];for(let i of r._children.compactArray())if(i instanceof $)await $o(i,t,e);else{let o=await t(i);n.push({bitField:r._children.bitField(),children:o})}return await e(n)}var lu=[255,254,252,248,240,224,192,128],pu=[1,3,7,15,31,63,127,255],Be=class{constructor(t){this._value=t,this._currentBytePos=t.length-1,this._currentBitPos=7}availableBits(){return this._currentBitPos+1+this._currentBytePos*8}totalBits(){return this._value.length*8}take(t){let e=t,n=0;for(;e>0&&this._haveBits();){let i=this._value[this._currentBytePos],o=this._currentBitPos+1,s=Math.min(o,e),u=du(i,o-s,s);n=(n<<s)+u,e-=s,this._currentBitPos-=s,this._currentBitPos<0&&(this._currentBitPos=7,this._currentBytePos--)}return n}untake(t){for(this._currentBitPos+=t;this._currentBitPos>7;)this._currentBitPos-=8,this._currentBytePos+=1}_haveBits(){return this._currentBytePos>=0}};function du(r,t,e){let n=yu(t,e);return(r&n)>>>t}function yu(r,t){return lu[r]&pu[Math.min(t+r-1,7)]}function Go(r,t){t||(t=r.reduce((i,o)=>i+o.length,0));let e=xe(t),n=0;for(let i of r)e.set(i,n),n+=i.length;return e}function qo(r){function t(e){return e instanceof Fe?e:new Fe(e,r)}return t}var Fe=class{constructor(t,e){if(!(t instanceof Uint8Array))throw new Error("can only hash Uint8Arrays");this._value=t,this._hashFn=e,this._depth=-1,this._availableBits=0,this._currentBufferIndex=0,this._buffers=[]}async take(t){let e=t;for(;this._availableBits<e;)await this._produceMoreBits();let n=0;for(;e>0;){let i=this._buffers[this._currentBufferIndex],o=Math.min(i.availableBits(),e),s=i.take(o);n=(n<<o)+s,e-=o,this._availableBits-=o,i.availableBits()===0&&this._currentBufferIndex++}return n}untake(t){let e=t;for(;e>0;){let n=this._buffers[this._currentBufferIndex],i=Math.min(n.totalBits()-n.availableBits(),e);n.untake(i),e-=i,this._availableBits+=i,this._currentBufferIndex>0&&n.totalBits()===n.availableBits()&&(this._depth--,this._currentBufferIndex--)}}async _produceMoreBits(){this._depth++;let t=this._depth>0?Go([this._value,Uint8Array.from([this._depth])]):this._value,e=await this._hashFn(t),n=new Be(e);this._buffers.push(n),this._availableBits+=n.availableBits()}};function Wo(r){if(r==null||r.hashFn==null)throw new Error("please define an options.hashFn");let t={bits:r.bits??8,hash:qo(r.hashFn)};return new $(t)}var Pr=class extends gt{constructor(t,e){super(t,e),this._bucket=Wo({hashFn:e.hamtHashFn,bits:e.hamtBucketBits})}async put(t,e){await this._bucket.put(t,e)}get(t){return this._bucket.get(t)}childCount(){return this._bucket.leafCount()}directChildrenCount(){return this._bucket.childrenCount()}onlyChild(){return this._bucket.onlyChild()}async*eachChildSeries(){for await(let{key:t,value:e}of this._bucket.eachLeafSeries())yield{key:t,child:e}}async*flush(t){for await(let e of Ko(this._bucket,t,this,this.options))yield{...e,path:this.path}}},Yo=Pr;async function*Ko(r,t,e,n){let i=r._children,o=[],s=0;for(let c=0;c<i.length;c++){let p=i.get(c);if(!p)continue;let g=c.toString(16).toUpperCase().padStart(2,"0");if(p instanceof $){let k;for await(let m of await Ko(p,t,null,n))k=m;if(!k)throw new Error("Could not flush sharded directory, no subshard found");o.push({Name:g,Tsize:k.size,Hash:k.cid}),s+=k.size}else if(typeof p.value.flush=="function"){let k=p.value,m;for await(let b of k.flush(t))m=b,yield m;let D=g+p.key;o.push({Name:D,Tsize:m.size,Hash:m.cid}),s+=m.size}else{let k=p.value;if(!k.cid)continue;let m=g+p.key,D=k.size;o.push({Name:m,Tsize:D,Hash:k.cid}),s+=D}}let u=Uint8Array.from(i.bitField().reverse()),a=new H({type:"hamt-sharded-directory",data:u,fanout:r.tableSize(),hashType:n.hamtHashCode,mtime:e&&e.mtime,mode:e&&e.mode}),h={Data:a.marshal(),Links:o},f=Z(J(h)),d=await et(f,t,n),A=f.length+s;yield{cid:d,unixfs:a,size:A}}async function Jo(r,t,e,n){let i=t;t instanceof ee&&t.directChildrenCount()>=e&&(i=await mu(t,n));let o=i.parent;if(o){if(i!==t){if(r&&(r.parent=i),!i.parentKey)throw new Error("No parent key found");await o.put(i.parentKey,i)}return Jo(i,o,e,n)}return i}async function mu(r,t){let e=new Yo({root:r.root,dir:!0,parent:r.parent,parentKey:r.parentKey,path:r.path,dirty:r.dirty,flat:!1,mtime:r.mtime,mode:r.mode},t);for await(let{key:n,child:i}of r.eachChildSeries())await e.put(n,i);return e}var Zo=Jo;var gu=(r="")=>(r.trim().match(/([^\\/]|\\\/)+/g)||[]).filter(Boolean),Xo=gu;async function Du(r,t,e){let n=Xo(r.path||""),i=n.length-1,o=t,s="";for(let u=0;u<n.length;u++){let a=n[u];s+=`${s?"/":""}${a}`;let h=u===i;if(o.dirty=!0,o.cid=void 0,o.size=void 0,h)await o.put(a,r),t=await Zo(null,o,e.shardSplitThreshold,e);else{let f=await o.get(a);(!f||!(f instanceof gt))&&(f=new ee({root:!1,dir:!0,parent:o,parentKey:a,path:s,dirty:!0,flat:!0,mtime:f&&f.unixfs&&f.unixfs.mtime,mode:f&&f.unixfs&&f.unixfs.mode},e)),await o.put(a,f),o=f}}return t}async function*Qo(r,t){if(!(r instanceof gt)){r&&r.unixfs&&r.unixfs.isDirectory()&&(yield r);return}yield*r.flush(t)}async function*wu(r,t,e){let n=new ee({root:!0,dir:!0,path:"",dirty:!0,flat:!0},e);for await(let i of r)!i||(n=await Du(i,n,e),(!i.unixfs||!i.unixfs.isDirectory())&&(yield i));if(e.wrapWithDirectory)yield*Qo(n,t);else for await(let i of n.eachChildSeries())!i||(yield*Qo(i.child,t))}var ts=wu;async function*bu(r,t,e={}){let n=mn(e),i;typeof e.dagBuilder=="function"?i=e.dagBuilder:i=Ro;let o;typeof e.treeBuilder=="function"?o=e.treeBuilder:o=ts;let s;Symbol.asyncIterator in r||Symbol.iterator in r?s=r:s=[r];for await(let u of o((0,es.default)(i(s,t,n),n.fileImportConcurrency),t,n))yield{cid:u.cid,path:u.path,unixfs:u.unixfs,size:u.size}}return as(_u);})();
17
+ /*!
18
+ * The buffer module from node.js, for the browser.
19
+ *
20
+ * @author Feross Aboukhadijeh <https://feross.org>
21
+ * @license MIT
22
+ */
23
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
24
+ return IpfsUnixfsImporter}));
@@ -6,5 +6,5 @@ export type BufferImporter = import('../../types').BufferImporter;
6
6
  /**
7
7
  * @type {BufferImporter}
8
8
  */
9
- declare function bufferImporter(file: import("../../types").File, block: import("interface-blockstore/dist/src/types").Blockstore, options: import("../../types").ImporterOptions): AsyncIterable<() => Promise<import("../../types").InProgressImportResult>>;
9
+ declare function bufferImporter(file: import("../../types").File, block: import("interface-blockstore").Blockstore, options: import("../../types").ImporterOptions): AsyncIterable<() => Promise<import("../../types").InProgressImportResult>>;
10
10
  //# sourceMappingURL=buffer-importer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"buffer-importer.d.ts","sourceRoot":"","sources":["../../../../src/dag-builder/file/buffer-importer.js"],"names":[],"mappings":";6BAMa,OAAO,aAAa,EAAE,cAAc;AADjD;;GAEG;AAEH;;GAEG;AACH,+PAoCC"}
1
+ {"version":3,"file":"buffer-importer.d.ts","sourceRoot":"","sources":["../../../../src/dag-builder/file/buffer-importer.js"],"names":[],"mappings":";6BAMa,OAAO,aAAa,EAAE,cAAc;AADjD;;GAEG;AAEH;;GAEG;AACH,gPAoCC"}
@@ -8,5 +8,5 @@ export type FileDAGBuilder = import('../../types').FileDAGBuilder;
8
8
  /**
9
9
  * @type {import('../../types').UnixFSV1DagBuilder<File>}
10
10
  */
11
- declare function fileBuilder(file: import("../../types").File, block: import("interface-blockstore/dist/src/types").Blockstore, options: import("../../types").ImporterOptions): Promise<import("../../types").InProgressImportResult>;
11
+ declare function fileBuilder(file: import("../../types").File, block: import("interface-blockstore").Blockstore, options: import("../../types").ImporterOptions): Promise<import("../../types").InProgressImportResult>;
12
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/dag-builder/file/index.js"],"names":[],"mappings":";yBAca,OAAO,sBAAsB,EAAE,UAAU;mBACzC,OAAO,aAAa,EAAE,IAAI;8BAC1B,OAAO,aAAa,EAAE,eAAe;sBACrC,OAAO,aAAa,EAAE,OAAO;yBAC7B,OAAO,aAAa,EAAE,UAAU;6BAChC,OAAO,aAAa,EAAE,cAAc;AA+KjD;;GAEG;AACH,uOAQC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/dag-builder/file/index.js"],"names":[],"mappings":";yBAca,OAAO,sBAAsB,EAAE,UAAU;mBACzC,OAAO,aAAa,EAAE,IAAI;8BAC1B,OAAO,aAAa,EAAE,eAAe;sBACrC,OAAO,aAAa,EAAE,OAAO;yBAC7B,OAAO,aAAa,EAAE,UAAU;6BAChC,OAAO,aAAa,EAAE,cAAc;AA+KjD;;GAEG;AACH,wNAQC"}
@@ -7,5 +7,5 @@ export type ChunkValidator = import('../types').ChunkValidator;
7
7
  /**
8
8
  * @type {DAGBuilder}
9
9
  */
10
- declare function dagBuilder(source: AsyncIterable<import("../types").ImportCandidate> | Iterable<import("../types").ImportCandidate>, blockstore: import("interface-blockstore/dist/src/types").Blockstore, options: import("../types").ImporterOptions): AsyncIterable<() => Promise<import("../types").InProgressImportResult>>;
10
+ declare function dagBuilder(source: AsyncIterable<import("../types").ImportCandidate> | Iterable<import("../types").ImportCandidate>, blockstore: import("interface-blockstore").Blockstore, options: import("../types").ImporterOptions): AsyncIterable<() => Promise<import("../types").InProgressImportResult>>;
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dag-builder/index.js"],"names":[],"mappings":";mBAQa,OAAO,UAAU,EAAE,IAAI;wBACvB,OAAO,UAAU,EAAE,SAAS;yBAC5B,OAAO,UAAU,EAAE,UAAU;sBAC7B,OAAO,UAAU,EAAE,OAAO;6BAC1B,OAAO,UAAU,EAAE,cAAc;AA2C9C;;GAEG;AACH,kUA4DC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dag-builder/index.js"],"names":[],"mappings":";mBAQa,OAAO,UAAU,EAAE,IAAI;wBACvB,OAAO,UAAU,EAAE,SAAS;yBAC5B,OAAO,UAAU,EAAE,UAAU;sBAC7B,OAAO,UAAU,EAAE,OAAO;6BAC1B,OAAO,UAAU,EAAE,cAAc;AA2C9C;;GAEG;AACH,mTA4DC"}
@@ -20,9 +20,17 @@ declare class DirFlat extends Dir {
20
20
  _children: {
21
21
  [key: string]: import("./types").InProgressImportResult | Dir;
22
22
  };
23
+ /**
24
+ * @param {string} name
25
+ */
26
+ get(name: string): Promise<import("./types").InProgressImportResult | Dir>;
23
27
  childCount(): number;
24
28
  directChildrenCount(): number;
25
29
  onlyChild(): import("./types").InProgressImportResult | Dir;
30
+ eachChildSeries(): AsyncGenerator<{
31
+ key: string;
32
+ child: import("./types").InProgressImportResult | Dir;
33
+ }, void, unknown>;
26
34
  }
27
35
  import Dir from "./dir.js";
28
36
  //# sourceMappingURL=dir-flat.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dir-flat.d.ts","sourceRoot":"","sources":["../../src/dir-flat.js"],"names":[],"mappings":";8BAMa,OAAO,SAAS,EAAE,eAAe;2BACjC,OAAO,SAAS,EAAE,YAAY;qCAC9B,OAAO,SAAS,EAAE,sBAAsB;yBACxC,OAAO,sBAAsB,EAAE,UAAU;uBACzC,OAAO,OAAO,EAAE,QAAQ;qBACxB,OAAO,cAAc,EAAE,MAAM;qBAC7B,OAAO,cAAc,EAAE,MAAM;AAP1C;;;;;;;;GAQG;AAEH;IAQI,8DAA8D;IAC9D;;MAAmB;IAqBrB,qBAEC;IAED,8BAEC;IAED,4DAEC;CAuEF"}
1
+ {"version":3,"file":"dir-flat.d.ts","sourceRoot":"","sources":["../../src/dir-flat.js"],"names":[],"mappings":";8BAMa,OAAO,SAAS,EAAE,eAAe;2BACjC,OAAO,SAAS,EAAE,YAAY;qCAC9B,OAAO,SAAS,EAAE,sBAAsB;yBACxC,OAAO,sBAAsB,EAAE,UAAU;uBACzC,OAAO,OAAO,EAAE,QAAQ;qBACxB,OAAO,cAAc,EAAE,MAAM;qBAC7B,OAAO,cAAc,EAAE,MAAM;AAP1C;;;;;;;;GAQG;AAEH;IAQI,8DAA8D;IAC9D;;MAAmB;IAcrB;;OAEG;IACH,UAFW,MAAM,2DAIhB;IAED,qBAEC;IAED,8BAEC;IAED,4DAEC;IAED;;;sBAWC;CA0DF"}
@@ -18,7 +18,11 @@ declare class DirSharded extends Dir {
18
18
  _bucket: Bucket<InProgressImportResult | Dir>;
19
19
  childCount(): number;
20
20
  directChildrenCount(): number;
21
- onlyChild(): Bucket<import("./types").InProgressImportResult | Dir> | Bucket.BucketChild<import("./types").InProgressImportResult | Dir>;
21
+ onlyChild(): Bucket<import("./types").InProgressImportResult | Dir> | import("hamt-sharding").BucketChild<import("./types").InProgressImportResult | Dir>;
22
+ eachChildSeries(): AsyncGenerator<{
23
+ key: string;
24
+ child: import("./types").InProgressImportResult | Dir;
25
+ }, void, unknown>;
22
26
  }
23
27
  import Dir from "./dir.js";
24
28
  import { Bucket } from "hamt-sharding";
@@ -1 +1 @@
1
- {"version":3,"file":"dir-sharded.d.ts","sourceRoot":"","sources":["../../src/dir-sharded.js"],"names":[],"mappings":";8BAOa,OAAO,SAAS,EAAE,eAAe;2BACjC,OAAO,SAAS,EAAE,YAAY;qCAC9B,OAAO,SAAS,EAAE,sBAAsB;yBACxC,OAAO,sBAAsB,EAAE,UAAU;uBAIzC,OAAO,OAAO,EAAE,QAAQ;AARrC;;;;;GAKG;AAEH;;GAEG;AAEH;IAQI,mDAAmD;IACnD,SADW,OAAO,sBAAsB,GAAG,GAAG,CAAC,CAI7C;IAkBJ,qBAEC;IAED,8BAEC;IAED,yIAEC;CAuBF"}
1
+ {"version":3,"file":"dir-sharded.d.ts","sourceRoot":"","sources":["../../src/dir-sharded.js"],"names":[],"mappings":";8BAOa,OAAO,SAAS,EAAE,eAAe;2BACjC,OAAO,SAAS,EAAE,YAAY;qCAC9B,OAAO,SAAS,EAAE,sBAAsB;yBACxC,OAAO,sBAAsB,EAAE,UAAU;uBAIzC,OAAO,OAAO,EAAE,QAAQ;AARrC;;;;;GAKG;AAEH;;GAEG;AAEH;IAQI,mDAAmD;IACnD,SADW,OAAO,sBAAsB,GAAG,GAAG,CAAC,CAI7C;IAkBJ,qBAEC;IAED,8BAEC;IAED,0JAEC;IAED;;;sBAOC;CAcF"}
package/dist/src/dir.d.ts CHANGED
@@ -14,7 +14,7 @@ export type DirProps = {
14
14
  parentKey?: string | undefined;
15
15
  unixfs?: import("ipfs-unixfs").UnixFS | undefined;
16
16
  mode?: number | undefined;
17
- mtime?: import("ipfs-unixfs/src/types").Mtime | undefined;
17
+ mtime?: import("ipfs-unixfs/dist/src/types").Mtime | undefined;
18
18
  };
19
19
  /**
20
20
  * @typedef {import('./types').ImporterOptions} ImporterOptions
@@ -51,7 +51,7 @@ declare class Dir {
51
51
  parentKey: string | undefined;
52
52
  unixfs: import("ipfs-unixfs").UnixFS | undefined;
53
53
  mode: number | undefined;
54
- mtime: import("ipfs-unixfs/src/types").Mtime | undefined;
54
+ mtime: import("ipfs-unixfs/dist/src/types").Mtime | undefined;
55
55
  /** @type {CID | undefined} */
56
56
  cid: CID | undefined;
57
57
  /** @type {number | undefined} */
@@ -1 +1 @@
1
- {"version":3,"file":"dir.d.ts","sourceRoot":"","sources":["../../src/dir.js"],"names":[],"mappings":";8BACa,OAAO,SAAS,EAAE,eAAe;2BACjC,OAAO,SAAS,EAAE,YAAY;qCAC9B,OAAO,SAAS,EAAE,sBAAsB;yBACxC,OAAO,sBAAsB,EAAE,UAAU;kBACzC,OAAO,kBAAkB,EAAE,GAAG;;UAG7B,OAAO;SACP,OAAO;UACP,MAAM;WACN,OAAO;UACP,OAAO;;;;;;;AAZrB;;;;;;;;;;;;;;;;;;GAkBG;AACH;IACE;;;OAGG;IACH,mBAHW,QAAQ,WACR,eAAe,EAoBzB;IAjBC,2CAA4B;IAE5B,cAAsB;IACtB,aAAoB;IACpB,aAAsB;IACtB,eAAwB;IACxB,cAAsB;IACtB,wBAA0B;IAC1B,8BAAgC;IAChC,iDAA0B;IAC1B,yBAAsB;IACtB,yDAAwB;IAExB,8BAA8B;IAC9B,KADW,GAAG,GAAG,SAAS,CACN;IACpB,iCAAiC;IACjC,MADW,MAAM,GAAG,SAAS,CACR;IAGvB;;;OAGG;IACH,UAHW,MAAM,SACN,sBAAsB,GAAG,GAAG,iBAEZ;IAE3B;;;OAGG;IACH,UAHW,MAAM,GACJ,QAAQ,sBAAsB,GAAG,GAAG,GAAG,SAAS,CAAC,CAI7D;IAED;;OAEG;IACH,mBAFa,cAAc;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,sBAAsB,GAAG,GAAG,CAAA;KAAC,CAAC,CAEjD;IAE9B;;;OAGG;IACH,kBAHW,UAAU,GACR,cAAc,YAAY,CAAC,CAEV;CAC/B"}
1
+ {"version":3,"file":"dir.d.ts","sourceRoot":"","sources":["../../src/dir.js"],"names":[],"mappings":";8BACa,OAAO,SAAS,EAAE,eAAe;2BACjC,OAAO,SAAS,EAAE,YAAY;qCAC9B,OAAO,SAAS,EAAE,sBAAsB;yBACxC,OAAO,sBAAsB,EAAE,UAAU;kBACzC,OAAO,kBAAkB,EAAE,GAAG;;UAG7B,OAAO;SACP,OAAO;UACP,MAAM;WACN,OAAO;UACP,OAAO;;;;;;;AAZrB;;;;;;;;;;;;;;;;;;GAkBG;AACH;IACE;;;OAGG;IACH,mBAHW,QAAQ,WACR,eAAe,EAoBzB;IAjBC,2CAA4B;IAE5B,cAAsB;IACtB,aAAoB;IACpB,aAAsB;IACtB,eAAwB;IACxB,cAAsB;IACtB,wBAA0B;IAC1B,8BAAgC;IAChC,iDAA0B;IAC1B,yBAAsB;IACtB,8DAAwB;IAExB,8BAA8B;IAC9B,KADW,GAAG,GAAG,SAAS,CACN;IACpB,iCAAiC;IACjC,MADW,MAAM,GAAG,SAAS,CACR;IAGvB;;;OAGG;IACH,UAHW,MAAM,SACN,sBAAsB,GAAG,GAAG,iBAEZ;IAE3B;;;OAGG;IACH,UAHW,MAAM,GACJ,QAAQ,sBAAsB,GAAG,GAAG,GAAG,SAAS,CAAC,CAI7D;IAED;;OAEG;IACH,mBAFa,cAAc;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,sBAAsB,GAAG,GAAG,CAAA;KAAC,CAAC,CAEjD;IAE9B;;;OAGG;IACH,kBAHW,UAAU,GACR,cAAc,YAAY,CAAC,CAEV;CAC/B"}