zkcloudworker 0.16.4 → 0.16.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. package/lib/ts/src/mina/index.d.ts +0 -1
  2. package/lib/ts/src/mina/index.js +0 -1
  3. package/lib/ts/src/mina/utils/index.d.ts +2 -0
  4. package/lib/ts/src/mina/utils/index.js +2 -0
  5. package/lib/ts/src/mina/utils/indexed-map.d.ts +21 -0
  6. package/lib/ts/src/mina/{nft/whitelist.js → utils/indexed-map.js} +24 -30
  7. package/lib/ts/src/mina/utils/ipfs.d.ts +5 -0
  8. package/lib/ts/src/mina/utils/ipfs.js +10 -0
  9. package/lib/ts/tsconfig.tsbuildinfo +1 -1
  10. package/lib/web/src/mina/index.d.ts +0 -1
  11. package/lib/web/src/mina/index.js +0 -1
  12. package/lib/web/src/mina/index.js.map +1 -1
  13. package/lib/web/src/mina/utils/index.d.ts +2 -0
  14. package/lib/web/src/mina/utils/index.js +2 -0
  15. package/lib/web/src/mina/utils/index.js.map +1 -1
  16. package/lib/web/src/mina/utils/indexed-map.d.ts +21 -0
  17. package/lib/web/src/mina/{nft/whitelist.js → utils/indexed-map.js} +22 -26
  18. package/lib/web/src/mina/utils/indexed-map.js.map +1 -0
  19. package/lib/web/src/mina/utils/ipfs.d.ts +5 -0
  20. package/lib/web/src/mina/utils/ipfs.js +8 -0
  21. package/lib/web/src/mina/utils/ipfs.js.map +1 -0
  22. package/lib/web/tsconfig.web.tsbuildinfo +1 -1
  23. package/package.json +1 -1
  24. package/lib/ts/src/mina/nft/index.d.ts +0 -3
  25. package/lib/ts/src/mina/nft/index.js +0 -19
  26. package/lib/ts/src/mina/nft/types.d.ts +0 -1254
  27. package/lib/ts/src/mina/nft/types.js +0 -236
  28. package/lib/ts/src/mina/nft/whitelist-admin.d.ts +0 -23
  29. package/lib/ts/src/mina/nft/whitelist-admin.js +0 -139
  30. package/lib/ts/src/mina/nft/whitelist.d.ts +0 -20
  31. package/lib/web/src/mina/nft/index.d.ts +0 -3
  32. package/lib/web/src/mina/nft/index.js +0 -4
  33. package/lib/web/src/mina/nft/index.js.map +0 -1
  34. package/lib/web/src/mina/nft/types.d.ts +0 -1254
  35. package/lib/web/src/mina/nft/types.js +0 -227
  36. package/lib/web/src/mina/nft/types.js.map +0 -1
  37. package/lib/web/src/mina/nft/whitelist-admin.d.ts +0 -23
  38. package/lib/web/src/mina/nft/whitelist-admin.js +0 -128
  39. package/lib/web/src/mina/nft/whitelist-admin.js.map +0 -1
  40. package/lib/web/src/mina/nft/whitelist.d.ts +0 -20
  41. package/lib/web/src/mina/nft/whitelist.js.map +0 -1
