pacman-contribution-graph 2.4.0 → 3.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.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # 👻 Pac-Man Contribution Graph Game
1
+ # 👻🧱🚀 Arcade Contribution Graph Games
2
2
 
3
3
  ![Active users count][active-users-shield]
4
4
  [![Forks][forks-shield]][forks-url]
@@ -7,7 +7,19 @@
7
7
  [![Stand with Palestine][stand-with-palestine-shield]][stand-with-palestine-url]
8
8
  [![Buy Me a Coffee][buy-me-a-coffee-shield]][buy-me-a-coffee-url]
9
9
 
10
- Transform your GitHub or GitLab contribution graph into an interactive Pac-Man game! This JavaScript library offers a unique and engaging way to visualize your coding activity over the past year.
10
+ Transform your GitHub or GitLab contribution graph into arcade games! This JavaScript library offers a unique and engaging way to visualize your coding activity over the past year.
11
+
12
+ ## 🕹️ Available Games
13
+
14
+ | Game | Description |
15
+ | --------------- | ------------------------------------------------------- |
16
+ | 👻 **Pac-Man** | Pac-Man eats your contributions while ghosts give chase |
17
+ | 🧱 **Breakout** | A ball bounces around breaking your contribution bricks |
18
+ | 🚀 **Galaga** | A fighter ship shoots lasers at your contribution grid |
19
+
20
+ More games coming soon!
21
+
22
+ ### Pac-Man preview
11
23
 
12
24
  <picture>
13
25
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/abozanona/abozanona/output/pacman-contribution-graph-dark.svg">
@@ -15,21 +27,36 @@ Transform your GitHub or GitLab contribution graph into an interactive Pac-Man g
15
27
  <img alt="pacman contribution graph" src="https://raw.githubusercontent.com/abozanona/abozanona/output/pacman-contribution-graph.svg">
16
28
  </picture>
17
29
 
30
+ ### Breakout preview
31
+
32
+ <picture>
33
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/abozanona/abozanona/output/breakout-contribution-graph-dark.svg">
34
+ <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/abozanona/abozanona/output/breakout-contribution-graph.svg">
35
+ <img alt="breakout contribution graph" src="https://raw.githubusercontent.com/abozanona/abozanona/output/breakout-contribution-graph.svg">
36
+ </picture>
37
+
38
+ ### Galaga preview
39
+
40
+ <picture>
41
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/abozanona/abozanona/output/galaga-contribution-graph-dark.svg">
42
+ <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/abozanona/abozanona/output/galaga-contribution-graph.svg">
43
+ <img alt="galaga contribution graph" src="https://raw.githubusercontent.com/abozanona/abozanona/output/galaga-contribution-graph.svg">
44
+ </picture>
45
+
18
46
  ## 🎮 Features
19
47
 
20
48
  Elevate your GitHub profile with the Pac-Man Contribution Graph Game and add a playful touch to your coding journey!
21
49
 
22
50
  - **Contribution Visualization**: Converts your GitHub or GitLab contribution data into a colorful grid.
23
- - **Pac-Man Gameplay**: Classic Pac-Man mechanics where commits are edible dots
51
+ - **Multiple Games**: Classic Pac-Man and Breakout, with more planned
24
52
  - **Multiple Themes**: Choose between different themes, such as GitHub Dark and GitLab Dark.
25
- - **Customizable Settings**: Adjust game speed, sound preferences, and output format (Canvas or SVG).
53
+ - **Customizable Settings**: Adjust game settings.
26
54
  - **GitHub Integration**: Automatically fetches your contribution data via GraphQL API
27
55
  - **GitHub Action**: Easy to add to your profile or website README
28
56
 
29
57
  ## 🕹️ Demo
30
58
 
