@kbve/laser 0.0.7 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +40 -10
  2. package/laser.es.js +376 -0
  3. package/package.json +54 -24
  4. package/src/index.d.ts +0 -19
  5. package/src/index.js +0 -37
  6. package/src/index.js.map +0 -1
  7. package/src/lib/animations/TypewriterComponent.d.ts +0 -8
  8. package/src/lib/animations/TypewriterComponent.js +0 -53
  9. package/src/lib/animations/TypewriterComponent.js.map +0 -1
  10. package/src/lib/constants.d.ts +0 -2
  11. package/src/lib/constants.js +0 -6
  12. package/src/lib/constants.js.map +0 -1
  13. package/src/lib/eventhandler.d.ts +0 -31
  14. package/src/lib/eventhandler.js +0 -45
  15. package/src/lib/eventhandler.js.map +0 -1
  16. package/src/lib/icon/CollapseIcon.d.ts +0 -4
  17. package/src/lib/icon/CollapseIcon.js +0 -10
  18. package/src/lib/icon/CollapseIcon.js.map +0 -1
  19. package/src/lib/icon/ExpandIcon.d.ts +0 -4
  20. package/src/lib/icon/ExpandIcon.js +0 -10
  21. package/src/lib/icon/ExpandIcon.js.map +0 -1
  22. package/src/lib/laser.d.ts +0 -1
  23. package/src/lib/laser.js +0 -8
  24. package/src/lib/laser.js.map +0 -1
  25. package/src/lib/localdb.d.ts +0 -55
  26. package/src/lib/localdb.js +0 -591
  27. package/src/lib/localdb.js.map +0 -1
  28. package/src/lib/minigame/dice/MinigameDice.d.ts +0 -4
  29. package/src/lib/minigame/dice/MinigameDice.js +0 -85
  30. package/src/lib/minigame/dice/MinigameDice.js.map +0 -1
  31. package/src/lib/phaser/monster/bird.d.ts +0 -7
  32. package/src/lib/phaser/monster/bird.js +0 -44
  33. package/src/lib/phaser/monster/bird.js.map +0 -1
  34. package/src/lib/phaser/npc/chatbubble.d.ts +0 -10
  35. package/src/lib/phaser/npc/chatbubble.js +0 -78
  36. package/src/lib/phaser/npc/chatbubble.js.map +0 -1
  37. package/src/lib/phaser/npc/npcdatabase.d.ts +0 -56
  38. package/src/lib/phaser/npc/npcdatabase.js +0 -497
  39. package/src/lib/phaser/npc/npcdatabase.js.map +0 -1
  40. package/src/lib/phaser/npc/npchandler.d.ts +0 -20
  41. package/src/lib/phaser/npc/npchandler.js +0 -114
  42. package/src/lib/phaser/npc/npchandler.js.map +0 -1
  43. package/src/lib/phaser/npc/tooltipmenu.d.ts +0 -17
  44. package/src/lib/phaser/npc/tooltipmenu.js +0 -68
  45. package/src/lib/phaser/npc/tooltipmenu.js.map +0 -1
  46. package/src/lib/phaser/player/playercontroller.d.ts +0 -24
  47. package/src/lib/phaser/player/playercontroller.js +0 -219
  48. package/src/lib/phaser/player/playercontroller.js.map +0 -1
  49. package/src/lib/quadtree.d.ts +0 -37
  50. package/src/lib/quadtree.js +0 -123
  51. package/src/lib/quadtree.js.map +0 -1
  52. package/src/lib/utils/debug.d.ts +0 -8
  53. package/src/lib/utils/debug.js +0 -46
  54. package/src/lib/utils/debug.js.map +0 -1
  55. package/src/lib/utils/loader.d.ts +0 -3
  56. package/src/lib/utils/loader.js +0 -87
  57. package/src/lib/utils/loader.js.map +0 -1
  58. package/src/lib/utils/ulid.d.ts +0 -1
  59. package/src/lib/utils/ulid.js +0 -38
  60. package/src/lib/utils/ulid.js.map +0 -1
  61. package/src/types.d.ts +0 -381
  62. package/src/types.js +0 -14
  63. package/src/types.js.map +0 -1
