@airgap/tezos 0.13.8 → 0.13.9-beta.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.
- package/airgap-coinlib-tezos.min.js +6 -0
- package/package.json +4 -4
- package/v1/index.d.ts +1 -2
- package/v1/index.js +1 -3
- package/v1/index.js.map +1 -1
- package/v1/module/TezosModule.d.ts +9 -6
- package/v1/module/TezosModule.js +126 -10
- package/v1/module/TezosModule.js.map +1 -1
- package/v1/protocol/fa/TezosFAProtocol.d.ts +3 -2
- package/v1/protocol/fa/TezosFAProtocol.js +21 -11
- package/v1/protocol/fa/TezosFAProtocol.js.map +1 -1
- package/v1/protocol/kt/TezosKtProtocol.js +7 -0
- package/v1/protocol/kt/TezosKtProtocol.js.map +1 -1
- package/v1/protocol/sapling/TezosSaplingProtocol.js +6 -2
- package/v1/protocol/sapling/TezosSaplingProtocol.js.map +1 -1
- package/v1/protocol/sapling/TezosShieldedTezProtocol.d.ts +0 -2
- package/v1/protocol/sapling/TezosShieldedTezProtocol.js +3 -5
- package/v1/protocol/sapling/TezosShieldedTezProtocol.js.map +1 -1
- package/v1/serializer/v3/schemas/converter/transaction-converter.js +26 -4
- package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -1
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-tezos-sapling.d.ts +1 -1
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-tezos.d.ts +5 -1
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-tezos-sapling.json +29 -36
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-tezos.json +8 -15
- package/v1/serializer/v3/serializer-companion.d.ts +15 -0
- package/v1/serializer/v3/serializer-companion.js +521 -0
- package/v1/serializer/v3/serializer-companion.js.map +1 -0
- package/v1/serializer/v3/validators/transaction-validator.d.ts +1 -7
- package/v1/serializer/v3/validators/transaction-validator.js +2 -20
- package/v1/serializer/v3/validators/transaction-validator.js.map +1 -1
- package/v1/utils/protocol/tezos/TezosAccountant.js +9 -5
- package/v1/utils/protocol/tezos/TezosAccountant.js.map +1 -1
- package/v1/module/TezosKtModule.d.ts +0 -8
- package/v1/module/TezosKtModule.js +0 -87
- package/v1/module/TezosKtModule.js.map +0 -1
- package/v1/module/TezosShieldedTezModule.d.ts +0 -8
- package/v1/module/TezosShieldedTezModule.js +0 -86
- package/v1/module/TezosShieldedTezModule.js.map +0 -1
|
@@ -75,7 +75,7 @@ var TezosAccountant = /** @class */ (function () {
|
|
|
75
75
|
var _this = this;
|
|
76
76
|
return __generator(this, function (_a) {
|
|
77
77
|
return [2 /*return*/, Promise.all(wrappedOperation.contents.map(function (content) { return __awaiter(_this, void 0, void 0, function () {
|
|
78
|
-
var operation, partialTxs, _a,
|
|
78
|
+
var operation, partialTxs, _a, tezosSpendOperation_1, tezosOriginationOperation, delegate, delegate;
|
|
79
79
|
var _this = this;
|
|
80
80
|
return __generator(this, function (_b) {
|
|
81
81
|
switch (_b.label) {
|
|
@@ -106,11 +106,15 @@ var TezosAccountant = /** @class */ (function () {
|
|
|
106
106
|
];
|
|
107
107
|
return [3 /*break*/, 8];
|
|
108
108
|
case 2:
|
|
109
|
-
|
|
110
|
-
operation =
|
|
111
|
-
return [4 /*yield*/, this.getDetailsFromTransactionOperation(
|
|
109
|
+
tezosSpendOperation_1 = content;
|
|
110
|
+
operation = tezosSpendOperation_1;
|
|
111
|
+
return [4 /*yield*/, this.getDetailsFromTransactionOperation(tezosSpendOperation_1)];
|
|
112
112
|
case 3:
|
|
113
|
-
partialTxs = _b.sent()
|
|
113
|
+
partialTxs = (_b.sent()).map(function (tx) {
|
|
114
|
+
var _a;
|
|
115
|
+
return (__assign(__assign({}, tx), { extra: tezosSpendOperation_1.parameters
|
|
116
|
+
? __assign(__assign({}, ((_a = tx.extra) !== null && _a !== void 0 ? _a : {})), { parameters: tezosSpendOperation_1.parameters }) : undefined }));
|
|
117
|
+
});
|
|
114
118
|
return [3 /*break*/, 8];
|
|
115
119
|
case 4:
|
|
116
120
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TezosAccountant.js","sourceRoot":"","sources":["../../../../../src/v1/utils/protocol/tezos/TezosAccountant.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA0D;AAC1D,sDAA6E;AAC7E,iDAAiE;AAOjE,mFAAiF;AAOjF;IACE,yBAAsC,MAAmB,EAAqB,OAA6B;QAArE,WAAM,GAAN,MAAM,CAAa;QAAqB,YAAO,GAAP,OAAO,CAAsB;IAAG,CAAC;IAElG,mDAAyB,GAAtC,UACE,WAA8D;;;;;4BAEd,qBAAM,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,EAAA;;wBAAlH,gBAAgB,GAA0B,SAAwE;wBAExH,sBAAO,IAAI,CAAC,8BAA8B,CAAC,gBAAgB,CAAC,EAAA;;;;KAC7D;IAEa,wDAA8B,GAA5C,UAA6C,gBAAuC;;;;gBAClF,sBAAO,OAAO,CAAC,GAAG,CAChB,gBAAgB,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAO,OAAuB;;;;;;oCAGtD,UAAU,GAAqD,EAAE,CAAA;oCAE7D,KAAA,OAAO,CAAC,IAAI,CAAA;;6CACb,uCAAkB,CAAC,MAAM,CAAC,CAA1B,wBAAyB;6CASzB,uCAAkB,CAAC,WAAW,CAAC,CAA/B,wBAA8B;
|
|
1
|
+
{"version":3,"file":"TezosAccountant.js","sourceRoot":"","sources":["../../../../../src/v1/utils/protocol/tezos/TezosAccountant.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA0D;AAC1D,sDAA6E;AAC7E,iDAAiE;AAOjE,mFAAiF;AAOjF;IACE,yBAAsC,MAAmB,EAAqB,OAA6B;QAArE,WAAM,GAAN,MAAM,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irGapBlockExplorer, AirGapModule, AirGapOfflineProtocol, AirGapOnlineProtocol, ProtocolNetwork } from '@airgap/module-kit';
|
|
2
|
-
export declare class TezosKtModule implements AirGapModule {
|
|
3
|
-
private readonly networkRegistry;
|
|
4
|
-
readonly supportedNetworks: Record<string, ProtocolNetwork>;
|
|
5
|
-
createOfflineProtocol(): Promise<AirGapOfflineProtocol | undefined>;
|
|
6
|
-
createOnlineProtocol(networkId?: string): Promise<AirGapOnlineProtocol | undefined>;
|
|
7
|
-
createBlockExplorer(networkId?: string): Promise<AirGapBlockExplorer | undefined>;
|
|
8
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.TezosKtModule = void 0;
|
|
40
|
-
var coinlib_core_1 = require("@airgap/coinlib-core");
|
|
41
|
-
var errors_1 = require("@airgap/coinlib-core/errors");
|
|
42
|
-
var module_kit_1 = require("@airgap/module-kit");
|
|
43
|
-
var factory_1 = require("../block-explorer/factory");
|
|
44
|
-
var TezosKtProtocol_1 = require("../protocol/kt/TezosKtProtocol");
|
|
45
|
-
var TezosProtocol_1 = require("../protocol/TezosProtocol");
|
|
46
|
-
var TezosKtModule = /** @class */ (function () {
|
|
47
|
-
function TezosKtModule() {
|
|
48
|
-
this.networkRegistry = new module_kit_1.ModuleNetworkRegistry({
|
|
49
|
-
supportedNetworks: [TezosProtocol_1.TEZOS_MAINNET_PROTOCOL_NETWORK]
|
|
50
|
-
});
|
|
51
|
-
this.supportedNetworks = this.networkRegistry.supportedNetworks;
|
|
52
|
-
}
|
|
53
|
-
TezosKtModule.prototype.createOfflineProtocol = function () {
|
|
54
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
55
|
-
return __generator(this, function (_a) {
|
|
56
|
-
return [2 /*return*/, (0, TezosKtProtocol_1.createTezosKtProtocol)()];
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
TezosKtModule.prototype.createOnlineProtocol = function (networkId) {
|
|
61
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
62
|
-
var network;
|
|
63
|
-
return __generator(this, function (_a) {
|
|
64
|
-
network = this.networkRegistry.findNetwork(networkId);
|
|
65
|
-
if (network === undefined) {
|
|
66
|
-
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.TEZOS, 'Protocol network type not supported.');
|
|
67
|
-
}
|
|
68
|
-
return [2 /*return*/, (0, TezosKtProtocol_1.createTezosKtProtocol)({ network: network })];
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
TezosKtModule.prototype.createBlockExplorer = function (networkId) {
|
|
73
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
74
|
-
var network;
|
|
75
|
-
return __generator(this, function (_a) {
|
|
76
|
-
network = this.networkRegistry.findNetwork(networkId);
|
|
77
|
-
if (network === undefined) {
|
|
78
|
-
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.TEZOS, 'Block Explorer network type not supported.');
|
|
79
|
-
}
|
|
80
|
-
return [2 /*return*/, (0, factory_1.createTezosBlockExplorer)(network.blockExplorer)];
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
return TezosKtModule;
|
|
85
|
-
}());
|
|
86
|
-
exports.TezosKtModule = TezosKtModule;
|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AAa"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AirGapBlockExplorer, AirGapModule, AirGapOfflineProtocol, AirGapOnlineProtocol, ProtocolNetwork } from '@airgap/module-kit';
|
|
2
|
-
export declare class TezosShieldedModule implements AirGapModule {
|
|
3
|
-
private readonly networkRegistry;
|
|
4
|
-
readonly supportedNetworks: Record<string, ProtocolNetwork>;
|
|
5
|
-
createOfflineProtocol(): Promise<AirGapOfflineProtocol | undefined>;
|
|
6
|
-
createOnlineProtocol(networkId?: string): Promise<AirGapOnlineProtocol | undefined>;
|
|
7
|
-
createBlockExplorer(networkId?: string): Promise<AirGapBlockExplorer | undefined>;
|
|
8
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.TezosShieldedModule = void 0;
|
|
40
|
-
var coinlib_core_1 = require("@airgap/coinlib-core");
|
|
41
|
-
var errors_1 = require("@airgap/coinlib-core/errors");
|
|
42
|
-
var module_kit_1 = require("@airgap/module-kit");
|
|
43
|
-
var factory_1 = require("../block-explorer/factory");
|
|
44
|
-
var TezosShieldedTezProtocol_1 = require("../protocol/sapling/TezosShieldedTezProtocol");
|
|
45
|
-
var TezosShieldedModule = /** @class */ (function () {
|
|
46
|
-
function TezosShieldedModule() {
|
|
47
|
-
this.networkRegistry = new module_kit_1.ModuleNetworkRegistry({
|
|
48
|
-
supportedNetworks: [TezosShieldedTezProtocol_1.SHIELDED_TEZ_MAINNET_PROTOCOL_NETWORK, TezosShieldedTezProtocol_1.SHIELDED_TEZ_GHOSTNET_PROTOCOL_NETWORK]
|
|
49
|
-
});
|
|
50
|
-
this.supportedNetworks = this.networkRegistry.supportedNetworks;
|
|
51
|
-
}
|
|
52
|
-
TezosShieldedModule.prototype.createOfflineProtocol = function () {
|
|
53
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
54
|
-
return __generator(this, function (_a) {
|
|
55
|
-
return [2 /*return*/, (0, TezosShieldedTezProtocol_1.createTezosShieldedTezProtocol)()];
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
TezosShieldedModule.prototype.createOnlineProtocol = function (networkId) {
|
|
60
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
61
|
-
var network;
|
|
62
|
-
return __generator(this, function (_a) {
|
|
63
|
-
network = this.networkRegistry.findNetwork(networkId);
|
|
64
|
-
if (network === undefined) {
|
|
65
|
-
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.TEZOS, 'Protocol network type not supported.');
|
|
66
|
-
}
|
|
67
|
-
return [2 /*return*/, (0, TezosShieldedTezProtocol_1.createTezosShieldedTezProtocol)({ network: network })];
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
};
|
|
71
|
-
TezosShieldedModule.prototype.createBlockExplorer = function (networkId) {
|
|
72
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
73
|
-
var network;
|
|
74
|
-
return __generator(this, function (_a) {
|
|
75
|
-
network = this.networkRegistry.findNetwork(networkId);
|
|
76
|
-
if (network === undefined) {
|
|
77
|
-
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.TEZOS, 'Block Explorer network type not supported.');
|
|
78
|
-
}
|
|
79
|
-
return [2 /*return*/, (0, factory_1.createTezosBlockExplorer)(network.blockExplorer)];
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
};
|
|
83
|
-
return TezosShieldedModule;
|
|
84
|
-
}());
|
|
85
|
-
exports.TezosShieldedModule = TezosShieldedModule;
|
|
86
|
-
//# sourceMappingURL=TezosShieldedTezModule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TezosShieldedTezModule.js","sourceRoot":"","sources":["../../../src/v1/module/TezosShieldedTezModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA6C;AAC7C,sDAAqE;AACrE,iDAO2B;AAE3B,qDAAoE;AACpE,yFAIqD;AAGrD;IAAA;QACmB,oBAAe,GAAuD,IAAI,kCAAqB,CAAC;YAC/G,iBAAiB,EAAE,CAAC,gEAAqC,EAAE,iEAAsC,CAAC;SACnG,CAAC,CAAA;QAEc,sBAAiB,GAAoC,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAA;IAuB7G,CAAC;IArBc,mDAAqB,GAAlC;;;gBACE,sBAAO,IAAA,yDAA8B,GAAE,EAAA;;;KACxC;IAEY,kDAAoB,GAAjC,UAAkC,SAAkB;;;;gBAC5C,OAAO,GAA4C,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;gBACpG,IAAI,OAAO,KAAK,SAAS,EAAE;oBACzB,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,KAAK,EAAE,sCAAsC,CAAC,CAAA;iBACxF;gBAED,sBAAO,IAAA,yDAA8B,EAAC,EAAE,OAAO,SAAA,EAAE,CAAC,EAAA;;;KACnD;IAEY,iDAAmB,GAAhC,UAAiC,SAAkB;;;;gBAC3C,OAAO,GAA4C,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;gBACpG,IAAI,OAAO,KAAK,SAAS,EAAE;oBACzB,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,KAAK,EAAE,4CAA4C,CAAC,CAAA;iBAC9F;gBAED,sBAAO,IAAA,kCAAwB,EAAC,OAAO,CAAC,aAAa,CAAC,EAAA;;;KACvD;IACH,0BAAC;AAAD,CAAC,AA5BD,IA4BC;AA5BY,kDAAmB"}
|