31
- Experience the game firsthand:
32
-
59
+ Experience the games firsthand:
33
60
  **Live Demo**: [Pac-Man Contribution Game](https://abozanona.github.io/pacman-contribution-graph/)
34
61
 
35
62
  ## 🔧 Installation
@@ -43,36 +70,94 @@ npm install pacman-contribution-graph
43
70
  Alternatively, include it directly in your HTML using jsDelivr:
44
71
 
45
72
  ```html
46
- <script src="https://cdn.jsdelivr.net/npm/pacman-contribution-graph@2.0.0/dist/index.min.js"></script>
73
+ <script src="https://cdn.jsdelivr.net/npm/pacman-contribution-graph/dist/pacman-contribution-graph.min.js"></script>
47
74
  ```
48
75
 
49
76
  ## 🧩 Usage
50
77
 
51
- Here's how to set up and run the Pac-Man Contribution Graph:
78
+ Here's how to set up and run the games:
52
79
 
53
80
  1. **Include the Library**: Ensure the library is included in your project, either via npm or a script tag.
54
- 2. **Initialize the Game**: Use the following code to generate the game:
81
+ 2. **Initialize the Game**: Use the following code to generate an arcade game:
82
+
83
+ **Pac-Man:**
84
+
85
+ ```javascript
86
+ import { PacmanRenderer, PlayerStyle } from 'pacman-contribution-graph';
87
+
88
+ const renderer = new PacmanRenderer({
89
+ username: 'your_username',
90
+ platform: 'github', // or 'gitlab'
91
+ gameTheme: 'github-dark', // 'github', 'github-dark', 'gitlab', or 'gitlab-dark'
92
+ playerStyle: PlayerStyle.OPPORTUNISTIC, // CONSERVATIVE, AGGRESSIVE, or OPPORTUNISTIC
93
+ svgCallback: (svg) => {
94
+ // called with the generated SVG string
95
+ document.getElementById('output').innerHTML = svg;
96
+ },
97
+ gameOverCallback: () => {
98
+ console.log('Game over!');
99
+ },
100
+ pointsIncreasedCallback: (points) => {
101
+ console.log('Score:', points);
102
+ }
103
+ });
104
+ renderer.start();
105
+ ```
106
+
107
+ **Breakout:**
55
108
 
56
109
  ```javascript
57
- import { generatePacManGame } from 'pacman-contribution-graph';
110
+ import { BreakoutRenderer } from 'pacman-contribution-graph';
58
111
 
59
- generatePacManGame({
112
+ const renderer = new BreakoutRenderer({
60
113
  username: 'your_username',
61
114
  platform: 'github', // or 'gitlab'
62
- theme: 'github-dark', // or 'gitlab-dark'
63
- speed: 2,
64
- sound: true,
65
- output: 'canvas' // or 'svg'
115
+ gameTheme: 'github-dark', // 'github', 'github-dark', 'gitlab', or 'gitlab-dark'
116
+ svgCallback: (svg) => {
117
+ document.getElementById('output').innerHTML = svg;
118
+ },
119
+ gameOverCallback: () => {
120
+ console.log('Game over!');
121
+ },
122
+ pointsIncreasedCallback: (points) => {
123
+ console.log('Score:', points);
124
+ }
125
+ });
126
+ renderer.start();
127
+ ```
128
+
129
+ import { GalagaRenderer } from 'pacman-contribution-graph';
130
+
131
+ const renderer = new GalagaRenderer({
132
+ username: 'your_username',
133
+ platform: 'github', // or 'gitlab'
134
+ gameTheme: 'github-dark', // 'github', 'github-dark', 'gitlab', or 'gitlab-dark'
135
+ svgCallback: (svg) => {
136
+ document.getElementById('output').innerHTML = svg;
137
+ },
138
+ gameOverCallback: () => {
139
+ console.log('Game over!');
140
+ },
141
+ pointsIncreasedCallback: (points) => {
142
+ console.log('Score:', points);
143
+ }
66
144
  });
145
+ renderer.start();
146
+
147
+ ```
148
+
67
149
  ```
68
150
 
69
151
  3. **Customize Settings**: Adjust the parameters as needed:
70
152
  - `username`: Your GitHub or GitLab username.
71
153
  - `platform`: Specify `'github'` or `'gitlab'`.
72
- - `theme`: Choose between available themes.
73
- - `speed`: Set the game speed (e.g., `1` for normal, `2` for fast).
74
- - `sound`: Enable or disable sound (`true` or `false`).
75
- - `output`: Select `'canvas'` for browser play or `'svg'` for a downloadable animated SVG.
154
+ - `gameTheme`: Choose between `'github'`, `'github-dark'`, `'gitlab'`, or `'gitlab-dark'`.
155
+ - `playerStyle` _(Pac-Man only)_: `PlayerStyle.OPPORTUNISTIC` (default), `PlayerStyle.CONSERVATIVE`, or `PlayerStyle.AGGRESSIVE`.
156
+ - `svgCallback`: Called with the finished SVG string once generation is complete.
157
+ - `gameOverCallback`: Called when the game finishes.
158
+ - `pointsIncreasedCallback`: Called each time the score increases.
159
+ - `gameStatsCallback`: Called at the end with `{ totalScore, steps, ghostsEaten }`.
160
+ - `githubSettings`: `{ accessToken: 'your_token' }` for private contribution data.
76
161
 
77
162
  ## Integrate into Your GitHub Profile
78
163
 
@@ -89,37 +174,41 @@ To showcase the Pac-Man game on your GitHub profile, follow these steps:
89
174
  - Add a `main.yml` file with the following content:
90
175
 
91
176
  ```yaml
92
- name: generate pacman game
177
+ name: generate arcade contribution graphs
93
178
 
94
179
  on:
95
- schedule: # Run automatically every 24 hours
96
- - cron: "0 0 * * *"
97
- workflow_dispatch: # Allows manual triggering
98
- push: # Runs on every push to the main branch
99
- branches:
100
- - main
180
+ schedule: # Run automatically every 24 hours
181
+ - cron: '0 0 * * *'
182
+ workflow_dispatch: # Allows manual triggering
183
+ push: # Runs on every push to the main branch
184
+ branches:
185
+ - main
101
186
 
102
187
  jobs:
103
- generate:
104
- permissions:
105
- contents: write
106
- runs-on: ubuntu-latest
107
- timeout-minutes: 5
108
-
109
- steps:
110
- - name: generate pacman-contribution-graph.svg
111
- uses: abozanona/pacman-contribution-graph@main
112
- with:
113
- github_user_name: ${{ github.repository_owner }}
114
-
115
- # Push the generated SVG to the output branch
116
- - name: push pacman-contribution-graph.svg to the output branch
117
- uses: crazy-max/ghaction-github-pages@v3.1.0
118
- with:
119
- target_branch: output
120
- build_dir: dist
121
- env:
122
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
188
+ generate:
189
+ permissions:
190
+ contents: write
191
+ runs-on: ubuntu-latest
192
+ timeout-minutes: 10
193
+
194
+ steps:
195
+ - name: generate contribution graph SVGs
196
+ uses: abozanona/pacman-contribution-graph@main
197
+ with:
198
+ github_user_name: ${{ github.repository_owner }}
199
+ # Comma-separated list of games to generate.
200
+ # Valid values: pacman, breakout, galaga
201
+ # Default: pacman
202
+ games: 'pacman,breakout,galaga'
203
+
204
+ # Push the generated SVGs to the output branch
205
+ - name: push SVGs to the output branch
206
+ uses: crazy-max/ghaction-github-pages@v3.1.0
207
+ with:
208
+ target_branch: output
209
+ build_dir: dist
210
+ env:
211
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123
212
  ```
124
213
 
125
214
  3. **Add to Profile README**:
@@ -129,11 +218,26 @@ To showcase the Pac-Man game on your GitHub profile, follow these steps:
129
218
  ```markdown
130
219
  ## My Contribution Graph
131
220
 
221
+ <!-- Pac-Man -->
132
222
  <picture>
133
223
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/[USERNAME]/[USERNAME]/output/pacman-contribution-graph-dark.svg">
134
224
  <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/[USERNAME]/[USERNAME]/output/pacman-contribution-graph.svg">
135
225
  <img alt="pacman contribution graph" src="https://raw.githubusercontent.com/[USERNAME]/[USERNAME]/output/pacman-contribution-graph.svg">
136
226
  </picture>
227
+
228
+ <!-- Breakout -->
229
+ <picture>
230
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/[USERNAME]/[USERNAME]/output/breakout-contribution-graph-dark.svg">
231
+ <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/[USERNAME]/[USERNAME]/output/breakout-contribution-graph.svg">
232
+ <img alt="breakout contribution graph" src="https://raw.githubusercontent.com/[USERNAME]/[USERNAME]/output/breakout-contribution-graph.svg">
233
+ </picture>
234
+
235
+ <!-- Galaga -->
236
+ <picture>
237
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/[USERNAME]/[USERNAME]/output/galaga-contribution-graph-dark.svg">
238
+ <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/[USERNAME]/[USERNAME]/output/galaga-contribution-graph.svg">
239
+ <img alt="galaga contribution graph" src="https://raw.githubusercontent.com/[USERNAME]/[USERNAME]/output/galaga-contribution-graph.svg">
240
+ </picture>
137
241
  ```
138
242
 
139
243
  4. **Commit and Push**:
@@ -169,20 +273,29 @@ To showcase the Pac-Man game on your GitLab profile, follow these steps:
169
273
  variables:
170
274
  GIT_SUBMODULE_STRATEGY: recursive
171
275
 
172
- generate_pacman_graph:
276
+ generate_graphs:
173
277
  stage: generate
174
278
  image: node:20
175
279
  script:
176
280
  - mkdir -p dist
177
281
  - npm install -g pacman-contribution-graph
178
- - pacman-contribution-graph --platform gitlab --username "$CI_PROJECT_NAMESPACE" --gameTheme gitlab --output pacman-contribution-graph-light.svg
179
- - mv pacman-contribution-graph-light.svg dist/pacman-contribution-graph-light.svg
180
- - pacman-contribution-graph --platform gitlab --username "$CI_PROJECT_NAMESPACE" --gameTheme gitlab-dark --output pacman-contribution-graph-dark.svg
181
- - mv pacman-contribution-graph-dark.svg dist/pacman-contribution-graph-dark.svg
282
+ # Pac-Man
283
+ - pacman-contribution-graph --platform gitlab --username "$CI_PROJECT_NAMESPACE" --game pacman --gameTheme gitlab --output dist/pacman-contribution-graph.svg
284
+ - pacman-contribution-graph --platform gitlab --username "$CI_PROJECT_NAMESPACE" --game pacman --gameTheme gitlab-dark --output dist/pacman-contribution-graph-dark.svg
285
+ # Breakout
286
+ - pacman-contribution-graph --platform gitlab --username "$CI_PROJECT_NAMESPACE" --game breakout --gameTheme gitlab --output dist/breakout-contribution-graph.svg
287
+ - pacman-contribution-graph --platform gitlab --username "$CI_PROJECT_NAMESPACE" --game breakout --gameTheme gitlab-dark --output dist/breakout-contribution-graph-dark.svg
288
+ # Galaga
289
+ - pacman-contribution-graph --platform gitlab --username "$CI_PROJECT_NAMESPACE" --game galaga --gameTheme gitlab --output dist/galaga-contribution-graph.svg
290
+ - pacman-contribution-graph --platform gitlab --username "$CI_PROJECT_NAMESPACE" --game galaga --gameTheme gitlab-dark --output dist/galaga-contribution-graph-dark.svg
182
291
  artifacts:
183
292
  paths:
184
- - dist/pacman-contribution-graph-light.svg
293
+ - dist/pacman-contribution-graph.svg
185
294
  - dist/pacman-contribution-graph-dark.svg
295
+ - dist/breakout-contribution-graph.svg
296
+ - dist/breakout-contribution-graph-dark.svg
297
+ - dist/galaga-contribution-graph.svg
298
+ - dist/galaga-contribution-graph-dark.svg
186
299
  expire_in: 1 hour
187
300
  rules:
188
301
  - if: '$CI_PIPELINE_SOURCE == "schedule"'
@@ -194,13 +307,12 @@ To showcase the Pac-Man game on your GitLab profile, follow these steps:
194
307
  script:
195
308
  - apk add --no-cache git
196
309
  - mkdir -p output
197
- - cp dist/pacman-contribution-graph-light.svg output/
198
- - cp dist/pacman-contribution-graph-dark.svg output/
310
+ - cp dist/*.svg output/
199
311
  - git remote set-url origin https://gitlab-ci-token:${CI_PUSH_TOKEN}@gitlab.com/${CI_PROJECT_PATH}.git
200
- - git config --global user.email "pacman-bot@example.com"
201
- - git config --global user.name "Pacman Bot"
202
- - git add output/pacman-contribution-graph-light.svg output/pacman-contribution-graph-dark.svg
203
- - git commit -m "Update Pac-Man contribution graph [ci skip]" || echo "No changes"
312
+ - git config --global user.email "arcade-bot@example.com"
313
+ - git config --global user.name "Arcade Bot"
314
+ - git add output/*.svg
315
+ - git commit -m "Update arcade contribution graphs [ci skip]" || echo "No changes"
204
316
  - git push origin HEAD:main
205
317
  rules:
206
318
  - if: '$CI_PIPELINE_SOURCE == "schedule"'
@@ -214,10 +326,25 @@ To showcase the Pac-Man game on your GitLab profile, follow these steps:
214
326
  ```markdown
215
327
  ## My Contribution Graph
216
328
 
329
+ <!-- Pac-Man -->
217
330
  <picture>
218
331
  <source media="(prefers-color-scheme: dark)" srcset="https://gitlab.com/[USERNAME]/[USERNAME]/-/raw/main/output/pacman-contribution-graph-dark.svg">
219
- <source media="(prefers-color-scheme: light)" srcset="https://gitlab.com/[USERNAME]/[USERNAME]/-/raw/main/output/pacman-contribution-graph-light.svg">
220
- <img alt="pacman contribution graph" src="https://gitlab.com/[USERNAME]/[USERNAME]/-/raw/main/output/pacman-contribution-graph-light.svg">
332
+ <source media="(prefers-color-scheme: light)" srcset="https://gitlab.com/[USERNAME]/[USERNAME]/-/raw/main/output/pacman-contribution-graph.svg">
333
+ <img alt="pacman contribution graph" src="https://gitlab.com/[USERNAME]/[USERNAME]/-/raw/main/output/pacman-contribution-graph.svg">
334
+ </picture>
335
+
336
+ <!-- Breakout -->
337
+ <picture>
338
+ <source media="(prefers-color-scheme: dark)" srcset="https://gitlab.com/[USERNAME]/[USERNAME]/-/raw/main/output/breakout-contribution-graph-dark.svg">
339
+ <source media="(prefers-color-scheme: light)" srcset="https://gitlab.com/[USERNAME]/[USERNAME]/-/raw/main/output/breakout-contribution-graph.svg">
340
+ <img alt="breakout contribution graph" src="https://gitlab.com/[USERNAME]/[USERNAME]/-/raw/main/output/breakout-contribution-graph.svg">
341
+ </picture>
342
+
343
+ <!-- Galaga -->
344
+ <picture>
345
+ <source media="(prefers-color-scheme: dark)" srcset="https://gitlab.com/[USERNAME]/[USERNAME]/-/raw/main/output/galaga-contribution-graph-dark.svg">
346
+ <source media="(prefers-color-scheme: light)" srcset="https://gitlab.com/[USERNAME]/[USERNAME]/-/raw/main/output/galaga-contribution-graph.svg">
347
+ <img alt="galaga contribution graph" src="https://gitlab.com/[USERNAME]/[USERNAME]/-/raw/main/output/galaga-contribution-graph.svg">
221
348
  </picture>
222
349
  ```
223
350
 
package/action.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  name: 'generate-pacman-game-from-github-contribution-grid'
2
- description: 'Generates a Pacman game from a github user contributions grid. Output the animation as svg'
2
+ description: 'Generates arcade games (Pac-Man, Breakout) from a GitHub user contributions grid and outputs animated SVGs'
3
3
  author: 'abozanona'
4
4
 
5
5
  runs:
@@ -14,3 +14,11 @@ inputs:
14
14
  description: 'github token used to fetch the contribution calendar. Default to the action token if empty.'
15
15
  required: false
16
16
  default: ${{ github.token }}
17
+ games:
18
+ description: 'Comma-separated list of games to generate. Valid values: pacman, breakout, galaga. Example: "pacman,breakout,galaga"'
19
+ required: false
20
+ default: 'pacman'
21
+ player_style:
22
+ description: 'Pac-Man player style: opportunistic, conservative, or aggressive'
23
+ required: false
24
+ default: 'opportunistic'
package/cli/cli.js CHANGED
@@ -4,47 +4,63 @@
4
4
  import fs from 'fs';
5
5
  import { hideBin } from 'yargs/helpers';
6
6
  import yargs from 'yargs/yargs';
7
- import { PacmanRenderer } from '../dist/pacman-contribution-graph.min.js';
7
+ import { BreakoutRenderer, GalagaRenderer, PacmanRenderer } from '../dist/pacman-contribution-graph.min.js';
8
8
 
9
9
  const argv = yargs(hideBin(process.argv))
10
- .option('platform', {
11
- alias: 'pl',
12
- describe: 'Platform: github, gitlab',
13
- choices: ['github', 'gitlab'],
14
- demandOption: true,
15
- type: 'string'
16
- })
17
- .option('gameTheme', {
18
- alias: 'gt',
19
- describe: 'Game theme: github, github-dark, gitlab, gitlab-dark',
20
- choices: ['github', 'github-dark', 'gitlab', 'gitlab-dark'],
21
- demandOption: true,
22
- type: 'string'
23
- })
24
- .option('username', {
25
- alias: 'un',
26
- describe: 'Username for the platform',
27
- demandOption: true,
28
- type: 'string'
29
- })
30
- .option('output', {
31
- alias: 'o',
32
- describe: 'Output file (SVG)',
33
- default: 'pacman-contribution-graph.svg',
34
- type: 'string'
35
- })
36
- .help()
37
- .argv;
10
+ .option('game', {
11
+ alias: 'g',
12
+ describe: 'Game to generate: pacman, breakout, galaga',
13
+ choices: ['pacman', 'breakout', 'galaga'],
14
+ default: 'pacman',
15
+ type: 'string'
16
+ })
17
+ .option('platform', {
18
+ alias: 'pl',
19
+ describe: 'Platform: github, gitlab',
20
+ choices: ['github', 'gitlab'],
21
+ demandOption: true,
22
+ type: 'string'
23
+ })
24
+ .option('gameTheme', {
25
+ alias: 'gt',
26
+ describe: 'Game theme: github, github-dark, gitlab, gitlab-dark',
27
+ choices: ['github', 'github-dark', 'gitlab', 'gitlab-dark'],
28
+ demandOption: true,
29
+ type: 'string'
30
+ })
31
+ .option('username', {
32
+ alias: 'un',
33
+ describe: 'Username for the platform',
34
+ demandOption: true,
35
+ type: 'string'
36
+ })
37
+ .option('output', {
38
+ alias: 'o',
39
+ describe: 'Output file (SVG)',
40
+ default: 'contribution-graph.svg',
41
+ type: 'string'
42
+ })
43
+ .help().argv;
38
44
 
39
- const pr = new PacmanRenderer({
40
- platform: argv.platform,
41
- username: argv.username,
42
- gameTheme: argv.gameTheme,
43
- outputFormat: 'svg',
44
- svgCallback: (svg) => {
45
- fs.writeFileSync(argv.output, svg);
46
- console.log(`SVG saved to ${argv.output}`);
47
- }
48
- });
45
+ const config = {
46
+ platform: argv.platform,
47
+ username: argv.username,
48
+ gameTheme: argv.gameTheme,
49
+ svgCallback: (svg) => {
50
+ fs.writeFileSync(argv.output, svg);
51
+ console.log(`SVG saved to ${argv.output}`);
52
+ }
53
+ };
49
54
 
50
- pr.start();
55
+ let renderer;
56
+ switch (argv.game) {
57
+ case 'breakout':
58
+ renderer = new BreakoutRenderer(config);
59
+ break;
60
+ case 'galaga':
61
+ renderer = new GalagaRenderer(config);
62
+ break;
63
+ default:
64
+ renderer = new PacmanRenderer(config);
65
+ }
66
+ renderer.start();
@@ -1 +1 @@
1
- var t={d:(e,n)=>{for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{C:()=>At});const n=53,a="yellow",o={github:{textColor:"#57606a",gridBackground:"#ffffff",wallColor:"#000000",intensityColors:["#ebedf0","#9be9a8","#40c463","#30a14e","#216e39"]},"github-dark":{textColor:"#8b949e",gridBackground:"#0d1117",wallColor:"#ffffff",intensityColors:["#161b22","#0e4429","#006d32","#26a641","#39d353"]},gitlab:{textColor:"#626167",gridBackground:"#ffffff",wallColor:"#000000",intensityColors:["#ececef","#d2dcff","#7992f5","#4e65cd","#303470"]},"gitlab-dark":{textColor:"#999999",gridBackground:"#1f1f1f",wallColor:"#ffffff",intensityColors:["#2a2a3d","#4a5bdc","#2e3dbf","#1b2e8a","#0f1a4e"]}},i={blinky:{up:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABiklEQVR4nIXSO2sVURQF4G8mMwa8QU2KxFcjCoIgacR/oCBYCP4fsTEIBkWwEK21UAQLIdjYaKEiJIXBXhNBCFaSeDP3zLa4mdyj5rHgwNmPtffZ62z+Q4miKHlWs3yALwUvKYphbC8UjDN3nIUB/SCCSDRnWKiZVxTFrvxp5kMRHbEltaTODuIED3YkT3FnUy+uS815qQkzMSJOxAWpuSo1A72Y4f5f5DFuBpE+vmsmZ9ukF9Eu/xwV+Pw1TEYcOtum9GmxCaLmdl7jeRDp968mcnQFMqS02bSkMV5tS36UBL6t7ixO6o/uK6sKymM0Q9l5NKC/Ldb3lWGrqenRCw73hr61H9viDujjKbztnLnae50uF4sl1nf91/2xvt9q7YuyEwKCNg+2DFoGue/fnHLoGwbyZQ/akqqkykkFZW6XmNy6VJdYyhPP8eE07/PCl1kqqbbMI3BrjY1rvMH4SW4kmou86Eac5UmiOcUcxq/wep2NirugYh4TXfOah6izUauax5leB2vuwR+e2vAshd8i9AAAAABJRU5ErkJggg==",down:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABmUlEQVR4nHXTT0tUYRQG8N97/TOloSYpYv/BNlLYqqJli1Z9gz5SOwkKgpDaRBS5CKJ2fYFWrsyNZWKSOYliw8y9p8XMHa+Tc+ByOec8z/M+7z3nJidHwhtc7ORreIjog29H1iYunmc5iPIpyGd5h0cd8ZNPvcLzXmJBXq1N8/g/kSSlyywFkdPMaVZJvfVZnkhHImmSZyWol9jrqMSMsti5tmhwJyhSO+8bZT8ogrulQDbDQZe8/ZPt38eZA9jbZ2OjKzTFPpJxPrdoBFFsruVRxq+tI/v1nW45vn2NIFo0TvMxTdLcYRBt+DHPne/Up36GvaygDn+p17+srp+d59S1KHyvXOPHgaFLTC9gfUtQdDp/TLAbRJPDQ2O7cyIuiAgzlQlcjSkR8yLCWJS7McJGV6Df2HoXqZqPsJmVdk56J7JEVrGsmida2TATZeM+q+U4E9kcKzdYqe7Hg+OYcdN8atG41f5Zagu8KMhv8rbck9u8L8iv8xS1e3xo0TjHMgyM8BJDnUMGa7xWjrYdQ8O8cuSkNsoSsn/EzgO2a6zxyAAAAABJRU5ErkJggg==",left:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABzklEQVR4nIWSy2tTURCHvzNnzk0TS21sQluhq4Kb+sAH4qrgyoV/oNuCUIogEUGKf4DoolBFfCC4sYKgDVXig/Tec8ZF7k1uo9GBWczvnN8H84DpcM6h6ruw14VBBwZdeIX3inPuj//18FkmS/jtDdgvYGhgBhYh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Yewiz9b4iasDtznsHpi3uG3kAu2CW0Zfery98R/+AA8N/U/uOBf2AAAAAElFTkSuQmCC"},pinky:{up:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACkElEQVR4nG2TT2hcVRTGf/fc+2bey4xJk9hoXGlMES0uCoVoF4IWW1BEkWBB6lKwEPBPLXUlhYIYEiouRDdSsGDalJYmrtIuhECLC0MQIaWmgo2RJo0WMmn+zMy997h4aScTenbn+8453+E798L2EECMFHDjCWbRwoLDTmBEcrI5TFNiDWVjhtJgX549fGV3W+nplKisV+dqu344+NuKrP1SMeZDfNSHDsgonprq//njZ7v2QpJAYZOoAhswW5lm37mXvvlX7w00rZEkiSlRHLz5/mXd1xbqEOr6kaoeq6l+qqqfqEKoP1/21bkPJrWMG7bW5uLGGIDj1/svqq/4as+LqjjVym1V/TKqnlBdW1ClRfWJPap+xVf/endcgc+NMThVBejY6UrQAn9e27JazUCA7DHQ1RwKAbq0FaBTVRFxTtpNKU1dEe5us7gG1IGwBVuGLEnoIMuMtWKAL268ef5Y73NvI8E7jhagCxhSmN/0uLsOx5Nc4NQaUVN/64+f6Lnw1rcOKJVc0WHwrCYwCFiFumncaDGBzzxEB7UClKHVpA4oOSCEGPNCFyFY8Kb5wApsuM3D50RdPECQBgSEmDc2gIYBFhAFzcVMFADbeJsKMbVeVSOqoEpIqYUitTwPqBJjwXoCaN4aBfAh+BjT6OXO786YuqgQY6rezk0VZP7XQiyqRyxGosidaRez6GMIEfACdO7IOsUt/Zc+dfbA2MTMdzVTNrJy+6orjPSdcT++cHr5n0lHBpMz3/snR1+95Jb+TtvTRwR4FOCNM6+cXOorPTMKOIF3xl77er3btn8FgMDjbufQ+OvDVYH3ALen3Ds6sv/EMtB/34FDQEtusgE4wpa/K4IAAyIPoIx8GP8DW7gOkh3Y7ZsAAAAASUVORK5CYII=",down:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACZ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rmH/UA3stP0Iur7f8AAAAASUVORK5CYII=",down:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAm0lEQVR4nO2Ryw3CQAxE35jdEBFRAycEpUAJ9A81EBIlcMjPgazEHUbyxX47I3vhLwBiDDydUpxnQt8zgG2+kQeD1A2cTJo3JIqVzV29jod9NrCX82m3xLRt27wHTYlmY+SjquslRpJ9ZVAmDKC/wf0K0lQAuFtWddn0a88ZgAwoKKx7MdRnShxdF5hAHIc5t+Q3rp2BoRT2c3oBFX9xUA7hwq8AAAAASUVORK5CYII=",left:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAuUlEQVR4nO2PvRIBQRCEu+fOIaD8RkoRKCGZwNt4fwKFcutnW2LP1tWdF6CjmdmveruBvxgGSSqOJKvgmEnM6CWYxS7hkYSVbuWdABIC9pTkI2cAeHiv3WazDPsiazWeFczDS0buQQLl0CfnrmHOb10LDHkoJxtV1cXZubyohCyyH36tVuji8vvHwJI6DltMhzNM2jqpUJqmaEdMD8YV5h3l0vHNrAf9zrjV/ARQpLrPYmYBZrWpfkwv2KllZq2VZYMAAAAASUVORK5CYII=",right:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAArklEQVR4nO2RsQrCMBCGv0vaUq2gIlJxEBEX6eLi5jv4/g8h0qViIpxT27S0i3M/COTCx5/cBSYAiIxBA8a8IcfEIhiRjmh7tQHi3pkAVnqpIfs4sbX8KIrdmGc6qfJCBETA+XlzZeWc73r1etIJgHXw7KjZV957Btn0A8K+26bf7vMd88izmbnl+UpVtVRVrVSvnJeLICAFkiRu51WqHjlkd05bAC7Gpv9+4wT8AASmiluJhbS5AAAAAElFTkSuQmCC"},scared:{imgDate:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADCklEQVR4nFWSX2hbZRjGf993vnN60qSNXWva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id:""}))),vertical:Array(54).fill(null).map((()=>Array(8).fill({active:!1,id:""})))},s=(t,e,n,a,o)=>{"horizontal"===n?t>=0&&t<r.horizontal.length&&e>=0&&e<r.horizontal[0].length&&(r.horizontal[t][e]={active:!0,id:a,color:o}):t>=0&&t<r.vertical.length&&e>=0&&e<r.vertical[0].length&&(r.vertical[t][e]={active:!0,id:a,color:o})},c=(t,e)=>[[-1,0],[1,0],[0,-1],[0,1]].filter((([a,o])=>{const i=t+a,s=e+o;return!(i<0||i>=n||s<0||s>=7||(-1===a?r.vertical[t][e].active:1===a?r.vertical[t+1][e].active:-1===o?r.horizontal[t][e].active:1===o&&r.horizontal[t][e+1].active))})),l={getValidMoves:c,calculateDistance:(t,e,n,a)=>Math.sqrt(Math.pow(n-t,2)+Math.pow(a-e,2)),findNextStepDijkstra(t,e){var n;if(t.x===e.x&&t.y===e.y)return null;const a=[Object.assign(Object.assign({},t),{cost:0,path:[]})],o=new Set([`${t.x},${t.y}`]);for(;a.length;){a.sort(((t,e)=>t.cost-e.cost));const{x:t,y:i,cost:r,path:s}=a.shift();for(const[l,A]of c(t,i)){const c=t+l,u=i+A,d=`${c},${u}`;if(o.has(d))continue;o.add(d);const h=r+1,g=[...s,{x:c,y:u}];if(c===e.x&&u===e.y)return null!==(n=g[0])&&void 0!==n?n:null;a.push({x:c,y:u,cost:h,path:g})}}return null}},A={blinky:{x:50,y:0},pinky:{x:0,y:0},inky:{x:50,y:6},clyde:{x:0,y:6}};let u="scatter",d=0,h=0;const g=t=>{switch(t.direction){case"up":t.direction="down";break;case"down":t.direction="up";break;case"left":t.direction="right";break;case"right":t.direction="left"}},m=(t,e)=>{if(!t.justReleasedFromHouse)return t.respawnCounter&&t.respawnCounter>0?(t.respawnCounter--,void(0===t.respawnCounter&&t.originalName&&(t.name=t.originalName,t.inHouse=!1,t.scared=e.pacman.powerupRemainingDuration>0))):("up"===t.direction&&t.y<=3?(t.direction="down",t.y=3):"down"===t.direction&&t.y>=3&&(t.direction="up",t.y=3),"up"===t.direction?t.y-=1:t.y+=1,void((t.y<3||t.y>=4)&&(t.y=(t.direction,3),t.direction="up"===t.direction?"down":"up")));26===t.x?(t.y=2,t.direction="up",t.inHouse=!1,t.justReleasedFromHouse=!1):t.x<26?(t.x+=1,t.direction="right"):t.x>26&&(t.x-=1,t.direction="left")},f=(t,e)=>{const n=A[t.name]||A.blinky;t.target=n;const a=C(t.x,t.y,n.x,n.y,t.direction);a&&(t.x=a.x,t.y=a.y,a.direction&&(t.direction=a.direction))},p=(t,e)=>{(!t.target||t.x===t.target.x&&t.y===t.target.y)&&(t.target=R(t.x,t.y));const n=y(t);if(0===n.length)return;const a=t.target.x-t.x,o=t.target.y-t.y;let i=n;if(Math.random()<.5);else{const t=n.filter((t=>{const e=t[0],n=t[1];return a>0&&e>0||a<0&&e<0||o>0&&n>0||o<0&&n<0}));t.length>0&&(i=t)}const[r,s]=i[Math.floor(Math.random()*i.length)];e.pacman.powerupRemainingDuration&&Math.random()<.6||(r>0?t.direction="right":r<0?t.direction="left":s>0?t.direction="down":s<0&&(t.direction="up"),t.x+=r,t.y+=s)},y=t=>l.getValidMoves(t.x,t.y).filter((e=>{const[n,a]=e;return!("right"===t.direction&&n<0||"left"===t.direction&&n>0||"up"===t.direction&&a>0||"down"===t.direction&&a<0)})),v=(t,e)=>{const n={x:26,y:3};if(Math.abs(t.x-n.x)<=1&&Math.abs(t.y-n.y)<=1)return t.x=n.x,t.y=n.y,t.inHouse=!0,void(t.respawnCounter=1);const a=l.findNextStepDijkstra({x:t.x,y:t.y},n);if(a){const e=a.x-t.x,n=a.y-t.y;e>0?t.direction="right":e<0?t.direction="left":n>0?t.direction="down":n<0&&(t.direction="up"),t.x=a.x,t.y=a.y}else{const e=C(t.x,t.y,n.x,n.y,t.direction);e&&(t.x=e.x,t.y=e.y,e.direction&&(t.direction=e.direction))}},x=(t,e)=>{if("eyes"===t.name)return void v(t);const n=w(t,e);t.target=n;const a=C(t.x,t.y,n.x,n.y,t.direction);a&&(t.x=a.x,t.y=a.y,a.direction&&(t.direction=a.direction))},C=(t,e,n,a,o)=>{if(t===n&&e===a)return null;const i=[{x:t,y:e,path:[],direction:o||"right"}],r=new Set;for(r.add(`${t},${e}`);i.length>0;){const t=i.shift(),{x:e,y:o,path:s,direction:c}=t,A=l.getValidMoves(e,o),u=A.filter((t=>{const[e,n]=t;return!c||!("right"===c&&e<0||"left"===c&&e>0||"up"===c&&n>0||"down"===c&&n<0)||1===A.length}));for(const[t,l]of u){const A=e+t,u=o+l,d=`${A},${u}`;if(r.has(d))continue;let h;r.add(d),h=t>0?"right":t<0?"left":l>0?"down":l<0?"up":c;const g=[...s,{x:A,y:u,pathDirection:h}];if(A===n&&u===a)return g.length>0?{x:g[0].x,y:g[0].y,direction:g[0].pathDirection}:null;i.push({x:A,y:u,path:g,direction:h})}}const s=l.getValidMoves(t,e);if(s.length>0){const[n,a]=s[Math.floor(Math.random()*s.length)];let i=o;return n>0?i="right":n<0?i="left":a>0?i="down":a<0&&(i="up"),{x:t+n,y:e+a,direction:i}}return null},w=(t,e)=>{const{pacman:n}=e;let a=S(e),o=1;if("blinky"===t.name){const t=371,e=(t-h)/t;if(e>.7&&(o=1.2),e>.9&&(o=1.4),Math.random()<.8*o)return{x:n.x,y:n.y}}switch(t.name){case"blinky":default:return{x:n.x,y:n.y};case"pinky":const o=4;let i=n.x,r=n.y;return"up"===n.direction?(i=n.x-4,r=n.y-4):(i=n.x+a[0]*o,r=n.y+a[1]*o),i=Math.min(Math.max(i,0),52),r=Math.min(Math.max(r,0),6),{x:i,y:r};case"inky":const s=e.ghosts.find((t=>"blinky"===t.name));let c={x:n.x+2*a[0],y:n.y+2*a[1]};if("up"===n.direction&&(c.x=n.x-2,c.y=n.y-2),s){const t=c.x-s.x,e=c.y-s.y;c={x:c.x+t,y:c.y+e}}return c.x=Math.min(Math.max(c.x,0),52),c.y=Math.min(Math.max(c.y,0),6),c;case"clyde":return l.calculateDistance(t.x,t.y,n.x,n.y)<8?A.clyde:{x:n.x,y:n.y}}},S=t=>{switch(t.pacman.direction){case"right":return[1,0];case"left":return[-1,0];case"up":return[0,-1];case"down":return[0,1];default:return[0,0]}},R=(t,e)=>{const n=t+Math.floor(17*Math.random())-8,a=e+Math.floor(17*Math.random())-8;return{x:Math.max(0,Math.min(n,52)),y:Math.max(0,Math.min(a,6))}},b=t=>{h=(t=>{let e=0;for(let a=0;a<n;a++)for(let n=0;n<7;n++)"NONE"!==t.grid[a][n].level&&e++;return e})(t),(t=>{t.pacman.powerupRemainingDuration>0||(d++,d>=5*("scatter"===u?7:20)&&(u="scatter"===u?"chase":"scatter",d=0,t.ghosts.forEach((t=>{t.inHouse||"eyes"===t.name||t.scared||g(t)}))))})(t);for(const e of t.ghosts)e.inHouse?m(e,t):("eyes"===e.name&&(e.scared=!1),e.scared?p(e,t):"eyes"===e.name?v(e):"scatter"===u?f(e):x(e,t))};var B;!function(t){t.CONSERVATIVE="conservative",t.AGGRESSIVE="aggressive",t.OPPORTUNISTIC="opportunistic"}(B||(B={}));const E=(t,e)=>Math.floor((e.getTime()-t.getTime())/6048e5),D=t=>new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())),I=t=>{var e;return null!==(e=o[t.config.gameTheme])&&void 0!==e?e:o.github},M=t=>{switch(t){case"NONE":default:return 0;case"FIRST_QUARTILE":return 1;case"SECOND_QUARTILE":return 2;case"THIRD_QUARTILE":return 3;case"FOURTH_QUARTILE":return 4}},T=(t,e)=>{const n=e/4;return 0===t?"NONE":t<n?"FIRST_QUARTILE":t<2*n?"SECOND_QUARTILE":t<3*n?"THIRD_QUARTILE":"FOURTH_QUARTILE"},k=t=>{const e=D(new Date),n=new Date(e);n.setUTCDate(e.getUTCDate()-365),n.setUTCDate(n.getUTCDate()-n.getUTCDay());const a=Array.from({length:53},(()=>Array.from({length:7},(()=>({commitsCount:0,color:I(t).intensityColors[0],level:"NONE"})))));t.contributions.forEach((o=>{const i=D(new Date(o.date));if(i<n||i>e)return;const r=i.getUTCDay(),s=E(n,i);if(s>=0&&s<53){const e=I(t);a[s][r]={commitsCount:o.count,color:e.intensityColors[M(o.level)],level:o.level}}})),t.grid=a},U=I,z=k,O=t=>{const e=[];for(let a=0;a<n;a++)for(let n=0;n<7;n++){const o=t.grid[a][n];if("NONE"!==o.level){const i=l.calculateDistance(a,n,t.pacman.x,t.pacman.y),r=o.commitsCount/(i+1);e.push({x:a,y:n,value:r})}}return e.sort(((t,e)=>e.value-t.value)),0===e.length?{x:t.pacman.x,y:t.pacman.y,value:0}:e[0]},N=t=>{const e=new Map,a=!!t.pacman.powerupRemainingDuration;if(t.ghosts.forEach((t=>{if(!t.scared)for(let a=-5;a<=5;a++)for(let o=-5;o<=5;o++){const i=t.x+a,r=t.y+o;if(i>=0&&i<n&&r>=0&&r<7){const t=`${i},${r}`,n=15-(Math.abs(a)+Math.abs(o));if(n>0){const a=e.get(t)||0;e.set(t,Math.max(a,n))}}}})),a)for(const[t,n]of e.entries())e.set(t,n/5);return e},P=(t,e)=>{var n;(n=t.pacman).recentPositions||(n.recentPositions=[]),t.pacman.recentPositions.push(`${e.x},${e.y}`),t.pacman.recentPositions.length>5&&t.pacman.recentPositions.shift();const a=e.x-t.pacman.x,o=e.y-t.pacman.y;t.pacman.direction=a>0?"right":a<0?"left":o>0?"down":o<0?"up":t.pacman.direction,t.pacman.x=e.x,t.pacman.y=e.y},Q=t=>{t.pacman.powerupRemainingDuration=15,t.ghosts.forEach((t=>t.scared=!0))},V=t=>{if(t.pacman.deadRemainingDuration)return;const e=!!t.pacman.powerupRemainingDuration,n=t.ghosts.filter((t=>t.scared));let a;try{if(e&&n.length>0){const e=(t=>{const e=t.ghosts.filter((t=>t.scared));return 0===e.length?null:e.reduce(((e,n)=>{const a=l.calculateDistance(n.x,n.y,t.pacman.x,t.pacman.y);return a<e.distance?{x:n.x,y:n.y,distance:a}:e}),{x:t.pacman.x,y:t.pacman.y,distance:1/0})})(t);a=null!=e?e:O(t)}else t.pacman.target?t.pacman.x===t.pacman.target.x&&t.pacman.y===t.pacman.target.y?(a=O(t),t.pacman.target=a):a=t.pacman.target:(a=O(t),t.pacman.target=a);a||(a={x:t.pacman.x,y:t.pacman.y});const o=((t,e)=>{var n;const a=[{x:t.pacman.x,y:t.pacman.y,path:[],score:0}],o=new Set([`${t.pacman.x},${t.pacman.y}`]),i=N(t);let r=.5,s=.5;switch(t.config.playerStyle){case B.CONSERVATIVE:r=3,s=.1;break;case B.AGGRESSIVE:r=.3,s=2;break;case B.OPPORTUNISTIC:default:r=.8,s=.8}let c=1/0;t.ghosts.forEach((e=>{if(!e.scared){const n=l.calculateDistance(t.pacman.x,t.pacman.y,e.x,e.y);c=Math.min(c,n)}}));const A=t.config.playerStyle===B.CONSERVATIVE?5:7,u=c<A;for(t.config.playerStyle===B.CONSERVATIVE&&u&&(r*=5);a.length>0;){a.sort(((t,e)=>e.score-t.score));const c=a.shift(),{x:A,y:u,path:d}=c;if(A===e.x&&u===e.y){if(d.length>0){let e=0,n=0;return d.forEach((a=>{const o=`${a.x},${a.y}`,c=i.get(o)||0,l=t.grid[a.x][a.y].commitsCount;e-=c*r,n+=l*s})),d[0]}return null}for(const[c,h]of l.getValidMoves(A,u)){const g=A+c,m=u+h,f=`${g},${m}`;if(!o.has(f)){const c=[...d,{x:g,y:m}],A=i.get(f)||0,u=t.grid[g][m].commitsCount,h=l.calculateDistance(g,m,e.x,e.y),p=(null===(n=t.pacman.recentPositions)||void 0===n?void 0:n.includes(f))?100:0;let y,v,x;t.config.playerStyle===B.CONSERVATIVE?(y=(15-A)*r,A>=5?y-=100:y+=50,v=u*s,x=5*y+v+-h/10-p):(y=(15-A)*r,v=u*s,x=y+v+-h/10-p),a.push({x:g,y:m,path:c,score:x}),o.add(f)}}}return null})(t,a);o?P(t,o):(t=>{const e=l.getValidMoves(t.pacman.x,t.pacman.y);if(0===e.length)return;const n=e.reduce(((e,[n,a])=>{const o=t.pacman.x+n,i=t.pacman.y+a;let r=1/0;return t.ghosts.forEach((t=>{if(!t.scared){const e=l.calculateDistance(t.x,t.y,o,i);r=Math.min(r,e)}})),r>e.distance?{dx:n,dy:a,distance:r}:e}),{dx:0,dy:0,distance:-1/0});P(t,{x:t.pacman.x+n.dx,y:t.pacman.y+n.dy})})(t),(t=>{const e=t.grid[t.pacman.x][t.pacman.y];if("NONE"!==e.level){t.pacman.totalPoints+=e.commitsCount,t.pacman.points++,t.config.pointsIncreasedCallback(t.pacman.totalPoints);const n=U(t);"FOURTH_QUARTILE"===e.level&&Q(t),e.level="NONE",e.color=n.intensityColors[0],e.commitsCount=0}})(t)}catch(t){console.error("Error in movePacman:",t)}};var H,F=function(t,e,n,a){return new(n||(n=Promise))((function(o,i){function r(t){try{c(a.next(t))}catch(t){i(t)}}function s(t){try{c(a.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}c((a=a.apply(t,e||[])).next())}))};!function(t){t.DEFAULT="https://cdn.jsdelivr.net/npm/pacman-contribution-graph/src/assets/sounds/pacman_chomp.wav",t.BEGINNING="https://cdn.jsdelivr.net/npm/pacman-contribution-graph/src/assets/sounds/pacman_beginning.wav",t.GAME_OVER="https://cdn.jsdelivr.net/npm/pacman-contribution-graph/src/assets/sounds/pacman_death.wav",t.EAT_GHOST="https://cdn.jsdelivr.net/npm/pacman-contribution-graph/src/assets/sounds/pacman_eatghost.wav"}(H||(H={}));class L{constructor(){this.sounds=new Map,this.currentSource=null,this.defaultSource=null,this.isMuted=!1,this.audioContext=new AudioContext}static getInstance(){return L.instance||(L.instance=new L),L.instance}preloadSounds(){return F(this,void 0,void 0,(function*(){for(const t of Object.values(H)){const e=yield fetch(t),n=yield e.arrayBuffer(),a=yield this.audioContext.decodeAudioData(n);this.sounds.set(t,a)}}))}play(t){return F(this,void 0,void 0,(function*(){if(this.isMuted)return;if(this.currentSource)try{this.currentSource.stop()}catch(t){}const e=this.sounds.get(t);if(e)return this.currentSource=this.audioContext.createBufferSource(),this.currentSource.buffer=e,this.currentSource.connect(this.audioContext.destination),this.isMuted||this.currentSource.start(),new Promise((t=>{this.currentSource.onended=()=>{this.currentSource=null,t()}}));console.error(`Sound ${t} not found`)}))}startDefaultSound(){if(this.defaultSource)try{this.defaultSource.stop()}catch(t){}const t=this.sounds.get(H.DEFAULT);t?(this.defaultSource=this.audioContext.createBufferSource(),this.defaultSource.buffer=t,this.defaultSource.loop=!0,this.defaultSource.connect(this.audioContext.destination),this.isMuted||this.defaultSource.start()):console.error("Default sound not found")}stopDefaultSound(){if(this.defaultSource){try{this.defaultSource.stop()}catch(t){}this.defaultSource=null}}mute(){this.isMuted=!0,this.currentSource&&this.currentSource.disconnect(),this.defaultSource&&this.defaultSource.disconnect()}unmute(){this.isMuted=!1,this.currentSource&&this.currentSource.connect(this.audioContext.destination),this.defaultSource&&this.defaultSource.connect(this.audioContext.destination)}}const Y=t=>t.deadRemainingDuration?"#80808064":t.powerupRemainingDuration?"red":a,j={},G=(t,e)=>{if(!j[t]){const n=new Image;n.src=e,j[t]=n}return j[t]},K=t=>{const e=t.config.canvas.getContext("2d");e.fillStyle=U(t).gridBackground,e.fillRect(0,0,t.config.canvas.width,t.config.canvas.height);for(let a=0;a<n;a++)for(let n=0;n<7;n++){if("NONE"!==t.grid[a][n].level){const o=t.grid[a][n].color;e.fillStyle=o}else e.fillStyle=U(t).intensityColors[0];e.beginPath(),t.config.canvas.getContext("2d").roundRect(22*a,22*n+15,20,20,5),e.fill()}e.fillStyle=U(t).wallColor;for(let t=0;t<=n;t++)for(let n=0;n<=7;n++)r.horizontal[t][n].active&&e.fillRect(22*t-2,22*n-2+15,22,2),r.vertical[t][n].active&&e.fillRect(22*t-2,22*n-2+15,2,22);e.fillStyle=U(t).textColor,e.font="10px Arial",e.textAlign="center";let a="";for(let o=0;o<n;o++)if(t.monthLabels[o]!==a){const n=22*o+10;e.fillText(t.monthLabels[o],n,10),a=t.monthLabels[o]}},J=t=>{t.config.enableSounds&&t.config.canvas.addEventListener("click",(function(e){const n=t.config.canvas.getBoundingClientRect(),a=e.clientX-n.left,o=e.clientY-n.top,i=t.config.canvas.width-30-10;a>=i&&a<=i+this.width&&o>=10&&o<=10+this.height&&(L.getInstance().isMuted?L.getInstance().unmute():L.getInstance().mute())}))},q=t=>{const e=10,n=t,a=2*Math.PI-t;return`M 10,10\n L ${e+e*Math.cos(n)},${e+e*Math.sin(n)}\n A 10,10 0 1,1 ${e+e*Math.cos(a)},${e+e*Math.sin(a)}\n Z`},W=(t,e,n)=>t.gameHistory.map((t=>t.grid[e][n].color)),X=(t,e)=>{if(t.gameHistory.length!==e.length)throw new Error(`The amount of values (${e.length}) does not match the size of the game history (${t.gameHistory.length})`);const n=t.gameHistory.length;if(0===n)return{keyTimes:"0;1",values:e[0]||"#000;#000"};let a=[],o=[],i=null,r=null;return e.forEach(((t,e)=>{t!==i&&(null!==i&&null!==r&&e-1!==r&&(a.push(Number(((e-1/40)/(n-1)).toFixed(4))),o.push(i)),a.push(Number((e/(n-1)).toFixed(4))),o.push(t),i=t,r=e)})),0!==a.length&&1===a[a.length-1]||(0===a.length?(a.push(0,1),o.push(e[0]||"#000",e[e.length-1]||"#000")):(a.push(1),o.push(i||e[e.length-1]||"#000"))),{keyTimes:a.join(";"),values:o.join(";")}},Z=t=>{const e=200*t.gameHistory.length;let o='<svg width="1166" height="184" xmlns="http://www.w3.org/2000/svg">';o+=`<desc>Generated with pacman-contribution-graph on ${new Date}</desc>`,o+=`<metadata>\n\t\t<info>\n\t\t\t<frames>${t.gameHistory.length}</frames>\n\t\t\t<frameRate>5</frameRate>\n\t\t\t<durationMs>${e}</durationMs>\n\t\t\t<generatedOn>${(new Date).toISOString()}</generatedOn>\n\t\t</info>\n\t</metadata>`,o+=`<rect width="100%" height="100%" fill="${U(t).gridBackground}"/>`,o+=(()=>{let t="<defs>";return["blinky","inky","pinky","clyde"].forEach((e=>{["up","down","left","right"].forEach((n=>{const a=i[e];n in a&&(t+=`\n <symbol id="ghost-${e}-${n}" viewBox="0 0 20 20">\n <image href="${a[n]}" width="20" height="20"/>\n </symbol>\n `)}))})),t+=`\n <symbol id="ghost-scared" viewBox="0 0 20 20">\n <image href="${i.scared.imgDate}" width="20" height="20"/>\n </symbol>`,["up","down","left","right"].forEach((e=>{i.eyes&&e in i.eyes?t+=`\n <symbol id="ghost-eyes-${e}" viewBox="0 0 20 20">\n <image href="${i.eyes[e]}" width="20" height="20"/>\n </symbol>\n `:(console.warn(`Imagem para eyes-${e} não encontrada, usando placeholder`),t+=`\n <symbol id="ghost-eyes-${e}" viewBox="0 0 20 20">\n <circle cx="10" cy="10" r="${20/3}" fill="white"/>\n </symbol>\n `)})),t+="</defs>",t})();let s="";for(let e=0;e<n;e++)t.monthLabels[e]!==s&&(o+=`<text x="${22*e+10}" y="10" text-anchor="middle" font-size="10" fill="${U(t).textColor}">${t.monthLabels[e]}</text>`,s=t.monthLabels[e]);for(let a=0;a<n;a++)for(let n=0;n<7;n++){const i=22*a,r=22*n+15,s=X(t,W(t,a,n));o+=`<rect id="c-${a}-${n}" x="${i}" y="${r}" width="20" height="20" rx="5" fill="${U(t).intensityColors[0]}">\n\t\t\t\t<animate attributeName="fill" dur="${e}ms" repeatCount="indefinite" \n\t\t\t\t\tvalues="${s.values}" \n\t\t\t\t\tkeyTimes="${s.keyTimes}"/>\n\t\t\t</rect>`}for(let e=0;e<7;e++){let a=null;for(let i=0;i<=n;i++){let s=i<n&&r.horizontal[i][e].active;s&&null===a&&(a=i),s&&i!==n||null===a||(o+=`<rect id="wh-${a}-${e}" x="${22*a-2}" y="${22*e-2+15}" width="${22*(i-a)}" height="2" fill="${U(t).wallColor}"></rect>`,a=null)}}for(let e=0;e<n;e++){let n=null;for(let a=0;a<=7;a++){let i=a<7&&r.vertical[e][a].active;i&&null===n&&(n=a),i&&7!==a||null===n||(o+=`<rect id="wv-${e}-${n}" x="${22*e-2}" y="${22*n-2+15}" width="2" height="${22*(a-n)}" fill="${U(t).wallColor}"></rect>`,n=null)}}const c=X(t,t.gameHistory.map((t=>Y(t.pacman)))),l=X(t,(t=>t.gameHistory.map((t=>`${22*t.pacman.x},${22*t.pacman.y+15}`)))(t)),A=X(t,(t=>t.gameHistory.map((t=>{switch(t.pacman.direction){case"right":default:return"0 10 10";case"left":return"180 10 10";case"up":return"270 10 10";case"down":return"90 10 10"}})))(t));return o+=`<path id="pacman" d="${q(.55)}" fill="${a}">\n\t\t<animate attributeName="fill" dur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${c.keyTimes}"\n\t\t\tvalues="${c.values}"/>\n\t\t<animateTransform attributeName="transform" type="translate" dur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${l.keyTimes}"\n\t\t\tvalues="${l.values}"\n\t\t\tadditive="sum"/>\n\t\t<animateTransform attributeName="transform" type="rotate" dur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${A.keyTimes}"\n\t\t\tvalues="${A.values}"\n\t\t\tadditive="sum"/>\n\t\t<animate attributeName="d" dur="0.5s" repeatCount="indefinite"\n\t\t\tvalues="${q(.55)};${q(.05)};${q(.55)}"/>\n\t</path>`,t.ghosts.forEach(((n,a)=>{const i=X(t,((t,e)=>t.gameHistory.map((t=>{if(e>=t.ghosts.length)return"0,0";const n=t.ghosts[e];return`${22*n.x},${22*n.y+15}`})))(t,a));o+=`<g id="ghost${a}" transform="translate(0,0)">\n\t\t\t<animateTransform attributeName="transform" type="translate" \n\t\t\t\tdur="${e}ms" repeatCount="indefinite"\n\t\t\t\tkeyTimes="${i.keyTimes}"\n\t\t\t\tvalues="${i.values}"\n\t\t\t\tadditive="replace"/>`;const r=function(t,e){const n={};["blinky-up","blinky-down","blinky-left","blinky-right","inky-up","inky-down","inky-left","inky-right","pinky-up","pinky-down","pinky-left","pinky-right","clyde-up","clyde-down","clyde-left","clyde-right","eyes-up","eyes-down","eyes-left","eyes-right","scared"].forEach((t=>{n[t]=[{time:0,visible:!1}]}));const a=t.ghosts[e];if(!a)return n;const o=a.scared?"scared":"eyes"===a.name?`eyes-${a.direction||"right"}`:`${a.name}-${a.direction||"right"}`;n[o]=[{time:0,visible:!0}];let i=o;return t.gameHistory.forEach(((a,o)=>{if(e>=a.ghosts.length)return;const r=a.ghosts[e],s=o/(t.gameHistory.length-1),c=r.scared?"scared":"eyes"===r.name?`eyes-${r.direction||"right"}`:`${r.name}-${r.direction||"right"}`;c!==i&&(n[i].push({time:s,visible:!1}),n[c]||(n[c]=[{time:0,visible:!1}]),n[c].push({time:s,visible:!0}),i=c)})),n[i].push({time:1,visible:!0}),Object.keys(n).forEach((t=>{t!==i&&n[t].length>0&&n[t][n[t].length-1].time<1&&n[t].push({time:1,visible:!1})})),n}(t,a);for(const[t,n]of Object.entries(r)){if(0===n.length)continue;const a=`#ghost-${t}`,i=n.map((t=>t.time.toFixed(4))).join(";"),r=n.map((t=>t.visible?"visible":"hidden")).join(";"),s=n[0].visible?"visible":"hidden";o+=`<use href="${a}" width="20" height="20" visibility="${s}">\n\t\t\t\t<animate attributeName="visibility" \n\t\t\t\t\tdur="${e}ms" repeatCount="indefinite"\n\t\t\t\t\tkeyTimes="${i}"\n\t\t\t\t\tvalues="${r}" />\n\t\t\t</use>`}o+="</g>"})),o+="</svg>",o};var $=function(t,e,n,a){return new(n||(n=Promise))((function(o,i){function r(t){try{c(a.next(t))}catch(t){i(t)}}function s(t){try{c(a.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}c((a=a.apply(t,e||[])).next())}))};const _=t=>{t.ghosts=[{x:26,y:2,name:"blinky",direction:"left",scared:!1,target:void 0,inHouse:!1,respawnCounter:0,freezeCounter:0,justReleasedFromHouse:!1},{x:25,y:3,name:"inky",direction:"up",scared:!1,target:void 0,inHouse:!0,respawnCounter:0,freezeCounter:10,justReleasedFromHouse:!1},{x:26,y:3,name:"pinky",direction:"down",scared:!1,target:void 0,inHouse:!0,respawnCounter:0,freezeCounter:20,justReleasedFromHouse:!1},{x:27,y:3,name:"clyde",direction:"up",scared:!1,target:void 0,inHouse:!0,respawnCounter:0,freezeCounter:30,justReleasedFromHouse:!1}],t.ghosts.forEach((t=>{t.justReleasedFromHouse=!1,t.respawnCounter=0,t.inHouse&&("inky"===t.name?t.direction="up":"pinky"===t.name?t.direction="down":"clyde"===t.name&&(t.direction="up"))}))},tt=t=>$(void 0,void 0,void 0,(function*(){var e,n,a;if(t.frameCount++,t.frameCount%t.config.gameSpeed!=0)return void et(t);if(t.pacman.deadRemainingDuration>0&&(t.pacman.deadRemainingDuration--,0===t.pacman.deadRemainingDuration&&((t=>{t.pacman.x=27,t.pacman.y=7,t.pacman.direction="right",t.pacman.recentPositions=[]})(t),_(t))),t.pacman.powerupRemainingDuration>0&&(t.pacman.powerupRemainingDuration--,0===t.pacman.powerupRemainingDuration&&(t.ghosts.forEach((t=>{"eyes"!==t.name&&(t.scared=!1)})),t.pacman.points=0)),t.ghosts.forEach((e=>{e.inHouse&&e.respawnCounter&&e.respawnCounter>0&&(e.respawnCounter--,0===e.respawnCounter&&(e.name=e.originalName||(t=>{const e=["blinky","inky","pinky","clyde"];return e[t%e.length]})(t.ghosts.indexOf(e)),e.inHouse=!1,e.scared=t.pacman.powerupRemainingDuration>0,e.justReleasedFromHouse=!0)),e.freezeCounter&&(e.freezeCounter--,0===e.freezeCounter&&at(t,e.name))})),!t.grid.some((t=>t.some((t=>t.commitsCount>0))))){if("svg"===t.config.outputFormat){const e=Z(t);t.config.svgCallback(e)}return"canvas"==t.config.outputFormat&&((t=>{const e=t.config.canvas.getContext("2d");e.fillStyle=U(t).textColor,e.font="20px Arial",e.textAlign="center",e.fillText("Game Over",t.config.canvas.width/2,t.config.canvas.height/2)})(t),L.getInstance().play(H.BEGINNING).then((()=>L.getInstance().stopDefaultSound()))),t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:t.pacman.totalPoints,steps:t.aliveSteps,ghostsEaten:null!==(e=t.pacman.ghostsEaten)&&void 0!==e?e:0}),void t.config.gameOverCallback()}V(t);const o=null===(n=t.grid[t.pacman.x])||void 0===n?void 0:n[t.pacman.y];o&&"FOURTH_QUARTILE"===o.level&&0===t.pacman.powerupRemainingDuration&&(t.pacman.powerupRemainingDuration=30,t.ghosts.forEach((t=>{"eyes"!==t.name&&(t.scared=!0)}))),nt(t),0===t.pacman.deadRemainingDuration&&(b(t),nt(t)),t.pacmanMouthOpen=!t.pacmanMouthOpen,0===t.pacman.deadRemainingDuration&&t.aliveSteps++,t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:t.pacman.totalPoints,steps:t.aliveSteps,ghostsEaten:null!==(a=t.pacman.ghostsEaten)&&void 0!==a?a:0}),et(t),"canvas"==t.config.outputFormat&&K(t),"canvas"==t.config.outputFormat&&(t=>{const e=t.config.canvas.getContext("2d"),n=22*t.pacman.x+10,a=22*t.pacman.y+10+15;e.fillStyle=Y(t.pacman);const o=t.pacmanMouthOpen?.35*Math.PI:.1*Math.PI;let i,r;switch(t.pacman.direction){case"up":i=1.5*Math.PI+o,r=1.5*Math.PI-o;break;case"down":i=.5*Math.PI+o,r=.5*Math.PI-o;break;case"left":i=Math.PI+o,r=Math.PI-o;break;default:i=0+o,r=2*Math.PI-o}e.beginPath(),e.arc(n,a,10,i,r),e.lineTo(n,a),e.fill()})(t),"canvas"==t.config.outputFormat&&(t=>{t.ghosts.forEach((e=>{const n=22*e.x,a=22*e.y+15,o=t.config.canvas.getContext("2d");if(e.scared)"imgDate"in i.scared&&o.drawImage(G("scared",i.scared.imgDate),n,a,20,20);else{const t=i[e.name][e.direction];o.drawImage(G(e.name+"-"+e.direction,t),n,a,20,20)}}))})(t),"canvas"==t.config.outputFormat&&(t=>{if(!t.config.enableSounds)return;const e=t.config.canvas.getContext("2d"),n=t.config.canvas.width-30-10;e.fillStyle=`rgba(0, 0, 0, ${L.getInstance().isMuted?.3:.5})`,e.beginPath(),e.moveTo(n+10,20),e.lineTo(n+20,15),e.lineTo(n+20,35),e.lineTo(n+10,30),e.closePath(),e.fill(),L.getInstance().isMuted?(e.strokeStyle="rgba(255, 0, 0, 0.6)",e.lineWidth=3,e.beginPath(),e.moveTo(n+25,15),e.lineTo(n+5,35),e.stroke()):(e.strokeStyle="rgba(0, 0, 0, 0.4)",e.lineWidth=2,e.beginPath(),e.arc(n+25,25,5,0,2*Math.PI),e.stroke(),e.beginPath(),e.arc(n+25,25,8,0,2*Math.PI),e.stroke())})(t)})),et=t=>{t.gameHistory.push({pacman:Object.assign({},t.pacman),ghosts:t.ghosts.map((t=>Object.assign({},t))),grid:t.grid.map((t=>t.map((t=>Object.assign({},t)))))})},nt=t=>{t.pacman.deadRemainingDuration||t.ghosts.forEach((e=>{var n;"eyes"!==e.name&&e.x===t.pacman.x&&e.y===t.pacman.y&&(t.pacman.powerupRemainingDuration&&e.scared?(e.originalName=e.name,e.name="eyes",e.scared=!1,e.target={x:26,y:3},t.pacman.points+=10,t.pacman.ghostsEaten=(null!==(n=t.pacman.ghostsEaten)&&void 0!==n?n:0)+1):(t.pacman.points=0,t.pacman.powerupRemainingDuration=0,0===t.pacman.deadRemainingDuration&&(t.pacman.deadRemainingDuration=10)))}))},at=(t,e)=>{const n=t.ghosts.find((t=>t.name===e&&t.inHouse));n&&(n.justReleasedFromHouse=!0,n.y=2,n.direction="up")},ot=t=>$(void 0,void 0,void 0,(function*(){"canvas"==t.config.outputFormat&&(t.config.canvas=t.config.canvas,(t=>{t.config.canvas.width=1166,t.config.canvas.height=174})(t),J(t)),t.frameCount=0,t.aliveSteps=0,t.gameHistory=[],t.ghosts.forEach((t=>t.scared=!1)),t.grid=(t=>(k(t),t.grid))(t);const e=()=>t.grid.some((t=>t.some((t=>t.commitsCount>0))));if(e()&&((t=>{t.pacman={x:0,y:0,direction:"right",points:0,totalPoints:0,deadRemainingDuration:0,powerupRemainingDuration:0,recentPositions:[],ghostsEaten:0}})(t),_(t)),"canvas"==t.config.outputFormat&&K(t),"canvas"==t.config.outputFormat&&(t.config.enableSounds||L.getInstance().mute(),yield L.getInstance().preloadSounds(),L.getInstance().startDefaultSound(),yield L.getInstance().play(H.BEGINNING)),"svg"===t.config.outputFormat){for(;e();)yield tt(t);yield tt(t)}else clearInterval(t.gameInterval),t.gameInterval=setInterval((()=>tt(t)),200*t.config.gameSpeed)})),it={frameCount:0,aliveSteps:0,contributions:[],pacman:{x:0,y:0,direction:"right",points:0,totalPoints:0,deadRemainingDuration:0,powerupRemainingDuration:0,recentPositions:[],ghostsEaten:0},ghosts:[],grid:[],monthLabels:[],pacmanMouthOpen:!0,gameInterval:0,gameHistory:[],config:void 0,useGithubThemeColor:!0};var rt=function(t,e,n,a){return new(n||(n=Promise))((function(o,i){function r(t){try{c(a.next(t))}catch(t){i(t)}}function s(t){try{c(a.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}c((a=a.apply(t,e||[])).next())}))};const st=t=>rt(void 0,void 0,void 0,(function*(){var e;return(null===(e=t.config.githubSettings)||void 0===e?void 0:e.accessToken)?yield(t=>rt(void 0,void 0,void 0,(function*(){var e;const n=yield fetch("https://api.github.com/graphql",{method:"POST",headers:{Authorization:`Bearer ${null===(e=t.config.githubSettings)||void 0===e?void 0:e.accessToken}`,"Content-Type":"application/json"},body:JSON.stringify({query:"\n\t\tquery ($login: String!) {\n\t\t\tuser(login: $login) {\n\t\t\t\tcontributionsCollection {\n\t\t\t\t\tcontributionCalendar {\n\t\t\t\t\t\tweeks {\n\t\t\t\t\t\t\tcontributionDays {\n\t\t\t\t\t\t\t\tdate\n\t\t\t\t\t\t\t\tcontributionCount\n\t\t\t\t\t\t\t\tcolor\n\t\t\t\t\t\t\t\tcontributionLevel\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t",variables:{login:t.config.username}})});if(!n.ok)throw new Error(`GitHub GraphQL request failed: ${n.status} ${n.statusText}`);return(yield n.json()).data.user.contributionsCollection.contributionCalendar.weeks.map((t=>t.contributionDays)).reduce(((t,e)=>t.concat(e)),[]).map((e=>{const n=e.contributionLevel,a=I(t);return{date:new Date(e.date),count:e.contributionCount,color:a.intensityColors[M(n)],level:n}}))})))(t):yield(t=>rt(void 0,void 0,void 0,(function*(){var e,n;const a=[];let o=!1,i=1;do{try{const r={};(null===(e=t.config.githubSettings)||void 0===e?void 0:e.accessToken)&&(r.Authorization="Bearer "+t.config.githubSettings.accessToken);const s=yield fetch(`https://api.github.com/search/commits?q=author:${t.config.username}&sort=author-date&order=desc&page=${i}&per_page=100`,{headers:r}),c=yield s.json();o=!c.items||0===c.items.length,a.push(...null!==(n=c.items)&&void 0!==n?n:[]),i++}catch(t){o=!0}}while(!o);const r=Array.from(a.reduce(((t,e)=>{var n,a,o,i;const r=null===(a=null===(n=e.commit.author)||void 0===n?void 0:n.date)||void 0===a?void 0:a.split("T")[0],s=(null===(i=null===(o=e.commit.committer)||void 0===o?void 0:o.date)||void 0===i?void 0:i.split("T")[0])||r,c=(t.get(s)||{count:0}).count+1;return t.set(s,{date:new Date(s),count:c,color:"",level:"NONE"})}),new Map).values()),s=Math.max(...r.map((t=>t.count)).filter((t=>t>0)));return r.map((e=>{const n=T(e.count,s),a=I(t);return{date:new Date(e.date),count:e.count,color:a.intensityColors[M(n)],level:n}}))})))(t)})),ct=t=>{return e=void 0,n=void 0,o=function*(){const e=yield fetch(`https://v0-new-project-q1hhrdodoye-abozanona-gmailcoms-projects.vercel.app/api/contributions?username=${t.config.username}`),n=yield e.json(),a=Object.entries(n).map((([t,e])=>({date:new Date(t),count:Number(e),color:"",level:"NONE"}))),o=Math.max(...a.map((t=>t.count)).filter((t=>t>0)));return a.map((e=>{const n=T(e.count,o),a=I(t);return{date:new Date(e.date),count:e.count,color:a.intensityColors[M(n)],level:n}}))},new((a=void 0)||(a=Promise))((function(t,i){function r(t){try{c(o.next(t))}catch(t){i(t)}}function s(t){try{c(o.throw(t))}catch(t){i(t)}}function c(e){var n;e.done?t(e.value):(n=e.value,n instanceof a?n:new a((function(t){t(n)}))).then(r,s)}c((o=o.apply(e,n||[])).next())}));var e,n,a,o},lt=(t,e,a,o,i)=>{"horizontal"==a?(s(t,e,"horizontal",i),"x"==o?s(n-t-1,e,"horizontal",i):"y"==o?s(t,7-e,"horizontal",i):"xy"==o&&(s(n-t-1,e,"horizontal",i),s(t,7-e,"horizontal",i),s(n-t-1,7-e,"horizontal",i))):(s(t,e,"vertical",i),"x"==o?s(n-t,e,"vertical",i):"y"==o?s(t,7-e-1,"vertical",i):"xy"==o&&(s(n-t,e,"vertical",i),s(t,7-e-1,"vertical",i),s(n-t,7-e-1,"vertical",i)))};class At{constructor(t){this.conf=Object.assign({},t)}start(){return t=this,e=void 0,o=function*(){const t={platform:"github",username:"",canvas:void 0,outputFormat:"svg",svgCallback:t=>{},gameOverCallback:()=>{},gameTheme:"github",gameSpeed:1,enableSounds:!1,pointsIncreasedCallback:t=>{},githubSettings:{accessToken:""},playerStyle:B.OPPORTUNISTIC};switch(this.store=JSON.parse(JSON.stringify(it)),this.store.config=Object.assign(Object.assign({},t),this.conf),this.store.config.platform){case"gitlab":this.store.contributions=yield ct(this.store);break;case"github":this.store.contributions=yield st(this.store);break;default:throw new Error(`Unsupported platform: ${this.store.config.platform}`)}return lt(0,2,"horizontal","xy","L1"),lt(1,2,"horizontal","xy","L1"),lt(4,1,"vertical","x","L2"),lt(4,2,"vertical","x","L2"),lt(4,3,"vertical","x","L2"),lt(4,4,"vertical","x","L2"),lt(3,3,"horizontal","x","L3"),lt(2,3,"horizontal","x","L3"),lt(4,5,"horizontal","x","L4"),lt(6,4,"vertical","x","L5"),lt(6,3,"vertical","x","L5"),lt(6,2,"vertical","x","L5"),lt(6,2,"horizontal","x","L6"),lt(7,2,"horizontal","x","L6"),lt(8,2,"horizontal","x","L6"),lt(9,2,"horizontal","x","L6"),lt(13,2,"horizontal","xy","L7"),lt(14,2,"horizontal","xy","L7"),lt(15,2,"horizontal","xy","L7"),lt(16,2,"horizontal","xy","L7"),lt(17,2,"horizontal","xy","L7"),lt(18,2,"horizontal","xy","L7"),lt(16,2,"vertical","xy","L8"),lt(8,1,"horizontal","x","L9"),lt(9,1,"horizontal","x","L9"),lt(10,1,"horizontal","x","L9"),lt(11,1,"horizontal","x","L9"),lt(12,1,"vertical","x","L10"),lt(12,3,"vertical","x","L10"),lt(11,4,"horizontal","x","L11"),lt(10,4,"horizontal","x","L11"),lt(9,4,"horizontal","x","L11"),lt(8,4,"horizontal","x","L11"),lt(8,4,"vertical","x","L12"),lt(8,5,"vertical","x","L12"),lt(23,1,"horizontal","x","L18"),lt(22,1,"horizontal","x","L18"),lt(21,1,"horizontal","x","L18"),lt(21,1,"vertical","x","L18"),lt(21,2,"vertical","x","L18"),lt(21,3,"vertical","x","L18"),lt(20,4,"horizontal","x","L18"),lt(19,4,"horizontal","x","L18"),lt(19,3,"vertical","x","L18"),lt(18,3,"horizontal","x","L18"),lt(22,5,"vertical","x","L19"),lt(21,5,"horizontal","x","L19"),lt(20,5,"horizontal","x","L19"),lt(20,5,"vertical","x","L19"),lt(1,6,"horizontal","x","L20"),lt(2,6,"horizontal","x","L20"),lt(3,4,"vertical","x","L20"),lt(5,6,"horizontal","x","L21"),lt(6,6,"horizontal","x","L21"),s(25,2,"horizontal","GH_TOP"),s(27,2,"horizontal","GH_TOP"),s(25,4,"horizontal","GH_BOTTOM"),s(26,4,"horizontal","GH_BOTTOM"),s(27,4,"horizontal","GH_BOTTOM"),s(25,3,"vertical","GH_LEFT"),s(28,3,"vertical","GH_RIGHT"),s(25,2,"vertical","GH_LEFT"),s(28,2,"vertical","GH_RIGHT"),z(this.store),(t=>{const e=D(new Date),a=new Date(e);a.setUTCDate(e.getUTCDate()-365),a.setUTCDate(a.getUTCDate()-a.getUTCDay());const o=E(a,e)+1,i=Array(o).fill("");let r="";for(let t=0;t<o;t++){const e=new Date(a);e.setUTCDate(e.getUTCDate()+7*t);const n=e.toLocaleString("default",{month:"short"});n!==r&&(i[t]=n,r=n)}t.monthLabels=o>n?i.slice(o-n):i})(this.store),yield ot(this.store),this.store},new((a=void 0)||(a=Promise))((function(n,i){function r(t){try{c(o.next(t))}catch(t){i(t)}}function s(t){try{c(o.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(r,s)}c((o=o.apply(t,e||[])).next())}));var t,e,a,o}stop(){var t;t=this.store,$(void 0,void 0,void 0,(function*(){clearInterval(t.gameInterval)}))}}var ut=e.C;export{ut as PacmanRenderer};
1
+ var t={d:(e,n)=>{for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{Lc:()=>U,b9:()=>J,Cf:()=>Ut,rn:()=>mt});const n=53,a={github:{textColor:"#57606a",gridBackground:"#ffffff",wallColor:"#000000",intensityColors:["#ebedf0","#9be9a8","#40c463","#30a14e","#216e39"]},"github-dark":{textColor:"#8b949e",gridBackground:"#0d1117",wallColor:"#ffffff",intensityColors:["#161b22","#0e4429","#006d32","#26a641","#39d353"]},gitlab:{textColor:"#626167",gridBackground:"#ffffff",wallColor:"#000000",intensityColors:["#ececef","#d2dcff","#7992f5","#4e65cd","#303470"]},"gitlab-dark":{textColor:"#999999",gridBackground:"#1f1f1f",wallColor:"#ffffff",intensityColors:["#2a2a3d","#4a5bdc","#2e3dbf","#1b2e8a","#0f1a4e"]}},i=(t,e)=>Math.floor((e.getTime()-t.getTime())/6048e5),o=t=>new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())),r=t=>{var e;return null!==(e=a[t.config.gameTheme])&&void 0!==e?e:a.github},s=t=>{switch(t){case"NONE":default:return 0;case"FIRST_QUARTILE":return 1;case"SECOND_QUARTILE":return 2;case"THIRD_QUARTILE":return 3;case"FOURTH_QUARTILE":return 4}},l=(t,e)=>{const n=e/4;return 0===t?"NONE":t<n?"FIRST_QUARTILE":t<2*n?"SECOND_QUARTILE":t<3*n?"THIRD_QUARTILE":"FOURTH_QUARTILE"},c=t=>{const e=o(new Date),n=new Date(e);n.setUTCDate(e.getUTCDate()-365),n.setUTCDate(n.getUTCDate()-n.getUTCDay());const a=Array.from({length:53},(()=>Array.from({length:7},(()=>({commitsCount:0,color:r(t).intensityColors[0],level:"NONE"})))));t.contributions.forEach((l=>{const c=o(new Date(l.date));if(c<n||c>e)return;const A=c.getUTCDay(),u=i(n,c);if(u>=0&&u<53){const e=r(t);a[u][A]={commitsCount:l.count,color:e.intensityColors[s(l.level)],level:l.level}}})),t.grid=a},A=r,u=c,h=t=>{const e=o(new Date),a=new Date(e);a.setUTCDate(e.getUTCDate()-365),a.setUTCDate(a.getUTCDate()-a.getUTCDay());const r=i(a,e)+1,s=Array(r).fill("");let l="";for(let t=0;t<r;t++){const e=new Date(a);e.setUTCDate(e.getUTCDate()+7*t);const n=e.toLocaleString("default",{month:"short"});n!==l&&(s[t]=n,l=n)}t.monthLabels=r>n?s.slice(r-n):s},d=t=>(c(t),t.grid);var g=function(t,e,n,a){return new(n||(n=Promise))((function(i,o){function r(t){try{l(a.next(t))}catch(t){o(t)}}function s(t){try{l(a.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}l((a=a.apply(t,e||[])).next())}))};const m=t=>g(void 0,void 0,void 0,(function*(){var e;return(null===(e=t.config.githubSettings)||void 0===e?void 0:e.accessToken)?yield(t=>g(void 0,void 0,void 0,(function*(){var e;const n=yield fetch("https://api.github.com/graphql",{method:"POST",headers:{Authorization:`Bearer ${null===(e=t.config.githubSettings)||void 0===e?void 0:e.accessToken}`,"Content-Type":"application/json"},body:JSON.stringify({query:"\n\t\tquery ($login: String!) {\n\t\t\tuser(login: $login) {\n\t\t\t\tcontributionsCollection {\n\t\t\t\t\tcontributionCalendar {\n\t\t\t\t\t\tweeks {\n\t\t\t\t\t\t\tcontributionDays {\n\t\t\t\t\t\t\t\tdate\n\t\t\t\t\t\t\t\tcontributionCount\n\t\t\t\t\t\t\t\tcolor\n\t\t\t\t\t\t\t\tcontributionLevel\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t",variables:{login:t.config.username}})});if(!n.ok)throw new Error(`GitHub GraphQL request failed: ${n.status} ${n.statusText}`);return(yield n.json()).data.user.contributionsCollection.contributionCalendar.weeks.map((t=>t.contributionDays)).reduce(((t,e)=>t.concat(e)),[]).map((e=>{const n=e.contributionLevel,a=r(t);return{date:new Date(e.date),count:e.contributionCount,color:a.intensityColors[s(n)],level:n}}))})))(t):yield(t=>g(void 0,void 0,void 0,(function*(){var e,n;const a=[];let i=!1,o=1;do{try{const r={};(null===(e=t.config.githubSettings)||void 0===e?void 0:e.accessToken)&&(r.Authorization="Bearer "+t.config.githubSettings.accessToken);const s=yield fetch(`https://api.github.com/search/commits?q=author:${t.config.username}&sort=author-date&order=desc&page=${o}&per_page=100`,{headers:r}),l=yield s.json();i=!l.items||0===l.items.length,a.push(...null!==(n=l.items)&&void 0!==n?n:[]),o++}catch(t){i=!0}}while(!i);const c=Array.from(a.reduce(((t,e)=>{var n,a,i,o;const r=null===(a=null===(n=e.commit.author)||void 0===n?void 0:n.date)||void 0===a?void 0:a.split("T")[0],s=(null===(o=null===(i=e.commit.committer)||void 0===i?void 0:i.date)||void 0===o?void 0:o.split("T")[0])||r,l=(t.get(s)||{count:0}).count+1;return t.set(s,{date:new Date(s),count:l,color:"",level:"NONE"})}),new Map).values()),A=Math.max(...c.map((t=>t.count)).filter((t=>t>0)));return c.map((e=>{const n=l(e.count,A),a=r(t);return{date:new Date(e.date),count:e.count,color:a.intensityColors[s(n)],level:n}}))})))(t)})),f=t=>{return e=void 0,n=void 0,i=function*(){const e=yield fetch(`https://v0-new-project-q1hhrdodoye-abozanona-gmailcoms-projects.vercel.app/api/contributions?username=${t.config.username}`),n=yield e.json(),a=Object.entries(n).map((([t,e])=>({date:new Date(t),count:Number(e),color:"",level:"NONE"}))),i=Math.max(...a.map((t=>t.count)).filter((t=>t>0)));return a.map((e=>{const n=l(e.count,i),a=r(t);return{date:new Date(e.date),count:e.count,color:a.intensityColors[s(n)],level:n}}))},new((a=void 0)||(a=Promise))((function(t,o){function r(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof a?n:new a((function(t){t(n)}))).then(r,s)}l((i=i.apply(e,n||[])).next())}));var e,n,a,i},y=.21,p=7.4,x=t=>22*t,v=t=>22*t+15,C=(t,e,n)=>{var a,i;const o=t.gameHistory.length,r=null!==(i=null===(a=t.initialColors[e])||void 0===a?void 0:a[n])&&void 0!==i?i:"#ebedf0",s=t.brickEvents.filter((t=>t.x===e&&t.y===n));if(0===s.length)return{keyTimes:"0;1",values:`${r};${r}`};const l=[0],c=[r];for(const t of s){const e=Number((t.frameIndex/Math.max(o-1,1)).toFixed(4));e!==l[l.length-1]?(l.push(e),c.push(t.color)):c[c.length-1]=t.color}return 1!==l[l.length-1]&&(l.push(1),c.push(c[c.length-1])),{keyTimes:l.join(";"),values:c.join(";")}},b=(t,e)=>{var n,a,i,o;const r=t.gameHistory.length;if(0===r){const t=null!==(n=e[0])&&void 0!==n?n:"0,0";return{keyTimes:"0;1",values:`${t};${t}`}}const s=[],l=[];let c=null,A=null;return e.forEach(((t,e)=>{t!==c&&(null!==c&&null!==A&&e-1!==A&&(s.push(Number(((e-1)/(r-1)).toFixed(4))),l.push(c)),s.push(Number((e/(r-1)).toFixed(4))),l.push(t),c=t,A=e)})),0!==s.length&&1===s[s.length-1]||(0===s.length?(s.push(0,1),l.push(null!==(a=e[0])&&void 0!==a?a:"0,0",null!==(i=e[e.length-1])&&void 0!==i?i:"0,0")):(s.push(1),l.push(null!==(o=null!=c?c:e[e.length-1])&&void 0!==o?o:"0,0"))),{keyTimes:s.join(";"),values:l.join(";")}},w=t=>{const e=200*t.gameHistory.length/2,a=A(t);let i='<svg width="1166" height="209" xmlns="http://www.w3.org/2000/svg">';i+=`<desc>Generated with breakout-contribution-graph on ${new Date}</desc>`,i+=`<metadata>\n\t\t<info>\n\t\t\t<frames>${t.gameHistory.length}</frames>\n\t\t\t<frameRate>5</frameRate>\n\t\t\t<durationMs>${e}</durationMs>\n\t\t\t<generatedOn>${(new Date).toISOString()}</generatedOn>\n\t\t</info>\n\t</metadata>`,i+=`<rect width="100%" height="100%" fill="${a.gridBackground}"/>`;let o="";for(let e=0;e<n;e++)t.monthLabels[e]!==o&&(i+=`<text x="${22*e+10}" y="10" text-anchor="middle" font-size="10" fill="${a.textColor}">${t.monthLabels[e]}</text>`,o=t.monthLabels[e]);for(let o=0;o<n;o++)for(let n=0;n<7;n++){const r=x(o),s=v(n),l=C(t,o,n);i+=`<rect id="c-${o}-${n}" x="${r}" y="${s}" width="20" height="20" rx="3" fill="${a.intensityColors[0]}">\n\t\t\t\t<animate attributeName="fill" calcMode="discrete" dur="${e}ms" repeatCount="indefinite"\n\t\t\t\t\tvalues="${l.values}" keyTimes="${l.keyTimes}"/>\n\t\t\t</rect>`}const r=Math.round(4.62),s=b(t,(t=>t.gameHistory.map((t=>`${x(t.ball.x)},${v(t.ball.y)}`)))(t));i+=`<circle id="ball" cx="0" cy="0" r="${r}" fill="${a.wallColor}" stroke="#aaaaaa" stroke-width="1">\n\t\t<animateTransform attributeName="transform" type="translate"\n\t\t\tcalcMode="linear"\n\t\t\tdur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${s.keyTimes}"\n\t\t\tvalues="${s.values}"/>\n\t</circle>`;const l=v(p),c=Math.round(152),u=Math.round(11),h=b(t,(t=>t.gameHistory.map((t=>`${x(t.paddle.x)},0`)))(t));return i+=`<rect id="paddle" x="0" y="${l}" width="${c}" height="${u}" rx="3" fill="${a.wallColor}">\n\t\t<animateTransform attributeName="transform" type="translate"\n\t\t\tcalcMode="linear"\n\t\t\tdur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${h.keyTimes}"\n\t\t\tvalues="${h.values}"/>\n\t</rect>`,i+="</svg>",i};const E=20/22,R=["NONE","FIRST_QUARTILE","SECOND_QUARTILE","THIRD_QUARTILE","FOURTH_QUARTILE"],B=t=>{const e=R.indexOf(t);return R[Math.max(0,e-1)]},M=t=>{var e,a;t.frameCount++;const{ball:i,paddle:o,grid:r}=t,s=Math.hypot(i.dx,i.dy),l=Math.ceil(s/y),c=1/l;for(let s=0;s<l;s++){i.x+=i.dx*c,i.y+=i.dy*c,i.x-y<=0&&(i.x=y,i.dx=Math.abs(i.dx)),i.x+y>=n&&(i.x=52.79,i.dx=-Math.abs(i.dx)),i.y-y<=0&&(i.y=y,i.dy=Math.abs(i.dy));const s=o.x,l=o.x+7;if(i.dy>0&&i.y+y>=p&&i.y-y<7.9&&i.x>=s-y&&i.x<=l+y){i.y=7.19;const e=s+3.5,n=Math.max(-1,Math.min(1,(i.x-e)/3.5)),a=Math.hypot(i.dx,i.dy),o=65*n*(Math.PI/180);i.dx=a*Math.sin(o),i.dy=-a*Math.cos(o),t.bouncesSinceTargetSet++,t.bouncesSinceTargetSet>=5&&(t.targetBrick=S(t),t.bouncesSinceTargetSet=0)}i.y>8.4&&(i.x=26.5,i.y=5.9,i.dy=-Math.abs(i.dy));const u=Math.max(0,Math.floor(i.x-y)),h=Math.min(52,Math.floor(i.x+y)),d=Math.max(0,Math.floor(i.y-y)),g=Math.min(6,Math.floor(i.y+y));let m=!1,f=!1;const x=A(t);for(let n=u;n<=h;n++)for(let o=d;o<=g;o++){if(0===r[n][o].commitsCount)continue;const s=Math.max(n,Math.min(n+E,i.x)),l=Math.max(o,Math.min(o+E,i.y));if(Math.pow(i.x-s,2)+Math.pow(i.y-l,2)>=.04409999999999999)continue;const c=r[n][o].level,A=B(c);if(r[n][o].level=A,"NONE"===A)r[n][o].commitsCount=0,r[n][o].color=x.intensityColors[0],(null===(e=t.targetBrick)||void 0===e?void 0:e.cx)===n&&(null===(a=t.targetBrick)||void 0===a?void 0:a.cy)===o&&(t.targetBrick=S(t),t.bouncesSinceTargetSet=0);else{const t=R.indexOf(A);r[n][o].color=x.intensityColors[t]}t.brickEvents.push({frameIndex:t.gameHistory.length,x:n,y:o,color:r[n][o].color});const u=y-Math.abs(i.x-s),h=y-Math.abs(i.y-l);u<=h?(i.x+=i.dx<0?u:-u,m=!0):(i.y+=i.dy<0?h:-h,f=!0),t.framesSinceLastBrickHit=0,t.config.pointsIncreasedCallback(k(t))}m&&(i.dx=-i.dx),f&&(i.dy=-i.dy)}if(i.dy>0&&t.targetBrick){const e=t.targetBrick,a=(p-i.y)/i.dy;let r=i.x+i.dx*a;r=Math.abs((r%106+106)%106),r>n&&(r=106-r);const s=e.cx+.5,l=e.cy+.5,c=p-l,A=s-r,u=Math.atan2(A,Math.max(c,.5))*(180/Math.PI),h=r-Math.max(-65,Math.min(65,u))/65*3.5,d=Math.max(0,Math.min(46,h-3.5));o.x<d-2?o.x+=2:o.x>d+2?o.x-=2:o.x=d}else if(i.dy>0){const t=o.x+3.5;t<i.x-.5?o.x=Math.min(o.x+2,46):t>i.x+.5&&(o.x=Math.max(o.x-2,0))}T(t)},T=t=>{t.gameHistory.push({ball:Object.assign({},t.ball),paddle:Object.assign({},t.paddle)})},k=t=>{let e=0;return t.grid.forEach((t=>t.forEach((t=>{0===t.commitsCount&&e++})))),e},S=t=>{var e,a;const i=[];for(let o=0;o<n;o++)for(let n=0;n<7;n++)(null===(a=null===(e=t.grid[o])||void 0===e?void 0:e[n])||void 0===a?void 0:a.commitsCount)>0&&i.push({cx:o,cy:n});return 0===i.length?null:i[Math.floor(Math.random()*i.length)]},D=t=>{return e=void 0,n=void 0,i=function*(){if(t.frameCount=0,t.framesSinceLastBrickHit=0,t.gameHistory=[],t.brickEvents=[],t.grid=d(t),t.initialColors=t.grid.map((t=>t.map((t=>t.color)))),0===t.grid.reduce(((t,e)=>t+e.filter((t=>t.commitsCount>0)).length),0)){const e=w(t);return t.config.svgCallback(e),void t.config.gameOverCallback()}for((t=>{t.ball={x:26.5,y:5.9,dx:.75,dy:-.95}})(t),(t=>{t.paddle={x:23,width:7}})(t),t.targetBrick=S(t),t.bouncesSinceTargetSet=0;t.grid.some((t=>t.some((t=>t.commitsCount>0))))&&t.frameCount<3e3;)M(t),t.frameCount%200==0&&t.grid.reduce(((t,e)=>t+e.filter((t=>t.commitsCount>0)).length),0);const e=w(t);t.config.svgCallback(e),t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:k(t),steps:t.frameCount,ghostsEaten:0}),t.config.gameOverCallback()},new((a=void 0)||(a=Promise))((function(t,o){function r(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof a?n:new a((function(t){t(n)}))).then(r,s)}l((i=i.apply(e,n||[])).next())}));var e,n,a,i},I={frameCount:0,contributions:[],ball:{x:0,y:0,dx:0,dy:0},paddle:{x:0,width:7},grid:[],monthLabels:[],framesSinceLastBrickHit:0,targetBrick:null,bouncesSinceTargetSet:0,gameHistory:[],initialColors:[],brickEvents:[],config:void 0};class U{constructor(t){this.conf=Object.assign({},t)}start(){return t=this,e=void 0,a=function*(){switch(this.store=JSON.parse(JSON.stringify(I)),this.store.config=Object.assign(Object.assign({},{platform:"github",username:"",svgCallback:t=>{},gameOverCallback:()=>{},gameTheme:"github",pointsIncreasedCallback:t=>{},githubSettings:{accessToken:""}}),this.conf),this.store.config.platform){case"gitlab":this.store.contributions=yield f(this.store);break;case"github":this.store.contributions=yield m(this.store);break;default:throw new Error(`Unsupported platform: ${this.store.config.platform}`)}return u(this.store),h(this.store),yield D(this.store),this.store},new((n=void 0)||(n=Promise))((function(i,o){function r(t){try{l(a.next(t))}catch(t){o(t)}}function s(t){try{l(a.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}l((a=a.apply(t,e||[])).next())}));var t,e,n,a}stop(){this.store}}const N=t=>22*t,O=t=>22*t+15,H=(t,e,n)=>{var a,i;const o=t.gameHistory.length,r=null!==(i=null===(a=t.initialColors[e])||void 0===a?void 0:a[n])&&void 0!==i?i:"#ebedf0",s=t.cellEvents.filter((t=>t.x===e&&t.y===n));if(0===s.length)return{keyTimes:"0;1",values:`${r};${r}`};const l=[0],c=[r];for(const t of s){const e=Number((t.frameIndex/Math.max(o-1,1)).toFixed(4));e!==l[l.length-1]?(l.push(e),c.push(t.color)):c[c.length-1]=t.color}return 1!==l[l.length-1]&&(l.push(1),c.push(c[c.length-1])),{keyTimes:l.join(";"),values:c.join(";")}},V=t=>{const e=t.gameHistory.length,a=Math.max(200*e/2,1e3),i=A(t),o=O(10.5);let r='<svg width="1166" height="259" xmlns="http://www.w3.org/2000/svg">';r+=`<desc>Generated with galaga-contribution-graph on ${new Date}</desc>`,r+='<rect width="100%" height="100%" fill="#000000"/>';{let t=12345;const e=()=>(t=1664525*t+1013904223>>>0,t/4294967295);for(let t=0;t<120;t++){const t=(1166*e()).toFixed(1),n=(.4+1.6*e()).toFixed(1),a=(.3+.7*e()).toFixed(2),i=Math.floor(2500+5500*e());r+=`<circle cx="${t}" cy="0" r="${n}" fill="white" opacity="${a}"><animate attributeName="cy" from="-2" to="261" dur="${i}ms" begin="-${Math.floor(e()*i)}ms" repeatCount="indefinite"/></circle>`}}let s="";for(let e=0;e<n;e++)t.monthLabels[e]!==s&&(r+=`<text x="${22*e+10}" y="10" text-anchor="middle" font-size="10" fill="#aaaaaa">${t.monthLabels[e]}</text>`,s=t.monthLabels[e]);const l=i.intensityColors[0];for(let e=0;e<n;e++)for(let n=0;n<7;n++){const i=N(e),o=O(n),s=H(t,e,n);r+=`<rect x="${i}" y="${o}" width="20" height="20" rx="3" fill="transparent">\n\t\t\t\t<animate attributeName="fill" calcMode="discrete" dur="${a}ms" repeatCount="indefinite"\n\t\t\t\t\tvalues="${s.values.split(";").map((t=>t===l?"transparent":t)).join(";")}" keyTimes="${s.keyTimes}"/>\n\t\t\t</rect>`}if(e>=2){const n=(t=>{const e=[],n=new Map;for(let a=0;a<t.gameHistory.length;a++){const i=t.gameHistory[a].bullets.filter((t=>t.active)),o=new Set(i.map((t=>t.id)));for(const[t,i]of n)o.has(t)||(e.push({id:t,x:i.x,startFrame:i.startFrame,endFrame:a-1,yPositions:i.yPositions}),n.delete(t));for(const t of i)n.has(t.id)?n.get(t.id).yPositions.push(t.y):n.set(t.id,{x:t.x,startFrame:a,yPositions:[t.y]})}for(const[a,i]of n)e.push({id:a,x:i.x,startFrame:i.startFrame,endFrame:t.gameHistory.length-1,yPositions:i.yPositions});return e})(t);for(const t of n){const n=N(t.x),i=Number((t.startFrame/(e-1)).toFixed(4)),o=Number((Math.min(t.endFrame+1,e-1)/(e-1)).toFixed(4));let s,l;i<=0&&o>=1?(s="0;1",l="1;1"):i<=0?(s=`0;${o};${o};1`,l="1;1;0;0"):o>=1?(s=`0;${i};${i};1`,l="0;0;1;1"):(s=`0;${i};${i};${o};${o};1`,l="0;0;1;1;0;0");const c=[],A=[],u=O(t.yPositions[0]).toFixed(1),h=O(t.yPositions[t.yPositions.length-1]).toFixed(1);t.startFrame>0&&(c.push(0),A.push(`${n.toFixed(1)},${u}`));for(let a=0;a<t.yPositions.length;a++){const i=t.startFrame+a,o=Number((i/(e-1)).toFixed(4)),r=O(t.yPositions[a]).toFixed(1);0!==c.length&&o===c[c.length-1]||(c.push(o),A.push(`${n.toFixed(1)},${r}`))}1!==c[c.length-1]&&(c.push(1),A.push(`${n.toFixed(1)},${h}`)),r+=`<image x="-5" y="-13" width="10" height="13" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAACACAMAAACMX59YAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAByUExURQAAAP////7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rszRLLWgkgbovJB2JJfKXIljUjlSEev0RJuArIF0vC84/AYNLX/sQtRIxoRxj4qpXkfiaeIm/J+HcbEDDSiRMRoQNV3AA8yDcgJM/G+EPdE3VUpFd5INV9+JXFMykLmAfjIjmyK0wLUj5NYkJKBx0sKrWIMEchGxsgVNsQVNCYEfLGEySrd5xSK6LArjdUwtDIrCL/JGvSI+ReIgAAAAAElFTkSuQmCC" opacity="0" preserveAspectRatio="xMidYMid meet">\n\t\t\t\t<animate attributeName="opacity" calcMode="discrete" dur="${a}ms" repeatCount="indefinite"\n\t\t\t\t\tkeyTimes="${s}" values="${l}"/>\n\t\t\t\t<animateTransform attributeName="transform" type="translate" calcMode="linear"\n\t\t\t\t\tdur="${a}ms" repeatCount="indefinite"\n\t\t\t\t\tkeyTimes="${c.join(";")}" values="${A.join(";")}"/>\n\t\t\t</image>`}}if(e>=2)for(const n of t.explosionEvents){const t=(N(n.x)+10).toFixed(1),i=(O(n.y)+10).toFixed(1),o=Number((n.frameIndex/(e-1)).toFixed(4)),s=Number((Math.min(n.frameIndex+7,e-1)/(e-1)).toFixed(4));if(s<=o)continue;const l=`0;${o};${o};${s};1`,c="0;0;1;0;0",A=`${a}ms`;r+=`<circle cx="${t}" cy="${i}" r="2" fill="none" stroke="${n.color}" stroke-width="3" opacity="0">\n\t\t\t\t<animate attributeName="r" calcMode="linear" dur="${A}" repeatCount="indefinite" keyTimes="${l}" values="2;2;2;20;20"/>\n\t\t\t\t<animate attributeName="stroke-width" calcMode="linear" dur="${A}" repeatCount="indefinite" keyTimes="${l}" values="3;3;3;0;0"/>\n\t\t\t\t<animate attributeName="opacity" calcMode="linear" dur="${A}" repeatCount="indefinite" keyTimes="${l}" values="${c}"/>\n\t\t\t</circle>`;const u=[{dx:0,dy:-11},{dx:0,dy:11},{dx:-11,dy:0},{dx:11,dy:0}];for(const{dx:e,dy:a}of u){const o=(Number(t)+e).toFixed(1),s=(Number(i)+a).toFixed(1);r+=`<circle cx="${t}" cy="${i}" r="2.5" fill="${n.color}" opacity="0">\n\t\t\t\t\t<animate attributeName="cx" calcMode="linear" dur="${A}" repeatCount="indefinite" keyTimes="${l}" values="${t};${t};${t};${o};${o}"/>\n\t\t\t\t\t<animate attributeName="cy" calcMode="linear" dur="${A}" repeatCount="indefinite" keyTimes="${l}" values="${i};${i};${i};${s};${s}"/>\n\t\t\t\t\t<animate attributeName="r" calcMode="linear" dur="${A}" repeatCount="indefinite" keyTimes="${l}" values="2.5;2.5;2.5;0;0"/>\n\t\t\t\t\t<animate attributeName="opacity" calcMode="linear" dur="${A}" repeatCount="indefinite" keyTimes="${l}" values="${c}"/>\n\t\t\t\t</circle>`}}const c=t.gameHistory.map((t=>`${N(t.ship.x).toFixed(1)},${o.toFixed(1)}`)),u=((t,e)=>{var n,a,i,o;const r=t.gameHistory.length;if(0===r){const t=null!==(n=e[0])&&void 0!==n?n:"0,0";return{keyTimes:"0;1",values:`${t};${t}`}}const s=[],l=[];let c=null,A=null;return e.forEach(((t,e)=>{t!==c&&(null!==c&&null!==A&&e-1!==A&&(s.push(Number(((e-1)/(r-1)).toFixed(4))),l.push(c)),s.push(Number((e/(r-1)).toFixed(4))),l.push(t),c=t,A=e)})),0!==s.length&&1===s[s.length-1]||(0===s.length?(s.push(0,1),l.push(null!==(a=e[0])&&void 0!==a?a:"0,0",null!==(i=e[e.length-1])&&void 0!==i?i:"0,0")):(s.push(1),l.push(null!==(o=null!=c?c:e[e.length-1])&&void 0!==o?o:"0,0"))),{keyTimes:s.join(";"),values:l.join(";")}})(t,c);return r+=`<image x="-16" y="-35" width="32" height="35" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABGCAYAAAB8MJLDAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAHdElNRQfqBQgWJQn/24JaAAAAJXRFWHRkYXRlOmNyZWF0ZQ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qyX3C4itLln2fR9hGHZJQFgDKV7s0yL/HeNPkc0h7Hvfc1ie0Gm329A0DeVyWUqgXC5Lt+9lsV+gXC5DdRwHuq7LlRO6rstNy70sNjAbhtGVZs4iwPVY/fL4XnsTbOh9OeewbRuMMTiOA9u2kSQJHMdBuVwu5Gq1ijiO4TgO1KK1M2JTQT8WLlcul8ee/dUyG6hUVe00SGOY2EaTjVAABnJ2zdN7tn3e0HUkYvu8piFcWnl+wbfPN5tN6LoOTdPgeV6OxV6ALIula0VMKZUbGAWL2dgiBiB3m3DOC1nsEslyqVQCY6yQxaapLNu2jTiOc6wOW0rWTwJZFucP2p8jXLSXh7lrv2RMbMgqOmeY22eZ2rbdtYZWLCPv5TRN0W63c8wYQxAEksXeniwX1bxt23LrmuA4jnMchiEYYzkOgkByu91GmqY5FuP/vSz+kxXbtvEfwITwAX3FN6kAAAAASUVORK5CYII=" preserveAspectRatio="xMidYMid meet">\n\t\t<animateTransform attributeName="transform" type="translate" calcMode="linear"\n\t\t\tdur="${a}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${u.keyTimes}"\n\t\t\tvalues="${u.values}"/>\n\t</image>`,r+="</svg>",r};const z=["NONE","FIRST_QUARTILE","SECOND_QUARTILE","THIRD_QUARTILE","FOURTH_QUARTILE"],F=t=>{const e=z.indexOf(t);return z[Math.max(0,e-1)]},L=()=>Math.floor(5*Math.random())+4,Q=t=>t.grid.some((t=>t.some((t=>t.commitsCount>0)))),j=(t,e=-1)=>{const a=Math.round(t.ship.x-.5),i=e=>t.grid[e].reduce(((t,e)=>{var n;return t+(null!==(n={NONE:0,FIRST_QUARTILE:1,SECOND_QUARTILE:2,THIRD_QUARTILE:3,FOURTH_QUARTILE:4}[e.level])&&void 0!==n?n:0)}),0);for(let t=3;t<=n;t++){let o=-1,r=0;for(let s=-t;s<=t;s++){const t=a+s;if(t<0||t>=n)continue;if(t===e)continue;const l=i(t);l>r&&(r=l,o=t)}if(-1!==o)return o}for(let a=0;a<n;a++)if(a!==e&&t.grid[a].some((t=>t.commitsCount>0)))return a;return Math.floor(26.5)},Y=t=>{var e;t.frameCount++;const{grid:a,ship:i}=t,o=A(t);for(const e of t.bullets){if(!e.active)continue;if(e.y-=.6,e.y<-1){e.active=!1;continue}const i=Math.round(e.x-.5),r=Math.floor(e.y);if(i>=0&&i<n&&r>=0&&r<7&&a[i][r].commitsCount>0){const n=a[i][r].color,s=F(a[i][r].level);a[i][r].level=s,a[i][r].color=o.intensityColors[z.indexOf(s)],"NONE"===s&&(a[i][r].commitsCount=0,t.explosionEvents.push({frameIndex:t.gameHistory.length,x:i,y:r,color:n})),t.cellEvents.push({frameIndex:t.gameHistory.length,x:i,y:r,color:a[i][r].color}),t.config.pointsIncreasedCallback(t.cellEvents.length),e.active=!1}}t.bullets=t.bullets.filter((t=>t.active)),(null===(e=a[t.currentTargetCol])||void 0===e?void 0:e.some((t=>t.commitsCount>0)))||(t.currentTargetCol=j(t),t.framesShootingAtTarget=0);const r=t.currentTargetCol,s=r+.5,l=s-i.x;Math.abs(l)>.4?i.x+=.4*Math.sign(l):i.x=s,i.x=Math.max(.8,Math.min(52.2,i.x));const c=Math.abs(i.x-s)<.5,u=a[r].some((t=>t.commitsCount>0));c&&u&&(t.framesShootingAtTarget>=t.framesAllowedForTarget?(t.currentTargetCol=j(t,r),t.framesShootingAtTarget=0,t.framesAllowedForTarget=L()):(t.frameCount%2==0&&t.bullets.length<10&&t.bullets.push({id:t.nextBulletId++,x:s,y:9.5,active:!0}),t.framesShootingAtTarget++)),(t=>{t.gameHistory.push({ship:{x:t.ship.x},bullets:t.bullets.map((t=>Object.assign({},t)))})})(t)},P=t=>{return e=void 0,n=void 0,i=function*(){if(t.frameCount=0,t.nextBulletId=0,t.gameHistory=[],t.cellEvents=[],t.explosionEvents=[],t.bullets=[],t.grid=d(t),t.initialColors=t.grid.map((t=>t.map((t=>t.color)))),!Q(t)){const e=V(t);return t.config.svgCallback(e),void t.config.gameOverCallback()}for(t.ship={x:26.5},t.currentTargetCol=j(t),t.framesShootingAtTarget=0,t.framesAllowedForTarget=L();Q(t)&&t.frameCount<3e3;)Y(t);const e=V(t);t.config.svgCallback(e),t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:t.cellEvents.length,steps:t.frameCount,ghostsEaten:0}),t.config.gameOverCallback()},new((a=void 0)||(a=Promise))((function(t,o){function r(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof a?n:new a((function(t){t(n)}))).then(r,s)}l((i=i.apply(e,n||[])).next())}));var e,n,a,i},G={frameCount:0,nextBulletId:0,contributions:[],ship:{x:0},bullets:[],grid:[],monthLabels:[],gameHistory:[],initialColors:[],cellEvents:[],explosionEvents:[],currentTargetCol:-1,framesShootingAtTarget:0,framesAllowedForTarget:4,config:void 0};class J{constructor(t){this.conf=Object.assign({},t)}start(){return t=this,e=void 0,a=function*(){switch(this.store=JSON.parse(JSON.stringify(G)),this.store.config=Object.assign(Object.assign({},{platform:"github",username:"",svgCallback:t=>{},gameOverCallback:()=>{},gameTheme:"github",pointsIncreasedCallback:t=>{},githubSettings:{accessToken:""}}),this.conf),this.store.config.platform){case"gitlab":this.store.contributions=yield f(this.store);break;case"github":this.store.contributions=yield m(this.store);break;default:throw new Error(`Unsupported platform: ${this.store.config.platform}`)}return u(this.store),h(this.store),yield P(this.store),this.store},new((n=void 0)||(n=Promise))((function(i,o){function r(t){try{l(a.next(t))}catch(t){o(t)}}function s(t){try{l(a.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}l((a=a.apply(t,e||[])).next())}));var t,e,n,a}stop(){this.store}}const K="yellow",W={blinky:{up:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABiklEQVR4nIXSO2sVURQF4G8mMwa8QU2KxFcjCoIgacR/oCBYCP4fsTEI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SbreAAAAAElFTkSuQmCC",left:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACnklEQVR4nG2TTYiVZRTHf+c8z/vee+emNVycYBocHAqGEN3IgEgg7bIZBir72CW2aNEERZiK6Ci4sNrooi9q02KaZhYubNGuhVEkLcqmLkhpwgwqRGBzZ+6d+77POS7uxUw8yz+HP/+Pc+C+EREIIsAc8AdwBVhEEOT+bf4PxTySinQid9+z8vKFpxoDT1RB+KdzrTM69+zFDuknsni0LMoHEAhkzuzV/V+fGNmyC2qP4sENQLqirK9wa+0XHv9q+kzL7DBm9xCoImbHf33x/Mnx8amurIlqVyOSIAnUFcus9MLtxl/f5FsXJk+6yCzufc/wxqVXvvC0lgozS3624z6T3Gfc/T1zd3dvuduxjVQeKjeaz8078I6IoO4OMMaBHXjFTUSUNyswBNQcXu27rIO8nSsK45VRgG3ujoYsyAC5TDyzkxhh5UY/k0zgtlAZhXxrHxsEHNCe/xijaCrS4e9e+Pz1fQ+7Qcgl7y+XBgapfU9N6xDakvtju+3n5+deK8vytAIjw9aoXjjo5k0YbgAfJripUIXyXeg2gQ7wfgHJ8MxtRBs5MBKBdpE2oArMlUCA1dDrR7yn5IMAXevhwcGgSwGwHgHtSQb+TSCxh4iDOxQKfwOiEB3KBATUBSBEQFx64XiWmxgKBg6WU4KjySMGJMFDNMzvxqJAwhzP3WT9poJDVDyKaet61Nb16CoGCkGQ9rJ65ma9I00K1DfHOqFb5hOLey83l+eNKsja7zr82Y4ft3z65PfSWlIG4M/lBXYuPH05dDv55vwhgE0AB7+d+vj29NDEJaD2SNj01tJLX7a317adBxRBx+tji7/tX9gYjLUjQG3f0MQPFyc/WQVmCCGg6DGgAaBRBfQcSOU/n5oBH/XfHGBQ4JRq5A5IWx73SeLhogAAAABJRU5ErkJggg==",right:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACmUlEQVR4nGWTT4iWVRTGf+fce9/v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T9jKjMyRvpILdlRuPJKd8Lmz0zlm61uHOvRVb0OmbsPD6drAW/YGH5Fe1PPbYaBykkrNWbvO8MWK8fOBABpb53yIfLPndXnzpIePDomDdf+qSLR4hzCtJU8OSBKOizP66vR/y+Ux33EnBN71P5DQllVXyQma9lAAAAAElFTkSuQmCC",left:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB4ElEQVR4nH2SvWtUURDFf3Pf24+siYkYFLRRizSaSiVi7V9g7b9hpSgogmIhipVbC0IwQrTQRgQ/CiMxCbsgxi9iIMHGENndrG/vPRZv3+atbDIwMHM4Z+65946xc1SByW791cwuSNIufIiiCOASFB8z/71FU2JTor7miSpPgKtdzgAxgCtdZ2lVSGmG4AnB9/r6uijsuRlh/WLnHLjyFea+CO8TOp12T5Rlp9PG+4TlX6JYuuGcS8VmBnCRd3VNe5/U8id284Okl5kj7xNq6wIu501Mz/xck/c+kaRaTvxc2/FUSh2G4IFnABQKDtzehzYksc8nG5spuefgqDRyJMUa2YBEwsrTUeqeO7z/1uBk8CBtbXSJWQ5LVNIBH/OPu7jSAB4AvOZ3Cs5sSZv/P56kuSDV81gInqYEzMdAky0Po47zpcFffNoGgH8BaDnAMLfDau0S6m5ArwSQQj9JYSCWC9ebJgUsZyXrzVyfqL/vOGCUYQPnYianPrP8J2M6Dh5eYv+BBXx38GoTTkx9wrmYIQDGAG7zttbgzLlXDsqMjV9j4UebieOzBpGBcWziEYsrLcYP3SpCiVNnX/BmqQHcJ45jKJTvAiMAzswwqwLF7XtaDK5q2ZWhgovvRVHMP7z+WsD4PpRYAAAAAElFTkSuQmCC",right:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB1klEQVR4nI2Tu4tTURDGf2fOvUlMcAXjigpZFfGBlaAI+h/4T9nYCClslFiJLlhZbJXCJmyxrs91bdyXYLFE8UGURaImN3PG4t6blxH8YIr5+OabOXPOcUzBpeECPAAuZ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FTkSuQmCC"},eyes:{up:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAj0lEQVR4nO2RsQ7CMAxE79K6aQCJbuztb8Af8P8rX8HaYzCChgbanZ5kyYqezjkb2MR3K02eOUdzJiBwhBCsgPWE7RcmD9YfBsCgp9zdS5Kul/Mpn50z95tzdSkAAKSYZp/7ZDzKF6XYxIUUvw12bbvKAF1VMQCvXUhSydXIjDk2kcDkjL4kF1k+4xrmH/UA3stP0Iur7f8AAAAASUVORK5CYII=",down:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAm0lEQVR4nO2Ryw3CQAxE35jdEBFRAycEpUAJ9A81EBIlcMjPgazEHUbyxX47I3vhLwBiDDydUpxnQt8zgG2+kQeD1A2cTJo3JIqVzV29jod9NrCX82m3xLRt27wHTYlmY+SjquslRpJ9ZVAmDKC/wf0K0lQAuFtWddn0a88ZgAwoKKx7MdRnShxdF5hAHIc5t+Q3rp2BoRT2c3oBFX9xUA7hwq8AAAAASUVORK5CYII=",left:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAuUlEQVR4nO2PvRIBQRCEu+fOIaD8RkoRKCGZwNt4fwKFcutnW2LP1tWdF6CjmdmveruBvxgGSSqOJKvgmEnM6CWYxS7hkYSVbuWdABIC9pTkI2cAeHiv3WazDPsiazWeFczDS0buQQLl0CfnrmHOb10LDHkoJxtV1cXZubyohCyyH36tVuji8vvHwJI6DltMhzNM2jqpUJqmaEdMD8YV5h3l0vHNrAf9zrjV/ARQpLrPYmYBZrWpfkwv2KllZq2VZYMAAAAASUVORK5CYII=",right:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAArklEQVR4nO2RsQrCMBCGv0vaUq2gIlJxEBEX6eLi5jv4/g8h0qViIpxT27S0i3M/COTCx5/cBSYAiIxBA8a8IcfEIh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ZPaxYGSkN30VI6TgUH4FK9xNevpd2iL307J/jIzRmHySyldvo4HmZ08iWu8lIiTFxBS57ArRg6/ip6/C4VKapy9/Rug+m8gzXYzOX2DcGIYSU1uvPHTta8aN4dDcd3Q81U5wl8PI718wkl2A4eRFQg+4W+LosRhH1xZ5dPo9hAJhw8DMh4ytLdI5Ft3ShfuCDC/N/AMdtzXsl7IlxgAAAABJRU5ErkJggg=="}},q={horizontal:Array(54).fill(null).map((()=>Array(8).fill({active:!1,id:""}))),vertical:Array(54).fill(null).map((()=>Array(8).fill({active:!1,id:""})))},X=(t,e,n,a,i)=>{"horizontal"===n?t>=0&&t<q.horizontal.length&&e>=0&&e<q.horizontal[0].length&&(q.horizontal[t][e]={active:!0,id:a,color:i}):t>=0&&t<q.vertical.length&&e>=0&&e<q.vertical[0].length&&(q.vertical[t][e]={active:!0,id:a,color:i})},Z=(t,e)=>[[-1,0],[1,0],[0,-1],[0,1]].filter((([a,i])=>{const o=t+a,r=e+i;return!(o<0||o>=n||r<0||r>=7||(-1===a?q.vertical[t][e].active:1===a?q.vertical[t+1][e].active:-1===i?q.horizontal[t][e].active:1===i&&q.horizontal[t][e+1].active))})),$={getValidMoves:Z,calculateDistance:(t,e,n,a)=>Math.sqrt(Math.pow(n-t,2)+Math.pow(a-e,2)),findNextStepDijkstra(t,e){if(t.x===e.x&&t.y===e.y)return null;const n=[Object.assign(Object.assign({},t),{cost:0,path:[]})],a=new Set([`${t.x},${t.y}`]);for(;n.length;){n.sort(((t,e)=>t.cost-e.cost));const{x:t,y:i,cost:o,path:r}=n.shift();for(const[s,l]of Z(t,i)){const c=t+s,A=i+l,u=`${c},${A}`;if(a.has(u))continue;a.add(u);const h=[...r,{x:c,y:A}];if(c===e.x&&A===e.y)return h.length>0?h[0]:null;n.push({x:c,y:A,cost:o+1,path:h})}}return null}},_={blinky:{x:50,y:0},pinky:{x:0,y:0},inky:{x:50,y:6},clyde:{x:0,y:6}};let tt="scatter",et=0,nt=0;const at=t=>{switch(t.direction){case"up":t.direction="down";break;case"down":t.direction="up";break;case"left":t.direction="right";break;case"right":t.direction="left"}},it=(t,e)=>{if(!t.justReleasedFromHouse)return t.respawnCounter&&t.respawnCounter>0?(t.respawnCounter--,void(0===t.respawnCounter&&t.originalName&&(t.name=t.originalName,t.inHouse=!1,t.scared=e.pacman.powerupRemainingDuration>0))):("up"===t.direction&&t.y<=3?(t.direction="down",t.y=3):"down"===t.direction&&t.y>=3&&(t.direction="up",t.y=3),"up"===t.direction?t.y-=1:t.y+=1,void((t.y<3||t.y>=4)&&(t.y=(t.direction,3),t.direction="up"===t.direction?"down":"up")));26===t.x?(t.y=2,t.direction="up",t.inHouse=!1,t.justReleasedFromHouse=!1):t.x<26?(t.x+=1,t.direction="right"):t.x>26&&(t.x-=1,t.direction="left")},ot=(t,e)=>{const n=_[t.name]||_.blinky;t.target=n;const a=At(t.x,t.y,n.x,n.y,t.direction);a&&(t.x=a.x,t.y=a.y,a.direction&&(t.direction=a.direction))},rt=(t,e)=>{(!t.target||t.x===t.target.x&&t.y===t.target.y)&&(t.target=dt(t.x,t.y));const n=st(t);if(0===n.length)return;const a=t.target.x-t.x,i=t.target.y-t.y;let o=n;if(Math.random()<.5);else{const t=n.filter((t=>{const e=t[0],n=t[1];return a>0&&e>0||a<0&&e<0||i>0&&n>0||i<0&&n<0}));t.length>0&&(o=t)}const[r,s]=o[Math.floor(Math.random()*o.length)];e.pacman.powerupRemainingDuration&&Math.random()<.6||(r>0?t.direction="right":r<0?t.direction="left":s>0?t.direction="down":s<0&&(t.direction="up"),t.x+=r,t.y+=s)},st=t=>$.getValidMoves(t.x,t.y).filter((e=>{const[n,a]=e;return!("right"===t.direction&&n<0||"left"===t.direction&&n>0||"up"===t.direction&&a>0||"down"===t.direction&&a<0)})),lt=(t,e)=>{const n={x:26,y:3};if(Math.abs(t.x-n.x)<=1&&Math.abs(t.y-n.y)<=1)return t.x=n.x,t.y=n.y,t.inHouse=!0,void(t.respawnCounter=1);const a=$.findNextStepDijkstra({x:t.x,y:t.y},n);if(a){const e=a.x-t.x,n=a.y-t.y;e>0?t.direction="right":e<0?t.direction="left":n>0?t.direction="down":n<0&&(t.direction="up"),t.x=a.x,t.y=a.y}else{const e=At(t.x,t.y,n.x,n.y,t.direction);e&&(t.x=e.x,t.y=e.y,e.direction&&(t.direction=e.direction))}},ct=(t,e)=>{if("eyes"===t.name)return void lt(t);const n=ut(t,e);t.target=n;const a=At(t.x,t.y,n.x,n.y,t.direction);a&&(t.x=a.x,t.y=a.y,a.direction&&(t.direction=a.direction))},At=(t,e,n,a,i)=>{if(t===n&&e===a)return null;const o=[{x:t,y:e,path:[],direction:i||"right"}],r=new Set;for(r.add(`${t},${e}`);o.length>0;){const t=o.shift(),{x:e,y:i,path:s,direction:l}=t,c=$.getValidMoves(e,i),A=c.filter((t=>{const[e,n]=t;return!l||!("right"===l&&e<0||"left"===l&&e>0||"up"===l&&n>0||"down"===l&&n<0)||1===c.length}));for(const[t,c]of A){const A=e+t,u=i+c,h=`${A},${u}`;if(r.has(h))continue;let d;r.add(h),d=t>0?"right":t<0?"left":c>0?"down":c<0?"up":l;const g=[...s,{x:A,y:u,pathDirection:d}];if(A===n&&u===a)return g.length>0?{x:g[0].x,y:g[0].y,direction:g[0].pathDirection}:null;o.push({x:A,y:u,path:g,direction:d})}}const s=$.getValidMoves(t,e);if(s.length>0){const[n,a]=s[Math.floor(Math.random()*s.length)];let o=i;return n>0?o="right":n<0?o="left":a>0?o="down":a<0&&(o="up"),{x:t+n,y:e+a,direction:o}}return null},ut=(t,e)=>{const{pacman:n}=e;let a=ht(e),i=1;if("blinky"===t.name){const t=371,e=(t-nt)/t;if(e>.7&&(i=1.2),e>.9&&(i=1.4),Math.random()<.8*i)return{x:n.x,y:n.y}}switch(t.name){case"blinky":default:return{x:n.x,y:n.y};case"pinky":const i=4;let o=n.x,r=n.y;return"up"===n.direction?(o=n.x-4,r=n.y-4):(o=n.x+a[0]*i,r=n.y+a[1]*i),o=Math.min(Math.max(o,0),52),r=Math.min(Math.max(r,0),6),{x:o,y:r};case"inky":const s=e.ghosts.find((t=>"blinky"===t.name));let l={x:n.x+2*a[0],y:n.y+2*a[1]};if("up"===n.direction&&(l.x=n.x-2,l.y=n.y-2),s){const t=l.x-s.x,e=l.y-s.y;l={x:l.x+t,y:l.y+e}}return l.x=Math.min(Math.max(l.x,0),52),l.y=Math.min(Math.max(l.y,0),6),l;case"clyde":return $.calculateDistance(t.x,t.y,n.x,n.y)<8?_.clyde:{x:n.x,y:n.y}}},ht=t=>{switch(t.pacman.direction){case"right":return[1,0];case"left":return[-1,0];case"up":return[0,-1];case"down":return[0,1];default:return[0,0]}},dt=(t,e)=>{const n=t+Math.floor(17*Math.random())-8,a=e+Math.floor(17*Math.random())-8;return{x:Math.max(0,Math.min(n,52)),y:Math.max(0,Math.min(a,6))}},gt=t=>{nt=(t=>{let e=0;for(let a=0;a<n;a++)for(let n=0;n<7;n++)"NONE"!==t.grid[a][n].level&&e++;return e})(t),(t=>{t.pacman.powerupRemainingDuration>0||(et++,et>=5*("scatter"===tt?7:20)&&(tt="scatter"===tt?"chase":"scatter",et=0,t.ghosts.forEach((t=>{t.inHouse||"eyes"===t.name||t.scared||at(t)}))))})(t);for(const e of t.ghosts)e.inHouse?it(e,t):("eyes"===e.name&&(e.scared=!1),e.scared?rt(e,t):"eyes"===e.name?lt(e):"scatter"===tt?ot(e):ct(e,t))};var mt;!function(t){t.CONSERVATIVE="conservative",t.AGGRESSIVE="aggressive",t.OPPORTUNISTIC="opportunistic"}(mt||(mt={}));const ft=t=>{const e=[];for(let a=0;a<n;a++)for(let n=0;n<7;n++){const i=t.grid[a][n];if("NONE"!==i.level){const o=$.calculateDistance(a,n,t.pacman.x,t.pacman.y),r=i.commitsCount/(o+1);e.push({x:a,y:n,value:r})}}return e.sort(((t,e)=>e.value-t.value)),0===e.length?{x:t.pacman.x,y:t.pacman.y,value:0}:e[0]},yt=t=>{const e=new Map,a=!!t.pacman.powerupRemainingDuration;if(t.ghosts.forEach((t=>{if(!t.scared)for(let a=-5;a<=5;a++)for(let i=-5;i<=5;i++){const o=t.x+a,r=t.y+i;if(o>=0&&o<n&&r>=0&&r<7){const t=`${o},${r}`,n=15-(Math.abs(a)+Math.abs(i));if(n>0){const a=e.get(t)||0;e.set(t,Math.max(a,n))}}}})),a)for(const[t,n]of e.entries())e.set(t,n/5);return e},pt=(t,e)=>{var n;(n=t.pacman).recentPositions||(n.recentPositions=[]),t.pacman.recentPositions.push(`${e.x},${e.y}`),t.pacman.recentPositions.length>5&&t.pacman.recentPositions.shift();const a=e.x-t.pacman.x,i=e.y-t.pacman.y;t.pacman.direction=a>0?"right":a<0?"left":i>0?"down":i<0?"up":t.pacman.direction,t.pacman.x=e.x,t.pacman.y=e.y},xt=t=>{t.pacman.powerupRemainingDuration=15,t.ghosts.forEach((t=>t.scared=!0))},vt=t=>{if(t.pacman.deadRemainingDuration)return;const e=!!t.pacman.powerupRemainingDuration,n=t.ghosts.filter((t=>t.scared));let a;try{if(e&&n.length>0){const e=(t=>{const e=t.ghosts.filter((t=>t.scared));return 0===e.length?null:e.reduce(((e,n)=>{const a=$.calculateDistance(n.x,n.y,t.pacman.x,t.pacman.y);return a<e.distance?{x:n.x,y:n.y,distance:a}:e}),{x:t.pacman.x,y:t.pacman.y,distance:1/0})})(t);a=null!=e?e:ft(t)}else t.pacman.target?t.pacman.x===t.pacman.target.x&&t.pacman.y===t.pacman.target.y?(a=ft(t),t.pacman.target=a):a=t.pacman.target:(a=ft(t),t.pacman.target=a);a||(a={x:t.pacman.x,y:t.pacman.y});const i=((t,e)=>{var n;const a=[{x:t.pacman.x,y:t.pacman.y,path:[],score:0}],i=new Set([`${t.pacman.x},${t.pacman.y}`]),o=yt(t);let r=.5,s=.5;switch(t.config.playerStyle){case mt.CONSERVATIVE:r=3,s=.1;break;case mt.AGGRESSIVE:r=.3,s=2;break;case mt.OPPORTUNISTIC:default:r=.8,s=.8}let l=1/0;t.ghosts.forEach((e=>{if(!e.scared){const n=$.calculateDistance(t.pacman.x,t.pacman.y,e.x,e.y);l=Math.min(l,n)}}));const c=t.config.playerStyle===mt.CONSERVATIVE?5:7,A=l<c;for(t.config.playerStyle===mt.CONSERVATIVE&&A&&(r*=5);a.length>0;){a.sort(((t,e)=>e.score-t.score));const l=a.shift(),{x:c,y:A,path:u}=l;if(c===e.x&&A===e.y){if(u.length>0){let e=0,n=0;return u.forEach((a=>{const i=`${a.x},${a.y}`,l=o.get(i)||0,c=t.grid[a.x][a.y].commitsCount;e-=l*r,n+=c*s})),u[0]}return null}for(const[l,h]of $.getValidMoves(c,A)){const d=c+l,g=A+h,m=`${d},${g}`;if(!i.has(m)){const l=[...u,{x:d,y:g}],c=o.get(m)||0,A=t.grid[d][g].commitsCount,h=$.calculateDistance(d,g,e.x,e.y),f=(null===(n=t.pacman.recentPositions)||void 0===n?void 0:n.includes(m))?100:0;let y,p,x;t.config.playerStyle===mt.CONSERVATIVE?(y=(15-c)*r,c>=5?y-=100:y+=50,p=A*s,x=5*y+p+-h/10-f):(y=(15-c)*r,p=A*s,x=y+p+-h/10-f),a.push({x:d,y:g,path:l,score:x}),i.add(m)}}}return null})(t,a);i?pt(t,i):(t=>{const e=$.getValidMoves(t.pacman.x,t.pacman.y);if(0===e.length)return;const n=e.reduce(((e,[n,a])=>{const i=t.pacman.x+n,o=t.pacman.y+a;let r=1/0;return t.ghosts.forEach((t=>{if(!t.scared){const e=$.calculateDistance(t.x,t.y,i,o);r=Math.min(r,e)}})),r>e.distance?{dx:n,dy:a,distance:r}:e}),{dx:0,dy:0,distance:-1/0});pt(t,{x:t.pacman.x+n.dx,y:t.pacman.y+n.dy})})(t),(t=>{const e=t.grid[t.pacman.x][t.pacman.y];if("NONE"!==e.level){t.pacman.totalPoints+=e.commitsCount,t.pacman.points++,t.config.pointsIncreasedCallback(t.pacman.totalPoints);const n=A(t);"FOURTH_QUARTILE"===e.level&&xt(t),e.level="NONE",e.color=n.intensityColors[0],e.commitsCount=0}})(t)}catch(t){console.error("Error in movePacman:",t)}},Ct=t=>{const e=10,n=t,a=2*Math.PI-t;return`M 10,10\n L ${e+e*Math.cos(n)},${e+e*Math.sin(n)}\n A 10,10 0 1,1 ${e+e*Math.cos(a)},${e+e*Math.sin(a)}\n Z`},bt=(t,e,n)=>t.gameHistory.map((t=>t.grid[e][n].color)),wt=(t,e)=>{if(t.gameHistory.length!==e.length)throw new Error(`The amount of values (${e.length}) does not match the size of the game history (${t.gameHistory.length})`);const n=t.gameHistory.length;if(0===n)return{keyTimes:"0;1",values:e[0]||"#000;#000"};let a=[],i=[],o=null,r=null;return e.forEach(((t,e)=>{t!==o&&(null!==o&&null!==r&&e-1!==r&&(a.push(Number(((e-1/40)/(n-1)).toFixed(4))),i.push(o)),a.push(Number((e/(n-1)).toFixed(4))),i.push(t),o=t,r=e)})),0!==a.length&&1===a[a.length-1]||(0===a.length?(a.push(0,1),i.push(e[0]||"#000",e[e.length-1]||"#000")):(a.push(1),i.push(o||e[e.length-1]||"#000"))),{keyTimes:a.join(";"),values:i.join(";")}},Et=t=>{const e=200*t.gameHistory.length;let a='<svg width="1166" height="184" xmlns="http://www.w3.org/2000/svg">';a+=`<desc>Generated with pacman-contribution-graph on ${new Date}</desc>`,a+=`<metadata>\n\t\t<info>\n\t\t\t<frames>${t.gameHistory.length}</frames>\n\t\t\t<frameRate>5</frameRate>\n\t\t\t<durationMs>${e}</durationMs>\n\t\t\t<generatedOn>${(new Date).toISOString()}</generatedOn>\n\t\t</info>\n\t</metadata>`,a+=`<rect width="100%" height="100%" fill="${A(t).gridBackground}"/>`,a+=(()=>{let t="<defs>";return["blinky","inky","pinky","clyde"].forEach((e=>{["up","down","left","right"].forEach((n=>{const a=W[e];n in a&&(t+=`\n <symbol id="ghost-${e}-${n}" viewBox="0 0 20 20">\n <image href="${a[n]}" width="20" height="20"/>\n </symbol>\n `)}))})),t+=`\n <symbol id="ghost-scared" viewBox="0 0 20 20">\n <image href="${W.scared.imgDate}" width="20" height="20"/>\n </symbol>`,["up","down","left","right"].forEach((e=>{W.eyes&&e in W.eyes?t+=`\n <symbol id="ghost-eyes-${e}" viewBox="0 0 20 20">\n <image href="${W.eyes[e]}" width="20" height="20"/>\n </symbol>\n `:(console.warn(`Imagem para eyes-${e} não encontrada, usando placeholder`),t+=`\n <symbol id="ghost-eyes-${e}" viewBox="0 0 20 20">\n <circle cx="10" cy="10" r="${20/3}" fill="white"/>\n </symbol>\n `)})),t+="</defs>",t})();let i="";for(let e=0;e<n;e++)t.monthLabels[e]!==i&&(a+=`<text x="${22*e+10}" y="10" text-anchor="middle" font-size="10" fill="${A(t).textColor}">${t.monthLabels[e]}</text>`,i=t.monthLabels[e]);for(let i=0;i<n;i++)for(let n=0;n<7;n++){const o=22*i,r=22*n+15,s=wt(t,bt(t,i,n));a+=`<rect id="c-${i}-${n}" x="${o}" y="${r}" width="20" height="20" rx="5" fill="${A(t).intensityColors[0]}">\n\t\t\t\t<animate attributeName="fill" dur="${e}ms" repeatCount="indefinite" \n\t\t\t\t\tvalues="${s.values}" \n\t\t\t\t\tkeyTimes="${s.keyTimes}"/>\n\t\t\t</rect>`}for(let e=0;e<7;e++){let i=null;for(let o=0;o<=n;o++){let r=o<n&&q.horizontal[o][e].active;r&&null===i&&(i=o),r&&o!==n||null===i||(a+=`<rect id="wh-${i}-${e}" x="${22*i-2}" y="${22*e-2+15}" width="${22*(o-i)}" height="2" fill="${A(t).wallColor}"></rect>`,i=null)}}for(let e=0;e<n;e++){let n=null;for(let i=0;i<=7;i++){let o=i<7&&q.vertical[e][i].active;o&&null===n&&(n=i),o&&7!==i||null===n||(a+=`<rect id="wv-${e}-${n}" x="${22*e-2}" y="${22*n-2+15}" width="2" height="${22*(i-n)}" fill="${A(t).wallColor}"></rect>`,n=null)}}const o=wt(t,t.gameHistory.map((t=>{return(e=t.pacman).deadRemainingDuration?"#80808064":e.powerupRemainingDuration?"red":K;var e}))),r=wt(t,(t=>t.gameHistory.map((t=>`${22*t.pacman.x},${22*t.pacman.y+15}`)))(t)),s=wt(t,(t=>t.gameHistory.map((t=>{switch(t.pacman.direction){case"right":default:return"0 10 10";case"left":return"180 10 10";case"up":return"270 10 10";case"down":return"90 10 10"}})))(t));return a+=`<path id="pacman" d="${Ct(.55)}" fill="${K}">\n\t\t<animate attributeName="fill" dur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${o.keyTimes}"\n\t\t\tvalues="${o.values}"/>\n\t\t<animateTransform attributeName="transform" type="translate" dur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${r.keyTimes}"\n\t\t\tvalues="${r.values}"\n\t\t\tadditive="sum"/>\n\t\t<animateTransform attributeName="transform" type="rotate" dur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${s.keyTimes}"\n\t\t\tvalues="${s.values}"\n\t\t\tadditive="sum"/>\n\t\t<animate attributeName="d" dur="0.5s" repeatCount="indefinite"\n\t\t\tvalues="${Ct(.55)};${Ct(.05)};${Ct(.55)}"/>\n\t</path>`,t.ghosts.forEach(((n,i)=>{const o=wt(t,((t,e)=>t.gameHistory.map((t=>{if(e>=t.ghosts.length)return"0,0";const n=t.ghosts[e];return`${22*n.x},${22*n.y+15}`})))(t,i));a+=`<g id="ghost${i}" transform="translate(0,0)">\n\t\t\t<animateTransform attributeName="transform" type="translate" \n\t\t\t\tdur="${e}ms" repeatCount="indefinite"\n\t\t\t\tkeyTimes="${o.keyTimes}"\n\t\t\t\tvalues="${o.values}"\n\t\t\t\tadditive="replace"/>`;const r=function(t,e){const n={};["blinky-up","blinky-down","blinky-left","blinky-right","inky-up","inky-down","inky-left","inky-right","pinky-up","pinky-down","pinky-left","pinky-right","clyde-up","clyde-down","clyde-left","clyde-right","eyes-up","eyes-down","eyes-left","eyes-right","scared"].forEach((t=>{n[t]=[{time:0,visible:!1}]}));const a=t.ghosts[e];if(!a)return n;const i=a.scared?"scared":"eyes"===a.name?`eyes-${a.direction||"right"}`:`${a.name}-${a.direction||"right"}`;n[i]=[{time:0,visible:!0}];let o=i;return t.gameHistory.forEach(((a,i)=>{if(e>=a.ghosts.length)return;const r=a.ghosts[e],s=i/(t.gameHistory.length-1),l=r.scared?"scared":"eyes"===r.name?`eyes-${r.direction||"right"}`:`${r.name}-${r.direction||"right"}`;l!==o&&(n[o].push({time:s,visible:!1}),n[l]||(n[l]=[{time:0,visible:!1}]),n[l].push({time:s,visible:!0}),o=l)})),n[o].push({time:1,visible:!0}),Object.keys(n).forEach((t=>{t!==o&&n[t].length>0&&n[t][n[t].length-1].time<1&&n[t].push({time:1,visible:!1})})),n}(t,i);for(const[t,n]of Object.entries(r)){if(0===n.length)continue;const i=`#ghost-${t}`,o=n.map((t=>t.time.toFixed(4))).join(";"),r=n.map((t=>t.visible?"visible":"hidden")).join(";"),s=n[0].visible?"visible":"hidden";a+=`<use href="${i}" width="20" height="20" visibility="${s}">\n\t\t\t\t<animate attributeName="visibility" \n\t\t\t\t\tdur="${e}ms" repeatCount="indefinite"\n\t\t\t\t\tkeyTimes="${o}"\n\t\t\t\t\tvalues="${r}" />\n\t\t\t</use>`}a+="</g>"})),a+="</svg>",a};var Rt=function(t,e,n,a){return new(n||(n=Promise))((function(i,o){function r(t){try{l(a.next(t))}catch(t){o(t)}}function s(t){try{l(a.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}l((a=a.apply(t,e||[])).next())}))};const Bt=t=>{t.ghosts=[{x:26,y:2,name:"blinky",direction:"left",scared:!1,target:void 0,inHouse:!1,respawnCounter:0,freezeCounter:0,justReleasedFromHouse:!1},{x:25,y:3,name:"inky",direction:"up",scared:!1,target:void 0,inHouse:!0,respawnCounter:0,freezeCounter:10,justReleasedFromHouse:!1},{x:26,y:3,name:"pinky",direction:"down",scared:!1,target:void 0,inHouse:!0,respawnCounter:0,freezeCounter:20,justReleasedFromHouse:!1},{x:27,y:3,name:"clyde",direction:"up",scared:!1,target:void 0,inHouse:!0,respawnCounter:0,freezeCounter:30,justReleasedFromHouse:!1}],t.ghosts.forEach((t=>{t.justReleasedFromHouse=!1,t.respawnCounter=0,t.inHouse&&("inky"===t.name?t.direction="up":"pinky"===t.name?t.direction="down":"clyde"===t.name&&(t.direction="up"))}))},Mt=t=>Rt(void 0,void 0,void 0,(function*(){var e,n,a;if(t.frameCount++,t.pacman.deadRemainingDuration>0&&(t.pacman.deadRemainingDuration--,0===t.pacman.deadRemainingDuration&&((t=>{t.pacman.x=27,t.pacman.y=7,t.pacman.direction="right",t.pacman.recentPositions=[]})(t),Bt(t))),t.pacman.powerupRemainingDuration>0&&(t.pacman.powerupRemainingDuration--,0===t.pacman.powerupRemainingDuration&&(t.ghosts.forEach((t=>{"eyes"!==t.name&&(t.scared=!1)})),t.pacman.points=0)),t.ghosts.forEach((e=>{e.inHouse&&e.respawnCounter&&e.respawnCounter>0&&(e.respawnCounter--,0===e.respawnCounter&&(e.name=e.originalName||(t=>{const e=["blinky","inky","pinky","clyde"];return e[t%e.length]})(t.ghosts.indexOf(e)),e.inHouse=!1,e.scared=t.pacman.powerupRemainingDuration>0,e.justReleasedFromHouse=!0)),e.freezeCounter&&(e.freezeCounter--,0===e.freezeCounter&&St(t,e.name))})),!t.grid.some((t=>t.some((t=>t.commitsCount>0))))){const n=Et(t);return t.config.svgCallback(n),t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:t.pacman.totalPoints,steps:t.aliveSteps,ghostsEaten:null!==(e=t.pacman.ghostsEaten)&&void 0!==e?e:0}),void t.config.gameOverCallback()}vt(t);const i=null===(n=t.grid[t.pacman.x])||void 0===n?void 0:n[t.pacman.y];i&&"FOURTH_QUARTILE"===i.level&&0===t.pacman.powerupRemainingDuration&&(t.pacman.powerupRemainingDuration=30,t.ghosts.forEach((t=>{"eyes"!==t.name&&(t.scared=!0)}))),kt(t),0===t.pacman.deadRemainingDuration&&(gt(t),kt(t)),t.pacmanMouthOpen=!t.pacmanMouthOpen,0===t.pacman.deadRemainingDuration&&t.aliveSteps++,t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:t.pacman.totalPoints,steps:t.aliveSteps,ghostsEaten:null!==(a=t.pacman.ghostsEaten)&&void 0!==a?a:0}),Tt(t)})),Tt=t=>{t.gameHistory.push({pacman:Object.assign({},t.pacman),ghosts:t.ghosts.map((t=>Object.assign({},t))),grid:t.grid.map((t=>t.map((t=>Object.assign({},t)))))})},kt=t=>{t.pacman.deadRemainingDuration||t.ghosts.forEach((e=>{var n;"eyes"!==e.name&&e.x===t.pacman.x&&e.y===t.pacman.y&&(t.pacman.powerupRemainingDuration&&e.scared?(e.originalName=e.name,e.name="eyes",e.scared=!1,e.target={x:26,y:3},t.pacman.points+=10,t.pacman.ghostsEaten=(null!==(n=t.pacman.ghostsEaten)&&void 0!==n?n:0)+1):(t.pacman.points=0,t.pacman.powerupRemainingDuration=0,0===t.pacman.deadRemainingDuration&&(t.pacman.deadRemainingDuration=10)))}))},St=(t,e)=>{const n=t.ghosts.find((t=>t.name===e&&t.inHouse));n&&(n.justReleasedFromHouse=!0,n.y=2,n.direction="up")},Dt={frameCount:0,aliveSteps:0,contributions:[],pacman:{x:0,y:0,direction:"right",points:0,totalPoints:0,deadRemainingDuration:0,powerupRemainingDuration:0,recentPositions:[],ghostsEaten:0},ghosts:[],grid:[],monthLabels:[],pacmanMouthOpen:!0,gameInterval:0,gameHistory:[],config:void 0,useGithubThemeColor:!0},It=(t,e,a,i,o)=>{"horizontal"==a?(X(t,e,"horizontal",o),"x"==i?X(n-t-1,e,"horizontal",o):"y"==i?X(t,7-e,"horizontal",o):"xy"==i&&(X(n-t-1,e,"horizontal",o),X(t,7-e,"horizontal",o),X(n-t-1,7-e,"horizontal",o))):(X(t,e,"vertical",o),"x"==i?X(n-t,e,"vertical",o):"y"==i?X(t,7-e-1,"vertical",o):"xy"==i&&(X(n-t,e,"vertical",o),X(t,7-e-1,"vertical",o),X(n-t,7-e-1,"vertical",o)))};class Ut{constructor(t){this.conf=Object.assign({},t)}start(){return t=this,e=void 0,a=function*(){const t={platform:"github",username:"",svgCallback:t=>{},gameOverCallback:()=>{},gameTheme:"github",pointsIncreasedCallback:t=>{},githubSettings:{accessToken:""},playerStyle:mt.OPPORTUNISTIC};switch(this.store=JSON.parse(JSON.stringify(Dt)),this.store.config=Object.assign(Object.assign({},t),this.conf),this.store.config.platform){case"gitlab":this.store.contributions=yield f(this.store);break;case"github":this.store.contributions=yield m(this.store);break;default:throw new Error(`Unsupported platform: ${this.store.config.platform}`)}return It(0,2,"horizontal","xy","L1"),It(1,2,"horizontal","xy","L1"),It(4,1,"vertical","x","L2"),It(4,2,"vertical","x","L2"),It(4,3,"vertical","x","L2"),It(4,4,"vertical","x","L2"),It(3,3,"horizontal","x","L3"),It(2,3,"horizontal","x","L3"),It(4,5,"horizontal","x","L4"),It(6,4,"vertical","x","L5"),It(6,3,"vertical","x","L5"),It(6,2,"vertical","x","L5"),It(6,2,"horizontal","x","L6"),It(7,2,"horizontal","x","L6"),It(8,2,"horizontal","x","L6"),It(9,2,"horizontal","x","L6"),It(13,2,"horizontal","xy","L7"),It(14,2,"horizontal","xy","L7"),It(15,2,"horizontal","xy","L7"),It(16,2,"horizontal","xy","L7"),It(17,2,"horizontal","xy","L7"),It(18,2,"horizontal","xy","L7"),It(16,2,"vertical","xy","L8"),It(8,1,"horizontal","x","L9"),It(9,1,"horizontal","x","L9"),It(10,1,"horizontal","x","L9"),It(11,1,"horizontal","x","L9"),It(12,1,"vertical","x","L10"),It(12,3,"vertical","x","L10"),It(11,4,"horizontal","x","L11"),It(10,4,"horizontal","x","L11"),It(9,4,"horizontal","x","L11"),It(8,4,"horizontal","x","L11"),It(8,4,"vertical","x","L12"),It(8,5,"vertical","x","L12"),It(23,1,"horizontal","x","L18"),It(22,1,"horizontal","x","L18"),It(21,1,"horizontal","x","L18"),It(21,1,"vertical","x","L18"),It(21,2,"vertical","x","L18"),It(21,3,"vertical","x","L18"),It(20,4,"horizontal","x","L18"),It(19,4,"horizontal","x","L18"),It(19,3,"vertical","x","L18"),It(18,3,"horizontal","x","L18"),It(22,5,"vertical","x","L19"),It(21,5,"horizontal","x","L19"),It(20,5,"horizontal","x","L19"),It(20,5,"vertical","x","L19"),It(1,6,"horizontal","x","L20"),It(2,6,"horizontal","x","L20"),It(3,4,"vertical","x","L20"),It(5,6,"horizontal","x","L21"),It(6,6,"horizontal","x","L21"),X(25,2,"horizontal","GH_TOP"),X(27,2,"horizontal","GH_TOP"),X(25,4,"horizontal","GH_BOTTOM"),X(26,4,"horizontal","GH_BOTTOM"),X(27,4,"horizontal","GH_BOTTOM"),X(25,3,"vertical","GH_LEFT"),X(28,3,"vertical","GH_RIGHT"),X(25,2,"vertical","GH_LEFT"),X(28,2,"vertical","GH_RIGHT"),u(this.store),h(this.store),yield(e=this.store,Rt(void 0,void 0,void 0,(function*(){e.frameCount=0,e.aliveSteps=0,e.gameHistory=[],e.ghosts.forEach((t=>t.scared=!1)),e.grid=d(e);const t=()=>e.grid.some((t=>t.some((t=>t.commitsCount>0))));for(t()&&((t=>{t.pacman={x:0,y:0,direction:"right",points:0,totalPoints:0,deadRemainingDuration:0,powerupRemainingDuration:0,recentPositions:[],ghostsEaten:0}})(e),Bt(e));t();)yield Mt(e);yield Mt(e)}))),this.store;var e},new((n=void 0)||(n=Promise))((function(i,o){function r(t){try{l(a.next(t))}catch(t){o(t)}}function s(t){try{l(a.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}l((a=a.apply(t,e||[])).next())}));var t,e,n,a}stop(){var t;t=this.store,Rt(void 0,void 0,void 0,(function*(){clearInterval(t.gameInterval)}))}}var Nt=e.Lc,Ot=e.b9,Ht=e.Cf,Vt=e.rn;export{Nt as BreakoutRenderer,Ot as GalagaRenderer,Ht as PacmanRenderer,Vt as PlayerStyle};
package/package.json CHANGED
@@ -1,21 +1,18 @@
1
1
  {
2
2
  "name": "pacman-contribution-graph",
3
- "version": "2.4.0",
3
+ "version": "3.1.0",
4
4
  "description": "Generates a pacman game from a github or gitlab user contributions grid",
5
5
  "repository": "github:abozanona/pacman-contribution-graph",
6
6
  "homepage": "https://abozanona.github.io/pacman-contribution-graph/",
7
7
  "type": "module",
8
8
  "main": "dist/pacman-contribution-graph.min.js",
9
- "types": "dist/index.d.ts",
10
9
  "exports": {
11
10
  ".": {
12
- "import": "./dist/pacman-contribution-graph.min.js",
13
- "types": "./dist/index.d.ts"
11
+ "import": "./dist/pacman-contribution-graph.min.js"
14
12
  }
15
13
  },
16
14
  "files": [
17
15
  "dist/pacman-contribution-graph.min.js",
18
- "dist/index.d.ts",
19
16
  "action.yml"
20
17
  ],
21
18
  "keywords": [
package/dist/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import { Config, StoreType } from './types';
2
- export declare class PacmanRenderer {
3
- store: StoreType;
4
- conf: Config;
5
- constructor(conf: Config);
6
- start(): Promise<StoreType>;
7
- stop(): void;
8
- }