@signageos/front-applet 5.6.0 → 5.7.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/CHANGELOG.md +7 -0
- package/dist/bundle.js +1 -1
- package/dist/bundle.js.map +1 -1
- package/docs/js-api/js-file-system.md +4 -0
- package/docs/js-api/js-hardware-serial.md +14 -8
- package/docs/js-api/js-iframes.md +2 -0
- package/docs/js-api/js-proof-of-play.md +62 -0
- package/docs/management-api/1-js-management.md +8 -0
- package/es6/FrontApplet/FrontApplet.d.ts +2 -0
- package/es6/FrontApplet/FrontApplet.js +2 -0
- package/es6/FrontApplet/FrontApplet.js.map +1 -1
- package/es6/FrontApplet/Hardware/ISerialPortOptions.d.ts +1 -1
- package/es6/FrontApplet/Management/Management.d.ts +1 -0
- package/es6/FrontApplet/Management/Management.js +8 -0
- package/es6/FrontApplet/Management/Management.js.map +1 -1
- package/es6/FrontApplet/ProofOfPlay/IRecordItemOptions.d.ts +10 -0
- package/es6/FrontApplet/ProofOfPlay/IRecordItemOptions.js +3 -0
- package/es6/FrontApplet/ProofOfPlay/IRecordItemOptions.js.map +1 -0
- package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.d.ts +7 -0
- package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.js +41 -0
- package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.js.map +1 -0
- package/es6/FrontApplet/ProofOfPlay/ProofOfPlayType.d.ts +4 -0
- package/es6/FrontApplet/ProofOfPlay/ProofOfPlayType.js +8 -0
- package/es6/FrontApplet/ProofOfPlay/ProofOfPlayType.js.map +1 -0
- package/package.json +1 -1
|
@@ -292,6 +292,10 @@ Download file to path within existing directory or **overrides existing file** i
|
|
|
292
292
|
| `uri` | String | <div class="red">Yes</div> | Url address to retrieve the file from network |
|
|
293
293
|
| `headers` | Object | <div class="yellow">No</div> | Key, value pairs of HTTP headers to send along with the request. Used when the target file is protected by a password or if any
|
|
294
294
|
|
|
295
|
+
::: alert alert--danger
|
|
296
|
+
For every download request, our app makes HEAD request for `content-length` header on that downloaded file.
|
|
297
|
+
:::
|
|
298
|
+
|
|
295
299
|
::: alert alert--warning
|
|
296
300
|
`headers` has to be a JSON object. If you are passing the value, make sure you use `JSON.parse()`.
|
|
297
301
|
:::
|
|
@@ -49,7 +49,7 @@ Here is the options object defined as Typescript interface:
|
|
|
49
49
|
|
|
50
50
|
```typescript
|
|
51
51
|
interface ISerialPortOptions {
|
|
52
|
-
device
|
|
52
|
+
device?: string;
|
|
53
53
|
baudRate: number;
|
|
54
54
|
parity?: 'none' | 'even' | 'mark' | 'odd' | 'space';
|
|
55
55
|
databits?: number;
|
|
@@ -59,6 +59,12 @@ interface ISerialPortOptions {
|
|
|
59
59
|
|
|
60
60
|
### Javascript example
|
|
61
61
|
```javascript
|
|
62
|
+
// Open default serial port based platform
|
|
63
|
+
const serialPort = await sos.hardware.openSerialPort({
|
|
64
|
+
baudRate: 115200,
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// Open specific serial port
|
|
62
68
|
const serialPort = await sos.hardware.openSerialPort({
|
|
63
69
|
device: '/dev/ttyUSB0',
|
|
64
70
|
baudRate: 115200,
|
|
@@ -68,13 +74,13 @@ const serialPort = await sos.hardware.openSerialPort({
|
|
|
68
74
|
::: alert alert--info
|
|
69
75
|
Device address is different per platform (at least for now). Kindly find the respective device address:
|
|
70
76
|
|
|
71
|
-
| Device type |
|
|
72
|
-
| ----------- | ----------------- |
|
|
73
|
-
| RaspberryPi / Linux | `/dev/ttyUSB0` |
|
|
74
|
-
| Windows | `COM3` (typically, but check your Win machine if this does not work) |
|
|
75
|
-
| Samsung Kiosk | `PORT1`, `PORT2`, `PORT3` |
|
|
76
|
-
| Android | `/dev/ttyusb0` |
|
|
77
|
-
| BrightSign |
|
|
77
|
+
| Device type | Default value | Other values for `device` |
|
|
78
|
+
| ----------- | ---------- | ----------------- |
|
|
79
|
+
| RaspberryPi / Linux | `/dev/ttyUSB0` | `/dev/ttyUSB0` |
|
|
80
|
+
| Windows | `COM3` | `COM3` (typically, but check your Win machine if this does not work) |
|
|
81
|
+
| Samsung Kiosk | `PORT1` |`PORT1`, `PORT2`, `PORT3` |
|
|
82
|
+
| Android | `/dev/ttyusb0` | `/dev/ttyusb0` |
|
|
83
|
+
| BrightSign | `0` | `0`, `1`, `USB:A/0` |
|
|
78
84
|
:::
|
|
79
85
|
|
|
80
86
|
## Serial port methods
|
|
@@ -17,6 +17,8 @@ We **do not recommend** to use iframes inside your Applet. However, if you have
|
|
|
17
17
|
|
|
18
18
|
::: alert alert--warning
|
|
19
19
|
The signageOS Snippet and API works **ONLY** if the iframe is served from the display's internal storage - `<iframe src="file://...`. If your iframe is served from a live URL - `<iframe src="https://your-iframe-url"...` the snippet and signageOS API will **NOT** work. This is a security limitation to prevent random site took advantage of the API and alter the display behavior. There is a simple way to [save and load your iframe from the internal storage](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/iframes). Just make sure you are using full paths in your iframe for linking javascripts and css instead of the relative ones.
|
|
20
|
+
|
|
21
|
+
If your device can not load a file stored in local storage, such as an html, you can try to use an alternative instead of python to zip the file when you are preparing the applet.
|
|
20
22
|
:::
|
|
21
23
|
|
|
22
24
|
## Create applet
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Proof of Play
|
|
3
|
+
author: Robert Pecha
|
|
4
|
+
date: 31.01.2023
|
|
5
|
+
type: js-api
|
|
6
|
+
tags:
|
|
7
|
+
- applet
|
|
8
|
+
- applet_api
|
|
9
|
+
- api
|
|
10
|
+
- js_api
|
|
11
|
+
description: "[Content JS API] You can use our Prooof of Play mechanism to log that some content was played on end device successfully or not. Our system includes important metadata about applet and device out-of-box to simplify solution of issues with content. You can use SignageOS to analyze, if, where, when and how long proposed content was playing in front of audience."
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# All methods
|
|
15
|
+
::: table-responsive
|
|
16
|
+
| Methods | Description | Supported since |
|
|
17
|
+
| ----------- | ------------ | -----------|
|
|
18
|
+
| `recordItemPlayed()` | Log that content was played successfully | 5.5.1 |
|
|
19
|
+
:::
|
|
20
|
+
|
|
21
|
+
## recordItemPlayed()
|
|
22
|
+
|
|
23
|
+
Send provided information about played content along with additional metadata about current applet and device to SignageOS.
|
|
24
|
+
|
|
25
|
+
### Parameters
|
|
26
|
+
|
|
27
|
+
::: table-responsive
|
|
28
|
+
| Param | Type | Required | Description |
|
|
29
|
+
| --------- | ------ | :------------------------: | -------------------------------------------------- |
|
|
30
|
+
| `options` | Object | <div class="red">Yes</div> | Object containing information about played content |
|
|
31
|
+
:::
|
|
32
|
+
|
|
33
|
+
### Options
|
|
34
|
+
|
|
35
|
+
Here is the options object defined as Typescript interface:
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
interface IRecordItemOptions {
|
|
39
|
+
name: string;
|
|
40
|
+
customId?: string;
|
|
41
|
+
type?: 'video' | 'image' | 'html' | 'custom';
|
|
42
|
+
tags?: string[];
|
|
43
|
+
fileName?: string;
|
|
44
|
+
playbackSuccess?: boolean;
|
|
45
|
+
errorMessage?: string;
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Javascript example
|
|
50
|
+
```javascript
|
|
51
|
+
|
|
52
|
+
await sos.proofOfPlay.recordItemPlayed({
|
|
53
|
+
name: 'tesla-commercial-ad-christmas-campaign',
|
|
54
|
+
customId: 'dBE43bFB3312VFfvd34bgGHJVV334cd2',
|
|
55
|
+
type: 'video',
|
|
56
|
+
tags: ['tesla', 'christmas'],
|
|
57
|
+
fileName: 'tesla.mp4',
|
|
58
|
+
playbackSuccess: false,
|
|
59
|
+
errorMessage: 'Unsupported framerate 60fps',
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
```
|
|
@@ -27,6 +27,7 @@ To make the management of devices more viable and open there is a management API
|
|
|
27
27
|
| `getTemperature()` | Current device temperature | 3.0.0 |
|
|
28
28
|
| `resetSettings()` | Clear all settings on device | 4.0.0 |
|
|
29
29
|
| `factoryReset()` | Do a device factory reset | 4.0.0 |
|
|
30
|
+
| `getBrand()` | Information about device brand | 5.7.0 |
|
|
30
31
|
:::
|
|
31
32
|
|
|
32
33
|
## Examples
|
|
@@ -131,3 +132,10 @@ Method `getTemperature()` will display information about the current temperature
|
|
|
131
132
|
```typescript
|
|
132
133
|
await sos.management.getTemperature(); // Returns number values 0-100
|
|
133
134
|
```
|
|
135
|
+
|
|
136
|
+
## getBrand()
|
|
137
|
+
Method `getBrand()` will display the manufacturer brand of your device.
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
await sos.management.getBrand(); // Returns string ex. Google, Samsung, signageOS for emulators
|
|
141
|
+
```
|
|
@@ -18,6 +18,7 @@ import Management from './Management/Management';
|
|
|
18
18
|
import Monitors from './Monitors/Monitors';
|
|
19
19
|
import Sensors from './Sensors/Sensors';
|
|
20
20
|
import OSD from './OSD/OSD';
|
|
21
|
+
import ProofOfPlay from './ProofOfPlay/ProofOfPlay';
|
|
21
22
|
export default class FrontApplet {
|
|
22
23
|
readonly window: Window & WeinreData;
|
|
23
24
|
private messagePrefix;
|
|
@@ -43,6 +44,7 @@ export default class FrontApplet {
|
|
|
43
44
|
readonly management: Management;
|
|
44
45
|
readonly monitors: Monitors;
|
|
45
46
|
readonly osd: OSD;
|
|
47
|
+
readonly proofOfPlay: ProofOfPlay;
|
|
46
48
|
readonly sensors: Sensors;
|
|
47
49
|
private readyEmitter;
|
|
48
50
|
private invocationResponseEmitter;
|
|
@@ -24,6 +24,7 @@ const Monitors_1 = require("./Monitors/Monitors");
|
|
|
24
24
|
const Sensors_1 = require("./Sensors/Sensors");
|
|
25
25
|
const Exchange_1 = require("./Exchange/Exchange");
|
|
26
26
|
const OSD_1 = require("./OSD/OSD");
|
|
27
|
+
const ProofOfPlay_1 = require("./ProofOfPlay/ProofOfPlay");
|
|
27
28
|
class FrontApplet {
|
|
28
29
|
constructor(window, messagePrefix) {
|
|
29
30
|
this.window = window;
|
|
@@ -49,6 +50,7 @@ class FrontApplet {
|
|
|
49
50
|
this.management = new Management_1.default(messagePrefix, this.postMessage.bind(this));
|
|
50
51
|
this.monitors = new Monitors_1.default(messagePrefix, this.postMessage.bind(this));
|
|
51
52
|
this.osd = new OSD_1.default(messagePrefix, this.postMessage.bind(this));
|
|
53
|
+
this.proofOfPlay = new ProofOfPlay_1.default(this.command);
|
|
52
54
|
this.sensors = new Sensors_1.default(messagePrefix);
|
|
53
55
|
this.javascriptLoadFileController = new JavascriptLoadFileController_1.default(this.window);
|
|
54
56
|
this.window.addEventListener('message', (event) => this.handleMessage(event));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrontApplet.js","sourceRoot":"","sources":["../../src/FrontApplet/FrontApplet.ts"],"names":[],"mappings":";;AACA,mCAAsC;AACtC,gDAAsD;AAEtD,yCAAkC;AAClC,4CAAqC;AACrC,+CAAwC;AAExC,kGAA2F;AAC3F,+CAAwC;AACxC,kDAA2C;AAC3C,+CAAwC;AACxC,4CAAqC;AACrC,yCAAkC;AAClC,yCAAkC;AAClC,yCAAkD;AAClD,wDAAiD;AACjD,+CAAwC;AACxC,4CAAqC;AACrC,sCAA+B;AAC/B,wDAAiD;AACjD,qDAA2E;AAC3E,wDAAiD;AACjD,kDAA2C;AAC3C,+CAAwC;AACxC,kDAAqD;AACrD,mCAA4B;
|
|
1
|
+
{"version":3,"file":"FrontApplet.js","sourceRoot":"","sources":["../../src/FrontApplet/FrontApplet.ts"],"names":[],"mappings":";;AACA,mCAAsC;AACtC,gDAAsD;AAEtD,yCAAkC;AAClC,4CAAqC;AACrC,+CAAwC;AAExC,kGAA2F;AAC3F,+CAAwC;AACxC,kDAA2C;AAC3C,+CAAwC;AACxC,4CAAqC;AACrC,yCAAkC;AAClC,yCAAkC;AAClC,yCAAkD;AAClD,wDAAiD;AACjD,+CAAwC;AACxC,4CAAqC;AACrC,sCAA+B;AAC/B,wDAAiD;AACjD,qDAA2E;AAC3E,w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,EAAE,IAAI,CAAC,CAAC;QACtC,MAAM,EAAE,CAAC;IACV,CAAC;CACD;AAxND,8BAwNC;AAED,SAAS,QAAQ,CAAC,MAAiC;IAClD,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -45,6 +45,7 @@ export default class Management {
|
|
|
45
45
|
getNetworkInfo(): Promise<INetworkInfo>;
|
|
46
46
|
getBatteryStatus(): Promise<IBatteryStatus>;
|
|
47
47
|
getTemperature(): Promise<number>;
|
|
48
|
+
getBrand(): Promise<string>;
|
|
48
49
|
resetSettings(): Promise<void>;
|
|
49
50
|
factoryReset(): Promise<void>;
|
|
50
51
|
private getMessage;
|
|
@@ -93,6 +93,14 @@ class Management {
|
|
|
93
93
|
return currentTemperature;
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
+
getBrand() {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
const { brand } = yield this.postMessage({
|
|
99
|
+
type: this.getMessage('get_brand'),
|
|
100
|
+
});
|
|
101
|
+
return brand;
|
|
102
|
+
});
|
|
103
|
+
}
|
|
96
104
|
resetSettings() {
|
|
97
105
|
return __awaiter(this, void 0, void 0, function* () {
|
|
98
106
|
yield this.postMessage({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Management.js","sourceRoot":"","sources":["../../../src/FrontApplet/Management/Management.ts"],"names":[],"mappings":";;;;;;;;;;;AAGA,yCAAkC;AAClC,mCAA4B;AAC5B,qCAA8B;AAC9B,mDAA4C;AAC5C,iCAA0B;AAC1B,+BAAwB;AACxB,6BAAsB;AACtB,mCAA4B;AAC5B,uCAAgC;AAChC,mCAA4B;AAC5B,uCAAgC;AAChC,iCAA0B;AAC1B,yCAAkC;AAClC,mDAA4C;AAC5C,mCAA4B;AAC5B,iDAA0C;AAG1C,MAAqB,UAAU;IAqB9B,YACS,aAAqB,EACrB,WAA8B;QAD9B,kBAAa,GAAb,aAAa,CAAQ;QACrB,g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O,gBAAgB;QACvB,OAAO,IAAI,CAAC,aAAa,GAAG,GAAG,GAAG,UAAU,CAAC,cAAc,CAAC;IAC7D,CAAC;;AAnHF,6BAoHC;AAlHc,yBAAc,GAAW,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IRecordItemOptions.js","sourceRoot":"","sources":["../../../src/FrontApplet/ProofOfPlay/IRecordItemOptions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import CommandApi from '../Command/Command';
|
|
2
|
+
import IRecordItemOptions from './IRecordItemOptions';
|
|
3
|
+
export default class ProofOfPlay {
|
|
4
|
+
private commandApi;
|
|
5
|
+
constructor(commandApi: CommandApi);
|
|
6
|
+
recordItemPlayed({ name, customId, type, tags, fileName, playbackSuccess, errorMessage }: IRecordItemOptions): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const Validate_1 = require("../Validate/Validate");
|
|
13
|
+
const ProofOfPlayType_1 = require("./ProofOfPlayType");
|
|
14
|
+
class ProofOfPlay {
|
|
15
|
+
constructor(commandApi) {
|
|
16
|
+
this.commandApi = commandApi;
|
|
17
|
+
}
|
|
18
|
+
recordItemPlayed({ name, customId, type, tags, fileName, playbackSuccess, errorMessage }) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
Validate_1.default({ name }).required().string();
|
|
21
|
+
Validate_1.default({ customId }).string();
|
|
22
|
+
Validate_1.default({ type }).string(['video', 'image', 'html', 'custom']);
|
|
23
|
+
Validate_1.default({ tags }).array('string');
|
|
24
|
+
Validate_1.default({ fileName }).string();
|
|
25
|
+
Validate_1.default({ playbackSuccess }).boolean();
|
|
26
|
+
Validate_1.default({ errorMessage }).string();
|
|
27
|
+
yield this.commandApi.dispatch({
|
|
28
|
+
type: ProofOfPlayType_1.default.ItemPlayed,
|
|
29
|
+
itemName: name,
|
|
30
|
+
customId,
|
|
31
|
+
itemType: type,
|
|
32
|
+
itemTags: tags,
|
|
33
|
+
fileName,
|
|
34
|
+
playbackSuccess,
|
|
35
|
+
errorMessage,
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.default = ProofOfPlay;
|
|
41
|
+
//# sourceMappingURL=ProofOfPlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProofOfPlay.js","sourceRoot":"","sources":["../../../src/FrontApplet/ProofOfPlay/ProofOfPlay.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,mDAA4C;AAC5C,uDAAgD;AAEhD,MAAqB,WAAW;IAE/B,YAAoB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAEjC,gBAAgB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,eAAe,EAAE,YAAY,EAAsB;;YACxH,kBAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC;YACvC,kBAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;YAChC,kBAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;YAChE,kBAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YACnC,kBAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;YAChC,kBAAQ,CAAC,EAAE,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;YACxC,kBAAQ,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;YAEpC,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;gBAC9B,IAAI,EAAE,yBAAe,CAAC,UAAU;gBAChC,QAAQ,EAAE,IAAI;gBACd,QAAQ;gBACR,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,IAAI;gBACd,QAAQ;gBACR,eAAe;gBACf,YAAY;aACZ,CAAC,CAAC;QACJ,CAAC;KAAA;CACD;AAxBD,8BAwBC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var ProofOfPlayType;
|
|
4
|
+
(function (ProofOfPlayType) {
|
|
5
|
+
ProofOfPlayType["ItemPlayed"] = "PoP.ItemPlayed";
|
|
6
|
+
})(ProofOfPlayType || (ProofOfPlayType = {}));
|
|
7
|
+
exports.default = ProofOfPlayType;
|
|
8
|
+
//# sourceMappingURL=ProofOfPlayType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProofOfPlayType.js","sourceRoot":"","sources":["../../../src/FrontApplet/ProofOfPlay/ProofOfPlayType.ts"],"names":[],"mappings":";;AAAA,IAAK,eAEJ;AAFD,WAAK,eAAe;IACnB,gDAA6B,CAAA;AAC9B,CAAC,EAFI,eAAe,KAAf,eAAe,QAEnB;AAED,kBAAe,eAAe,CAAC"}
|