@@ -1,87 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addLoader = exports.removeLoader = void 0;
4
- const debug_1 = require("./debug");
5
- function removeLoader(options) {
6
- const { elementIdOrName, duration = 500, onComplete } = options;
7
- let loader = null;
8
- loader = document.getElementById(elementIdOrName);
9
- if (!loader) {
10
- const elementsByName = document.getElementsByName(elementIdOrName);
11
- if (elementsByName.length > 0) {
12
- loader = elementsByName[0];
13
- }
14
- }
15
- if (!loader) {
16
- debug_1.Debug.error(`Loader element with ID or name "${elementIdOrName}" not found.`);
17
- return;
18
- }
19
- if (!(loader instanceof HTMLElement)) {
20
- debug_1.Debug.error(`Element found by "${elementIdOrName}" is not an HTMLElement.`);
21
- return;
22
- }
23
- debug_1.Debug.log(`Removing loader element with ID or name "${elementIdOrName}" with duration ${duration}ms.`);
24
- loader.classList.add('opacity-0', 'transition-opacity', `duration-${duration}`);
25
- setTimeout(() => {
26
- loader.style.display = 'none';
27
- debug_1.Debug.log(`Loader element with ID or name "${elementIdOrName}" has been hidden.`);
28
- // Call the optional onComplete callback if provided
29
- if (onComplete) {
30
- onComplete();
31
- }
32
- }, duration);
33
- }
34
- exports.removeLoader = removeLoader;
35
- function addLoader(options) {
36
- const { elementIdOrName, duration = 500, onComplete } = options;
37
- let loader = null;
38
- // Try to get the element by ID first
39
- loader = document.getElementById(elementIdOrName);
40
- // If not found by ID, try to get the element by name
41
- if (!loader) {
42
- const elementsByName = document.getElementsByName(elementIdOrName);
43
- if (elementsByName.length > 0) {
44
- loader = elementsByName[0];
45
- }
46
- }
47
- // If loader is still not found, create a new one
48
- if (!loader) {
49
- loader = document.createElement('div');
50
- loader.id = elementIdOrName;
51
- loader.classList.add('z-[1000]', 'fixed', 'top-0', 'left-0', 'w-full', 'h-full', 'flex', 'items-center', 'justify-center', 'bg-gray-100', 'opacity-100', 'transition-opacity', `duration-${duration}`);
52
- loader.innerHTML = `
53
- <div class="loader"></div>
54
- <style>
55
- .loader {
56
- border: 16px solid #f3f3f3;
57
- border-top: 16px solid #3498db;
58
- border-radius: 50%;
59
- width: 120px;
60
- height: 120px;
61
- animation: spin 2s linear infinite;
62
- }
63
- @keyframes spin {
64
- 0% { transform: rotate(0deg); }
65
- 100% { transform: rotate(360deg); }
66
- }
67
- </style>
68
- `;
69
- document.body.appendChild(loader);
70
- }
71
- if (!(loader instanceof HTMLElement)) {
72
- debug_1.Debug.error(`Element found by "${elementIdOrName}" is not an HTMLElement.`);
73
- return;
74
- }
75
- debug_1.Debug.log(`Adding loader element with ID or name "${elementIdOrName}" with duration ${duration}ms.`);
76
- loader.style.display = 'block';
77
- loader.classList.remove('opacity-0');
78
- loader.classList.add('opacity-100');
79
- // Call the optional onComplete callback if provided
80
- if (onComplete) {
81
- setTimeout(() => {
82
- onComplete();
83
- }, duration);
84
- }
85
- }
86
- exports.addLoader = addLoader;
87
- //# sourceMappingURL=loader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loader.js","sourceRoot":"","sources":["../../../../../../packages/laser/src/lib/utils/loader.ts"],"names":[],"mappings":"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"}
@@ -1 +0,0 @@
1
- export declare function createULID(): string;
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createULID = void 0;
4
- const crockford32 = '0123456789ABCDEFGHJKMNPQRSTVWXYZ';
5
- function padStart(str, length, pad) {
6
- while (str.length < length) {
7
- str = pad + str;
8
- }
9
- return str;
10
- }
11
- function randomChar() {
12
- const random = Math.floor(Math.random() * crockford32.length);
13
- return crockford32.charAt(random);
14
- }
15
- function randomChars(count) {
16
- let str = '';
17
- for (let i = 0; i < count; i++) {
18
- str += randomChar();
19
- }
20
- return str;
21
- }
22
- function encodeTime(time, length) {
23
- let str = '';
24
- for (let i = length - 1; i >= 0; i--) {
25
- const mod = time % crockford32.length;
26
- str = crockford32.charAt(mod) + str;
27
- time = Math.floor(time / crockford32.length);
28
- }
29
- return padStart(str, length, crockford32[0]);
30
- }
31
- function createULID() {
32
- const timestamp = Date.now();
33
- const timePart = encodeTime(timestamp, 10);
34
- const randomPart = randomChars(16);
35
- return timePart + randomPart;
36
- }
37
- exports.createULID = createULID;
38
- //# sourceMappingURL=ulid.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ulid.js","sourceRoot":"","sources":["../../../../../../packages/laser/src/lib/utils/ulid.ts"],"names":[],"mappings":";;;AACA,MAAM,WAAW,GAAG,kCAAkC,CAAC;AAEvD,SAAS,QAAQ,CAAC,GAAW,EAAE,MAAc,EAAE,GAAW;IACxD,OAAO,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC;QAC3B,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAClB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,UAAU;IACjB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9D,OAAO,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,WAAW,CAAC,KAAa;IAChC,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;QAC/B,GAAG,IAAI,UAAU,EAAE,CAAC;IACtB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,UAAU,CAAC,IAAY,EAAE,MAAc;IAC9C,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,IAAI,GAAG,WAAW,CAAC,MAAM,CAAC;QACtC,GAAG,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;QACpC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED,SAAgB,UAAU;IACxB,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC7B,MAAM,QAAQ,GAAG,UAAU,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IAC3C,MAAM,UAAU,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC;IACnC,OAAO,QAAQ,GAAG,UAAU,CAAC;AAC/B,CAAC;AALD,gCAKC"}
package/src/types.d.ts DELETED
@@ -1,381 +0,0 @@
1
- export interface IPlayerStats {
2
- username: string;
3
- health: string;
4
- mana: string;
5
- energy: string;
6
- maxHealth: string;
7
- maxMana: string;
8
- maxEnergy: string;
9
- armour: string;
10
- agility: string;
11
- strength: string;
12
- intelligence: string;
13
- experience: string;
14
- reputation: string;
15
- faith: string;
16
- }
17
- export interface IconProps {
18
- styleClass?: string;
19
- size?: number;
20
- color?: string;
21
- onClick?: () => void;
22
- [key: string]: any;
23
- }
24
- export interface UserGenericMenu {
25
- id: string | null;
26
- position: {
27
- x: number;
28
- y: number;
29
- };
30
- }
31
- export interface UserSettings {
32
- tooltipItem: UserGenericMenu;
33
- submenuItem: UserGenericMenu;
34
- tooltipNPC: UserGenericMenu;
35
- isStatsMenuCollapsed: boolean;
36
- isSettingsMenuCollapsed: boolean;
37
- debugMode: boolean;
38
- }
39
- export interface IStatBoost extends Partial<IPlayerStats> {
40
- duration: number;
41
- expiry?: number;
42
- }
43
- export interface IPlayerState {
44
- inCombat: boolean;
45
- isDead: boolean;
46
- isResting: boolean;
47
- activeBoosts: Record<string, IStatBoost>;
48
- }
49
- export interface IObject {
50
- id: string;
51
- name: string;
52
- type: string;
53
- category?: string;
54
- description?: string;
55
- img?: string;
56
- bonuses?: {
57
- armor?: string;
58
- intelligence?: string;
59
- health?: string;
60
- mana?: string;
61
- energy?: string;
62
- [key: string]: string | undefined;
63
- };
64
- durability?: string;
65
- weight?: string;
66
- equipped?: boolean;
67
- consumable?: boolean;
68
- cooldown?: string;
69
- slug?: string;
70
- craftingMaterials?: string[];
71
- rarity?: string;
72
- }
73
- export interface IConsumable extends IObject {
74
- type: 'food' | 'scroll' | 'drink' | 'potion';
75
- effects: {
76
- health?: number;
77
- mana?: number;
78
- energy?: number;
79
- [key: string]: number | undefined;
80
- };
81
- boost?: IStatBoost;
82
- duration?: number;
83
- action?: string;
84
- }
85
- export interface ItemAction {
86
- actionEvent: 'consume' | 'equip' | 'unequip' | 'discard' | 'view';
87
- actionDetails?: string;
88
- }
89
- export interface IObjectAction extends ItemAction {
90
- itemId: string;
91
- itemObject: IObject;
92
- actionId: string;
93
- }
94
- export interface IEquipment extends IObject {
95
- type: 'head' | 'body' | 'legs' | 'feet' | 'hands' | 'weapon' | 'shield' | 'accessory';
96
- bonuses?: {
97
- armor?: string;
98
- intelligence?: string;
99
- health?: string;
100
- mana?: string;
101
- [key: string]: string | undefined;
102
- };
103
- durability?: string;
104
- weight?: string;
105
- }
106
- export interface IPlayerInventory {
107
- backpack: string[];
108
- equipment: {
109
- head: string | null;
110
- body: string | null;
111
- legs: string | null;
112
- feet: string | null;
113
- hands: string | null;
114
- weapon: string | null;
115
- shield: string | null;
116
- accessory: string | null;
117
- };
118
- }
119
- export interface IPlayerData {
120
- stats: IPlayerStats;
121
- inventory: IPlayerInventory;
122
- state: IPlayerState;
123
- }
124
- export interface NotificationType {
125
- type: 'caution' | 'warning' | 'danger' | 'success' | 'info';
126
- color: string;
127
- imgUrl: string;
128
- }
129
- export interface INotification {
130
- id: number;
131
- title: string;
132
- message: string;
133
- notificationType: NotificationType;
134
- }
135
- /**
136
- *
137
- * IQuest - Slay 15 Goblins in the Castle and kill their leader.
138
- * - IJournal 1 - Go to the Castle
139
- * - ITask (1) -> (is X, Y Zone within Castle)
140
- * - IJournal 2 - KIll 15 Goblins
141
- * - ITask (15) -> Kill a Goblin
142
- * - IJournal 3 - Slay The Goblin Leader
143
- * - ITask (1) -> Kill Goblin Leader
144
- *
145
- */
146
- export interface ITask<T = any> {
147
- id: string;
148
- name: string;
149
- description: string;
150
- isComplete: boolean;
151
- action: T;
152
- }
153
- export interface IJournal<T = any> {
154
- id: string;
155
- title: string;
156
- tasks: ITask<T>[];
157
- isComplete: boolean;
158
- }
159
- export interface IQuest<T = any> {
160
- id: string;
161
- title: string;
162
- description: string;
163
- journals: IJournal<T>[];
164
- isComplete: boolean;
165
- reward: string;
166
- }
167
- export interface ItemActionEventData {
168
- itemId: string;
169
- action: ItemAction['actionEvent'];
170
- }
171
- export interface PlayerViewItem {
172
- itemId: string;
173
- }
174
- export interface NotificationEventData {
175
- title: string;
176
- message: string;
177
- notificationType: NotificationType;
178
- }
179
- export interface PlayerRewardEvent {
180
- message: string;
181
- item: IObject;
182
- }
183
- export interface PlayerCombatDamage {
184
- damage: string;
185
- }
186
- export interface PlayerStealEventData<T = any> {
187
- npcId: string;
188
- npcName: string;
189
- data?: T;
190
- }
191
- export interface NPCInteractionEventData<T = any> {
192
- npcId: string;
193
- npcName: string;
194
- actions: string[];
195
- data?: T;
196
- coords: {
197
- x: number;
198
- y: number;
199
- };
200
- }
201
- export interface NPCMessageEventData {
202
- npcId: string;
203
- npcName: string;
204
- message: string;
205
- }
206
- export interface PlayerMoveEventData {
207
- x: number;
208
- y: number;
209
- }
210
- export interface OpenModalEventData {
211
- message: string;
212
- }
213
- export interface PlayerEventData extends IPlayerData {
214
- account: string;
215
- }
216
- export interface SceneTransitionEventData {
217
- newSceneKey: string;
218
- additionalInfo?: string;
219
- }
220
- export interface CharacterEventData {
221
- message: string;
222
- character_name?: string;
223
- character_image?: string;
224
- background_image?: string;
225
- }
226
- export interface WASMEventData {
227
- result: {
228
- value: number;
229
- description: string;
230
- };
231
- }
232
- export interface GameEvent {
233
- type: 'levelUp' | 'itemFound';
234
- payload: {
235
- level?: number;
236
- item?: string;
237
- };
238
- }
239
- export interface TaskCompletionEventData {
240
- taskId: string;
241
- isComplete: boolean;
242
- }
243
- export interface MinigameDiceProps {
244
- styleClass?: string;
245
- textures: DiceTextures;
246
- diceCount: number;
247
- }
248
- export type GameMode = 'Idle' | 'Dice' | 'Slot' | 'War';
249
- export interface DiceAction {
250
- type: 'ROLL_DICE';
251
- diceValues: number[];
252
- isRolling: boolean;
253
- }
254
- export interface SlotAction {
255
- type: 'SPIN_SLOT';
256
- slotValues: number[];
257
- }
258
- export interface WarAction {
259
- type: 'PLAY_WAR';
260
- playerCard: string;
261
- opponentCard: string;
262
- }
263
- export type MinigameAction = DiceAction | SlotAction | WarAction;
264
- export interface DiceTextures {
265
- side1: string;
266
- side2: string;
267
- side3: string;
268
- side4: string;
269
- side5: string;
270
- side6: string;
271
- }
272
- export interface SlotTextures {
273
- reel1: string;
274
- reel2: string;
275
- reel3: string;
276
- }
277
- export interface WarTextures {
278
- cardBack: string;
279
- playerCards: {
280
- [key: string]: string;
281
- };
282
- opponentCards: {
283
- [key: string]: string;
284
- };
285
- }
286
- export type MinigameTextures = DiceTextures | SlotTextures | WarTextures;
287
- export interface MinigameState {
288
- gamemode: GameMode;
289
- action: MinigameAction;
290
- textures: MinigameTextures;
291
- }
292
- export interface DiceRollResultEventData {
293
- diceValues: number[];
294
- }
295
- export declare function isDiceAction(action: MinigameAction): action is DiceAction;
296
- export interface INPCPosition {
297
- x: number;
298
- y: number;
299
- }
300
- export interface INPCData {
301
- id: string;
302
- name: string;
303
- spriteKey: string;
304
- walkingAnimationMapping: number;
305
- startPosition: INPCPosition;
306
- speed: number;
307
- scale: number;
308
- slug: string;
309
- actions: NPCAction[];
310
- effects?: string[];
311
- stats?: IPlayerStats;
312
- spriteImageId?: string;
313
- avatarImageId?: string;
314
- dialogues?: INPCDialogue[];
315
- }
316
- export interface ISprite {
317
- id: string;
318
- spriteName: string;
319
- assetLocation: string;
320
- frameWidth: number;
321
- frameHeight: number;
322
- scale?: number;
323
- spriteData?: Blob;
324
- slug: string;
325
- }
326
- export interface IAvatar {
327
- id: string;
328
- avatarName: string;
329
- avatarLocation: string;
330
- avatarData: Blob;
331
- slug: string;
332
- }
333
- export type NPCAction = 'talk' | 'quest' | 'trade' | 'combat' | 'heal' | 'steal' | 'lore';
334
- export interface INPCDialogue {
335
- dialogueId: string;
336
- read: boolean;
337
- priority: number;
338
- }
339
- export interface IDialogueObject {
340
- id: string;
341
- title: string;
342
- message: string;
343
- playerResponse?: string;
344
- actions?: string[];
345
- options?: string[];
346
- style?: string;
347
- backgroundImage?: string;
348
- }
349
- export interface NPCDialogueEventData {
350
- npcId: string;
351
- dialogue: IDialogueObject & {
352
- priority: number;
353
- read: boolean;
354
- };
355
- }
356
- export interface CaptchaConfig {
357
- hl: string;
358
- sitekey: string;
359
- apihost: string;
360
- reCaptchaCompat: boolean;
361
- theme: CaptchaTheme;
362
- size: 'normal' | 'compact' | 'invisible';
363
- }
364
- export declare enum CaptchaTheme {
365
- DARK = "dark",// Represents the dark theme.
366
- LIGHT = "light"
367
- }
368
- export interface UIRegiserState {
369
- email: string;
370
- password: string;
371
- confirm: string;
372
- username: string;
373
- captchaToken: string;
374
- svelte_internal_message: string;
375
- successful_message: string;
376
- }
377
- export interface LoaderOptions {
378
- elementIdOrName: string;
379
- duration?: number;
380
- onComplete?: () => void;
381
- }
package/src/types.js DELETED
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CaptchaTheme = exports.isDiceAction = void 0;
4
- // Type Guards
5
- function isDiceAction(action) {
6
- return action.type === 'ROLL_DICE';
7
- }
8
- exports.isDiceAction = isDiceAction;
9
- var CaptchaTheme;
10
- (function (CaptchaTheme) {
11
- CaptchaTheme["DARK"] = "dark";
12
- CaptchaTheme["LIGHT"] = "light";
13
- })(CaptchaTheme || (exports.CaptchaTheme = CaptchaTheme = {}));
14
- //# sourceMappingURL=types.js.map
package/src/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../packages/laser/src/types.ts"],"names":[],"mappings":";;;AAmWA,cAAc;AAEd,SAAgB,YAAY,CAAC,MAAsB;IACjD,OAAO,MAAM,CAAC,IAAI,KAAK,WAAW,CAAC;AACrC,CAAC;AAFD,oCAEC;AAgFD,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,+BAAe,CAAA;AACjB,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB"}