@gamepark/react-game 7.5.2 → 7.5.7
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/dist/components/material/Dices/OctahedralDiceDescription.d.ts +48 -0
- package/dist/components/material/Dices/OctahedralDiceDescription.js +142 -0
- package/dist/components/material/Dices/OctahedralDiceDescription.js.map +1 -0
- package/dist/components/material/GameTable/DevToolsHub.d.ts +31 -0
- package/dist/components/material/GameTable/DevToolsHub.js +436 -0
- package/dist/components/material/GameTable/DevToolsHub.js.map +1 -0
- package/dist/components/material/GameTable/index.d.ts +1 -0
- package/dist/components/material/GameTable/index.js +1 -0
- package/dist/components/material/GameTable/index.js.map +1 -1
- package/dist/css/backgroundCss.js +3 -3
- package/dist/css/cursorCss.js +6 -6
- package/dist/css/fadeIn.js +6 -6
- package/dist/css/shineEffect.js +28 -28
- package/dist/css/transformCss.js +4 -4
- package/dist/locators/GridLocator.js +1 -2
- package/dist/locators/GridLocator.js.map +1 -1
- package/dist/utilities/translation.util.js +2 -0
- package/dist/utilities/translation.util.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/material/Wheel/WheelContent.d.ts +0 -13
- package/dist/components/material/Wheel/WheelContent.js +0 -37
- package/dist/components/material/Wheel/WheelContent.js.map +0 -1
- package/dist/hooks/useFailures.d.ts +0 -1
- package/dist/hooks/useFailures.js +0 -11
- package/dist/hooks/useFailures.js.map +0 -1
- package/dist/hooks/useWebP.d.ts +0 -1
- package/dist/hooks/useWebP.js +0 -13
- package/dist/hooks/useWebP.js.map +0 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
2
|
+
import { Interpolation, Theme } from '@emotion/react';
|
|
3
|
+
import { MaterialItem } from '@gamepark/rules-api';
|
|
4
|
+
import { ItemContext } from '../../../locators';
|
|
5
|
+
import { MaterialContentProps } from '../MaterialDescription';
|
|
6
|
+
import { MobileMaterialDescription } from '../MobileMaterialDescription';
|
|
7
|
+
/**
|
|
8
|
+
* 8-faced (octahedral) dice with CSS 3D transforms.
|
|
9
|
+
*
|
|
10
|
+
* The `images` array must contain exactly 8 images, one per face:
|
|
11
|
+
*
|
|
12
|
+
* - **images[0–3]**: top faces (triangles pointing up)
|
|
13
|
+
* - **images[4–7]**: bottom faces (triangles pointing down)
|
|
14
|
+
*
|
|
15
|
+
* Within each half, faces are arranged by cardinal direction:
|
|
16
|
+
*
|
|
17
|
+
* | Index | Half | Direction |
|
|
18
|
+
* |-------|--------|-----------|
|
|
19
|
+
* | 0 | top | front |
|
|
20
|
+
* | 1 | top | right |
|
|
21
|
+
* | 2 | top | back |
|
|
22
|
+
* | 3 | top | left |
|
|
23
|
+
* | 4 | bottom | front |
|
|
24
|
+
* | 5 | bottom | right |
|
|
25
|
+
* | 6 | bottom | back |
|
|
26
|
+
* | 7 | bottom | left |
|
|
27
|
+
*
|
|
28
|
+
* `location.rotation` (0–7) selects which face is shown on top.
|
|
29
|
+
* Top face images should have their symbol shifted toward the base of the triangle (centroid offset).
|
|
30
|
+
* Bottom face images should be rotated 180° with the symbol shifted the opposite way.
|
|
31
|
+
*/
|
|
32
|
+
export declare abstract class OctahedralDiceDescription<P extends number = number, M extends number = number, L extends number = number, ItemId = any> extends MobileMaterialDescription<P, M, L, ItemId> {
|
|
33
|
+
width: number;
|
|
34
|
+
ratio: number;
|
|
35
|
+
borderRadius: number;
|
|
36
|
+
color: string;
|
|
37
|
+
abstract images: string[] | Record<any, string[]>;
|
|
38
|
+
/** Set to true to display face index labels (0-7) for debugging */
|
|
39
|
+
debugFaceLabels: boolean;
|
|
40
|
+
private get tz();
|
|
41
|
+
getImages(): string[];
|
|
42
|
+
getDiceImages(itemId: ItemId): string[];
|
|
43
|
+
getColor(_itemId: ItemId): string;
|
|
44
|
+
content: ({ itemId, highlight, preview, playDown }: MaterialContentProps<ItemId>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
45
|
+
getItemTransform(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): string[];
|
|
46
|
+
getRotations(item: MaterialItem<P, L>, _context: ItemContext<P, M, L>): string[];
|
|
47
|
+
getHelpDisplayExtraCss(item: Partial<MaterialItem<P, L>>, context: ItemContext<P, M, L>): Interpolation<Theme>;
|
|
48
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
import { range } from 'es-toolkit';
|
|
5
|
+
import { backgroundCss, shadowEffect, shineEffect, transformCss } from '../../../css';
|
|
6
|
+
import { MobileMaterialDescription } from '../MobileMaterialDescription';
|
|
7
|
+
const TILT = 35.26; // 90 - arctan(sqrt(2)) in degrees
|
|
8
|
+
const TZ_RATIO = 0.2562; // translateZ / width ratio for octahedron
|
|
9
|
+
/**
|
|
10
|
+
* 8-faced (octahedral) dice with CSS 3D transforms.
|
|
11
|
+
*
|
|
12
|
+
* The `images` array must contain exactly 8 images, one per face:
|
|
13
|
+
*
|
|
14
|
+
* - **images[0–3]**: top faces (triangles pointing up)
|
|
15
|
+
* - **images[4–7]**: bottom faces (triangles pointing down)
|
|
16
|
+
*
|
|
17
|
+
* Within each half, faces are arranged by cardinal direction:
|
|
18
|
+
*
|
|
19
|
+
* | Index | Half | Direction |
|
|
20
|
+
* |-------|--------|-----------|
|
|
21
|
+
* | 0 | top | front |
|
|
22
|
+
* | 1 | top | right |
|
|
23
|
+
* | 2 | top | back |
|
|
24
|
+
* | 3 | top | left |
|
|
25
|
+
* | 4 | bottom | front |
|
|
26
|
+
* | 5 | bottom | right |
|
|
27
|
+
* | 6 | bottom | back |
|
|
28
|
+
* | 7 | bottom | left |
|
|
29
|
+
*
|
|
30
|
+
* `location.rotation` (0–7) selects which face is shown on top.
|
|
31
|
+
* Top face images should have their symbol shifted toward the base of the triangle (centroid offset).
|
|
32
|
+
* Bottom face images should be rotated 180° with the symbol shifted the opposite way.
|
|
33
|
+
*/
|
|
34
|
+
export class OctahedralDiceDescription extends MobileMaterialDescription {
|
|
35
|
+
width = 2;
|
|
36
|
+
ratio = 1;
|
|
37
|
+
borderRadius = 0;
|
|
38
|
+
color = '#222222';
|
|
39
|
+
/** Set to true to display face index labels (0-7) for debugging */
|
|
40
|
+
debugFaceLabels = false;
|
|
41
|
+
get tz() { return this.width * TZ_RATIO; }
|
|
42
|
+
getImages() {
|
|
43
|
+
return Array.isArray(this.images) ? this.images : Object.values(this.images).flat();
|
|
44
|
+
}
|
|
45
|
+
getDiceImages(itemId) {
|
|
46
|
+
return Array.isArray(this.images) ? this.images : this.images[itemId];
|
|
47
|
+
}
|
|
48
|
+
getColor(_itemId) {
|
|
49
|
+
return this.color;
|
|
50
|
+
}
|
|
51
|
+
content = ({ itemId, highlight, preview, playDown = preview }) => {
|
|
52
|
+
const images = this.getDiceImages(itemId);
|
|
53
|
+
const w = this.width;
|
|
54
|
+
const tz = this.tz;
|
|
55
|
+
const sideCss = css `
|
|
56
|
+
position: absolute;
|
|
57
|
+
width: ${w}em;
|
|
58
|
+
height: ${w}em;
|
|
59
|
+
backface-visibility: hidden;
|
|
60
|
+
`;
|
|
61
|
+
const diamondTopCss = css `
|
|
62
|
+
display: block;
|
|
63
|
+
width: 100%;
|
|
64
|
+
height: 100%;
|
|
65
|
+
overflow: hidden;
|
|
66
|
+
backface-visibility: hidden;
|
|
67
|
+
transform: translateY(50%) rotate(30deg) skewY(30deg) scaleX(0.866);
|
|
68
|
+
filter: drop-shadow(0 0 0.03em rgba(0, 0, 0, 0.5));
|
|
69
|
+
`;
|
|
70
|
+
const diamondBottomCss = css `
|
|
71
|
+
display: block;
|
|
72
|
+
width: 100%;
|
|
73
|
+
height: 100%;
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
backface-visibility: hidden;
|
|
76
|
+
transform: translateY(-50%) rotate(30deg) skewY(30deg) scaleX(0.866);
|
|
77
|
+
filter: drop-shadow(0 0 0.03em rgba(0, 0, 0, 0.5));
|
|
78
|
+
`;
|
|
79
|
+
const contentTopCss = css `
|
|
80
|
+
display: block;
|
|
81
|
+
width: 100%;
|
|
82
|
+
height: 100%;
|
|
83
|
+
backface-visibility: hidden;
|
|
84
|
+
background-color: ${this.getColor(itemId)};
|
|
85
|
+
transform: scaleX(1.155) skewY(-30deg) rotate(-30deg) translateY(-50%);
|
|
86
|
+
`;
|
|
87
|
+
const contentBottomCss = css `
|
|
88
|
+
display: block;
|
|
89
|
+
width: 100%;
|
|
90
|
+
height: 100%;
|
|
91
|
+
backface-visibility: hidden;
|
|
92
|
+
background-color: ${this.getColor(itemId)};
|
|
93
|
+
transform: scaleX(1.155) skewY(-30deg) rotate(-30deg) translateY(50%);
|
|
94
|
+
`;
|
|
95
|
+
const faceLabelCss = this.debugFaceLabels ? css `
|
|
96
|
+
position: absolute;
|
|
97
|
+
top: 50%;
|
|
98
|
+
left: 50%;
|
|
99
|
+
transform: translate(-50%, -50%);
|
|
100
|
+
font-size: ${w * 0.3}em;
|
|
101
|
+
font-weight: bold;
|
|
102
|
+
color: red;
|
|
103
|
+
pointer-events: none;
|
|
104
|
+
z-index: 1;
|
|
105
|
+
` : undefined;
|
|
106
|
+
return _jsx(_Fragment, { children: range(8).map((_, index) => {
|
|
107
|
+
const yRot = (index % 4) * 90;
|
|
108
|
+
// Bottom faces are offset by 180° so that rotateX(180deg) brings face N to the top
|
|
109
|
+
const bottomYRot = ((index % 4) * 90 + 180) % 360;
|
|
110
|
+
const sideTransform = index < 4
|
|
111
|
+
? transformCss(index > 0 ? `rotateY(${yRot}deg)` : undefined, `rotateX(${TILT}deg)`, `translateZ(${tz}em)`)
|
|
112
|
+
: transformCss(`translateY(52%)`, bottomYRot > 0 ? `rotateY(${bottomYRot}deg)` : undefined, `rotateX(${-TILT}deg)`, `translateZ(${tz}em)`);
|
|
113
|
+
return _jsx("div", { css: [sideCss, sideTransform], children: _jsx("div", { css: index < 4 ? diamondTopCss : diamondBottomCss, children: _jsx("div", { css: [
|
|
114
|
+
index < 4 ? contentTopCss : contentBottomCss,
|
|
115
|
+
backgroundCss(images[index]),
|
|
116
|
+
highlight ? shineEffect : playDown && shadowEffect
|
|
117
|
+
], children: faceLabelCss && _jsx("span", { css: faceLabelCss, children: index }) }) }) }, index);
|
|
118
|
+
}) });
|
|
119
|
+
};
|
|
120
|
+
getItemTransform(item, context) {
|
|
121
|
+
return super.getItemTransform(item, context).concat(`translateZ(${this.tz}em)`, ...this.getRotations(item, context));
|
|
122
|
+
}
|
|
123
|
+
getRotations(item, _context) {
|
|
124
|
+
switch (item.location.rotation) {
|
|
125
|
+
case 0: return [];
|
|
126
|
+
case 1: return ['rotateY(-90deg)'];
|
|
127
|
+
case 2: return ['rotateY(-180deg)'];
|
|
128
|
+
case 3: return ['rotateY(90deg)'];
|
|
129
|
+
case 4: return ['rotateX(180deg)'];
|
|
130
|
+
case 5: return ['rotateX(180deg)', 'rotateY(90deg)'];
|
|
131
|
+
case 6: return ['rotateX(180deg)', 'rotateY(180deg)'];
|
|
132
|
+
case 7: return ['rotateX(180deg)', 'rotateY(-90deg)'];
|
|
133
|
+
default: return [];
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
getHelpDisplayExtraCss(item, context) {
|
|
137
|
+
return item.location && [transformCss(...this.getRotations(item, context)), css `
|
|
138
|
+
margin: ${this.width / 4}em;
|
|
139
|
+
`];
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=OctahedralDiceDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OctahedralDiceDescription.js","sourceRoot":"","sources":["../../../../src/components/material/Dices/OctahedralDiceDescription.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,GAAG,EAAwB,MAAM,gBAAgB,CAAA;AAE1D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,aAAa,EAAE,YAAY,E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AAC,iBAAiB,EAAE,gBAAgB,CAAC,CAAA;YACpD,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAA;YACrD,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAA;YACrD,OAAO,CAAC,CAAC,OAAO,EAAE,CAAA;QACpB,CAAC;IACH,CAAC;IAED,sBAAsB,CAAC,IAAiC,EAAE,OAA6B;QACrF,OAAO,IAAI,CAAC,QAAQ,IAAI,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,IAA0B,EAAE,OAAO,CAAC,CAAC,EAAE,GAAG,CAAA;gBACzF,IAAI,CAAC,KAAK,GAAG,CAAC;KACzB,CAAC,CAAA;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FC, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
export type GameOption = {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
type: 'boolean';
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* A single entry in the DevToolsHub panel.
|
|
9
|
+
* Use this instead of raw `<button>` when adding custom tools via `children`.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* <DevToolsHub>
|
|
13
|
+
* <DevToolEntry icon="✦" label="Card Viewer" desc="Browse agents" onClick={() => setShowCards(true)} />
|
|
14
|
+
* </DevToolsHub>
|
|
15
|
+
*/
|
|
16
|
+
export declare const DevToolEntry: FC<{
|
|
17
|
+
icon: ReactNode;
|
|
18
|
+
label: string;
|
|
19
|
+
desc?: string;
|
|
20
|
+
onClick?: () => void;
|
|
21
|
+
}>;
|
|
22
|
+
type DevToolsHubProps = PropsWithChildren<{
|
|
23
|
+
fabBottom?: string;
|
|
24
|
+
gameOptions?: GameOption[];
|
|
25
|
+
}>;
|
|
26
|
+
export declare const DevToolsHub: FC<DevToolsHubProps>;
|
|
27
|
+
export declare const devToolBtnCss: import("@emotion/utils").SerializedStyles;
|
|
28
|
+
export declare const devToolIconCss: import("@emotion/utils").SerializedStyles;
|
|
29
|
+
export declare const devToolLabelCss: import("@emotion/utils").SerializedStyles;
|
|
30
|
+
export declare const devToolDescCss: import("@emotion/utils").SerializedStyles;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { css, keyframes } from '@emotion/react';
|
|
4
|
+
import { useCallback, useRef, useState } from 'react';
|
|
5
|
+
import { createPortal } from 'react-dom';
|
|
6
|
+
import { useGame } from '../../../hooks/useGame';
|
|
7
|
+
import { usePlayerId, usePlayerIds } from '../../../hooks/usePlayerId';
|
|
8
|
+
const GP_PRIMARY = '#28B8CE';
|
|
9
|
+
const GP_DARK = '#002448';
|
|
10
|
+
const GP_SURFACE = '#0a1929';
|
|
11
|
+
const GP_ACCENT = '#9fe2f7';
|
|
12
|
+
/**
|
|
13
|
+
* A single entry in the DevToolsHub panel.
|
|
14
|
+
* Use this instead of raw `<button>` when adding custom tools via `children`.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* <DevToolsHub>
|
|
18
|
+
* <DevToolEntry icon="✦" label="Card Viewer" desc="Browse agents" onClick={() => setShowCards(true)} />
|
|
19
|
+
* </DevToolsHub>
|
|
20
|
+
*/
|
|
21
|
+
export const DevToolEntry = ({ icon, label, desc, onClick }) => (_jsxs("button", { css: devToolBtnCss, onClick: onClick, children: [_jsx("span", { css: devToolIconCss, children: icon }), _jsx("span", { css: devToolLabelCss, children: label }), desc && _jsx("span", { css: devToolDescCss, children: desc })] }));
|
|
22
|
+
export const DevToolsHub = ({ children, fabBottom, gameOptions }) => {
|
|
23
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
24
|
+
const [newGamePlayers, setNewGamePlayers] = useState(2);
|
|
25
|
+
const [options, setOptions] = useState({});
|
|
26
|
+
const [undoCount, setUndoCount] = useState(1);
|
|
27
|
+
const [botActive, setBotActive] = useState(false);
|
|
28
|
+
const [flash, setFlash] = useState(null);
|
|
29
|
+
const flashTimeout = useRef(null);
|
|
30
|
+
const gameState = useGame();
|
|
31
|
+
const currentPlayer = usePlayerId();
|
|
32
|
+
const players = usePlayerIds();
|
|
33
|
+
const doFlash = useCallback((msg) => {
|
|
34
|
+
if (flashTimeout.current)
|
|
35
|
+
clearTimeout(flashTimeout.current);
|
|
36
|
+
setFlash(msg);
|
|
37
|
+
flashTimeout.current = setTimeout(() => setFlash(null), 1500);
|
|
38
|
+
}, []);
|
|
39
|
+
const copyToClipboard = useCallback(async (text, label) => {
|
|
40
|
+
try {
|
|
41
|
+
await navigator.clipboard.writeText(text);
|
|
42
|
+
doFlash(`${label} copied!`);
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
doFlash('Copy failed');
|
|
46
|
+
}
|
|
47
|
+
}, [doFlash]);
|
|
48
|
+
const g = typeof window !== 'undefined' ? window.game : undefined;
|
|
49
|
+
const exec = useCallback((action, successMsg) => {
|
|
50
|
+
if (!g) {
|
|
51
|
+
doFlash('game helper not available');
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
action();
|
|
55
|
+
doFlash(successMsg);
|
|
56
|
+
}, [g, doFlash]);
|
|
57
|
+
const root = document.getElementById('root');
|
|
58
|
+
if (!root)
|
|
59
|
+
return null;
|
|
60
|
+
return createPortal(_jsxs(_Fragment, { children: [_jsx("button", { css: fabCss, onClick: () => setIsOpen(o => !o), "data-open": isOpen, style: fabBottom ? { bottom: fabBottom } : undefined, children: _jsxs("svg", { css: logoCss, viewBox: "0 0 46 46", "data-open": isOpen, children: [_jsx("circle", { cx: "11", cy: "11", r: "7" }), _jsx("circle", { cx: "35", cy: "11", r: "7" }), _jsx("circle", { cx: "11", cy: "35", r: "7" }), _jsx("circle", { cx: "35", cy: "35", r: "7" })] }) }), isOpen && (_jsxs(_Fragment, { children: [_jsx("div", { css: backdropCss, onClick: () => setIsOpen(false) }), _jsxs("div", { css: panelCss, style: fabBottom ? { bottom: `calc(${fabBottom} + 48px)` } : undefined, children: [_jsxs("div", { css: panelHeaderCss, children: [_jsxs("svg", { css: headerLogoCss, viewBox: "0 0 46 46", children: [_jsx("circle", { cx: "11", cy: "11", r: "7" }), _jsx("circle", { cx: "35", cy: "11", r: "7" }), _jsx("circle", { cx: "11", cy: "35", r: "7" }), _jsx("circle", { cx: "35", cy: "35", r: "7" })] }), _jsx("span", { css: panelTitleCss, children: "Dev Tools" }), _jsx("span", { css: panelBadgeCss, children: "GP" })] }), _jsxs("div", { css: toolListCss, children: [_jsxs("div", { css: devToolBtnCss, style: { animationDelay: '0ms' }, children: [_jsx("span", { css: devToolIconCss, children: '\u21BB' }), _jsx("span", { css: devToolLabelCss, children: "New Game" }), _jsx("span", { css: devToolDescCss, children: "Reset with N players" }), _jsxs("div", { css: inlineRowCss, onClick: e => e.stopPropagation(), children: [_jsx("button", { css: stepBtnCss, onClick: () => setNewGamePlayers(c => Math.max(1, c - 1)), children: "-" }), _jsx("input", { type: "number", min: 1, max: 10, value: newGamePlayers, onChange: e => setNewGamePlayers(Math.max(1, parseInt(e.target.value) || 2)), css: numberInputCss }), _jsx("button", { css: stepBtnCss, onClick: () => setNewGamePlayers(c => Math.min(10, c + 1)), children: "+" }), _jsx("button", { css: goBtnCss, onClick: () => exec(() => {
|
|
61
|
+
const hasOptions = gameOptions?.length && Object.values(options).some(Boolean);
|
|
62
|
+
g.new(hasOptions ? { players: newGamePlayers, ...options } : newGamePlayers);
|
|
63
|
+
}, `New game ${newGamePlayers}p`), children: "Go" })] }), gameOptions?.map(opt => (_jsxs("label", { css: toggleRowCss, onClick: e => e.stopPropagation(), children: [_jsx("input", { type: "checkbox", checked: options[opt.key] ?? false, onChange: e => setOptions(prev => ({ ...prev, [opt.key]: e.target.checked })), css: checkboxCss }), _jsx("span", { css: toggleLabelCss, children: opt.label })] }, opt.key)))] }), _jsxs("div", { css: devToolBtnCss, style: { animationDelay: '40ms' }, children: [_jsx("span", { css: devToolIconCss, children: '\u238C' }), _jsx("span", { css: devToolLabelCss, children: "Undo" }), _jsx("span", { css: devToolDescCss, children: "Revert N moves" }), _jsxs("div", { css: inlineRowCss, onClick: e => e.stopPropagation(), children: [_jsx("button", { css: stepBtnCss, onClick: () => setUndoCount(c => Math.max(1, c - 1)), children: "-" }), _jsx("input", { type: "number", min: 1, max: 999, value: undoCount, onChange: e => setUndoCount(Math.max(1, parseInt(e.target.value) || 1)), css: numberInputCss }), _jsx("button", { css: stepBtnCss, onClick: () => setUndoCount(c => c + 1), children: "+" }), _jsx("button", { css: goBtnCss, onClick: () => exec(() => g.undo(undoCount), `Undo ${undoCount} move${undoCount > 1 ? 's' : ''}`), children: "Go" })] })] }), _jsxs("div", { css: devToolBtnCss, style: { animationDelay: '80ms' }, children: [_jsx("span", { css: devToolIconCss, children: '\u2194' }), _jsx("span", { css: devToolLabelCss, children: "Switch Player" }), _jsx("span", { css: devToolDescCss, children: "View as another player" }), _jsxs("div", { css: inlineRowCss, onClick: e => e.stopPropagation(), children: [players.map(pid => (_jsxs("button", { css: [playerBtnCss, pid === currentPlayer && playerBtnActiveCss], onClick: () => exec(() => g.changePlayer(pid), `Switched to P${pid}`), children: ["P", String(pid)] }, String(pid)))), _jsx("button", { css: [playerBtnCss, currentPlayer === undefined && playerBtnActiveCss], onClick: () => exec(() => g.changePlayer(), 'Spectator mode'), children: "Spect" })] })] }), _jsxs("button", { css: [devToolBtnCss, botActive && toolBtnActiveCss], style: { animationDelay: '120ms' }, onClick: () => {
|
|
64
|
+
const next = !botActive;
|
|
65
|
+
exec(() => g.bot(next), next ? 'Bots enabled' : 'Bots disabled');
|
|
66
|
+
setBotActive(next);
|
|
67
|
+
}, children: [_jsx("span", { css: devToolIconCss, children: '\u2699' }), _jsx("span", { css: devToolLabelCss, children: botActive ? 'Disable Bots' : 'Enable Bots' }), _jsx("span", { css: devToolDescCss, children: botActive ? 'Stop auto-play' : 'Auto-play all moves' }), botActive && _jsx("span", { css: activeIndicatorCss })] }), _jsxs("button", { css: devToolBtnCss, style: { animationDelay: '160ms' }, onClick: () => exec(() => g.tutorial(), 'Tutorial started'), children: [_jsx("span", { css: devToolIconCss, children: "?" }), _jsx("span", { css: devToolLabelCss, children: "Tutorial" }), _jsx("span", { css: devToolDescCss, children: "Start tutorial mode" })] }), children && (_jsxs(_Fragment, { children: [_jsx("div", { css: dividerCss }), children] })), _jsx("div", { css: dividerCss }), _jsxs("button", { css: devToolBtnCss, style: { animationDelay: '240ms' }, onClick: () => {
|
|
68
|
+
if (gameState)
|
|
69
|
+
copyToClipboard(JSON.stringify(gameState, null, 2), 'Game state');
|
|
70
|
+
else
|
|
71
|
+
doFlash('No game state');
|
|
72
|
+
}, children: [_jsx("span", { css: devToolIconCss, children: '\u2398' }), _jsx("span", { css: devToolLabelCss, children: "Copy State" }), _jsx("span", { css: devToolDescCss, children: "Copy game state to clipboard" })] }), _jsxs("button", { css: devToolBtnCss, style: { animationDelay: '280ms' }, onClick: () => {
|
|
73
|
+
const data = {};
|
|
74
|
+
for (let i = 0; i < localStorage.length; i++) {
|
|
75
|
+
const key = localStorage.key(i);
|
|
76
|
+
if (key)
|
|
77
|
+
data[key] = localStorage.getItem(key) ?? '';
|
|
78
|
+
}
|
|
79
|
+
copyToClipboard(JSON.stringify(data, null, 2), 'localStorage');
|
|
80
|
+
}, children: [_jsx("span", { css: devToolIconCss, children: '\u29C9' }), _jsx("span", { css: devToolLabelCss, children: "Copy LocalStorage" }), _jsx("span", { css: devToolDescCss, children: "Copy localStorage to clipboard" })] })] }), flash && _jsx("div", { css: flashCss, children: flash }, flash)] })] }))] }), root);
|
|
81
|
+
};
|
|
82
|
+
// ═══════════════════════════════════════
|
|
83
|
+
// Styles — GamePark branded
|
|
84
|
+
// ═══════════════════════════════════════
|
|
85
|
+
const fabPulse = keyframes `
|
|
86
|
+
0%, 100% { box-shadow: 0 0 0 0 rgba(40, 184, 206, 0.25); }
|
|
87
|
+
50% { box-shadow: 0 0 0 5px rgba(40, 184, 206, 0); }
|
|
88
|
+
`;
|
|
89
|
+
const fabCss = css `
|
|
90
|
+
position: fixed;
|
|
91
|
+
bottom: 16px;
|
|
92
|
+
left: 16px;
|
|
93
|
+
z-index: 900;
|
|
94
|
+
width: 40px;
|
|
95
|
+
height: 40px;
|
|
96
|
+
border-radius: 10px;
|
|
97
|
+
border: 1px solid rgba(40, 184, 206, 0.4);
|
|
98
|
+
background: linear-gradient(145deg, ${GP_SURFACE}, ${GP_DARK});
|
|
99
|
+
cursor: pointer;
|
|
100
|
+
display: flex;
|
|
101
|
+
align-items: center;
|
|
102
|
+
justify-content: center;
|
|
103
|
+
padding: 0;
|
|
104
|
+
animation: ${fabPulse} 3s ease-in-out infinite;
|
|
105
|
+
transition: all 0.2s;
|
|
106
|
+
|
|
107
|
+
&:hover {
|
|
108
|
+
border-color: rgba(40, 184, 206, 0.7);
|
|
109
|
+
animation: none;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&[data-open="true"] {
|
|
113
|
+
animation: none;
|
|
114
|
+
background: ${GP_PRIMARY};
|
|
115
|
+
border-color: ${GP_PRIMARY};
|
|
116
|
+
}
|
|
117
|
+
`;
|
|
118
|
+
const logoCss = css `
|
|
119
|
+
width: 22px;
|
|
120
|
+
height: 22px;
|
|
121
|
+
fill: ${GP_PRIMARY};
|
|
122
|
+
transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
123
|
+
|
|
124
|
+
&[data-open="true"] {
|
|
125
|
+
fill: ${GP_DARK};
|
|
126
|
+
transform: rotate(90deg);
|
|
127
|
+
}
|
|
128
|
+
`;
|
|
129
|
+
const backdropCss = css `
|
|
130
|
+
position: fixed;
|
|
131
|
+
inset: 0;
|
|
132
|
+
z-index: 899;
|
|
133
|
+
background: rgba(0, 0, 0, 0.3);
|
|
134
|
+
backdrop-filter: blur(2px);
|
|
135
|
+
`;
|
|
136
|
+
const slideUp = keyframes `
|
|
137
|
+
from { opacity: 0; transform: translateY(8px) scale(0.97); }
|
|
138
|
+
to { opacity: 1; transform: translateY(0) scale(1); }
|
|
139
|
+
`;
|
|
140
|
+
const panelCss = css `
|
|
141
|
+
position: fixed;
|
|
142
|
+
bottom: 64px;
|
|
143
|
+
left: 16px;
|
|
144
|
+
z-index: 900;
|
|
145
|
+
width: 320px;
|
|
146
|
+
background: linear-gradient(170deg, #0f2035 0%, ${GP_SURFACE} 100%);
|
|
147
|
+
border: 1px solid rgba(40, 184, 206, 0.25);
|
|
148
|
+
border-radius: 12px;
|
|
149
|
+
box-shadow:
|
|
150
|
+
0 12px 40px rgba(0, 0, 0, 0.5),
|
|
151
|
+
0 0 0 1px rgba(0, 0, 0, 0.3),
|
|
152
|
+
inset 0 1px 0 rgba(159, 226, 247, 0.05);
|
|
153
|
+
overflow: hidden;
|
|
154
|
+
animation: ${slideUp} 0.2s ease-out;
|
|
155
|
+
font-family: 'Mulish', sans-serif;
|
|
156
|
+
`;
|
|
157
|
+
const panelHeaderCss = css `
|
|
158
|
+
display: flex;
|
|
159
|
+
align-items: center;
|
|
160
|
+
gap: 8px;
|
|
161
|
+
padding: 12px 16px;
|
|
162
|
+
border-bottom: 1px solid rgba(40, 184, 206, 0.15);
|
|
163
|
+
background: rgba(40, 184, 206, 0.04);
|
|
164
|
+
`;
|
|
165
|
+
const headerLogoCss = css `
|
|
166
|
+
width: 18px;
|
|
167
|
+
height: 18px;
|
|
168
|
+
fill: ${GP_ACCENT};
|
|
169
|
+
flex-shrink: 0;
|
|
170
|
+
`;
|
|
171
|
+
const panelTitleCss = css `
|
|
172
|
+
font-size: 14px;
|
|
173
|
+
font-weight: 800;
|
|
174
|
+
color: #e0f0f4;
|
|
175
|
+
text-transform: uppercase;
|
|
176
|
+
letter-spacing: 0.08em;
|
|
177
|
+
flex: 1;
|
|
178
|
+
`;
|
|
179
|
+
const panelBadgeCss = css `
|
|
180
|
+
font-size: 9px;
|
|
181
|
+
font-weight: 800;
|
|
182
|
+
padding: 2px 6px;
|
|
183
|
+
border-radius: 4px;
|
|
184
|
+
background: rgba(40, 184, 206, 0.15);
|
|
185
|
+
color: ${GP_PRIMARY};
|
|
186
|
+
letter-spacing: 0.1em;
|
|
187
|
+
`;
|
|
188
|
+
const toolReveal = keyframes `
|
|
189
|
+
from { opacity: 0; transform: translateX(-6px); }
|
|
190
|
+
to { opacity: 1; transform: translateX(0); }
|
|
191
|
+
`;
|
|
192
|
+
const toolListCss = css `
|
|
193
|
+
display: flex;
|
|
194
|
+
flex-direction: column;
|
|
195
|
+
padding: 6px;
|
|
196
|
+
gap: 2px;
|
|
197
|
+
`;
|
|
198
|
+
export const devToolBtnCss = css `
|
|
199
|
+
position: relative;
|
|
200
|
+
display: grid;
|
|
201
|
+
grid-template-columns: 28px 1fr;
|
|
202
|
+
grid-template-rows: auto auto;
|
|
203
|
+
align-items: center;
|
|
204
|
+
gap: 0 10px;
|
|
205
|
+
padding: 10px 12px;
|
|
206
|
+
border: none;
|
|
207
|
+
border-radius: 8px;
|
|
208
|
+
background: transparent;
|
|
209
|
+
cursor: pointer;
|
|
210
|
+
text-align: left;
|
|
211
|
+
transition: background 0.15s;
|
|
212
|
+
animation: ${toolReveal} 0.25s ease-out backwards;
|
|
213
|
+
font-family: inherit;
|
|
214
|
+
|
|
215
|
+
&:hover {
|
|
216
|
+
background: rgba(40, 184, 206, 0.08);
|
|
217
|
+
}
|
|
218
|
+
&:active {
|
|
219
|
+
background: rgba(40, 184, 206, 0.14);
|
|
220
|
+
}
|
|
221
|
+
`;
|
|
222
|
+
const toolBtnActiveCss = css `
|
|
223
|
+
background: rgba(40, 184, 206, 0.1);
|
|
224
|
+
&::after {
|
|
225
|
+
content: '';
|
|
226
|
+
position: absolute;
|
|
227
|
+
left: 0;
|
|
228
|
+
top: 8px;
|
|
229
|
+
bottom: 8px;
|
|
230
|
+
width: 3px;
|
|
231
|
+
border-radius: 0 3px 3px 0;
|
|
232
|
+
background: ${GP_PRIMARY};
|
|
233
|
+
}
|
|
234
|
+
`;
|
|
235
|
+
export const devToolIconCss = css `
|
|
236
|
+
grid-row: 1 / -1;
|
|
237
|
+
font-size: 15px;
|
|
238
|
+
color: ${GP_PRIMARY};
|
|
239
|
+
display: flex;
|
|
240
|
+
align-items: center;
|
|
241
|
+
justify-content: center;
|
|
242
|
+
width: 28px;
|
|
243
|
+
height: 28px;
|
|
244
|
+
border-radius: 6px;
|
|
245
|
+
background: rgba(40, 184, 206, 0.08);
|
|
246
|
+
`;
|
|
247
|
+
export const devToolLabelCss = css `
|
|
248
|
+
font-size: 14px;
|
|
249
|
+
font-weight: 700;
|
|
250
|
+
color: #e0f0f4;
|
|
251
|
+
line-height: 1.2;
|
|
252
|
+
`;
|
|
253
|
+
export const devToolDescCss = css `
|
|
254
|
+
font-size: 12px;
|
|
255
|
+
color: #5a8a98;
|
|
256
|
+
line-height: 1.2;
|
|
257
|
+
`;
|
|
258
|
+
const activeIndicatorCss = css `
|
|
259
|
+
position: absolute;
|
|
260
|
+
top: 10px;
|
|
261
|
+
right: 12px;
|
|
262
|
+
width: 7px;
|
|
263
|
+
height: 7px;
|
|
264
|
+
border-radius: 50%;
|
|
265
|
+
background: ${GP_PRIMARY};
|
|
266
|
+
box-shadow: 0 0 6px rgba(40, 184, 206, 0.5);
|
|
267
|
+
`;
|
|
268
|
+
const dividerCss = css `
|
|
269
|
+
height: 1px;
|
|
270
|
+
margin: 4px 12px;
|
|
271
|
+
background: rgba(40, 184, 206, 0.1);
|
|
272
|
+
`;
|
|
273
|
+
// ── Inline controls ──
|
|
274
|
+
const inlineRowCss = css `
|
|
275
|
+
grid-column: 1 / -1;
|
|
276
|
+
display: flex;
|
|
277
|
+
align-items: center;
|
|
278
|
+
gap: 4px;
|
|
279
|
+
margin-top: 6px;
|
|
280
|
+
`;
|
|
281
|
+
const stepBtnCss = css `
|
|
282
|
+
width: 26px;
|
|
283
|
+
height: 26px;
|
|
284
|
+
border-radius: 5px;
|
|
285
|
+
border: 1px solid rgba(40, 184, 206, 0.25);
|
|
286
|
+
background: rgba(40, 184, 206, 0.06);
|
|
287
|
+
color: ${GP_PRIMARY};
|
|
288
|
+
font-size: 14px;
|
|
289
|
+
font-weight: 700;
|
|
290
|
+
cursor: pointer;
|
|
291
|
+
display: flex;
|
|
292
|
+
align-items: center;
|
|
293
|
+
justify-content: center;
|
|
294
|
+
font-family: inherit;
|
|
295
|
+
transition: all 0.15s;
|
|
296
|
+
|
|
297
|
+
&:hover {
|
|
298
|
+
background: rgba(40, 184, 206, 0.14);
|
|
299
|
+
border-color: rgba(40, 184, 206, 0.4);
|
|
300
|
+
}
|
|
301
|
+
`;
|
|
302
|
+
const numberInputCss = css `
|
|
303
|
+
width: 48px;
|
|
304
|
+
height: 26px;
|
|
305
|
+
border-radius: 5px;
|
|
306
|
+
border: 1px solid rgba(40, 184, 206, 0.25);
|
|
307
|
+
background: rgba(0, 0, 0, 0.3);
|
|
308
|
+
color: #e0f0f4;
|
|
309
|
+
font-size: 13px;
|
|
310
|
+
font-weight: 700;
|
|
311
|
+
text-align: center;
|
|
312
|
+
font-family: inherit;
|
|
313
|
+
font-variant-numeric: tabular-nums;
|
|
314
|
+
|
|
315
|
+
&:focus {
|
|
316
|
+
outline: none;
|
|
317
|
+
border-color: ${GP_PRIMARY};
|
|
318
|
+
box-shadow: 0 0 0 2px rgba(40, 184, 206, 0.15);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
&::-webkit-inner-spin-button,
|
|
322
|
+
&::-webkit-outer-spin-button {
|
|
323
|
+
-webkit-appearance: none;
|
|
324
|
+
margin: 0;
|
|
325
|
+
}
|
|
326
|
+
`;
|
|
327
|
+
const goBtnCss = css `
|
|
328
|
+
height: 26px;
|
|
329
|
+
padding: 0 12px;
|
|
330
|
+
border-radius: 5px;
|
|
331
|
+
border: 1px solid rgba(40, 184, 206, 0.35);
|
|
332
|
+
background: rgba(40, 184, 206, 0.15);
|
|
333
|
+
color: ${GP_PRIMARY};
|
|
334
|
+
font-size: 12px;
|
|
335
|
+
font-weight: 800;
|
|
336
|
+
text-transform: uppercase;
|
|
337
|
+
letter-spacing: 0.05em;
|
|
338
|
+
cursor: pointer;
|
|
339
|
+
margin-left: auto;
|
|
340
|
+
font-family: inherit;
|
|
341
|
+
transition: all 0.15s;
|
|
342
|
+
|
|
343
|
+
&:hover {
|
|
344
|
+
background: rgba(40, 184, 206, 0.25);
|
|
345
|
+
border-color: rgba(40, 184, 206, 0.5);
|
|
346
|
+
}
|
|
347
|
+
`;
|
|
348
|
+
const playerBtnCss = css `
|
|
349
|
+
height: 26px;
|
|
350
|
+
padding: 0 10px;
|
|
351
|
+
border-radius: 5px;
|
|
352
|
+
border: 1px solid rgba(40, 184, 206, 0.25);
|
|
353
|
+
background: rgba(40, 184, 206, 0.06);
|
|
354
|
+
color: #5a8a98;
|
|
355
|
+
font-size: 12px;
|
|
356
|
+
font-weight: 700;
|
|
357
|
+
cursor: pointer;
|
|
358
|
+
font-family: inherit;
|
|
359
|
+
transition: all 0.15s;
|
|
360
|
+
|
|
361
|
+
&:hover {
|
|
362
|
+
background: rgba(40, 184, 206, 0.14);
|
|
363
|
+
border-color: rgba(40, 184, 206, 0.4);
|
|
364
|
+
color: #e0f0f4;
|
|
365
|
+
}
|
|
366
|
+
`;
|
|
367
|
+
const playerBtnActiveCss = css `
|
|
368
|
+
background: rgba(40, 184, 206, 0.2);
|
|
369
|
+
border-color: ${GP_PRIMARY};
|
|
370
|
+
color: ${GP_PRIMARY};
|
|
371
|
+
`;
|
|
372
|
+
// ── Flash ──
|
|
373
|
+
const flashFade = keyframes `
|
|
374
|
+
0% { opacity: 0; transform: translateY(4px); }
|
|
375
|
+
15% { opacity: 1; transform: translateY(0); }
|
|
376
|
+
85% { opacity: 1; transform: translateY(0); }
|
|
377
|
+
100% { opacity: 0; transform: translateY(-4px); }
|
|
378
|
+
`;
|
|
379
|
+
const flashCss = css `
|
|
380
|
+
padding: 8px 16px;
|
|
381
|
+
font-size: 12px;
|
|
382
|
+
font-weight: 700;
|
|
383
|
+
color: ${GP_PRIMARY};
|
|
384
|
+
text-align: center;
|
|
385
|
+
border-top: 1px solid rgba(40, 184, 206, 0.1);
|
|
386
|
+
background: rgba(40, 184, 206, 0.04);
|
|
387
|
+
animation: ${flashFade} 1.5s ease-out forwards;
|
|
388
|
+
`;
|
|
389
|
+
// ── Game Options toggles ──
|
|
390
|
+
const toggleRowCss = css `
|
|
391
|
+
grid-column: 1 / -1;
|
|
392
|
+
display: flex;
|
|
393
|
+
align-items: center;
|
|
394
|
+
gap: 8px;
|
|
395
|
+
margin-top: 4px;
|
|
396
|
+
padding: 4px 0;
|
|
397
|
+
cursor: pointer;
|
|
398
|
+
`;
|
|
399
|
+
const checkboxCss = css `
|
|
400
|
+
appearance: none;
|
|
401
|
+
width: 16px;
|
|
402
|
+
height: 16px;
|
|
403
|
+
border-radius: 4px;
|
|
404
|
+
border: 1px solid rgba(40, 184, 206, 0.35);
|
|
405
|
+
background: rgba(0, 0, 0, 0.3);
|
|
406
|
+
cursor: pointer;
|
|
407
|
+
flex-shrink: 0;
|
|
408
|
+
position: relative;
|
|
409
|
+
transition: all 0.15s;
|
|
410
|
+
|
|
411
|
+
&:checked {
|
|
412
|
+
background: rgba(40, 184, 206, 0.2);
|
|
413
|
+
border-color: ${GP_PRIMARY};
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
&:checked::after {
|
|
417
|
+
content: '✓';
|
|
418
|
+
position: absolute;
|
|
419
|
+
top: 50%;
|
|
420
|
+
left: 50%;
|
|
421
|
+
transform: translate(-50%, -50%);
|
|
422
|
+
font-size: 11px;
|
|
423
|
+
color: ${GP_PRIMARY};
|
|
424
|
+
font-weight: 700;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
&:hover {
|
|
428
|
+
border-color: rgba(40, 184, 206, 0.5);
|
|
429
|
+
}
|
|
430
|
+
`;
|
|
431
|
+
const toggleLabelCss = css `
|
|
432
|
+
font-size: 12px;
|
|
433
|
+
font-weight: 600;
|
|
434
|
+
color: #5a8a98;
|
|
435
|
+
`;
|
|
436
|
+
//# sourceMappingURL=DevToolsHub.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevToolsHub.js","sourceRoot":"","sources":["../../../../src/components/material/GameTable/DevToolsHub.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAoC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAEtE,MAAM,UAAU,GAAG,SAAS,CAAA;AAC5B,MAAM,OAAO,GAAG,SAAS,CAAA;AACzB,MAAM,UAAU,GAAG,SAAS,CAAA;AAC5B,MAAM,SAAS,GAAG,SAAS,CAAA;AAQ3B;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,YAAY,GAKpB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CACvC,kBAAQ,GAAG,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,aAC1C,eAAM,GAAG,EAAE,cAAc,YAAG,IAAI,GAAQ,EACxC,eAAM,GAAG,EAAE,eAAe,YAAG,KAAK,GAAQ,EACzC,IAAI,IAAI,eAAM,GAAG,EAAE,cAAc,YAAG,IAAI,GAAQ,IAC1C,CACV,CAAA;AAOD,MAAM,CAAC,MAAM,WAAW,GAAyB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,EAAE;IACxF,MAAM,CAAC,MAAM,EAAE,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AAExB,MAAM,YAAY,GAAG,GAAG,CAAA;;;;;;CAMvB,CAAA;AAED,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;WAMX,UAAU;;;;;;;;;;;;;;CAcpB,CAAA;AAED,MAAM,cAAc,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;oBAeN,UAAU;;;;;;;;;CAS7B,CAAA;AAED,MAAM,QAAQ,GAAG,GAAG,CAAA;;;;;;WAMT,UAAU;;;;;;;;;;;;;;CAcpB,CAAA;AAED,MAAM,YAAY,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;CAkBvB,CAAA;AAED,MAAM,kBAAkB,GAAG,GAAG,CAAA;;kBAEZ,UAAU;WACjB,UAAU;CACpB,CAAA;AAED,cAAc;AAEd,MAAM,SAAS,GAAG,SAAS,CAAA;;;;;CAK1B,CAAA;AAED,MAAM,QAAQ,GAAG,GAAG,CAAA;;;;WAIT,UAAU;;;;eAIN,SAAS;CACvB,CAAA;AAED,6BAA6B;AAE7B,MAAM,YAAY,GAAG,GAAG,CAAA;;;;;;;;CAQvB,CAAA;AAED,MAAM,WAAW,GAAG,GAAG,CAAA;;;;;;;;;;;;;;oBAcH,UAAU;;;;;;;;;;aAUjB,UAAU;;;;;;;CAOtB,CAAA;AAED,MAAM,cAAc,GAAG,GAAG,CAAA;;;;CAIzB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/material/GameTable/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/material/GameTable/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
|
-
export const backgroundCss = (image) => image && css `
|
|
3
|
-
background-image: url(${image});
|
|
4
|
-
background-size: cover;
|
|
2
|
+
export const backgroundCss = (image) => image && css `
|
|
3
|
+
background-image: url(${image});
|
|
4
|
+
background-size: cover;
|
|
5
5
|
`;
|
|
6
6
|
//# sourceMappingURL=backgroundCss.js.map
|
package/dist/css/cursorCss.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
|
-
export const pointerCursorCss = css `
|
|
3
|
-
cursor: pointer;
|
|
2
|
+
export const pointerCursorCss = css `
|
|
3
|
+
cursor: pointer;
|
|
4
4
|
`;
|
|
5
|
-
export const grabCursor = css `
|
|
6
|
-
cursor: grab;
|
|
5
|
+
export const grabCursor = css `
|
|
6
|
+
cursor: grab;
|
|
7
7
|
`;
|
|
8
|
-
export const grabbingCursor = css `
|
|
9
|
-
cursor: grabbing;
|
|
8
|
+
export const grabbingCursor = css `
|
|
9
|
+
cursor: grabbing;
|
|
10
10
|
`;
|
|
11
11
|
//# sourceMappingURL=cursorCss.js.map
|
package/dist/css/fadeIn.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { css, keyframes } from '@emotion/react';
|
|
2
|
-
export const fadeIn = (duration) => css `
|
|
3
|
-
animation: ${fadeInKeyFrames} ${duration}s ease-in-out forwards
|
|
2
|
+
export const fadeIn = (duration) => css `
|
|
3
|
+
animation: ${fadeInKeyFrames} ${duration}s ease-in-out forwards
|
|
4
4
|
`;
|
|
5
|
-
const fadeInKeyFrames = keyframes `
|
|
6
|
-
from {
|
|
7
|
-
opacity: 0;
|
|
8
|
-
}
|
|
5
|
+
const fadeInKeyFrames = keyframes `
|
|
6
|
+
from {
|
|
7
|
+
opacity: 0;
|
|
8
|
+
}
|
|
9
9
|
`;
|
|
10
10
|
//# sourceMappingURL=fadeIn.js.map
|
package/dist/css/shineEffect.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { css, keyframes } from '@emotion/react';
|
|
2
|
-
const slideKeyframes = keyframes `
|
|
3
|
-
0% {
|
|
4
|
-
transform: translate(-33%, -33%);
|
|
5
|
-
}
|
|
6
|
-
50%, 100% {
|
|
7
|
-
transform: translate(33%, 33%);
|
|
8
|
-
}
|
|
2
|
+
const slideKeyframes = keyframes `
|
|
3
|
+
0% {
|
|
4
|
+
transform: translate(-33%, -33%);
|
|
5
|
+
}
|
|
6
|
+
50%, 100% {
|
|
7
|
+
transform: translate(33%, 33%);
|
|
8
|
+
}
|
|
9
9
|
`;
|
|
10
|
-
export const shineEffect = css `
|
|
11
|
-
overflow: hidden;
|
|
12
|
-
|
|
13
|
-
&:after {
|
|
14
|
-
content: '';
|
|
15
|
-
position: absolute;
|
|
16
|
-
pointer-events: none;
|
|
17
|
-
left: -100%;
|
|
18
|
-
right: -100%;
|
|
19
|
-
top: -100%;
|
|
20
|
-
bottom: -100%;
|
|
21
|
-
animation: ${slideKeyframes} 2s linear infinite;
|
|
22
|
-
z-index: 1;
|
|
23
|
-
transform-style: preserve-3d;
|
|
24
|
-
background: linear-gradient(to bottom right,
|
|
25
|
-
rgba(255, 255, 255, 0) 0%,
|
|
26
|
-
rgba(255, 255, 255, 0) 34%,
|
|
27
|
-
rgba(255, 255, 255, 0.7) 50%,
|
|
28
|
-
rgba(255, 255, 255, 0) 66%,
|
|
29
|
-
rgba(255, 255, 255, 0) 100%);
|
|
30
|
-
}
|
|
10
|
+
export const shineEffect = css `
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
|
|
13
|
+
&:after {
|
|
14
|
+
content: '';
|
|
15
|
+
position: absolute;
|
|
16
|
+
pointer-events: none;
|
|
17
|
+
left: -100%;
|
|
18
|
+
right: -100%;
|
|
19
|
+
top: -100%;
|
|
20
|
+
bottom: -100%;
|
|
21
|
+
animation: ${slideKeyframes} 2s linear infinite;
|
|
22
|
+
z-index: 1;
|
|
23
|
+
transform-style: preserve-3d;
|
|
24
|
+
background: linear-gradient(to bottom right,
|
|
25
|
+
rgba(255, 255, 255, 0) 0%,
|
|
26
|
+
rgba(255, 255, 255, 0) 34%,
|
|
27
|
+
rgba(255, 255, 255, 0.7) 50%,
|
|
28
|
+
rgba(255, 255, 255, 0) 66%,
|
|
29
|
+
rgba(255, 255, 255, 0) 100%);
|
|
30
|
+
}
|
|
31
31
|
`;
|
|
32
32
|
//# sourceMappingURL=shineEffect.js.map
|
package/dist/css/transformCss.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
|
-
export const transformCss = (...transformations) => css `
|
|
3
|
-
transform: ${transformations.filter(t => !!t).join(' ')};
|
|
2
|
+
export const transformCss = (...transformations) => css `
|
|
3
|
+
transform: ${transformations.filter(t => !!t).join(' ')};
|
|
4
4
|
`;
|
|
5
|
-
export const preserve3d = css `
|
|
6
|
-
transform-style: preserve-3d;
|
|
5
|
+
export const preserve3d = css `
|
|
6
|
+
transform-style: preserve-3d;
|
|
7
7
|
`;
|
|
8
8
|
//# sourceMappingURL=transformCss.js.map
|
|
@@ -130,7 +130,7 @@ export class GridLocator extends Locator {
|
|
|
130
130
|
this.game = context.rules.game;
|
|
131
131
|
this.refreshedGrids.clear();
|
|
132
132
|
}
|
|
133
|
-
if (!this.refreshedGrids.has(gridId)) {
|
|
133
|
+
if (!this.refreshedGrids.has(gridId) && this.itemTypes) {
|
|
134
134
|
this.refreshedGrids.add(gridId);
|
|
135
135
|
this.refreshDelta(location, context, gridId);
|
|
136
136
|
}
|
|
@@ -148,7 +148,6 @@ export class GridLocator extends Locator {
|
|
|
148
148
|
}
|
|
149
149
|
getPositionDependencies(location, context) {
|
|
150
150
|
const gridId = this.getGridId(location, context);
|
|
151
|
-
this.ensureRefreshed(location, context, gridId);
|
|
152
151
|
const delta = this.deltas.get(gridId) ?? { deltaX: 0, deltaY: 0 };
|
|
153
152
|
return [delta.deltaX, delta.deltaY];
|
|
154
153
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridLocator.js","sourceRoot":"","sources":["../../src/locators/GridLocator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,kBAAkB,EAAY,MAAM,qBAAqB,CAAA;AAC/E,OAAO,EAAE,OAAO,EAAmB,MAAM,WAAW,CAAA;AAoBpD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,WAA6F,SAAQ,OAAgB;IAEhI,YAAY,KAA4B;QACtC,KAAK,EAAE,CAAA;QACP,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IAC5B,CAAC;IAED;;OAEG;IACH,GAAG,CAAuB;IAE1B;;;;;OAKG;IACH,MAAM,CAAC,SAAyB,EAAE,QAAkC;QAClE,OAAO,IAAI,CAAC,GAAG,IAAI,EAAE,CAAA;IACvB,CAAC;IAED;;;;;OAKG;IACH,QAAQ,CAAW;IAEnB;;;;;OAKG;IACH,WAAW,CAAC,SAAyB,EAAE,QAAkC;QACvE,OAAO,IAAI,CAAC,QAAQ,CAAA;IACtB,CAAC;IAED;;;;;OAKG;IACH,SAAS,CAAC,QAAwB,EAAE,QAAkC;QACpE,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACrG,CAAC;IAED;;;;;;;;;OASG;IACH,aAAa,CAAC,QAAwB,EAAE,OAAiC;QACvE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAA;QACzB,IAAI,IAAI,GAAG,QAAQ,EAAE,IAAI,GAAG,CAAC,QAAQ,EAAE,IAAI,GAAG,QAA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rC,CAAC;CACF"}
|
|
@@ -36,6 +36,8 @@ export const setupTranslation = (gameId, options) => {
|
|
|
36
36
|
const locale = lngs[0];
|
|
37
37
|
if (!locale || !namespace || !key)
|
|
38
38
|
return;
|
|
39
|
+
if (/_zero|_one|_two|_few|_many|_other$/.test(key))
|
|
40
|
+
return;
|
|
39
41
|
try {
|
|
40
42
|
const body = JSON.stringify({ locale, namespace, key, defaultValue, origin: window.location.href });
|
|
41
43
|
navigator.sendBeacon(`${PLATFORM_URI}/api/translations/missing`, new Blob([body], { type: 'text/plain' }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.util.js","sourceRoot":"","sources":["../../src/utilities/translation.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,iBAAiB,CAAA;AACxB,OAAO,iBAAiB,CAAA;AACxB,OAAO,iBAAiB,CAAA;AACxB,OAAO,OAAwB,MAAM,SAAS,CAAA;AAC9C,OAAO,WAAW,MAAM,sBAAsB,CAAA;AAC9C,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAEhD,IAAI,sBAAsB,GAAG,KAAK,CAAA;AAElC;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAc,EAAE,OAAqB,EAAE,EAAE;IACxE,IAAI,sBAAsB,EAAE,CAAC;QAC3B,OAAM;IACR,CAAC;IAED,sBAAsB,GAAG,IAAI,CAAA;IAE7B,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;IAEvD,MAAM,KAAK,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IACzD,MAAM,MAAM,GAAG,KAAK,CA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
|
"description": "React components & tools to create a Board Game user interface for Game Park",
|
|
6
6
|
"author": "Romain Fromi <romain@game-park.com> (https://game-park.com/)",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Interpolation, Theme } from '@emotion/react';
|
|
2
|
-
import { FC } from 'react';
|
|
3
|
-
import { MaterialContentProps } from '../MaterialDescription';
|
|
4
|
-
import { ComponentSize } from '../ComponentDescription';
|
|
5
|
-
export type WheelContentProps = {
|
|
6
|
-
size: ComponentSize;
|
|
7
|
-
image?: string;
|
|
8
|
-
wheelImage?: string;
|
|
9
|
-
borderRadius?: number;
|
|
10
|
-
extraCss?: Interpolation<Theme>;
|
|
11
|
-
wheelExtraCss?: Interpolation<Theme>;
|
|
12
|
-
} & MaterialContentProps;
|
|
13
|
-
export declare const WheelContent: FC<WheelContentProps>;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { css } from '@emotion/react';
|
|
3
|
-
import { backgroundCss, borderRadiusCss, shadowCss, shadowEffect, shineEffect, sizeCss } from '../../../css';
|
|
4
|
-
export const WheelContent = (props) => {
|
|
5
|
-
const { playDown, highlight, size, image, wheelImage, borderRadius, extraCss, wheelExtraCss, children } = props;
|
|
6
|
-
return _jsxs(_Fragment, { children: [_jsx("div", { css: [
|
|
7
|
-
faceCss,
|
|
8
|
-
extraCss,
|
|
9
|
-
sizeCss(size.width, size.height),
|
|
10
|
-
wheelImage && [backgroundCss(wheelImage), shadowCss(wheelImage)],
|
|
11
|
-
borderRadius && borderRadiusCss(borderRadius),
|
|
12
|
-
highlight ? shineEffect : (playDown && playDownCss(image))
|
|
13
|
-
], children: children }), image && _jsx("div", { css: [
|
|
14
|
-
faceCss,
|
|
15
|
-
wheelExtraCss,
|
|
16
|
-
sizeCss(size.width, size.height),
|
|
17
|
-
backgroundCss(image),
|
|
18
|
-
borderRadius && borderRadiusCss(borderRadius),
|
|
19
|
-
highlight ? shineEffect : (playDown && playDownCss(image))
|
|
20
|
-
] })] });
|
|
21
|
-
};
|
|
22
|
-
const faceCss = css `
|
|
23
|
-
position: absolute;
|
|
24
|
-
transform-style: preserve-3d;
|
|
25
|
-
backface-visibility: hidden;
|
|
26
|
-
`;
|
|
27
|
-
const playDownCss = (image) => {
|
|
28
|
-
if (image?.endsWith('.jpg')) {
|
|
29
|
-
return shadowEffect;
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
return css `
|
|
33
|
-
filter: brightness(0.5);
|
|
34
|
-
`;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=WheelContent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WheelContent.js","sourceRoot":"","sources":["../../../../src/components/material/Wheel/WheelContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAwB,MAAM,gBAAgB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAc5G,MAAM,CAAC,MAAM,YAAY,GAA0B,CAAC,KAAK,EAAE,EAAE;IAC3D,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAA;IAC/G,OAAO,8BACL,cAAK,GAAG,EAAE;oBACR,OAAO;oBACP,QAAQ;oBACR,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC;oBAChC,UAAU,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;oBAChE,YAAY,IAAI,eAAe,CAAC,YAAY,CAAC;oBAC7C,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC;iBAC3D,YACE,QAAQ,GACL,EACL,KAAK,IAAI,cAAK,GAAG,EAAE;oBAClB,OAAO;oBACP,aAAa;oBACb,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC;oBAChC,aAAa,CAAC,KAAK,CAAC;oBACpB,YAAY,IAAI,eAAe,CAAC,YAAY,CAAC;oBAC7C,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC;iBAC3D,GAAG,IACH,CAAA;AACL,CAAC,CAAA;AAED,MAAM,OAAO,GAAG,GAAG,CAAA;;;;CAIlB,CAAA;AAED,MAAM,WAAW,GAAG,CAAC,KAAc,EAAE,EAAE;IACrC,IAAI,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5B,OAAO,YAAY,CAAA;IACrB,CAAC;SAAM,CAAC;QACN,OAAO,GAAG,CAAA;;KAET,CAAA;IACH,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useFailures: <Move = any>() => [string[], () => {}];
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useFailures = void 0;
|
|
4
|
-
var react_client_1 = require("@gamepark/react-client");
|
|
5
|
-
var react_redux_1 = require("react-redux");
|
|
6
|
-
var useFailures = function () {
|
|
7
|
-
var dispatch = (0, react_redux_1.useDispatch)();
|
|
8
|
-
return [(0, react_redux_1.useSelector)(function (state) { return state.failures; }), function () { return dispatch((0, react_client_1.clearFailures)()); }];
|
|
9
|
-
};
|
|
10
|
-
exports.useFailures = useFailures;
|
|
11
|
-
//# sourceMappingURL=useFailures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFailures.js","sourceRoot":"","sources":["../../src/hooks/useFailures.ts"],"names":[],"mappings":";;;AAAA,uDAAqE;AACrE,2CAAsD;AAE/C,IAAM,WAAW,GAAG;IACzB,IAAM,QAAQ,GAAG,IAAA,yBAAW,GAAE,CAAA;IAC9B,OAAO,CAAC,IAAA,yBAAW,EAAC,UAAC,KAA+B,IAAK,OAAA,KAAK,CAAC,QAAQ,EAAd,CAAc,CAAC,EAAE,cAAM,OAAA,QAAQ,CAAC,IAAA,4BAAa,GAAE,CAAC,EAAzB,CAAyB,CAAC,CAAA;AAC5G,CAAC,CAAA;AAHY,QAAA,WAAW,eAGvB"}
|
package/dist/hooks/useWebP.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useWebP: () => boolean | undefined;
|
package/dist/hooks/useWebP.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
import webPCheck from 'supports-webp';
|
|
3
|
-
export const useWebP = () => {
|
|
4
|
-
const [webP, setWebP] = useState();
|
|
5
|
-
useEffect(() => {
|
|
6
|
-
(async () => {
|
|
7
|
-
const webP = await webPCheck;
|
|
8
|
-
setWebP(webP);
|
|
9
|
-
})();
|
|
10
|
-
}, [webPCheck, setWebP]);
|
|
11
|
-
return webP;
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=useWebP.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useWebP.js","sourceRoot":"","sources":["../../src/hooks/useWebP.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,SAAS,MAAM,eAAe,CAAA;AAErC,MAAM,CAAC,MAAM,OAAO,GAAG,GAAwB,EAAE;IAC/C,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,EAAW,CAAA;IAE3C,SAAS,CAAC,GAAG,EAAE;QACb,CAAC,KAAK,IAAI,EAAE;YACV,MAAM,IAAI,GAAG,MAAM,SAAS,CAAA;YAC5B,OAAO,CAAC,IAAI,CAAC,CAAA;QACf,CAAC,CAAC,EAAE,CAAA;IACN,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAA;IAExB,OAAO,IAAI,CAAA;AACb,CAAC,CAAA"}
|