@arkiv-network/sdk 0.7.0 → 0.8.0-advanced.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/README.md +71 -16
  2. package/dist/actions/advanced/index.cjs +13 -0
  3. package/dist/actions/advanced/index.d.cts +8 -0
  4. package/dist/actions/advanced/index.d.ts +9 -0
  5. package/dist/actions/advanced/index.js +9 -0
  6. package/dist/advanced-Ds2XRflQ.cjs +656 -0
  7. package/dist/advanced-FZy7WoYR.js +598 -0
  8. package/dist/advanced-FZy7WoYR.js.map +1 -0
  9. package/dist/arkivTransactions-BpARZOsH.d.cts +584 -0
  10. package/dist/arkivTransactions-BpARZOsH.d.cts.map +1 -0
  11. package/dist/arkivTransactions-DfZ_yVDD.d.ts +584 -0
  12. package/dist/arkivTransactions-DfZ_yVDD.d.ts.map +1 -0
  13. package/dist/attr/index.cjs +35 -0
  14. package/dist/attr/index.d.cts +2 -0
  15. package/dist/attr/index.d.ts +3 -0
  16. package/dist/attr/index.js +4 -0
  17. package/dist/attributes-BJGuhsqp.js +819 -0
  18. package/dist/attributes-BJGuhsqp.js.map +1 -0
  19. package/dist/attributes-CMJlp1wn.cjs +1039 -0
  20. package/dist/chains/index.cjs +2 -3
  21. package/dist/chains/index.d.cts +41 -76
  22. package/dist/chains/index.d.cts.map +1 -1
  23. package/dist/chains/index.d.ts +24 -59
  24. package/dist/chains/index.d.ts.map +1 -1
  25. package/dist/chains/index.js +2 -2
  26. package/dist/chains-BfNQliHU.cjs +76 -0
  27. package/dist/chains-Du8tql7I.js +60 -0
  28. package/dist/chains-Du8tql7I.js.map +1 -0
  29. package/dist/codec-M74UR1_0.d.ts +101 -0
  30. package/dist/codec-M74UR1_0.d.ts.map +1 -0
  31. package/dist/entity/index.cjs +21 -0
  32. package/dist/entity/index.d.cts +4 -0
  33. package/dist/entity/index.d.ts +5 -0
  34. package/dist/entity/index.js +7 -0
  35. package/dist/entity-B00Li04j.cjs +71 -0
  36. package/dist/entity-B7G8q_Eo.cjs +0 -0
  37. package/dist/entity-BYQR1uoe.js +67 -0
  38. package/dist/entity-BYQR1uoe.js.map +1 -0
  39. package/dist/entity-CD_qFF2M.js +0 -0
  40. package/dist/errors-51znTSB1.cjs +56 -0
  41. package/dist/errors-CwPJ16bn.js +33 -0
  42. package/dist/errors-CwPJ16bn.js.map +1 -0
  43. package/dist/expiry-CZErShX6.js +95 -0
  44. package/dist/expiry-CZErShX6.js.map +1 -0
  45. package/dist/expiry-DRV29F1r.d.cts +79 -0
  46. package/dist/expiry-DRV29F1r.d.cts.map +1 -0
  47. package/dist/expiry-nDbCgZX4.d.ts +79 -0
  48. package/dist/expiry-nDbCgZX4.d.ts.map +1 -0
  49. package/dist/expiry-xr6mx4f7.cjs +135 -0
  50. package/dist/flags-5dTNRnow.d.ts +41 -0
  51. package/dist/flags-5dTNRnow.d.ts.map +1 -0
  52. package/dist/flags-Bh0HJldY.cjs +43 -0
  53. package/dist/flags-CRjPpoh3.d.cts +41 -0
  54. package/dist/flags-CRjPpoh3.d.cts.map +1 -0
  55. package/dist/flags-Cr76ldwF.js +33 -0
  56. package/dist/flags-Cr76ldwF.js.map +1 -0
  57. package/dist/index-CMeD8uEq.d.cts +280 -0
  58. package/dist/index-CMeD8uEq.d.cts.map +1 -0
  59. package/dist/index-CTDI5pXZ.d.ts +184 -0
  60. package/dist/index-CTDI5pXZ.d.ts.map +1 -0
  61. package/dist/index-CekGjkRx.d.cts +184 -0
  62. package/dist/index-CekGjkRx.d.cts.map +1 -0
  63. package/dist/index-D0IzFwMX.d.ts +328 -0
  64. package/dist/index-D0IzFwMX.d.ts.map +1 -0
  65. package/dist/index-DZxwz2Ky.d.cts +177 -0
  66. package/dist/index-DZxwz2Ky.d.cts.map +1 -0
  67. package/dist/index-Dz4SkQWg.d.ts +280 -0
  68. package/dist/index-Dz4SkQWg.d.ts.map +1 -0
  69. package/dist/index-JP31fjyM.d.ts +177 -0
  70. package/dist/index-JP31fjyM.d.ts.map +1 -0
  71. package/dist/index-NbfnXxgr.d.cts +424 -0
  72. package/dist/index-NbfnXxgr.d.cts.map +1 -0
  73. package/dist/index.cjs +434 -412
  74. package/dist/index.d.cts +401 -235
  75. package/dist/index.d.cts.map +1 -1
  76. package/dist/index.d.ts +402 -235
  77. package/dist/index.d.ts.map +1 -1
  78. package/dist/index.js +370 -404
  79. package/dist/index.js.map +1 -1
  80. package/dist/key-E7mv0BYf.cjs +116 -0
  81. package/dist/key-XQkpw2xh.js +82 -0
  82. package/dist/key-XQkpw2xh.js.map +1 -0
  83. package/dist/logger-CVpvU8ik.js +153 -0
  84. package/dist/logger-CVpvU8ik.js.map +1 -0
  85. package/dist/logger-Cr15lPAQ.cjs +188 -0
  86. package/dist/payload-Cvrir3Q-.cjs +108 -0
  87. package/dist/payload-D53ms-Mg.d.ts +153 -0
  88. package/dist/payload-D53ms-Mg.d.ts.map +1 -0
  89. package/dist/payload-DaPzUvEh.js +92 -0
  90. package/dist/payload-DaPzUvEh.js.map +1 -0
  91. package/dist/payload-hluX1rc0.d.cts +153 -0
  92. package/dist/payload-hluX1rc0.d.cts.map +1 -0
  93. package/dist/query/index.cjs +26 -149
  94. package/dist/query/index.d.cts +5 -3
  95. package/dist/query/index.d.ts +6 -3
  96. package/dist/query/index.js +8 -137
  97. package/dist/queryBuilder-BXR-HxD9.cjs +947 -0
  98. package/dist/queryBuilder-BwauPaGO.js +823 -0
  99. package/dist/queryBuilder-BwauPaGO.js.map +1 -0
  100. package/dist/selection-C6KeWJ7g.d.cts +441 -0
  101. package/dist/selection-C6KeWJ7g.d.cts.map +1 -0
  102. package/dist/selection-mjiiAGDO.d.ts +442 -0
  103. package/dist/selection-mjiiAGDO.d.ts.map +1 -0
  104. package/dist/types/index.cjs +4 -1
  105. package/dist/types/index.d.cts +7 -2
  106. package/dist/types/index.d.ts +8 -2
  107. package/dist/types/index.js +4 -1
  108. package/dist/types-Bu_ZwMbZ.js +0 -0
  109. package/dist/types-NRqymi6S.cjs +0 -0
  110. package/dist/utils/index.cjs +4 -17
  111. package/dist/utils/index.d.cts +3 -17
  112. package/dist/utils/index.d.ts +3 -17
  113. package/dist/utils/index.js +4 -18
  114. package/package.json +26 -9
  115. package/src/actions/advanced/advanced.test.ts +258 -0
  116. package/src/actions/advanced/buildMutation.ts +104 -0
  117. package/src/actions/advanced/getMutationResult.ts +112 -0
  118. package/src/actions/advanced/index.ts +21 -0
  119. package/src/actions/advanced/pingTransaction.ts +43 -0
  120. package/src/actions/advanced/sendMutation.ts +59 -0
  121. package/src/actions/public/getEntity.ts +28 -43
  122. package/src/actions/public/getEntityNonce.ts +30 -0
  123. package/src/actions/public/predictEntityKeys.test.ts +159 -0
  124. package/src/actions/public/predictEntityKeys.ts +152 -0
  125. package/src/actions/public/query.ts +35 -67
  126. package/src/actions/public/watchEntityEvents.test.ts +414 -0
  127. package/src/actions/public/watchEntityEvents.ts +225 -0
  128. package/src/actions/wallet/changeOwnership.ts +8 -8
  129. package/src/actions/wallet/createEntity.ts +105 -26
  130. package/src/actions/wallet/deleteEntity.ts +2 -3
  131. package/src/actions/wallet/executeBatch.test.ts +76 -0
  132. package/src/actions/wallet/executeBatch.ts +51 -0
  133. package/src/actions/wallet/extendEntity.ts +40 -16
  134. package/src/actions/wallet/patchEntity.ts +90 -0
  135. package/src/attr/attributes.test.ts +120 -0
  136. package/src/attr/attributes.ts +196 -0
  137. package/src/attr/codec.test.ts +162 -0
  138. package/src/attr/codec.ts +220 -0
  139. package/src/attr/decimal.ts +86 -0
  140. package/src/attr/errors.ts +145 -0
  141. package/src/attr/index.ts +50 -0
  142. package/src/attr/names.ts +106 -0
  143. package/src/attr/types.ts +150 -0
  144. package/src/attr/values.test.ts +271 -0
  145. package/src/attr/values.ts +506 -0
  146. package/src/chains/cheesecake.ts +22 -0
  147. package/src/chains/index.ts +1 -2
  148. package/src/chains/localhost.ts +3 -0
  149. package/src/clients/createPublicClient.test.ts +4 -6
  150. package/src/clients/createPublicClient.ts +9 -8
  151. package/src/clients/createWalletClient.test.ts +4 -4
  152. package/src/clients/createWalletClient.ts +13 -9
  153. package/src/clients/decorators/arkivAdvanced.ts +144 -0
  154. package/src/clients/decorators/arkivPublic.ts +181 -147
  155. package/src/clients/decorators/arkivWallet.ts +141 -122
  156. package/src/consts.ts +2 -1
  157. package/src/entity/create.test.ts +203 -0
  158. package/src/entity/errors.ts +39 -0
  159. package/src/entity/events.ts +16 -0
  160. package/src/entity/expiry.test.ts +195 -0
  161. package/src/entity/expiry.ts +182 -0
  162. package/src/entity/flags.ts +65 -0
  163. package/src/entity/index.ts +16 -0
  164. package/src/entity/key.ts +88 -0
  165. package/src/entity/operations.ts +135 -0
  166. package/src/entity/params.ts +15 -0
  167. package/src/errors.ts +33 -28
  168. package/src/index.ts +19 -0
  169. package/src/query/engine.ts +68 -132
  170. package/src/query/errors.ts +151 -0
  171. package/src/query/expression.test.ts +286 -0
  172. package/src/query/expression.ts +500 -0
  173. package/src/query/index.ts +40 -4
  174. package/src/query/injection.test.ts +151 -0
  175. package/src/query/queryBuilder.test.ts +342 -637
  176. package/src/query/queryBuilder.ts +133 -359
  177. package/src/query/queryResult.ts +54 -51
  178. package/src/query/selection.test.ts +48 -98
  179. package/src/query/selection.ts +77 -65
  180. package/src/types/entity.test.ts +44 -155
  181. package/src/types/entity.ts +62 -44
  182. package/src/types/events.ts +64 -23
  183. package/src/types/index.ts +24 -20
  184. package/src/types/rpcSchema.ts +71 -33
  185. package/src/types/txParams.ts +8 -0
  186. package/src/utils/arkivTransactions.test.ts +687 -38
  187. package/src/utils/arkivTransactions.ts +400 -115
  188. package/src/utils/chains.test.ts +21 -24
  189. package/src/utils/compression.ts +1 -1
  190. package/src/utils/entities.test.ts +62 -0
  191. package/src/utils/entities.ts +111 -29
  192. package/src/utils/expirationTime.ts +153 -10
  193. package/src/utils/logger.ts +2 -2
  194. package/src/utils/payload.ts +29 -2
  195. package/src/utils/revert.test.ts +99 -0
  196. package/src/utils/revert.ts +145 -0
  197. package/dist/chains-BifaY04V.cjs +0 -108
  198. package/dist/chains-CrtkVbBh.js +0 -86
  199. package/dist/chains-CrtkVbBh.js.map +0 -1
  200. package/dist/consts-AUoL-v42.cjs +0 -18
  201. package/dist/consts-BV4PR-de.js +0 -7
  202. package/dist/consts-BV4PR-de.js.map +0 -1
  203. package/dist/entity-B6g_EPm1.d.cts +0 -382
  204. package/dist/entity-B6g_EPm1.d.cts.map +0 -1
  205. package/dist/entity-qoLMAuuk.d.ts +0 -382
  206. package/dist/entity-qoLMAuuk.d.ts.map +0 -1
  207. package/dist/index-DdspxNAA.d.ts +0 -481
  208. package/dist/index-DdspxNAA.d.ts.map +0 -1
  209. package/dist/index-Ds9dwqb5.d.cts +0 -481
  210. package/dist/index-Ds9dwqb5.d.cts.map +0 -1
  211. package/dist/payload-B2kFJyah.d.ts +0 -6
  212. package/dist/payload-B2kFJyah.d.ts.map +0 -1
  213. package/dist/payload-CJN8fTvX.d.cts +0 -6
  214. package/dist/payload-CJN8fTvX.d.cts.map +0 -1
  215. package/dist/payload-Claf2jUO.js +0 -13
  216. package/dist/payload-Claf2jUO.js.map +0 -1
  217. package/dist/payload-DpA5PA-w.cjs +0 -23
  218. package/dist/query/index.js.map +0 -1
  219. package/dist/queryBuilder-D2uwP9jI.js +0 -704
  220. package/dist/queryBuilder-D2uwP9jI.js.map +0 -1
  221. package/dist/queryBuilder-UW2MCaX4.cjs +0 -792
  222. package/dist/utils/index.d.cts.map +0 -1
  223. package/dist/utils/index.d.ts.map +0 -1
  224. package/dist/utils/index.js.map +0 -1
  225. package/src/actions/public/buildQuery.ts +0 -10
  226. package/src/actions/public/subscribeEntityEvents.ts +0 -119
  227. package/src/actions/wallet/mutateEntities.ts +0 -111
  228. package/src/actions/wallet/updateEntity.ts +0 -60
  229. package/src/chains/braga.ts +0 -26
  230. package/src/chains/kaolin.ts +0 -29
  231. package/src/query/engine.test.ts +0 -526
  232. package/src/query/predicate.test.ts +0 -461
  233. package/src/query/predicate.ts +0 -144
  234. package/src/query/queryResult.test.ts +0 -270
  235. package/src/query/selectQueryBuilder.test.ts +0 -210
  236. package/src/types/attributes.ts +0 -16
  237. package/src/utils/validation.test.ts +0 -60
  238. package/src/utils/validation.ts +0 -32
  239. /package/dist/{types-H-TSmRpm.js → attr-DlmErkvR.cjs} +0 -0
  240. /package/dist/{types-o3zWarRp.cjs → attr-GcQKatub.js} +0 -0