@@ -1,227 +0,0 @@
1
- import { Field, PublicKey, Bool, VerificationKey, Struct, UInt32, UInt64, Encoding, Provable, DynamicProof, FeatureFlags, } from "o1js";
2
- export { Storage, MintParams, MintSignatureData, NFTData, CollectionData, NFTState, NFTImmutableState, NFTUpdateProof, };
3
- class Storage extends Struct({
4
- url: Provable.Array(Field, 2),
5
- }) {
6
- constructor(value) {
7
- super(value);
8
- }
9
- static assertEquals(a, b) {
10
- a.url[0].assertEquals(b.url[0]);
11
- a.url[1].assertEquals(b.url[1]);
12
- }
13
- static equals(a, b) {
14
- return a.url[0].equals(b.url[0]).and(a.url[1].equals(b.url[1]));
15
- }
16
- static fromURL(url) {
17
- const fields = Encoding.stringToFields(url);
18
- if (fields.length !== 2)
19
- throw new Error("Invalid URL");
20
- return new Storage({ url: [fields[0], fields[1]] });
21
- }
22
- toURL() {
23
- return Encoding.stringFromFields(this.url);
24
- }
25
- }
26
- class NFTImmutableState extends Struct({
27
- creator: PublicKey, // readonly
28
- canChangeOwner: Bool, // readonly
29
- canChangeMetadata: Bool, // readonly
30
- canChangePrice: Bool, // readonly
31
- canChangeStorage: Bool, // readonly
32
- canChangeName: Bool, // readonly
33
- canChangeMetadataVerificationKeyHash: Bool, // readonly
34
- canPause: Bool, // readonly
35
- address: PublicKey, // readonly
36
- tokenId: Field, // readonly
37
- }) {
38
- static assertEqual(a, b) {
39
- a.creator.assertEquals(b.creator);
40
- a.canChangeOwner.assertEquals(b.canChangeOwner);
41
- a.canChangeMetadata.assertEquals(b.canChangeMetadata);
42
- a.canChangePrice.assertEquals(b.canChangePrice);
43
- a.canChangeStorage.assertEquals(b.canChangeStorage);
44
- a.canChangeName.assertEquals(b.canChangeName);
45
- a.canChangeMetadataVerificationKeyHash.assertEquals(b.canChangeMetadataVerificationKeyHash);
46
- a.canPause.assertEquals(b.canPause);
47
- a.address.assertEquals(b.address);
48
- a.tokenId.assertEquals(b.tokenId);
49
- }
50
- }
51
- class NFTState extends Struct({
52
- immutableState: NFTImmutableState,
53
- name: Field,
54
- metadata: Field,
55
- storage: Storage,
56
- owner: PublicKey,
57
- price: UInt64,
58
- version: UInt32,
59
- isPaused: Bool,
60
- }) {
61
- static assertEqual(a, b) {
62
- NFTImmutableState.assertEqual(a.immutableState, b.immutableState);
63
- a.name.assertEquals(b.name);
64
- a.metadata.assertEquals(b.metadata);
65
- Storage.assertEquals(a.storage, b.storage);
66
- a.owner.assertEquals(b.owner);
67
- a.price.assertEquals(b.price);
68
- a.version.assertEquals(b.version);
69
- a.isPaused.assertEquals(b.isPaused);
70
- }
71
- }
72
- class NFTUpdateProof extends DynamicProof {
73
- }
74
- NFTUpdateProof.publicInputType = NFTState;
75
- NFTUpdateProof.publicOutputType = NFTState;
76
- NFTUpdateProof.maxProofsVerified = 2;
77
- NFTUpdateProof.featureFlags = FeatureFlags.allMaybe;
78
- class NFTData extends Struct({
79
- price: UInt64,
80
- version: UInt32,
81
- canChangeOwner: Bool, // readonly
82
- canChangeMetadata: Bool, // readonly
83
- canChangePrice: Bool, // readonly
84
- canChangeStorage: Bool, // readonly
85
- canChangeName: Bool, // readonly
86
- canChangeMetadataVerificationKeyHash: Bool, // readonly
87
- canPause: Bool, // readonly
88
- isPaused: Bool,
89
- // what else?
90
- }) {
91
- new(params = {}) {
92
- const { price, version, canChangeOwner, canChangeMetadata, canChangePrice, canChangeStorage, canChangeName, canChangeMetadataVerificationKeyHash, canPause, isPaused, } = params;
93
- return new NFTData({
94
- price: UInt64.from(price ?? 0),
95
- version: UInt32.from(version ?? 0),
96
- canChangeOwner: Bool(canChangeOwner ?? true),
97
- canChangeMetadata: Bool(canChangeMetadata ?? false),
98
- canChangePrice: Bool(canChangePrice ?? true),
99
- canChangeStorage: Bool(canChangeStorage ?? false),
100
- canChangeName: Bool(canChangeName ?? false),
101
- canChangeMetadataVerificationKeyHash: Bool(canChangeMetadataVerificationKeyHash ?? false),
102
- canPause: Bool(canPause ?? false),
103
- isPaused: Bool(isPaused ?? false),
104
- });
105
- }
106
- pack() {
107
- const price = this.price.value.toBits(64);
108
- const version = this.version.value.toBits(32);
109
- return Field.fromBits([
110
- ...price,
111
- ...version,
112
- this.canChangeOwner,
113
- this.canChangeMetadata,
114
- this.canChangePrice,
115
- this.canChangeStorage,
116
- this.canChangeName,
117
- this.canChangeMetadataVerificationKeyHash,
118
- this.canPause,
119
- this.isPaused,
120
- ]);
121
- }
122
- static unpack(packed) {
123
- const bits = packed.toBits(64 + 32 + 8);
124
- const price = UInt64.Unsafe.fromField(Field.fromBits(bits.slice(0, 64)));
125
- const version = UInt32.Unsafe.fromField(Field.fromBits(bits.slice(64, 64 + 32)));
126
- const canChangeOwner = bits[64 + 32];
127
- const canChangeMetadata = bits[64 + 32 + 1];
128
- const canChangePrice = bits[64 + 32 + 2];
129
- const canChangeStorage = bits[64 + 32 + 3];
130
- const canChangeName = bits[64 + 32 + 4];
131
- const canChangeMetadataVerificationKeyHash = bits[64 + 32 + 5];
132
- const canPause = bits[64 + 32 + 6];
133
- const isPaused = bits[64 + 32 + 7];
134
- return new NFTData({
135
- price,
136
- version,
137
- canChangeOwner,
138
- canChangeMetadata,
139
- canChangePrice,
140
- canChangeStorage,
141
- canChangeName,
142
- canChangeMetadataVerificationKeyHash,
143
- canPause,
144
- isPaused,
145
- });
146
- }
147
- }
148
- class CollectionData extends Struct({
149
- requireTransferApproval: Bool,
150
- requireUpdateApproval: Bool,
151
- requireSaleApproval: Bool,
152
- requireBuyApproval: Bool,
153
- requireMintApproval: Bool,
154
- canMint: Bool,
155
- canPause: Bool,
156
- canResume: Bool,
157
- canChangeName: Bool,
158
- canChangeCreator: Bool,
159
- canChangeBaseUri: Bool,
160
- canChangeSaleCommission: Bool,
161
- isPaused: Bool,
162
- }) {
163
- pack() {
164
- return Field.fromBits([
165
- this.requireTransferApproval,
166
- this.requireUpdateApproval,
167
- this.requireSaleApproval,
168
- this.requireMintApproval,
169
- this.requireBuyApproval,
170
- this.canMint,
171
- this.canChangeName,
172
- this.canChangeCreator,
173
- this.canChangeBaseUri,
174
- this.canChangeSaleCommission,
175
- this.canPause,
176
- this.canResume,
177
- this.isPaused,
178
- ]);
179
- }
180
- static unpack(packed) {
181
- const bits = packed.toBits(13);
182
- return new CollectionData({
183
- requireTransferApproval: bits[0],
184
- requireUpdateApproval: bits[1],
185
- requireSaleApproval: bits[2],
186
- requireMintApproval: bits[3],
187
- requireBuyApproval: bits[4],
188
- canMint: bits[5],
189
- canChangeName: bits[6],
190
- canChangeCreator: bits[7],
191
- canChangeBaseUri: bits[8],
192
- canChangeSaleCommission: bits[9],
193
- canPause: bits[10],
194
- canResume: bits[11],
195
- isPaused: bits[12],
196
- });
197
- }
198
- }
199
- class MintParams extends Struct({
200
- name: Field,
201
- address: PublicKey,
202
- tokenId: Field,
203
- owner: PublicKey,
204
- data: NFTData,
205
- fee: UInt64,
206
- metadata: Field,
207
- storage: Storage,
208
- metadataVerificationKey: VerificationKey,
209
- nftVerificationKey: VerificationKey,
210
- expiry: UInt32,
211
- }) {
212
- }
213
- class MintSignatureData extends Struct({
214
- name: Field,
215
- address: PublicKey,
216
- tokenId: Field,
217
- owner: PublicKey,
218
- packedData: Field,
219
- fee: UInt64,
220
- metadata: Field,
221
- storage: Storage,
222
- metadataVerificationKeyHash: Field,
223
- nftVerificationKeyHash: Field,
224
- expiry: UInt32,
225
- }) {
226
- }
227
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"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kBAAkB,EAAE,eAAe;IACnC,MAAM,EAAE,MAAM;CACf,CAAC;CAAG;AAEL,MAAM,iBAAkB,SAAQ,MAAM,CAAC;IACrC,IAAI,EAAE,KAAK;IACX,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,SAAS;IAChB,UAAU,EAAE,KAAK;IACjB,GAAG,EAAE,MAAM;IACX,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE,OAAO;IAChB,2BAA2B,EAAE,KAAK;IAClC,sBAAsB,EAAE,KAAK;IAC7B,MAAM,EAAE,MAAM;CACf,CAAC;CAAG"}
@@ -1,23 +0,0 @@
1
- import { DeployArgs, PublicKey, SmartContract, State, VerificationKey, UInt64, Field } from "o1js";
2
- import { MintParams, NFTState, NFTAdminBase, Storage } from "./types";
3
- export interface NFTWhitelistedAdminDeployProps extends Exclude<DeployArgs, undefined> {
4
- admin: PublicKey;
5
- collection: PublicKey;
6
- whitelist: Field;
7
- storage: Storage;
8
- }
9
- export declare class NFTWhitelistedAdmin extends SmartContract implements NFTAdminBase {
10
- collection: State<PublicKey>;
11
- admin: State<PublicKey>;
12
- whitelist: State<import("o1js/dist/node/lib/provable/field").Field>;
13
- storage: State<Storage>;
14
- deploy(props: NFTWhitelistedAdminDeployProps): Promise<void>;
15
- isWhitelisted(address: PublicKey, amount: UInt64): Promise<import("o1js/dist/node/lib/provable/bool").Bool>;
16
- updateVerificationKey(vk: VerificationKey): Promise<void>;
17
- canMint(params: MintParams): Promise<import("o1js/dist/node/lib/provable/bool").Bool>;
18
- canUpdate(input: NFTState, output: NFTState): Promise<import("o1js/dist/node/lib/provable/bool").Bool>;
19
- canTransfer(address: PublicKey, from: PublicKey, to: PublicKey): Promise<import("o1js/dist/node/lib/provable/bool").Bool>;
20
- canSell(address: PublicKey, seller: PublicKey, price: UInt64): Promise<import("o1js/dist/node/lib/provable/bool").Bool>;
21
- canBuy(address: PublicKey, seller: PublicKey, buyer: PublicKey, price: UInt64): Promise<import("o1js/dist/node/lib/provable/bool").Bool>;
22
- updateMerkleMapRoot(root: Field, storage: Storage): Promise<void>;
23
- }
@@ -1,128 +0,0 @@
1
- import { __decorate, __metadata } from "tslib";
2
- import { Bool, method, Permissions, Provable, PublicKey, SmartContract, State, state, VerificationKey, UInt64, Field, Poseidon, } from "o1js";
3
- import { Whitelist, loadWhitelist } from "./whitelist";
4
- import { MintParams, NFTState, Storage } from "./types";
5
- export class NFTWhitelistedAdmin extends SmartContract {
6
- constructor() {
7
- super(...arguments);
8
- this.collection = State();
9
- this.admin = State();
10
- this.whitelist = State();
11
- this.storage = State();
12
- }
13
- async deploy(props) {
14
- await super.deploy(props);
15
- this.collection.set(props.collection);
16
- this.admin.set(props.admin);
17
- this.whitelist.set(props.whitelist);
18
- this.storage.set(props.storage);
19
- this.account.zkappUri.set("zkcloudworker#NFTWhitelistedAdmin");
20
- this.account.permissions.set({
21
- ...Permissions.default(),
22
- setVerificationKey: Permissions.VerificationKey.impossibleDuringCurrentVersion(),
23
- setPermissions: Permissions.impossible(),
24
- });
25
- }
26
- async isWhitelisted(address, amount) {
27
- const whitelist = this.whitelist.getAndRequireEquals();
28
- const storage = this.storage.getAndRequireEquals();
29
- const map = await Provable.witnessAsync(Whitelist, async () => {
30
- return await loadWhitelist(storage);
31
- });
32
- map.root.assertEquals(whitelist);
33
- const key = Poseidon.hash(address.toFields());
34
- map.assertIncluded(key, "Address not whitelisted");
35
- const value = map.get(key);
36
- value.assertLessThanOrEqual(Field(UInt64.MAXINT().value));
37
- const maxAmount = UInt64.Unsafe.fromField(value);
38
- return Bool(amount.lessThanOrEqual(maxAmount));
39
- }
40
- async updateVerificationKey(vk) {
41
- const sender = this.sender.getAndRequireSignature();
42
- this.admin.getAndRequireEquals().assertEquals(sender);
43
- this.account.verificationKey.set(vk);
44
- }
45
- async canMint(params) {
46
- return await this.isWhitelisted(params.owner, UInt64.from(0));
47
- }
48
- async canUpdate(input, output) {
49
- return await this.isWhitelisted(output.owner, UInt64.from(0));
50
- }
51
- async canTransfer(address, from, to) {
52
- return await this.isWhitelisted(to, UInt64.from(0));
53
- }
54
- async canSell(address, seller, price) {
55
- return await this.isWhitelisted(address, price);
56
- }
57
- async canBuy(address, seller, buyer, price) {
58
- return (await this.isWhitelisted(buyer, price)).and(await this.isWhitelisted(seller, price));
59
- }
60
- async updateMerkleMapRoot(root, storage) {
61
- const sender = this.sender.getAndRequireSignature();
62
- this.admin.getAndRequireEquals().assertEquals(sender);
63
- this.whitelist.set(root);
64
- this.storage.set(storage);
65
- }
66
- }
67
- __decorate([
68
- state(PublicKey),
69
- __metadata("design:type", Object)
70
- ], NFTWhitelistedAdmin.prototype, "collection", void 0);
71
- __decorate([
72
- state(PublicKey),
73
- __metadata("design:type", Object)
74
- ], NFTWhitelistedAdmin.prototype, "admin", void 0);
75
- __decorate([
76
- state(Field),
77
- __metadata("design:type", Object)
78
- ], NFTWhitelistedAdmin.prototype, "whitelist", void 0);
79
- __decorate([
80
- state(Storage),
81
- __metadata("design:type", Object)
82
- ], NFTWhitelistedAdmin.prototype, "storage", void 0);
83
- __decorate([
84
- method,
85
- __metadata("design:type", Function),
86
- __metadata("design:paramtypes", [VerificationKey]),
87
- __metadata("design:returntype", Promise)
88
- ], NFTWhitelistedAdmin.prototype, "updateVerificationKey", null);
89
- __decorate([
90
- method.returns(Bool),
91
- __metadata("design:type", Function),
92
- __metadata("design:paramtypes", [MintParams]),
93
- __metadata("design:returntype", Promise)
94
- ], NFTWhitelistedAdmin.prototype, "canMint", null);
95
- __decorate([
96
- method.returns(Bool),
97
- __metadata("design:type", Function),
98
- __metadata("design:paramtypes", [NFTState, NFTState]),
99
- __metadata("design:returntype", Promise)
100
- ], NFTWhitelistedAdmin.prototype, "canUpdate", null);
101
- __decorate([
102
- method.returns(Bool),
103
- __metadata("design:type", Function),
104
- __metadata("design:paramtypes", [PublicKey, PublicKey, PublicKey]),
105
- __metadata("design:returntype", Promise)
106
- ], NFTWhitelistedAdmin.prototype, "canTransfer", null);
107
- __decorate([
108
- method.returns(Bool),
109
- __metadata("design:type", Function),
110
- __metadata("design:paramtypes", [PublicKey, PublicKey, UInt64]),
111
- __metadata("design:returntype", Promise)
112
- ], NFTWhitelistedAdmin.prototype, "canSell", null);
113
- __decorate([
114
- method.returns(Bool),
115
- __metadata("design:type", Function),
116
- __metadata("design:paramtypes", [PublicKey,
117
- PublicKey,
118
- PublicKey,
119
- UInt64]),
120
- __metadata("design:returntype", Promise)
121
- ], NFTWhitelistedAdmin.prototype, "canBuy", null);
122
- __decorate([
123
- method,
124
- __metadata("design:type", Function),
125
- __metadata("design:paramtypes", [Field, Storage]),
126
- __metadata("design:returntype", Promise)
127
- ], NFTWhitelistedAdmin.prototype, "updateMerkleMapRoot", null);
128
- //# sourceMappingURL=whitelist-admin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"whitelist-admin.js","sourceRoot":"","sources":["../../../../../../src/mina/nft/whitelist-admin.ts"],"names":[],"mappings":";AAAA,OAAO,EAEL,IAAI,EAEJ,MAAM,EACN,WAAW,EACX,QAAQ,EACR,SAAS,EACT,aAAa,EACb,KAAK,EACL,KAAK,EACL,eAAe,EACf,MAAM,EAEN,KAAK,EACL,QAAQ,GACT,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAgB,OAAO,EAAE,MAAM,SAAS,CAAC;AAUtE,MAAM,OAAO,mBAAoB,SAAQ,aAAa;IAAtD;;QACoB,eAAU,GAAG,KAAK,EAAa,CAAC;QAChC,UAAK,GAAG,KAAK,EAAa,CAAC;QAC/B,cAAS,GAAG,KAAK,EAAS,CAAC;QACzB,YAAO,GAAG,KAAK,EAAW,CAAC;IA8E7C,CAAC;IA5EC,KAAK,CAAC,MAAM,CAAC,KAAqC;QAChD,MAAM,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC1B,IAAI,CAAC,UAAU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AKd;AAGK;IADL,MAAM;;qCACyB,KAAK,EAAW,OAAO;;8DAKtD"}
@@ -1,20 +0,0 @@
1
- import { Storage } from "./types";
2
- declare const IndexedMerkleMap: typeof import("o1js/dist/node/lib/provable/merkle-tree-indexed").IndexedMerkleMap;
3
- declare const Whitelist_base: typeof import("o1js/dist/node/lib/provable/merkle-tree-indexed").IndexedMerkleMapBase;
4
- export declare class Whitelist extends Whitelist_base {
5
- }
6
- export declare function loadWhitelist(storage: Storage): Promise<Whitelist>;
7
- interface IndexedMapSerialized {
8
- height: number;
9
- root: string;
10
- length: string;
11
- nodes: string;
12
- sortedLeaves: string;
13
- }
14
- export declare function serializeWhitelist(map: Whitelist): string;
15
- export declare function deserializeWhitelist(params: {
16
- serializedIndexedMap: string;
17
- type?: ReturnType<typeof IndexedMerkleMap>;
18
- }): InstanceType<ReturnType<typeof IndexedMerkleMap>> | undefined;
19
- export declare function parseIndexedMapSerialized(serializedMap: string): IndexedMapSerialized;
20
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"whitelist.js","sourceRoot":"","sources":["../../../../../../src/mina/nft/whitelist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/D,MAAM,EAAE,gBAAgB,EAAE,GAAG,YAAY,CAAC;AAC1C,MAAM,OAAO,SAAU,SAAQ,gBAAgB,CAAC,EAAE,CAAC;CAAG;AAEtD,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAAgB;IAClD,MAAM,GAAG,GAAG,oCAAoC,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IACnE,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;I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