@@ -0,0 +1,135 @@
1
+ const require_errors = require('./errors-51znTSB1.cjs');
2
+
3
+ //#region src/consts.ts
4
+ const ARKIV_ADDRESS = "0x4400000000000000000000000000000000000044";
5
+ const BLOCK_TIME = 2;
6
+
7
+ //#endregion
8
+ //#region src/entity/params.ts
9
+ /**
10
+ * Max uint64 value
11
+ */
12
+ const MAX_EXPIRES_AT = 2n ** 64n - 1n;
13
+ /** The operation tags of the `execute` ABI's tagged union. */
14
+ const OperationType = {
15
+ Create: 1,
16
+ Patch: 2,
17
+ ExtendExpiry: 3,
18
+ TransferOwnership: 4,
19
+ Delete: 5
20
+ };
21
+
22
+ //#endregion
23
+ //#region src/entity/expiry.ts
24
+ /**
25
+ * Builds a branded {@link Expiry}.
26
+ *
27
+ * Internal seam for {@link ExpirationTime}, which is the only thing that should call it — it is not
28
+ * part of the package's public surface.
29
+ */
30
+ function makeExpiry(minLifetime, expiresAt) {
31
+ return {
32
+ minLifetime,
33
+ expiresAt
34
+ };
35
+ }
36
+ /**
37
+ * Resolves an expiry into the wire pair and the block the entity will expire at.
38
+ *
39
+ * Durations are converted to blocks at the nominal `BLOCK_TIME` (2 seconds), which makes them
40
+ * **approximate**: block production is not a clock, so a lifetime asked for in days drifts if the
41
+ * chain runs fast or slow. The block it was converted to comes back as
42
+ * {@link ResolvedExpiry.target}, so the approximation is always observable rather than assumed.
43
+ *
44
+ * @throws {InvalidExpiryError} If the expiry is malformed, does not fit the `uint64` the wire
45
+ * carries, or would leave the entity dead on arrival.
46
+ */
47
+ function resolveExpiry(expiry, context) {
48
+ const { currentBlock } = context;
49
+ if (typeof expiry?.minLifetime !== "bigint" || expiry.expiresAt === void 0) throw new require_errors.InvalidExpiryError("expires must be built with ExpirationTime, e.g. ExpirationTime.fromDays(30) or ExpirationTime.atBlock(1_200_000n)");
50
+ const { minLifetime } = expiry;
51
+ const absolute = typeof expiry.expiresAt === "bigint" ? expiry.expiresAt : blockAtDate(expiry.expiresAt, currentBlock);
52
+ if (minLifetime === 0n && absolute === 0n) throw new require_errors.InvalidExpiryError("no expiry given. Pass ExpirationTime.fromDays(30) for a lifetime, ExpirationTime.atBlock(n) for an absolute deadline, or a deadline with { atLeast } to take whichever is later.");
53
+ if (absolute > MAX_EXPIRES_AT) throw new require_errors.InvalidExpiryError(`expiresAt resolves to block ${absolute}, which does not fit the uint64 the wire carries (max ${MAX_EXPIRES_AT}). Use ExpirationTime.permanent() for an entity that should not expire.`);
54
+ if (minLifetime > MAX_EXPIRES_AT) throw new require_errors.InvalidExpiryError(`the lifetime is ${minLifetime} blocks, which does not fit the uint64 the wire carries (max ${MAX_EXPIRES_AT})`);
55
+ const relative = minLifetime === 0n ? 0n : currentBlock + minLifetime;
56
+ const target = absolute > relative ? absolute : relative;
57
+ if (target <= currentBlock) throw new require_errors.InvalidExpiryError(`the entity would expire at block ${target}, which is not after the current block ${currentBlock}, so it would be dead on arrival`);
58
+ if (target > MAX_EXPIRES_AT) throw new require_errors.InvalidExpiryError(`a lifetime of ${minLifetime} blocks from block ${currentBlock} lands at ${target}, past the largest expiry the wire carries (${MAX_EXPIRES_AT})`);
59
+ return {
60
+ expiresAt: absolute,
61
+ minLifetime,
62
+ target
63
+ };
64
+ }
65
+ /**
66
+ * A duration in seconds as a whole number of blocks.
67
+ *
68
+ * Arkiv counts lifetimes in blocks, so a duration that is not a whole number of them does not
69
+ * describe anything the chain can store. Rather than silently round a caller's `3` up to two blocks
70
+ * — four seconds, not what they asked for — this rejects it: a duration must be a positive multiple
71
+ * of `BLOCK_TIME` (2 seconds). The {@link ExpirationTime} helpers all produce such multiples.
72
+ *
73
+ * @throws {InvalidExpiryError} If the duration is not a positive whole number of blocks' seconds.
74
+ */
75
+ function toBlocks(seconds) {
76
+ if (!Number.isInteger(seconds) || seconds <= 0) throw new require_errors.InvalidExpiryError(`a lifetime must be a positive whole number of seconds, got ${seconds}. Use the ExpirationTime helpers, e.g. ExpirationTime.fromDays(30).`);
77
+ if (seconds % BLOCK_TIME !== 0) throw new require_errors.InvalidExpiryError(`a lifetime must be a multiple of the ${BLOCK_TIME}s block time, got ${seconds}, which is ${seconds / BLOCK_TIME} blocks. Try ${seconds - seconds % BLOCK_TIME} or ${seconds + BLOCK_TIME - seconds % BLOCK_TIME}, or ExpirationTime.fromBlocks(n).`);
78
+ return BigInt(seconds / BLOCK_TIME);
79
+ }
80
+ /**
81
+ * The block a wall-clock instant lands on.
82
+ *
83
+ * Rounds **up**: a date almost never falls on a block boundary, and unlike a duration — which the
84
+ * caller states and can state exactly — there is nothing here to reject, so the entity lives until
85
+ * at least the instant asked for.
86
+ */
87
+ function blockAtDate(date, currentBlock) {
88
+ const secondsAway = (date.getTime() - Date.now()) / 1e3;
89
+ if (secondsAway <= 0) throw new require_errors.InvalidExpiryError(`the deadline ${date.toISOString()} is in the past, so the entity would be dead on arrival`);
90
+ return currentBlock + BigInt(Math.ceil(secondsAway / BLOCK_TIME));
91
+ }
92
+
93
+ //#endregion
94
+ Object.defineProperty(exports, 'ARKIV_ADDRESS', {
95
+ enumerable: true,
96
+ get: function () {
97
+ return ARKIV_ADDRESS;
98
+ }
99
+ });
100
+ Object.defineProperty(exports, 'BLOCK_TIME', {
101
+ enumerable: true,
102
+ get: function () {
103
+ return BLOCK_TIME;
104
+ }
105
+ });
106
+ Object.defineProperty(exports, 'MAX_EXPIRES_AT', {
107
+ enumerable: true,
108
+ get: function () {
109
+ return MAX_EXPIRES_AT;
110
+ }
111
+ });
112
+ Object.defineProperty(exports, 'OperationType', {
113
+ enumerable: true,
114
+ get: function () {
115
+ return OperationType;
116
+ }
117
+ });
118
+ Object.defineProperty(exports, 'makeExpiry', {
119
+ enumerable: true,
120
+ get: function () {
121
+ return makeExpiry;
122
+ }
123
+ });
124
+ Object.defineProperty(exports, 'resolveExpiry', {
125
+ enumerable: true,
126
+ get: function () {
127
+ return resolveExpiry;
128
+ }
129
+ });
130
+ Object.defineProperty(exports, 'toBlocks', {
131
+ enumerable: true,
132
+ get: function () {
133
+ return toBlocks;
134
+ }
135
+ });
@@ -0,0 +1,41 @@
1
+ //#region src/entity/flags.d.ts
2
+ /**
3
+ * The immutable properties an entity is created with. Both default to `false`.
4
+ *
5
+ * Creation flags are fixed at creation: there is no operation that changes them, so an entity is
6
+ * whatever it was created as for its whole life.
7
+ */
8
+ type CreationFlags = {
9
+ /**
10
+ * The entity's attributes and payload can never be changed — only its expiry extended, its
11
+ * ownership transferred, and the entity deleted.
12
+ */
13
+ readonly?: boolean;
14
+ /**
15
+ * Anyone, not just the owner, may extend the entity's expiry. Lets a third party keep something
16
+ * alive without being able to change it.
17
+ */
18
+ permissionlessExtension?: boolean;
19
+ };
20
+ /** {@link CreationFlags} as read back, with every flag resolved and the raw byte alongside. */
21
+ type ResolvedCreationFlags = {
22
+ readonly: boolean;
23
+ permissionlessExtension: boolean;
24
+ raw: number;
25
+ };
26
+ /**
27
+ * Packs creation flags into the `creationFlags` byte.
28
+ *
29
+ * @throws {InvalidCreationFlagsError} If a value is not a boolean.
30
+ */
31
+ declare function encodeCreationFlags(flags?: CreationFlags): number;
32
+ /**
33
+ * Reads the `creationFlags` byte back.
34
+ *
35
+ * @param raw - The `creationFlags` byte.
36
+ * @throws {InvalidCreationFlagsError} Malformed input
37
+ */
38
+ declare function decodeCreationFlags(raw: number): ResolvedCreationFlags;
39
+ //#endregion
40
+ export { encodeCreationFlags as i, ResolvedCreationFlags as n, decodeCreationFlags as r, CreationFlags as t };
41
+ //# sourceMappingURL=flags-5dTNRnow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flags-5dTNRnow.d.ts","names":[],"sources":["../src/entity/flags.ts"],"sourcesContent":[],"mappings":";;AAYA;AAcA;AAWA;AAkBA;;KA3CY,aAAA;;;;;;;;;;;;;KAcA,qBAAA;;;;;;;;;;iBAWI,mBAAA,SAA2B;;;;;;;iBAkB3B,mBAAA,eAAkC"}
@@ -0,0 +1,43 @@
1
+ const require_errors = require('./errors-51znTSB1.cjs');
2
+
3
+ //#region src/entity/flags.ts
4
+ /** Bit positions in the `creationFlags` byte. Bits 2-7 are reserved and must be zero. */
5
+ const READONLY_BIT = 1;
6
+ const PERMISSIONLESS_EXTENSION_BIT = 2;
7
+ /**
8
+ * Packs creation flags into the `creationFlags` byte.
9
+ *
10
+ * @throws {InvalidCreationFlagsError} If a value is not a boolean.
11
+ */
12
+ function encodeCreationFlags(flags = {}) {
13
+ for (const [name, value] of Object.entries(flags)) if (value !== void 0 && typeof value !== "boolean") throw new require_errors.InvalidCreationFlagsError(`"${name}" must be a boolean, got ${typeof value}`);
14
+ return (flags.readonly ? READONLY_BIT : 0) | (flags.permissionlessExtension ? PERMISSIONLESS_EXTENSION_BIT : 0);
15
+ }
16
+ /**
17
+ * Reads the `creationFlags` byte back.
18
+ *
19
+ * @param raw - The `creationFlags` byte.
20
+ * @throws {InvalidCreationFlagsError} Malformed input
21
+ */
22
+ function decodeCreationFlags(raw) {
23
+ if (!Number.isInteger(raw) || raw < 0 || raw > 255) throw new require_errors.InvalidCreationFlagsError(`${raw} is not a byte`);
24
+ return {
25
+ readonly: (raw & READONLY_BIT) !== 0,
26
+ permissionlessExtension: (raw & PERMISSIONLESS_EXTENSION_BIT) !== 0,
27
+ raw
28
+ };
29
+ }
30
+
31
+ //#endregion
32
+ Object.defineProperty(exports, 'decodeCreationFlags', {
33
+ enumerable: true,
34
+ get: function () {
35
+ return decodeCreationFlags;
36
+ }
37
+ });
38
+ Object.defineProperty(exports, 'encodeCreationFlags', {
39
+ enumerable: true,
40
+ get: function () {
41
+ return encodeCreationFlags;
42
+ }
43
+ });
@@ -0,0 +1,41 @@
1
+ //#region src/entity/flags.d.ts
2
+ /**
3
+ * The immutable properties an entity is created with. Both default to `false`.
4
+ *
5
+ * Creation flags are fixed at creation: there is no operation that changes them, so an entity is
6
+ * whatever it was created as for its whole life.
7
+ */
8
+ type CreationFlags = {
9
+ /**
10
+ * The entity's attributes and payload can never be changed — only its expiry extended, its
11
+ * ownership transferred, and the entity deleted.
12
+ */
13
+ readonly?: boolean;
14
+ /**
15
+ * Anyone, not just the owner, may extend the entity's expiry. Lets a third party keep something
16
+ * alive without being able to change it.
17
+ */
18
+ permissionlessExtension?: boolean;
19
+ };
20
+ /** {@link CreationFlags} as read back, with every flag resolved and the raw byte alongside. */
21
+ type ResolvedCreationFlags = {
22
+ readonly: boolean;
23
+ permissionlessExtension: boolean;
24
+ raw: number;
25
+ };
26
+ /**
27
+ * Packs creation flags into the `creationFlags` byte.
28
+ *
29
+ * @throws {InvalidCreationFlagsError} If a value is not a boolean.
30
+ */
31
+ declare function encodeCreationFlags(flags?: CreationFlags): number;
32
+ /**
33
+ * Reads the `creationFlags` byte back.
34
+ *
35
+ * @param raw - The `creationFlags` byte.
36
+ * @throws {InvalidCreationFlagsError} Malformed input
37
+ */
38
+ declare function decodeCreationFlags(raw: number): ResolvedCreationFlags;
39
+ //#endregion
40
+ export { encodeCreationFlags as i, ResolvedCreationFlags as n, decodeCreationFlags as r, CreationFlags as t };
41
+ //# sourceMappingURL=flags-CRjPpoh3.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flags-CRjPpoh3.d.cts","names":[],"sources":["../src/entity/flags.ts"],"sourcesContent":[],"mappings":";;AAYA;AAcA;AAWA;AAkBA;;KA3CY,aAAA;;;;;;;;;;;;;KAcA,qBAAA;;;;;;;;;;iBAWI,mBAAA,SAA2B;;;;;;;iBAkB3B,mBAAA,eAAkC"}
@@ -0,0 +1,33 @@
1
+ import { t as InvalidCreationFlagsError } from "./errors-CwPJ16bn.js";
2
+
3
+ //#region src/entity/flags.ts
4
+ /** Bit positions in the `creationFlags` byte. Bits 2-7 are reserved and must be zero. */
5
+ const READONLY_BIT = 1;
6
+ const PERMISSIONLESS_EXTENSION_BIT = 2;
7
+ /**
8
+ * Packs creation flags into the `creationFlags` byte.
9
+ *
10
+ * @throws {InvalidCreationFlagsError} If a value is not a boolean.
11
+ */
12
+ function encodeCreationFlags(flags = {}) {
13
+ for (const [name, value] of Object.entries(flags)) if (value !== void 0 && typeof value !== "boolean") throw new InvalidCreationFlagsError(`"${name}" must be a boolean, got ${typeof value}`);
14
+ return (flags.readonly ? READONLY_BIT : 0) | (flags.permissionlessExtension ? PERMISSIONLESS_EXTENSION_BIT : 0);
15
+ }
16
+ /**
17
+ * Reads the `creationFlags` byte back.
18
+ *
19
+ * @param raw - The `creationFlags` byte.
20
+ * @throws {InvalidCreationFlagsError} Malformed input
21
+ */
22
+ function decodeCreationFlags(raw) {
23
+ if (!Number.isInteger(raw) || raw < 0 || raw > 255) throw new InvalidCreationFlagsError(`${raw} is not a byte`);
24
+ return {
25
+ readonly: (raw & READONLY_BIT) !== 0,
26
+ permissionlessExtension: (raw & PERMISSIONLESS_EXTENSION_BIT) !== 0,
27
+ raw
28
+ };
29
+ }
30
+
31
+ //#endregion
32
+ export { encodeCreationFlags as n, decodeCreationFlags as t };
33
+ //# sourceMappingURL=flags-Cr76ldwF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flags-Cr76ldwF.js","names":[],"sources":["../src/entity/flags.ts"],"sourcesContent":["import { InvalidCreationFlagsError } from \"./errors\"\n\n/** Bit positions in the `creationFlags` byte. Bits 2-7 are reserved and must be zero. */\nconst READONLY_BIT = 0b0000_0001\nconst PERMISSIONLESS_EXTENSION_BIT = 0b0000_0010\n\n/**\n * The immutable properties an entity is created with. Both default to `false`.\n *\n * Creation flags are fixed at creation: there is no operation that changes them, so an entity is\n * whatever it was created as for its whole life.\n */\nexport type CreationFlags = {\n /**\n * The entity's attributes and payload can never be changed — only its expiry extended, its\n * ownership transferred, and the entity deleted.\n */\n readonly?: boolean\n /**\n * Anyone, not just the owner, may extend the entity's expiry. Lets a third party keep something\n * alive without being able to change it.\n */\n permissionlessExtension?: boolean\n}\n\n/** {@link CreationFlags} as read back, with every flag resolved and the raw byte alongside. */\nexport type ResolvedCreationFlags = {\n readonly: boolean\n permissionlessExtension: boolean\n raw: number\n}\n\n/**\n * Packs creation flags into the `creationFlags` byte.\n *\n * @throws {InvalidCreationFlagsError} If a value is not a boolean.\n */\nexport function encodeCreationFlags(flags: CreationFlags = {}): number {\n for (const [name, value] of Object.entries(flags)) {\n if (value !== undefined && typeof value !== \"boolean\") {\n throw new InvalidCreationFlagsError(`\"${name}\" must be a boolean, got ${typeof value}`)\n }\n }\n return (\n (flags.readonly ? READONLY_BIT : 0) |\n (flags.permissionlessExtension ? PERMISSIONLESS_EXTENSION_BIT : 0)\n )\n}\n\n/**\n * Reads the `creationFlags` byte back.\n *\n * @param raw - The `creationFlags` byte.\n * @throws {InvalidCreationFlagsError} Malformed input\n */\nexport function decodeCreationFlags(raw: number): ResolvedCreationFlags {\n if (!Number.isInteger(raw) || raw < 0 || raw > 0xff) {\n throw new InvalidCreationFlagsError(`${raw} is not a byte`)\n }\n return {\n readonly: (raw & READONLY_BIT) !== 0,\n permissionlessExtension: (raw & PERMISSIONLESS_EXTENSION_BIT) !== 0,\n raw,\n }\n}\n"],"mappings":";;;;AAGA,MAAM,eAAe;AACrB,MAAM,+BAA+B;;;;;;AAiCrC,SAAgB,oBAAoB,QAAuB,EAAE,EAAU;AACrE,MAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,MAAM,CAC/C,KAAI,UAAU,UAAa,OAAO,UAAU,UAC1C,OAAM,IAAI,0BAA0B,IAAI,KAAK,2BAA2B,OAAO,QAAQ;AAG3F,SACG,MAAM,WAAW,eAAe,MAChC,MAAM,0BAA0B,+BAA+B;;;;;;;;AAUpE,SAAgB,oBAAoB,KAAoC;AACtE,KAAI,CAAC,OAAO,UAAU,IAAI,IAAI,MAAM,KAAK,MAAM,IAC7C,OAAM,IAAI,0BAA0B,GAAG,IAAI,gBAAgB;AAE7D,QAAO;EACL,WAAW,MAAM,kBAAkB;EACnC,0BAA0B,MAAM,kCAAkC;EAClE;EACD"}
@@ -0,0 +1,280 @@
1
+ import { R as RpcSelect, i as SelectArg, j as ArkivClient, p as Expression, s as Entity } from "./selection-C6KeWJ7g.cjs";
2
+ import { K as TypeTag } from "./index-NbfnXxgr.cjs";
3
+ import { Hex } from "viem";
4
+
5
+ //#region src/query/engine.d.ts
6
+ declare const MAX_LIMIT = 200;
7
+ /** One `arkiv_query` call. */
8
+ type QueryRequest = {
9
+ /** The query expression, already rendered. */
10
+ query: string;
11
+ /** What to return. */
12
+ select: RpcSelect;
13
+ /** Page size, up to {@link MAX_LIMIT}. Defaults to the node's own page size. */
14
+ limit?: number | undefined;
15
+ /** Cursor from a previous page. */
16
+ cursor?: string | undefined;
17
+ /** Block height to read at. Defaults to the head. */
18
+ atBlock?: bigint | undefined;
19
+ };
20
+ /** One page of results. */
21
+ type QueryResponse = {
22
+ entities: Entity[];
23
+ /** The block the page was read at — the same for every page of a paginated query. */
24
+ blockNumber: bigint;
25
+ /** The cursor for the next page, or `undefined` when this was the last one. */
26
+ cursor: string | undefined;
27
+ };
28
+ /**
29
+ * Runs one query and decodes the page it returns.
30
+ *
31
+ * @throws {QueryError} If the node rejects the query.
32
+ */
33
+ declare function runQuery(client: ArkivClient, request: QueryRequest): Promise<QueryResponse>;
34
+ //#endregion
35
+ //#region src/query/errors.d.ts
36
+ /**
37
+ * A predicate asked for an operator the query language does not define for that type.
38
+ *
39
+ * The operator × type matrix is part of the language, not a policy: a range comparison on an
40
+ * equality-only type is a **parse error** at the node, not an empty result. Catching it here turns
41
+ * a round trip and an RPC error code into a stack trace pointing at the call site.
42
+ *
43
+ * | | `=` `!=` | `<` `<=` `>` `>=` | `STARTSWITH` |
44
+ * | --- | --- | --- | --- |
45
+ * | `bool` | yes | no | no |
46
+ * | `i32` `u64` `u256` `dec` | yes | yes | no |
47
+ * | `str` | yes | no | yes |
48
+ * | `addr` `key` `bytes32` | yes | no | no |
49
+ */
50
+ declare class UnsupportedOperatorError extends Error {
51
+ /** The attribute the predicate names. */
52
+ readonly attributeName: string;
53
+ /** The operator, as it would have been written in the query. */
54
+ readonly operator: string;
55
+ /** The type of the value it was applied to. */
56
+ readonly tag: TypeTag;
57
+ constructor(attributeName: string, operator: string, tag: TypeTag, hint?: string);
58
+ }
59
+ /**
60
+ * A predicate could not be expressed in the query language for a reason other than its operator —
61
+ * a system attribute that is returned in results but cannot be filtered on, a system attribute
62
+ * compared against the wrong type, or a combinator with nothing to combine.
63
+ */
64
+ declare class InvalidPredicateError extends Error {
65
+ /** The attribute the predicate names, where there is one. */
66
+ readonly attributeName: string | undefined;
67
+ constructor(message: string, attributeName?: string);
68
+ }
69
+ /**
70
+ * What a node rejected a query for. Part of the frozen RPC surface, so it is safe to branch on —
71
+ * a `"cursor"` failure means start the query again, a `"block"` failure means the node no longer
72
+ * retains that height, and the rest mean the query itself needs fixing.
73
+ */
74
+ type QueryErrorKind = /** The query string does not parse. `data` locates it: `{ position, expected, got }`. */
75
+ "parse"
76
+ /** A predicate is well-formed but ill-typed — a range operator on an equality-only type, an unknown tag. */ | "type"
77
+ /** A literal failed validation — an `i32` out of range, a bad EIP-55 checksum, more than 18 decimal places. */ | "literal"
78
+ /** A node budget was exceeded — query length, predicate count, nesting depth, bitmap operations. */ | "limits"
79
+ /** The cursor expired, is malformed, or belongs to a different query, block or selection. */ | "cursor"
80
+ /** `atBlock` is outside the range the node retains. */ | "block";
81
+ /**
82
+ * The node rejected a query.
83
+ *
84
+ * These codes are part of the frozen `arkiv_query` surface, so {@link kind} and {@link data} are
85
+ * stable enough to branch on — which the underlying JSON-RPC error is not, because the codes
86
+ * overlap Ethereum's own EIP-1474 numbering and get wrapped accordingly on the way up.
87
+ *
88
+ * @example
89
+ * try {
90
+ * await result.next()
91
+ * } catch (error) {
92
+ * if (error instanceof QueryError && error.kind === "cursor") {
93
+ * // The page is gone — start the query over.
94
+ * }
95
+ * }
96
+ */
97
+ declare class QueryError extends Error {
98
+ /** Which failure this is. */
99
+ readonly kind: QueryErrorKind;
100
+ /** The JSON-RPC error code. */
101
+ readonly code: number;
102
+ /** The machine-readable detail the node sent, if any — e.g. `{ position, expected, got }`. */
103
+ readonly data: unknown;
104
+ /** The query string that was rejected. */
105
+ readonly query: string;
106
+ constructor(kind: QueryErrorKind, code: number, query: string, data: unknown, detail?: string);
107
+ }
108
+ //#endregion
109
+ //#region src/query/queryResult.d.ts
110
+ /** Fetches the page a cursor points at. */
111
+ type FetchPage<TEntity> = (cursor: string) => Promise<QueryResult<TEntity>>;
112
+ /**
113
+ * One page of query results.
114
+ *
115
+ * A page is immutable: {@link next} returns the following page rather than mutating this one, so a
116
+ * page that has been read stays readable.
117
+ *
118
+ * @typeParam TEntity - The shape of each entity, inferred from the selection by `client.select()`.
119
+ *
120
+ * @example
121
+ * let page = await client.select({ key: true }).where(eq("category", "docs")).limit(100).fetch()
122
+ * while (page.hasNextPage()) {
123
+ * page = await page.next()
124
+ * }
125
+ */
126
+ declare class QueryResult<TEntity = Entity> {
127
+ /** The entities on this page. */
128
+ readonly entities: readonly TEntity[];
129
+ /**
130
+ * The block this page was read at.
131
+ *
132
+ * Every page of one walk reads the same block — the cursor is bound to it — so results cannot
133
+ * shift under a paginating reader.
134
+ */
135
+ readonly blockNumber: bigint;
136
+ /** The cursor for the next page, or `undefined` when this was the last one. */
137
+ readonly cursor: string | undefined;
138
+ private readonly fetchPage;
139
+ constructor(entities: readonly TEntity[], blockNumber: bigint, cursor: string | undefined, fetchPage: FetchPage<TEntity>);
140
+ /**
141
+ * Whether another page follows.
142
+ *
143
+ * The node omits the cursor once nothing remains, so this is an answer rather than the guess a
144
+ * short final page would be — a full last page is reported correctly.
145
+ */
146
+ hasNextPage(): boolean;
147
+ /**
148
+ * Fetches the next page.
149
+ *
150
+ * @throws {NoMoreResultsError} If this was the last page — check {@link hasNextPage} first.
151
+ * @throws {QueryError} If the node rejects the request; `kind === "cursor"` means the cursor
152
+ * expired and the walk has to start again.
153
+ */
154
+ next(): Promise<QueryResult<TEntity>>;
155
+ }
156
+ //#endregion
157
+ //#region src/query/queryBuilder.d.ts
158
+ /**
159
+ * Builds and runs a query.
160
+ *
161
+ * The selection is fixed when the builder is created and the filter is added by chaining, so the
162
+ * result type is known before a single predicate is written. Create one with `client.select(...)`
163
+ * rather than constructing it directly — that is what infers the entity shape from the selection.
164
+ *
165
+ * Every filter added with {@link where}, {@link ownedBy} and {@link createdBy} must hold; use
166
+ * {@link or} for alternatives inside one call.
167
+ *
168
+ * @typeParam TEntity - The projected entity shape, inferred from the selection by `client.select()`.
169
+ *
170
+ * @example
171
+ * import { createPublicClient } from "@arkiv-network/sdk"
172
+ * import { i32 } from "@arkiv-network/sdk/attr"
173
+ * import { cheesecake } from "@arkiv-network/sdk/chains"
174
+ * import { eq, gte, or } from "@arkiv-network/sdk/query"
175
+ * import { http } from "viem"
176
+ *
177
+ * const client = createPublicClient({ chain: cheesecake, transport: http() })
178
+ *
179
+ * const page = await client
180
+ * .select({ key: true, attributes: true })
181
+ * .where(gte("level", i32(10)), or(eq("status", "open"), eq("status", "review")))
182
+ * .ownedBy(owner)
183
+ * .limit(100)
184
+ * .fetch()
185
+ *
186
+ * for (const entity of page.entities) console.log(entity.key, entity.attributes)
187
+ */
188
+ declare class SelectQueryBuilder<TEntity = Entity> {
189
+ private readonly _client;
190
+ private readonly _select;
191
+ private readonly _filters;
192
+ private _ownedBy;
193
+ private _createdBy;
194
+ private _limit;
195
+ private _cursor;
196
+ private _atBlock;
197
+ constructor(client: ArkivClient, selection?: SelectArg);
198
+ /**
199
+ * Adds filters. Everything passed here, and across repeated calls, must hold.
200
+ *
201
+ * @param expressions - The expressions, as separate arguments or one array.
202
+ *
203
+ * @example
204
+ * builder.where(eq("category", "docs"))
205
+ * builder.where(gte("level", i32(10)), lt("level", i32(20)))
206
+ * builder.where(or(eq("status", "open"), not(exists("closedAt"))))
207
+ */
208
+ where(expressions: readonly Expression[]): this;
209
+ where(...expressions: Expression[]): this;
210
+ /**
211
+ * Restricts the results to entities this account owns — shorthand for
212
+ * `where(eq("$owner", addr(owner)))`. Calling it again replaces the filter.
213
+ *
214
+ * @example
215
+ * builder.ownedBy("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045")
216
+ */
217
+ ownedBy(owner: Hex): this;
218
+ /**
219
+ * Restricts the results to entities this account created — shorthand for
220
+ * `where(eq("$creator", addr(creator)))`. Calling it again replaces the filter.
221
+ *
222
+ * The creator never changes; the owner does, so these differ after a transfer.
223
+ */
224
+ createdBy(creator: Hex): this;
225
+ /**
226
+ * Sets the page size, up to the node maximum of 200. Without it the node picks the page size.
227
+ *
228
+ * @example
229
+ * builder.limit(100)
230
+ */
231
+ limit(limit: number): this;
232
+ /**
233
+ * Starts from a cursor returned by an earlier page.
234
+ *
235
+ * Pagination normally goes through {@link QueryResult.next}, which carries the cursor for you;
236
+ * this is for resuming a walk in a later process. A cursor is bound to the query, block and
237
+ * selection it came from, so it must be used with an identically-built query — {@link atBlock}
238
+ * set to the `blockNumber` of the page the cursor came from is required (persist the two
239
+ * together), and a fetch with a cursor but no block rejects locally.
240
+ */
241
+ cursor(cursor: string): this;
242
+ /**
243
+ * Reads the state as of a given block rather than the head. The block must be within the range
244
+ * the node retains.
245
+ *
246
+ * @example
247
+ * builder.atBlock(1_297_000n)
248
+ */
249
+ atBlock(block: bigint): this;
250
+ /**
251
+ * The query string this builder will send — the same text the node parses.
252
+ *
253
+ * @throws {InvalidPredicateError} If no filter has been added.
254
+ */
255
+ toString(): string;
256
+ /**
257
+ * Runs the query and returns the first page.
258
+ *
259
+ * @throws {InvalidPredicateError} If no filter has been added.
260
+ * @throws {QueryError} If the node rejects the query.
261
+ *
262
+ * @example
263
+ * const page = await client.select({ key: true }).where(eq("category", "docs")).fetch()
264
+ * page.entities // this page
265
+ * await page.next() // the next one
266
+ */
267
+ fetch(): Promise<QueryResult<TEntity>>;
268
+ /**
269
+ * Walks every page, yielding one entity at a time.
270
+ *
271
+ * @example
272
+ * for await (const entity of client.select({ key: true }).where(eq("category", "docs"))) {
273
+ * console.log(entity.key)
274
+ * }
275
+ */
276
+ [Symbol.asyncIterator](): AsyncGenerator<TEntity>;
277
+ }
278
+ //#endregion
279
+ export { QueryErrorKind as a, QueryRequest as c, QueryError as i, QueryResponse as l, QueryResult as n, UnsupportedOperatorError as o, InvalidPredicateError as r, MAX_LIMIT as s, SelectQueryBuilder as t, runQuery as u };
280
+ //# sourceMappingURL=index-CMeD8uEq.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-CMeD8uEq.d.cts","names":[],"sources":["../src/query/engine.ts","../src/query/errors.ts","../src/query/queryResult.ts","../src/query/queryBuilder.ts"],"sourcesContent":[],"mappings":";;;;;cAUa,SAAA;;AAAA,KAGD,YAAA,GAHU;EAGV;EAcA,KAAA,EAAA,MAAA;EAaU;EAAiB,MAAA,EAvB7B,SAuB6B;EAAsB;EAAuB,KAAA,CAAA,EAAA,MAAA,GAAA,SAAA;EAAR;EAAO,MAAA,CAAA,EAAA,MAAA,GAAA,SAAA;;;;ACxBnF;AAMgB,KDKJ,aAAA,GCLI;EAE4C,QAAA,EDIhD,MCJgD,EAAA;EARd;EAAK,WAAA,EAAA,MAAA;EAyBtC;EAgBD,MAAA,EAAA,MAAA,GAAc,SAAA;AAwC1B,CAAA;;;;;;iBDzDsB,QAAA,SAAiB,sBAAsB,eAAe,QAAQ;;;;;;;AA9BpF;AAGA;AAcA;AAaA;;;;;;;cCxBa,wBAAA,SAAiC,KAAA;;EAAjC,SAAA,aAAA,EAAA,MAAyB;EAMtB;EAE4C,SAAA,QAAA,EAAA,MAAA;EARd;EAAK,SAAA,GAAA,EAMnC,OANmC;EAyBtC,WAAA,CAAA,aAAsB,EAAA,MAAA,EAAA,QAAa,EAAA,MAAA,EAAA,GAAA,EAjBY,OAiBZ,EAAA,IAAA,CAAA,EAAA,MAAA;AAgBhD;AAwCA;;;;;cAxDa,qBAAA,SAA8B,KAAA;;;ECrCtC,WAAA,CAAS,OAAA,EAAA,MAAA,EAAA,aAAA,CAAA,EAAA,MAAA;;;;;AAgBd;;AAE8B,KDmClB,cAAA;;+GCSwB;kHAApB;;;ACzBhB,0DAA0C,OAAA;;;;;;;;;;;;;;;;;cFwD7B,UAAA,SAAmB,KAAA;;iBAEf;;;;;;;oBAQG;;;;;KCvGf,yCAAyC,QAAQ,YAAY;;;AFMlE;AAGA;AAcA;AAaA;;;;;;;;;ACxBa,cCIA,WDJyB,CAAA,UCIH,MDJG,CAAA,CAAA;EAMtB;EAE4C,SAAA,QAAA,EAAA,SCF9B,ODE8B,EAAA;EARd;;AAyB9C;AAgBA;AAwCA;;EAUoB,SAAA,WAAA,EAAA,MAAA;EAVY;EAAK,SAAA,MAAA,EAAA,MAAA,GAAA,SAAA;;iCC7Dd,uEAGR,UAAU;;AAtCoB;;;;;EAmBhC,WAAA,CAAA,CAAA,EAAW,OAAA;EAAW;;;;;;;EA8CnB,IAAA,CAAA,CAAA,EAAA,OAAA,CAAQ,WAAR,CAAoB,OAApB,CAAA,CAAA;;;;AFrDhB;AAcA;AAaA;;;;;;;;;ACxBA;;;;;AAyBA;AAgBA;AAwCA;;;;;;;;AChG6C;;;;AAGQ,cCqCxC,kBDrCwC,CAAA,UCqCX,MDrCW,CAAA,CAAA;EAgBxC,iBAAW,OAAA;EAAW,iBAAA,OAAA;EAEL,iBAAA,QAAA;EAcP,QAAA,QAAA;EAGE,QAAA,UAAA;EAAV,QAAA,MAAA;EA2BqB,QAAA,OAAA;EAAZ,QAAA,QAAA;EAAR,WAAA,CAAA,MAAA,ECfM,WDeN,EAAA,SAAA,CAAA,ECf+B,SDe/B;EAAO;;;;ACzBvB;;;;;;EAuCiB,KAAA,CAAA,WAAA,EAAA,SAda,UAcb,EAAA,CAAA,EAAA,IAAA;EAWI,KAAA,CAAA,GAAA,WAAA,EAxBG,UAwBH,EAAA,CAAA,EAAA,IAAA;EAyEgB;;;;;;;iBApFpB;;;;;;;qBAWI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAyEJ,QAAQ,YAAY;;;;;;;;;GAqB3B,MAAA,CAAO,aAAA,KAAkB,eAAe"}