Compare commits
361
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
220c891c72 | ||
|
|
2b9493422d | ||
|
|
621f568ba2 | ||
|
|
972d08a54d | ||
|
|
7a13d412f1 | ||
|
|
9de4b06e75 | ||
|
|
123fa97611 | ||
|
|
1fad792be7 | ||
|
|
acd1262955
|
||
|
|
3d6941ab93
|
||
|
|
de72bd800c
|
||
|
|
b465dcfa92 | ||
|
|
73f3df0bc6 | ||
|
|
90a7b7b70e | ||
|
|
4f002a29e1 | ||
|
|
66d090d045 | ||
|
|
4715441afd | ||
|
|
77ac771b8f | ||
|
|
3762750968 | ||
|
|
a276c24f8f | ||
|
|
25c5c1b018 | ||
|
|
c7f37b0854 | ||
|
|
c35f675a11 | ||
|
|
a9e5e45872 | ||
|
|
73d50f3f50 | ||
|
|
0871d2971d | ||
|
|
9744bd973f | ||
|
|
ecaa0af24a | ||
|
|
a762b6875d
|
||
|
|
4e6c4ecf38 | ||
|
|
ec3c912847
|
||
|
|
5636d96478 | ||
|
|
d40ceff2ba
|
||
|
|
fd357ba938 | ||
|
|
92079c5a47 | ||
|
|
753af3874e | ||
|
|
e03a01ec89 | ||
|
|
fd18df7c3a | ||
|
|
93c161be4c | ||
|
|
853a3a42d2
|
||
|
|
a80fb2b297 | ||
|
|
f484fb095e | ||
|
|
8ff29ca34e | ||
|
|
611e7167f9
|
||
|
|
ee37dc79a7
|
||
|
|
2fb6aef67c | ||
|
|
7e7cec2f6c | ||
|
|
345599888d | ||
|
|
19b4950be4 | ||
|
|
d9307753c4 | ||
|
|
7a23dcc96a | ||
|
|
f2b80ba89f | ||
|
|
114116b97c | ||
|
|
924faca13f | ||
|
|
ea4a0745e0 | ||
|
|
76f5a39a8f | ||
|
|
37f8a3ac4e | ||
|
|
ea46dd664c | ||
|
|
b2d0be014c | ||
|
|
571d27c230 | ||
|
|
37a9eb46ae | ||
|
|
bfc4f6567b | ||
|
|
d423a57fa0 | ||
|
|
210fda0401 | ||
|
|
b67b25b4a4 | ||
|
|
385290d1a2 | ||
|
|
cf2deb983d | ||
|
|
dcec45acf5 | ||
|
|
008af10d0e | ||
|
|
f7df234312 | ||
|
|
d855bbe911 | ||
|
|
f2507ddcdd | ||
|
|
a70b05a0ef | ||
|
|
1d793cef4e | ||
|
|
4cf2ac1aa8 | ||
|
|
6e6bd285af | ||
|
|
474a8d3f31 | ||
|
|
4379794dba | ||
|
|
c5d7ce4178 | ||
|
|
382d3c203a | ||
|
|
5a7934b2a3 | ||
|
|
8476563678 | ||
|
|
97b57b361d | ||
|
|
069466ef5f | ||
|
|
d5f6656e2b | ||
|
|
32e26f35cb | ||
|
|
36fc33c3e9 | ||
|
|
17ab241250
|
||
|
|
36ce5a553b | ||
|
|
a5807148e1 | ||
|
|
53e478b05c | ||
|
|
182be8ac7b
|
||
|
|
beba199f60 | ||
|
|
767a83d1d6 | ||
|
|
da3f8c47f9
|
||
|
|
8d1235be92 | ||
|
|
1546fc6d47
|
||
|
|
04f64f505e
|
||
|
|
e84e34d735 | ||
|
|
c955fbf5f8 | ||
|
|
847936b799
|
||
|
|
0b27d2e8d8
|
||
|
|
45fbef52ed
|
||
|
|
ca6f676fb7 | ||
|
|
cc8530621d
|
||
|
|
abff9aef3a | ||
|
|
41288258c9 | ||
|
|
47a0c97f3d | ||
|
|
3ea6c7886a | ||
|
|
17d0ae7ccc
|
||
|
|
8f2fb04112 | ||
|
|
c6198b7220 | ||
|
|
13fd048cd2 | ||
|
|
b7b2eafb93 | ||
|
|
0860567e1b | ||
|
|
25009ba149 | ||
|
|
208c6c63e8 | ||
|
|
e2da7271af | ||
|
|
d5e4387303 | ||
|
|
1903a6c9be | ||
|
|
77a170be6d
|
||
|
|
9f02207eb0 | ||
|
|
ae4ad036a8
|
||
|
|
3996765c8a
|
||
|
|
b047c4de35 | ||
|
|
1f14890d43 | ||
|
|
2ea6ed16bb | ||
|
|
189e664f37 | ||
|
|
f33a421aee | ||
|
|
017235cccf | ||
|
|
1bff48a4b9 | ||
|
|
385640c10e | ||
|
|
a0c38a8d59 | ||
|
|
198ee8a4ce | ||
|
|
08c662a65f | ||
|
|
c8b7930a8e | ||
|
|
20d52b2b21 | ||
|
|
1502cc871c | ||
|
|
826bbf5990 | ||
|
|
c26972369f | ||
|
|
4c5cae7ff5 | ||
|
|
59c3442647 | ||
|
|
12846ed83d | ||
|
|
bb4ee784fa | ||
|
|
1777e894e9 | ||
|
|
3c3659c056 | ||
|
|
e05492f4a8 | ||
|
|
97a2c8a9f6 | ||
|
|
9aa425d1c3 | ||
|
|
f0a411c031 | ||
|
|
6228e21d38
|
||
|
|
64e7f8dc6b
|
||
|
|
a0285e700d
|
||
|
|
68e55e8355
|
||
|
|
157e5951fc | ||
|
|
4241f15731 | ||
|
|
cead1188ab | ||
|
|
5c7147bb17 | ||
|
|
7d8e1113cc | ||
|
|
354793a29f | ||
|
|
d5b1df32b6 | ||
|
|
2a58c335f2 | ||
|
|
4f511bf066 | ||
|
|
62f64eed60 | ||
|
|
4b1db883e2 | ||
|
|
58a4c87661
|
||
|
|
f52cb31189 | ||
|
|
044648674c | ||
|
|
4b0ea8cf40 | ||
|
|
dae59f67ce | ||
|
|
66282bce9f | ||
|
|
b7a574a312 | ||
|
|
8fbfb36958 | ||
|
|
86f1a6f17b | ||
|
|
68df9f99fa | ||
|
|
2fe6153705 | ||
|
|
042553c123 | ||
|
|
3cf5153e79 | ||
|
|
07e5fb3a73 | ||
|
|
c14d0a9d21 | ||
|
|
5c728098df | ||
|
|
28d252279a | ||
|
|
ab91a39a63 | ||
|
|
d4c48ee9f1 | ||
|
|
5325d6e3ae | ||
|
|
ce2efb61c8 | ||
|
|
b7c97ead2b | ||
|
|
84fe1df671 | ||
|
|
8fdfb470cb | ||
|
|
160cfb0bbf | ||
|
|
31159ebb5c | ||
|
|
ac88307036 | ||
|
|
847b1ca419 | ||
|
|
5bda05925c | ||
|
|
be084cfd12 | ||
|
|
0b4b38f6c5 | ||
|
|
21de520175 | ||
|
|
b88d820c12 | ||
|
|
521c98fdc2 | ||
|
|
ba8b32160d | ||
|
|
3571b96cfc | ||
|
|
619d2601f1 | ||
|
|
03ff0c0568 | ||
|
|
82a3b152f2 | ||
|
|
d2a697904e | ||
|
|
fe34ff4705 | ||
|
|
de7774047f | ||
|
|
a524845d06 | ||
|
|
8e40638b5e | ||
|
|
13d9020c7d | ||
|
|
8a544515d0 | ||
|
|
481c96bec2 | ||
|
|
1383814e34 | ||
|
|
7ff47b6e9c | ||
|
|
fba30cff9e | ||
|
|
875cfb8b7c | ||
|
|
0ca5640564 | ||
|
|
acfd366fc8 | ||
|
|
4111839852 | ||
|
|
e69ece23d0 | ||
|
|
b42324987b | ||
|
|
3b31fa794f | ||
|
|
c33b73a114 | ||
|
|
2f2a72bfa0 | ||
|
|
6b58c852a2 | ||
|
|
8b35b3dc01 | ||
|
|
93144d0f90 | ||
|
|
3c08022c20 | ||
|
|
204e6a9505
|
||
|
|
d639fa5ee3 | ||
|
|
e1d8e37c52 | ||
|
|
8e932b1b67
|
||
|
|
dbbf74f2c3 | ||
|
|
4aa15ec72a | ||
|
|
2938707f0f | ||
|
|
0e7c18e088 | ||
|
|
886077349c | ||
|
|
434cc8dd2b | ||
|
|
d9ec085d2c | ||
|
|
4a85a55290 | ||
|
|
37d24c59e7 | ||
|
|
5acca4d10d | ||
|
|
b050a74b75 | ||
|
|
010f9200a7 | ||
|
|
6a39464f61 | ||
|
|
7222bca6e2 | ||
|
|
6df81a66f2
|
||
|
|
34a36f8b1e | ||
|
|
2a558e40cb | ||
|
|
3350533e74 | ||
|
|
aaaba0ddf3
|
||
|
|
a253a5152d
|
||
|
|
38ed249150
|
||
|
|
212ab638a2
|
||
|
|
e158fa1f87
|
||
|
|
6289be529a
|
||
|
|
1f69040436
|
||
|
|
56a14a3e8a
|
||
|
|
b72c0a8e17 | ||
|
|
bb0e6783ec | ||
|
|
57de070eb1
|
||
|
|
24a54bdee4 | ||
|
|
d1b4023d92
|
||
|
|
c27c3ac9fb | ||
|
|
837db9aba9
|
||
|
|
09d5e1c293
|
||
|
|
dcd1fad6ac
|
||
|
|
8c2397c4cf
|
||
|
|
cc89d7f5b7 | ||
|
|
36f1ab3203 | ||
|
|
45bfe08c9a | ||
|
|
6c688dab59 | ||
|
|
516fc0d5e6
|
||
|
|
7abd2a001f
|
||
|
|
9850f2145c | ||
|
|
25fe568148 | ||
|
|
672d17cf0e | ||
|
|
49196caccc | ||
|
|
0b0fe9ae78 | ||
|
|
057d8ff001 | ||
|
|
684c3095eb | ||
|
|
bbe1f9767c | ||
|
|
3956037ab5 | ||
|
|
21a42737a2 | ||
|
|
2d43707aca | ||
|
|
f1b3b0dd45 | ||
|
|
512e8a41dd | ||
|
|
1a5f3cf65e | ||
|
|
298cdcaae0 | ||
|
|
dbe24dbc5f | ||
|
|
1a1baccddd | ||
|
|
ba7e9599de | ||
|
|
fa522eabd3 | ||
|
|
caf11b5b19 | ||
|
|
25019d8b91 | ||
|
|
69c3a3b965 | ||
|
|
0de7b69b1b
|
||
|
|
7c9fe9235c
|
||
|
|
56df39b584
|
||
|
|
4c79b9e51f
|
||
|
|
6559462f2b
|
||
|
|
43adb6d31f
|
||
|
|
9c92e7d1e9
|
||
|
|
88108918dd
|
||
|
|
c0ab074a95
|
||
|
|
4f4ed952cc
|
||
|
|
d8cbbdc94b
|
||
|
|
f39cc004ad
|
||
|
|
4983b67fbe
|
||
|
|
0015763523
|
||
|
|
f1154713b7
|
||
|
|
883ff19fa3
|
||
|
|
fdfbd5a948
|
||
|
|
b90716ab38
|
||
|
|
3f74c5bb07
|
||
|
|
c11ad4fa11
|
||
|
|
5d877c3460
|
||
|
|
5691ff1783
|
||
|
|
fbbc6978d5
|
||
|
|
bb5d1a6982 | ||
|
|
6503af0096
|
||
|
|
42d9231ef6
|
||
|
|
fb6527afd5 | ||
|
|
b9fec5e7b4
|
||
|
|
62136f5060
|
||
|
|
9ca94668d7
|
||
|
|
dda321256c | ||
|
|
85b0be3479 | ||
|
|
a795108859 | ||
|
|
3f1c4732ec | ||
|
|
ef4929640d
|
||
|
|
3abe4cd6ef | ||
|
|
5958b15c84 | ||
|
|
8648631d32 | ||
|
|
db2003b51a | ||
|
|
6f5f89d954 | ||
|
|
abef330bd7 | ||
|
|
4f1a44549b | ||
|
|
55e095bcc6
|
||
|
|
26bcb045ed | ||
|
|
5d8c3d03c5 | ||
|
|
95888a4600 | ||
|
|
f0f60de12f | ||
|
|
351c0dbfb2 | ||
|
|
3e304ca0ac | ||
|
|
9e299b39bd | ||
|
|
c807568689 | ||
|
|
67552901d6 | ||
|
|
ffc8682453 | ||
|
|
93ec63beae | ||
|
|
87d00943c0 | ||
|
|
dc559cefee | ||
|
|
b2db8eec16 | ||
|
|
9a20462ede | ||
|
|
c2b6ad0693 | ||
|
|
f0b2c31a06
|
||
|
|
b50e0db3fc
|
||
|
|
b00ab09079 | ||
|
|
05fc134281 | ||
|
|
b8897cd697
|
||
|
|
407b881144 |
No files matched your search
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# https://help.github.com/articles/dealing-with-line-endings/
|
||||
#
|
||||
# Linux start script should use lf
|
||||
/gradlew text eol=lf
|
||||
|
||||
# These are Windows script files and should use crlf
|
||||
*.bat text eol=crlf
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
name: Build and test backend
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
Build-backend:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '21'
|
||||
distribution: 'temurin'
|
||||
- uses: gradle/gradle-build-action@v3
|
||||
- name: building
|
||||
run: ./gradlew backend:build -x test
|
||||
# Test-backend:
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
# - uses: actions/setup-java@v3
|
||||
# with:
|
||||
# java-version: '21'
|
||||
# distribution: 'temurin'
|
||||
# - run: curl -fsSL https://get.docker.com | sh
|
||||
# - uses: gradle/gradle-build-action@v3
|
||||
# - name: testing
|
||||
# run: ./gradlew backend:test
|
||||
@@ -0,0 +1,57 @@
|
||||
name: deploy to production
|
||||
run-name: ${{ gitea.actor }} has pushed to production
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
workflow_run:
|
||||
workflows:
|
||||
- Build and test backend
|
||||
- Build and test frontend
|
||||
types:
|
||||
- completed
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy-frontend:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
working-directory: ./frontend
|
||||
- run: npm ci
|
||||
name: clean install
|
||||
working-directory: ./frontend
|
||||
- name: building
|
||||
working-directory: ./frontend
|
||||
run: npm run build
|
||||
- name: pushing to the server
|
||||
working-directory: ./frontend
|
||||
run: |
|
||||
echo "${{ secrets.SSH_KEY }}" > key
|
||||
chmod 0600 key
|
||||
scp -o "StrictHostKeyChecking=no" -o "LogLevel=ERROR" -i key -r dist/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:
|
||||
- run: echo "The website has been deployed. visit https://clyde.herisson.ovh/"
|
||||
|
||||
deploy-backend:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '21'
|
||||
distribution: 'temurin'
|
||||
- uses: gradle/gradle-build-action@v3
|
||||
- name: building
|
||||
run: ./gradlew backend:build -x test
|
||||
- name: pushing to the server
|
||||
run: |
|
||||
echo "${{ secrets.SSH_KEY }}" > key
|
||||
chmod 0600 key
|
||||
scp -o "StrictHostKeyChecking=no" -o "LogLevel=ERROR" -i key -r * ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:api/
|
||||
- name: restarting the backend
|
||||
run: |
|
||||
ssh -o "StrictHostKeyChecking=no" -o "LogLevel=ERROR" -i key ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} 'cd api/backend && docker build -t clyde/backend . && docker rm clyde_backend_prod -f || true && docker run --rm -d -u $(id -u clyde):$(id -g clyde) -v /var/run/postgresql:/var/run/postgresql --name clyde_backend_prod -p 4000:8080 clyde/backend && docker image prune -f'
|
||||
- run: echo "The backend has been deployed. running at https://clyde.herisson.ovh/api"
|
||||
@@ -0,0 +1,22 @@
|
||||
name: Build and test FrontEnd
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
Build-frontend:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
working-directory: ./frontend
|
||||
- run: npm ci
|
||||
name: clean install
|
||||
working-directory: ./frontend
|
||||
- run: npm run build --if-present
|
||||
name: build
|
||||
working-directory: ./frontend
|
||||
@@ -0,0 +1,9 @@
|
||||
# Ignore Gradle project-specific cache directory
|
||||
.gradle
|
||||
|
||||
# Ignore Gradle build output directory
|
||||
build
|
||||
|
||||
.project
|
||||
.settings
|
||||
.idea/
|
||||
Submodule
+1
Submodule Clyde added at bd27ffd3cb.
@@ -0,0 +1,48 @@
|
||||
# Journal de bord du 29 février
|
||||
|
||||
Ce premier journal de bord permet d'initier une tendance a garder une trace des choix fait lors du dévelopement du
|
||||
projet de génie logiciel. Ces journaux pourront alors être consultés par la suite, pour la rédaction du rapport.
|
||||
|
||||
## Choix des technologies utilisées
|
||||
|
||||
### Backend: spring.io
|
||||
|
||||
Le backend est imposé, nous devons utiliser spring boots. La courbe d'aprentisage nous semble difficile mais après de
|
||||
longues documentations nous commençons à comprendre son fonctionnement.
|
||||
|
||||
### Frontend: Vue.js
|
||||
|
||||
Le frontend n'est pas imposé, nous devons utiliser javascript mais le choix du framework (si utilisé) est libre. Nous
|
||||
avons pris la recomendation du cours: vue.js qui est un framework simple d'aprentisage et très performant.
|
||||
|
||||
#### Librairies
|
||||
|
||||
- **Vue3-toastify:** Nous avons opté pour l'utilisation d'une librarie de "notification". cette librairie permet
|
||||
d'afficher des notifications sur la page. Elle nous est utile autant pour l'application finale que pour le
|
||||
dévelopement.
|
||||
|
||||
### Database: postgresql
|
||||
|
||||
C'est une base de données très efficace qui est déjà installé
|
||||
|
||||
### VCS: Gitea
|
||||
|
||||
C'est une alternative a github mais self-hosted. Nous avons accés à un serveur sur lequel gitea est installé
|
||||
(https://git.herisson.ovh/).
|
||||
|
||||
### CI/CD: Gitea Actions
|
||||
|
||||
Gitea a récement implémenter l'équivalent de github actions dans gitea et qui est complètement compatible avec github
|
||||
actions. Nous avons donc implémentés les test et build en continu lors des pr et merge. Lorsqu'un merge est fait avec la
|
||||
branche master, le site est instentanément mis à jours (après une dernière verification du build et test) sur l'adresse
|
||||
http://clyde.herisson.ovh pour le frontent et http://clyde.herisson.ovh/api pour le backend.
|
||||
|
||||
|
||||
## Répartition des taches
|
||||
|
||||
Nous nous répartisons les taches par familiarité et préférences avec les différentes partie du projet.
|
||||
|
||||
- Wiliam: Frontend visuel
|
||||
- Anthony: Frontend technique
|
||||
- Max: Backend Endpoints
|
||||
- Léo: Backend Data
|
||||
@@ -0,0 +1,36 @@
|
||||
# Authentification
|
||||
|
||||
## Contexte
|
||||
|
||||
Le projet demande de pouvoir authentifier les utilisateurs présents. Le but étant de leurs associer un "contexte"
|
||||
(cours, informations personnelles, ...). Pour que ceux-ci puissent accomplir différentes actions nécéssitantes une
|
||||
identification (permission, info personelles, ...).
|
||||
|
||||
## Méthode
|
||||
|
||||
Lorsque qu'un utilisateur se connecte au serveur, nous lui envoyons un token qui sera stocké dans le
|
||||
navigateur. Ce token est unique à l'utilisateur et pourra être ré-envoyé dans les futures requêtes
|
||||
pour identifier l'utilisateur.
|
||||
|
||||
Ce token est donc une chaine de 64 caractères suivant la norme ISO_8859_1(8bits par cararctère) aléatoires,ce qui est d'après nos recherches suffisant.
|
||||
|
||||
De plus une limite de 5 token par utilisateur sera ajoutée de sorte à
|
||||
1) S'assurer qu'une personne ne noie la base de donnée de tokens.
|
||||
2) Ajouter une protection supplémentaire pour assurer qu'un token est bien unique à un utilisateur.
|
||||
|
||||
## Autres méthodes envisagée
|
||||
|
||||
### Oauth2
|
||||
|
||||
C'est un protocol d'identification vastement utilisé permettant, en plus d'identifier les requettes,
|
||||
de gérer leurs permissions. Un utilisateur créen un token peut lui attribuer des permissions
|
||||
spécifique qui restrainderaients les permissions d'utilisation de ce token. C'est très utile pour
|
||||
déployer des api de site pouvant notament être accédé par des ordinateurs / bots. Ca n'est en
|
||||
revanche pas l'objectif du projet et l'option n'a donc pas été retenue
|
||||
|
||||
### Spring Sessions / Tomcat sessions
|
||||
|
||||
Il aurait été possible de laisser une librairie automatiser les sessions. Malheuresement, celà
|
||||
implique de devoir se plier au format de la dite librairie. L'implémentation d'un système de gestion
|
||||
de token maison semblai à la fois, non-imposible et interessant à notre apprentisage. C'est pourquoi
|
||||
nous n'avons pas utilisé cette option.
|
||||
@@ -0,0 +1,45 @@
|
||||
# Internationalization (i18n)
|
||||
|
||||
L'un des critère du projet est de donner la possibilité aux utilisateur de choisir entre différentes
|
||||
langues. Minimum 2 sont a implémenter, le français et l'anglais.
|
||||
|
||||
## Intention
|
||||
|
||||
La gestion des langue au niveau backend peut sembler être une bonne idée aux premier abord car celà
|
||||
permeterais de laisser la possibilité a différents frontend utilisant la meme api de traduction.
|
||||
cependant, peu d'éléments venant de la base de données sont traduisible. Nous alons alors opter pour
|
||||
une internationalization au niveau du frontend. Dans le cas ou un éléments venant du frontend
|
||||
devrait être traduit, Il suffirait alors de le faire traduire par le frontend directement
|
||||
|
||||
## Implémentation
|
||||
|
||||
Le frontend va se voir équiper d'une collection de fonctions permettant la traduction. notament
|
||||
`i18n(key: str) -> str` qui prendrait en entrée une "clé" identifiant la traduction à aller
|
||||
chercher. Cette clé serait sous la forme : `<context>.<element>`. La fonctions retournera alors la
|
||||
traduction du texte dans la langue choisie par l'utilisateur. cette langue sera stockée dans les
|
||||
cookies pour qu'un utilisateur non enregistré puisse naviguer sur le site sans problèmes. Si
|
||||
l'utilisateur est enregistré elle pourra également être ajouter à son profil pour que la langue soit
|
||||
mise à jours lors de son prochain passage.
|
||||
|
||||
### Base de données de traduction
|
||||
|
||||
Les traductions seront rassembler dans fichier txt. Une langue sera présente par fichier et une
|
||||
traduction par ligne. (Ce format semble être utilisé par certaines librairies de spring. Malgré le
|
||||
fait que nous ne l'utiliserons finalement pas, ce format semble efficace est facile à utilsier).
|
||||
|
||||
Chaque ligne commence par la clé. suivi immédiatement d'un "=". le contenu après ce égale est la
|
||||
traduction jusqu'au égale.
|
||||
|
||||
## Considérations
|
||||
|
||||
- Il existe certainemnt des librairies prète à l'emploi de traduction mais celà semble être
|
||||
relativement simple à implémenter manuellement.
|
||||
|
||||
- Dans l'éventualité où nous voudrions implémenter des éléments au milieu d'une traduction (example:
|
||||
Veuillez vérifier votre addresse mail: `tonitch@herisson.ovh` puis revenir sur le site!). Dans ce
|
||||
cas nous pouvons utiliser le regex et simplement renseigner ces éléments par \1, \2, \3, ... puis
|
||||
créer une fonction qui s'occuperais de remplacer ces éléments dans le texte avant de le mettre en
|
||||
avant.
|
||||
|
||||
- Il ne devrait pas etre trop compliqué d'écrire un script qui vérifie que toutes les traductions
|
||||
sont présente dans tout les fichiers en vérifiant que toutes les clés d'un fichiers sont présente.
|
||||
+1380
-409
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,87 @@
|
||||
# Entity relational diagram
|
||||
|
||||
## Messaging extension
|
||||
|
||||
```mermaid
|
||||
%%{init: { "er": {"fontSize": 25, "stroke": "black" }}}%%
|
||||
erDiagram
|
||||
|
||||
%% General
|
||||
Users
|
||||
|
||||
%% Messages
|
||||
Discussions{
|
||||
Integer id PK
|
||||
String name
|
||||
}
|
||||
|
||||
Messages{
|
||||
Integer id PK
|
||||
Integer response FK "Messages"
|
||||
String content
|
||||
}
|
||||
|
||||
Discussions ||--o{ Messages: ""
|
||||
Discussions ||--o{ Users: ""
|
||||
|
||||
Messages o|--o{ Messages: "answers"
|
||||
|
||||
%% Forums
|
||||
Forums{
|
||||
Integer id PK
|
||||
String name
|
||||
Integer course FK "Course"
|
||||
}
|
||||
|
||||
Topics{
|
||||
Integer id PK
|
||||
String subject
|
||||
String content
|
||||
Boolean locked
|
||||
}
|
||||
Answers{
|
||||
Integer id PK
|
||||
String content
|
||||
Boolean anonymous
|
||||
TimeStamp creation_time
|
||||
}
|
||||
|
||||
Polls{
|
||||
Integer id PK
|
||||
enum PollType
|
||||
}
|
||||
Options{
|
||||
Integer id PK
|
||||
String name
|
||||
}
|
||||
|
||||
Forums ||--o{ Users: "Registered"
|
||||
Forums ||--|| Teacher: "Owner"
|
||||
Forums ||--o{ Topics: ""
|
||||
Forums ||--o{ Polls: ""
|
||||
|
||||
Topics ||--|| Teacher: "Author"
|
||||
Topics ||--|| Users: "Author"
|
||||
Topics ||--o{ Answers: ""
|
||||
|
||||
Polls ||--o{ Options: ""
|
||||
|
||||
Options ||--o{ Votes : ""
|
||||
|
||||
Votes }o--|| Users: "Voter"
|
||||
|
||||
|
||||
%% Appointments
|
||||
Teacher
|
||||
Appointments{
|
||||
Integer id PK
|
||||
Integer teacher FK "Teacher"
|
||||
TIME sent_time
|
||||
enum Status
|
||||
}
|
||||
|
||||
Appointments ||--|| Users: ""
|
||||
|
||||
```
|
||||
|
||||
Debucquoy Anthony
|
||||
@@ -11,8 +11,9 @@ extension_messagerie.pdf:use_case_messagerie.tex extension_messagerie.bbl extens
|
||||
use_case_messagerie.tex: use_case_messagerie.uml
|
||||
plantuml -tlatex:nopreamble use_case_messagerie.uml
|
||||
|
||||
image: use_case_messagerie.uml interaction_diagram.uml
|
||||
image: use_case_messagerie.uml interaction_diagram.uml class.uml
|
||||
plantuml $^
|
||||
mmdc -i ERD.md -o ERD.png
|
||||
|
||||
extension_messagerie.bbl: extension_messagerie.bcf
|
||||
biber extension_messagerie
|
||||
@@ -24,6 +25,7 @@ clean:
|
||||
latexmk -C
|
||||
rm -f use_case_messagerie.tex
|
||||
rm -f extension_messagerie.{bbl,run.xml}
|
||||
rm -f class.tex
|
||||
|
||||
run: extension_messagerie.pdf
|
||||
xdg-open $<
|
||||
@@ -0,0 +1,86 @@
|
||||
@startuml
|
||||
title Class diagram for Messaging extension
|
||||
|
||||
package Messages {
|
||||
class Message{
|
||||
content: String
|
||||
response: Message
|
||||
respond(User, String)
|
||||
}
|
||||
class Discussion{
|
||||
name: String
|
||||
users: ArrayList<User>
|
||||
invite(User)
|
||||
sendMessage(User, String)
|
||||
}
|
||||
Discussion *-- Message
|
||||
}
|
||||
|
||||
package Forums {
|
||||
class Forum{
|
||||
name: String
|
||||
Owner: Teacher
|
||||
Registered: ArrayList<User>
|
||||
{static} createForum(Course): Forum
|
||||
createTopic(String): Topic
|
||||
createPoll(String, PollType, ArrayList<Option>): Poll
|
||||
}
|
||||
class Topic{
|
||||
subject: String
|
||||
author: Teacher
|
||||
content: String
|
||||
answer(User, String): Answer
|
||||
lock(Boolean)
|
||||
}
|
||||
class Answer{
|
||||
author: User
|
||||
content: String
|
||||
anonymous: Boolean
|
||||
remove()
|
||||
}
|
||||
class Poll{
|
||||
options: ArrayList<Option>
|
||||
type: PollType
|
||||
answer(User, Option): Vote
|
||||
addOption(Option)
|
||||
}
|
||||
class Option{
|
||||
name: String
|
||||
}
|
||||
class Vote{
|
||||
voter: User
|
||||
}
|
||||
enum PollType {
|
||||
ALLOW_NEW_OPTIONS
|
||||
ALLOW_MULTIPLE_CHOICE
|
||||
}
|
||||
note "Change the behaviour of poll" as N
|
||||
|
||||
Forum *-l- Topic
|
||||
Topic *-l- Answer
|
||||
|
||||
Topic <|-d- Poll
|
||||
Poll *-l- Option
|
||||
Option "1..*" -d-x Vote
|
||||
Poll *-- Vote
|
||||
|
||||
Poll -- PollType
|
||||
PollType .r. N
|
||||
|
||||
}
|
||||
|
||||
package Appointments{
|
||||
class Appointment{
|
||||
date: Date
|
||||
teacher: Teacher
|
||||
student: Student
|
||||
{static} Appointment(Student, Teacher, Date)
|
||||
accept()
|
||||
refuse()
|
||||
propose(Date)
|
||||
export(): File
|
||||
}
|
||||
}
|
||||
|
||||
Appointments -[hidden]d- Messages
|
||||
@enduml
|
||||
@@ -3,6 +3,7 @@
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage{amsmath, amsfonts, amssymb, amsthm}
|
||||
\usepackage{dirtytalk}
|
||||
\usepackage{tikz}
|
||||
\usepackage{biblatex}
|
||||
|
||||
@@ -20,77 +21,74 @@
|
||||
\resizebox{345pt}{!}{
|
||||
\input{./use_case_messagerie.tex}
|
||||
}
|
||||
\caption{Use Case Diagram of the messaging extension}
|
||||
\caption{Use Case Diagram pour l'extension de messagerie}
|
||||
\label{fig:useCase:msg_ext}
|
||||
\end{figure}
|
||||
|
||||
In the diagram Figure~\ref{fig:useCase:msg_ext},
|
||||
the <<extend>> definition is not pulled from the "Genie logiciel" course
|
||||
of the University of Mons (UMONS). It is in fact the definition from
|
||||
the Dan Pilone's pocket reference \cite{Pilone2006-fn}.
|
||||
Dans le diagramme \ref{fig:useCase:msg_ext}, la définition du <<extend>> est tirée du livre:
|
||||
"uml Pocket reference" de Dan Pilone \cite{Pilone2006-fn}.
|
||||
|
||||
\say{Use case extension encapsulates a distinct flow of events
|
||||
that are not considered part of the normal or basic flow.
|
||||
They are not necessarily exceptional conditions.}
|
||||
|
||||
\subsection{Answer topic}
|
||||
|
||||
The user should be able to answer to a topic created by a teacher.
|
||||
This answer will depend on the type of topic. The answer could be a selection on a poll,
|
||||
a private answer (which mean that the answer is not visible to the other users except to the professor).
|
||||
The answer could finally be a basic answer to the topic and be visible to other users browsing the topic.
|
||||
L'utilisateur doit être capable de répondre à un topic crée par l'enseignant.
|
||||
Cette réponse va dépendre du type de topic. Elle peut être une réponse à un questionnaire,
|
||||
un message privé (qui ne serait pas visible par les autres utilisateur excepté l'enseignant) ou
|
||||
une simple réponse qui serait visible par tous.
|
||||
|
||||
\subsection{Create discutions}
|
||||
|
||||
The user can select multiple users and group them into a discussion.
|
||||
In this discussion, users will be able to exchange messages readable by
|
||||
every other members of the discussion
|
||||
L'utilisateur peut séléctionner plusieurs utilisateurs et les include dans un groupe de discussion.
|
||||
Dans cette discussion, les utilisateurs peuvent échanger des messages lisible par les autres membres du
|
||||
groupe
|
||||
|
||||
\subsubsection{Send messages}
|
||||
|
||||
Allow the creation of a message in a discussion.
|
||||
The text sent to others shall be received by other users
|
||||
and these users shall be notified of this message by the notification
|
||||
system.
|
||||
Permet la création d'un message dans une discusison.
|
||||
Ce message va être reçu par les autres utilisateur et ceux-ci vont être notifié
|
||||
du message par le système de notification
|
||||
|
||||
\subsection{Ask appointment}
|
||||
|
||||
A student can ask for an appointment to a teacher.
|
||||
In this request, the student will have to give a date, a time
|
||||
and a subject he want to propose to the teacher.
|
||||
Un étudiant peut demander un rendes-vous à un enseignant.
|
||||
Dans cette demande, l'étudiant doit donner une date qui lui convient pour ce rendez-vous
|
||||
ainsi qu'une raison à ce rendez-vous.
|
||||
|
||||
\subsubsection{Export to calendar}
|
||||
|
||||
When an appointment is made. The program can export the event
|
||||
to an open format that can be read by calendar software to add
|
||||
the event to the user's calendar.
|
||||
Quand un rendez-vous est crée, Le programme peut exporter l'événement dans un
|
||||
format libre qui pourra être lu par les programme de gestions de planning.
|
||||
|
||||
\subsection{Manage appointment}
|
||||
|
||||
When a teacher received an appointment, he is able to
|
||||
validate, deny or propose a new appointment schedule to the
|
||||
student.
|
||||
Quand un enseignant reçois une demande de rendez-vous,
|
||||
il a la possibilité de valider/refuser ou de proposer un nouveau rendez-vous
|
||||
à l'étudiant
|
||||
|
||||
\subsubsection{Propose new appointment}
|
||||
|
||||
If the teacher can't attend to an appointment because of his
|
||||
schedule, he can make a new time proposal and send it to
|
||||
the student. The student then receive a notification of
|
||||
the proposed modifications.
|
||||
Si l'enseignant n'est pas disponible pour le rendez-vous proposé,
|
||||
il peut alors proposer un nouveau créneau horaire et l'envoyer à l'étudiant.
|
||||
L'étudiant reçois alors une notification du nouveau créneau horaire.
|
||||
|
||||
\subsection{Create forum}
|
||||
|
||||
The teacher can create a new forum under a specific course
|
||||
The new forum will then make every student of this course
|
||||
follow the forum and its topic.
|
||||
L'enseignant peut créer un nouveau forum lié à un cours.
|
||||
Ce nouveau forum enregistrera les étudiant du cours automatiquement.
|
||||
|
||||
\subsubsection{Post topics}
|
||||
|
||||
The teacher can post a new topic inside a forum to let
|
||||
the student know of something specific or to ask a question to
|
||||
them.
|
||||
L'enseignant peut envoyer un topic dans un forum pour préciser quelque chose aux étudiants
|
||||
ou pour poser une questions
|
||||
|
||||
\subsubsection{Post poll}
|
||||
|
||||
When posting a topic to a forum, the teacher can choose to
|
||||
make the post as a poll. In that case, student will have to vote
|
||||
for one of the options or if allowed by the teacher, create a new option.
|
||||
Lors d'un post, il est possible de choisir de créer un questionnaire à choix multiples ou non.
|
||||
Dans ce cas, les étudiants vont devoir voter pour l'une des options proposée ou potentiellement
|
||||
crée une nouvelle option.
|
||||
|
||||
\printbibliography
|
||||
|
||||
|
||||
@@ -1,23 +1,19 @@
|
||||
@startuml
|
||||
note
|
||||
Appointment
|
||||
endnote
|
||||
mainframe Appointment
|
||||
start
|
||||
:Asking Apointment]
|
||||
:Asking Appointment]
|
||||
repeat
|
||||
if (accepted) is (yes) then
|
||||
:Export to calendar]
|
||||
stop
|
||||
else (no)
|
||||
:Propose new apointment]
|
||||
:Propose new appointment]
|
||||
endif
|
||||
|
||||
@enduml
|
||||
|
||||
@startuml
|
||||
note
|
||||
Messaging
|
||||
endnote
|
||||
mainframe Messaging
|
||||
start
|
||||
split
|
||||
:Create Discution]
|
||||
@@ -31,10 +27,7 @@ stop
|
||||
@enduml
|
||||
|
||||
@startuml
|
||||
note
|
||||
Forum
|
||||
endnote
|
||||
|
||||
mainframe Forum
|
||||
start
|
||||
:Forum Creation]
|
||||
|
||||
|
||||
@@ -5,14 +5,13 @@ left to right direction
|
||||
:Student: as s
|
||||
:Teacher: as t
|
||||
|
||||
|
||||
package "Messagerie"{
|
||||
|
||||
(Answer topics) as at
|
||||
(Ask appointement) as aa
|
||||
(Create Discution) as cd
|
||||
(Ask appointment) as aa
|
||||
(Create Discussion) as cd
|
||||
(Create Forum) as cf
|
||||
(Manage appointement) as ma
|
||||
(Manage appointment) as ma
|
||||
|
||||
s -- at
|
||||
s -- aa
|
||||
@@ -32,7 +31,7 @@ cf <-- pt : << include >>
|
||||
pt <|-- (Post poll)
|
||||
cd <-- (Send messages) : << include >>
|
||||
|
||||
ma <-- (Propose new appointment) : << exlude>> \n [refuse]
|
||||
ma <-- (Propose new appointment) : << extends >> \n [refuse]
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# Clyde project
|
||||
|
||||
## Signature
|
||||
|
||||
Projet du groupe 01:
|
||||
|
||||
- Debucquoy Anthony: Extension messagerie
|
||||
- Maxime Bartha: Extension publication scientifique
|
||||
- William Karpinski: Extension gestion des horaires
|
||||
- Léo Moulin: Extension inscription des étudiants
|
||||
|
||||
## Dévelopement
|
||||
|
||||
```
|
||||
$ ./gradlew backend:run frontend:run --parallel
|
||||
```
|
||||
|
||||
permet de lancer le frontend sur [http://localhost:5173](http://localhost:5173) ansi que le frontend sur [http://localhost:8080](http://localhost:8080)
|
||||
@@ -0,0 +1,39 @@
|
||||
HELP.md
|
||||
.gradle
|
||||
build/
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
bin/
|
||||
!**/src/main/**/bin/
|
||||
!**/src/test/**/bin/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
out/
|
||||
!**/src/main/**/out/
|
||||
!**/src/test/**/out/
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
/cdn
|
||||
@@ -0,0 +1,6 @@
|
||||
FROM eclipse-temurin:21-jdk-alpine
|
||||
VOLUME /tmp
|
||||
VOLUME /cdn
|
||||
ENV SPRING_PROFILES_ACTIVE=prod
|
||||
COPY build/libs/backend-0.0.1-SNAPSHOT.jar /app.jar
|
||||
ENTRYPOINT ["java", "-jar", "/app.jar"]
|
||||
@@ -0,0 +1,46 @@
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "3.2.2"
|
||||
id("io.spring.dependency-management") version "1.1.4"
|
||||
}
|
||||
|
||||
group = "ovh.herisson"
|
||||
version = "0.0.1-SNAPSHOT"
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_21
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("org.springframework.boot:spring-boot-starter-jdbc")
|
||||
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
|
||||
implementation("org.springframework.boot:spring-boot-starter-mail")
|
||||
implementation("org.springframework.boot:spring-boot-starter-web")
|
||||
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
|
||||
implementation("org.springframework.boot:spring-boot-starter-security")
|
||||
implementation("com.kohlschutter.junixsocket:junixsocket-core:2.9.0")
|
||||
// implementation("org.springframework.session:spring-session-jdbc")
|
||||
developmentOnly("org.springframework.boot:spring-boot-devtools")
|
||||
runtimeOnly("org.postgresql:postgresql")
|
||||
testImplementation("org.springframework.boot:spring-boot-starter-test")
|
||||
testImplementation("org.springframework.boot:spring-boot-testcontainers")
|
||||
testImplementation("org.testcontainers:junit-jupiter")
|
||||
testImplementation("org.testcontainers:postgresql")
|
||||
testImplementation("io.rest-assured:rest-assured")
|
||||
testImplementation("org.hamcrest:hamcrest")
|
||||
}
|
||||
|
||||
|
||||
tasks.register("run") {
|
||||
dependsOn(tasks.bootRun)
|
||||
}
|
||||
|
||||
|
||||
tasks.withType<Test> {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
services:
|
||||
postgres:
|
||||
image: 'postgres:latest'
|
||||
environment:
|
||||
- 'POSTGRES_DB=clyde'
|
||||
- 'POSTGRES_USER=devel'
|
||||
- 'POSTGRES_PASSWORD=devel'
|
||||
ports:
|
||||
- '5442:5432'
|
||||
@@ -0,0 +1,13 @@
|
||||
package ovh.herisson.Clyde;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
|
||||
|
||||
@SpringBootApplication(exclude = { SecurityAutoConfiguration.class })
|
||||
public class ClydeApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ClydeApplication.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package ovh.herisson.Clyde.EndPoints;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import ovh.herisson.Clyde.Services.AuthenticatorService;
|
||||
import ovh.herisson.Clyde.Tables.Applications;
|
||||
import ovh.herisson.Clyde.Tables.Role;
|
||||
import ovh.herisson.Clyde.Tables.User;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@RestController
|
||||
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
|
||||
public class ApplicationsController {
|
||||
|
||||
AuthenticatorService authServ;
|
||||
|
||||
public ApplicationsController(AuthenticatorService authServ){
|
||||
this.authServ = authServ;
|
||||
}
|
||||
|
||||
|
||||
/** return a list of authorized applications.
|
||||
* depends on the token
|
||||
*/
|
||||
@GetMapping("/apps")
|
||||
public ResponseEntity<Iterable<Applications>> getAuthorizedApps(@RequestHeader("Authorization") String token){
|
||||
return new ResponseEntity<>(getAuthorizedApplications(token), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/apps/{identifier}")
|
||||
public ResponseEntity<Boolean> getAppAuthorization(@PathVariable Applications identifier, @RequestHeader("Authorization") String token){
|
||||
|
||||
if (getAuthorizedApplications(token).contains(identifier)){
|
||||
return new ResponseEntity<>(true, HttpStatus.OK);
|
||||
}
|
||||
return new ResponseEntity<>(false, HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ArrayList<Applications> getAuthorizedApplications(String token){
|
||||
ArrayList<Applications> authorizedApps = new ArrayList<>();
|
||||
|
||||
//if unAuthed
|
||||
authorizedApps.add(Applications.Login);
|
||||
authorizedApps.add(Applications.Schedule);
|
||||
|
||||
User user = authServ.getUserFromToken(token);
|
||||
if(user == null)
|
||||
return authorizedApps;
|
||||
// if authed
|
||||
authorizedApps.add(Applications.Profile);
|
||||
|
||||
if (!authServ.isNotIn(new Role[]{Role.Teacher,Role.Student,Role.Admin},token)) {
|
||||
authorizedApps.add(Applications.Msg);
|
||||
authorizedApps.add(Applications.Forum);
|
||||
authorizedApps.add(Applications.Rdv);
|
||||
}
|
||||
|
||||
//if Teacher or Secretary or Admin add ManageCourses App
|
||||
if (!authServ.isNotIn(new Role[]{Role.Teacher,Role.Secretary,Role.Admin},token))
|
||||
authorizedApps.add(Applications.ManageCourses);
|
||||
|
||||
if (!authServ.isNotIn(new Role[]{Role.InscriptionService,Role.Admin},token)){
|
||||
authorizedApps.add(Applications.Inscription);
|
||||
authorizedApps.add(Applications.StudentsList);}
|
||||
|
||||
if (!authServ.isNotIn(new Role[]{Role.Secretary,Role.Admin},token)){
|
||||
authorizedApps.add(Applications.UsersList);}
|
||||
return authorizedApps;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
package ovh.herisson.Clyde.EndPoints;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
|
||||
import ovh.herisson.Clyde.Services.AuthenticatorService;
|
||||
import ovh.herisson.Clyde.Services.CourseService;
|
||||
import ovh.herisson.Clyde.Services.ProtectionService;
|
||||
import ovh.herisson.Clyde.Services.TeacherCourseService;
|
||||
import ovh.herisson.Clyde.Tables.Course;
|
||||
import ovh.herisson.Clyde.Tables.Role;
|
||||
import ovh.herisson.Clyde.Tables.User;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
|
||||
public class CourseController {
|
||||
|
||||
private final CourseService courseServ;
|
||||
|
||||
private final TeacherCourseService teacherCourseServ;
|
||||
|
||||
private final AuthenticatorService authServ;
|
||||
|
||||
public CourseController(CourseService courseServ, TeacherCourseService teacherCourseServ, AuthenticatorService authServ) {
|
||||
this.courseServ = courseServ;
|
||||
this.teacherCourseServ = teacherCourseServ;
|
||||
this.authServ = authServ;
|
||||
}
|
||||
|
||||
@GetMapping("/course/{id}")
|
||||
public ResponseEntity<HashMap<String,Object>> getCourse(@RequestHeader("Authorization") String token, @PathVariable long id){
|
||||
if (authServ.getUserFromToken(token) == null)
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
Course foundCourse = courseServ.findById(id);
|
||||
|
||||
if (foundCourse == null)
|
||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||
|
||||
return new ResponseEntity<>(ProtectionService.courseWithoutPassword(foundCourse), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/courses")
|
||||
public ResponseEntity<Iterable<HashMap<String,Object>>> getAllCourses(@RequestHeader("Authorization") String token){
|
||||
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token))
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
return new ResponseEntity<>(ProtectionService.coursesWithoutPasswords(courseServ.findAll()),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/courses/owned")
|
||||
public ResponseEntity<Iterable<HashMap<String ,Object>>> getOwnedCourses(@RequestHeader("Authorization") String token){
|
||||
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Teacher},token))
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
return new ResponseEntity<>(ProtectionService.coursesWithoutPasswords(courseServ.findOwnedCourses(authServ.getUserFromToken(token))),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/course/{id}/assistants")
|
||||
public ResponseEntity<Iterable<HashMap<String,Object>>> getCourseAssistants(@RequestHeader("Authorization")String token, @PathVariable long id){
|
||||
if (authServ.getUserFromToken(token) == null)
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
Iterable<User> assistants = teacherCourseServ.findCourseAssistants(courseServ.findById(id));
|
||||
|
||||
return new ResponseEntity<>(ProtectionService.usersWithoutPasswords(assistants),HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/course")
|
||||
public ResponseEntity<Map<String ,Object>> postCourse(@RequestHeader("Authorization") String token,
|
||||
@RequestBody Course course)
|
||||
{
|
||||
System.out.println(course);
|
||||
System.out.println(token);
|
||||
if (authServ.isNotIn(new Role[]{Role.Secretary,Role.Admin},token))
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
Course createdCourse = courseServ.save(course);
|
||||
if (createdCourse == null)
|
||||
return new ResponseEntity<>(null,HttpStatus.BAD_REQUEST);
|
||||
|
||||
return new ResponseEntity<>(ProtectionService.courseWithoutPassword(createdCourse), HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
|
||||
@PatchMapping("/course/{id}")
|
||||
public ResponseEntity<Course> patchCourse(@RequestHeader("Authorization") String token,
|
||||
@RequestBody Map<String,Object> updates,
|
||||
@PathVariable long id)
|
||||
{
|
||||
|
||||
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Teacher,Role.Secretary}, token))
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
|
||||
|
||||
if (!courseServ.modifyData(id, updates, authServ.getUserFromToken(token).getRole()))
|
||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/course/{id}")
|
||||
public ResponseEntity<String> postTeachers(@RequestHeader("Authorization") String token,
|
||||
@RequestBody Iterable<Long> teacherIds,
|
||||
@PathVariable Long id)
|
||||
{
|
||||
|
||||
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary}, token))
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
|
||||
if (!teacherCourseServ.saveAll(teacherIds,courseServ.findById(id)))
|
||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@DeleteMapping("course/{id}")
|
||||
public ResponseEntity<String> deleteUser(@RequestHeader("Authorization") String token, @PathVariable Long id){
|
||||
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary}, token))
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
Course toDelete = courseServ.findById(id);
|
||||
|
||||
if (toDelete == null)
|
||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||
|
||||
|
||||
courseServ.delete(courseServ.findById(id));
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package ovh.herisson.Clyde.EndPoints;
|
||||
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
|
||||
import ovh.herisson.Clyde.Services.*;
|
||||
import ovh.herisson.Clyde.Tables.Curriculum;
|
||||
import ovh.herisson.Clyde.Tables.Role;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
|
||||
public class CurriculumController {
|
||||
|
||||
|
||||
private final CurriculumService curriculumServ;
|
||||
private final AuthenticatorService authServ;
|
||||
|
||||
private final UserCurriculumService userCurriculumServ;
|
||||
private final CurriculumCourseService curriculumCourseServ;
|
||||
|
||||
public CurriculumController(CurriculumService curriculumServ, AuthenticatorService authServ, UserCurriculumService userCurriculumServ, CurriculumCourseService curriculumCourseServ){
|
||||
this.curriculumServ = curriculumServ;
|
||||
this.authServ = authServ;
|
||||
this.userCurriculumServ = userCurriculumServ;
|
||||
this.curriculumCourseServ = curriculumCourseServ;
|
||||
}
|
||||
|
||||
@GetMapping("/curriculum/{id}")
|
||||
public ResponseEntity<Map<String,Object>> findById(@PathVariable long id){
|
||||
Curriculum foundCurriculum = curriculumServ.findById(id);
|
||||
|
||||
if (foundCurriculum == null)
|
||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||
|
||||
return new ResponseEntity<>(curriculumCourseServ.getDepthCurriculum(foundCurriculum), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/curriculum")
|
||||
public ResponseEntity<Map<String ,Object>> findSelfCurriculum(@RequestHeader("Authorization") String token){
|
||||
if (authServ.getUserFromToken(token) == null)
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
Curriculum curriculum = userCurriculumServ.findByUser(authServ.getUserFromToken(token));
|
||||
|
||||
if (curriculum == null)
|
||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||
|
||||
return new ResponseEntity<>(curriculumCourseServ.getDepthCurriculum(curriculum),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/curriculums")
|
||||
public ResponseEntity<Iterable<Map<String, Object>>> findAllIndDepth(){
|
||||
return new ResponseEntity<>(curriculumCourseServ.getAllDepthCurriculum(),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/curriculum")
|
||||
public ResponseEntity<Curriculum> postCurriculum(@RequestHeader("Authorization") String token,@RequestBody Curriculum curriculum){
|
||||
|
||||
if (authServ.isNotIn(new Role[]{Role.Secretary,Role.Admin},token))
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
return new ResponseEntity<>(curriculumServ.save(curriculum),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PostMapping("/curriculum/{id}")
|
||||
public ResponseEntity<String> postCoursesToCurriculum(@RequestHeader("Authorization") String token,
|
||||
@RequestBody Iterable<Long> coursesIds,
|
||||
@PathVariable long id)
|
||||
{
|
||||
|
||||
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token))
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
if (!curriculumCourseServ.saveAll(coursesIds, curriculumServ.findById(id)))
|
||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@DeleteMapping("/curriculum/{id}")
|
||||
public ResponseEntity<String > deleteCurriculum(@RequestHeader("Authorization") String token, @PathVariable Long id){
|
||||
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary}, token))
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
Curriculum toDelete = curriculumServ.findById(id);
|
||||
|
||||
if (toDelete == null)
|
||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||
|
||||
curriculumServ.delete(toDelete);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package ovh.herisson.Clyde.EndPoints;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
|
||||
import ovh.herisson.Clyde.Services.AuthenticatorService;
|
||||
import ovh.herisson.Clyde.Services.InscriptionService;
|
||||
import ovh.herisson.Clyde.Services.ProtectionService;
|
||||
import ovh.herisson.Clyde.Tables.InscriptionRequest;
|
||||
import ovh.herisson.Clyde.Tables.RequestState;
|
||||
import ovh.herisson.Clyde.Tables.Role;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
|
||||
public class InscriptionController {
|
||||
|
||||
|
||||
private final InscriptionService inscriptionServ;
|
||||
private final AuthenticatorService authServ;
|
||||
|
||||
public InscriptionController(InscriptionService inscriptionServ, AuthenticatorService authServ){
|
||||
this.inscriptionServ = inscriptionServ;
|
||||
this.authServ = authServ;
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/requests/register")
|
||||
public ResponseEntity<Iterable<Map<String,Object>>> getAllRequests(@RequestHeader("Authorization") String token){
|
||||
|
||||
if (authServ.isNotIn(new Role[]{Role.Admin,Role.InscriptionService},token))
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
Iterable<InscriptionRequest> inscriptionRequests = inscriptionServ.getAll();
|
||||
|
||||
return new ResponseEntity<>(ProtectionService.requestsWithoutPasswords(inscriptionRequests), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/request/register/{id}")
|
||||
public ResponseEntity<Map<String,Object>> getById(@RequestHeader("Authorization") String token, @PathVariable long id){
|
||||
|
||||
if (authServ.isNotIn(new Role[]{Role.Admin,Role.InscriptionService},token))
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
InscriptionRequest foundInscriptionRequest = inscriptionServ.getById(id);
|
||||
|
||||
if (foundInscriptionRequest == null)
|
||||
return new ResponseEntity<>(null, HttpStatus.BAD_REQUEST);
|
||||
|
||||
return new ResponseEntity<>(ProtectionService.requestWithoutPassword(foundInscriptionRequest), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PatchMapping("/request/register/{id}")
|
||||
public ResponseEntity<InscriptionRequest> changeRequestState(@PathVariable long id,
|
||||
@RequestHeader("Authorization") String token,
|
||||
@RequestBody RequestState state)
|
||||
{
|
||||
if (authServ.isNotIn(new Role[]{Role.InscriptionService,Role.Admin},token))
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
if (!inscriptionServ.modifyState(id, state))
|
||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
@DeleteMapping("/request/register/{id}")
|
||||
public ResponseEntity<String > deleteRequest(@RequestHeader("Authorization") String token, @PathVariable Long id){
|
||||
if (authServ.isNotIn(new Role[]{Role.Admin,Role.InscriptionService}, token))
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
InscriptionRequest toDelete = inscriptionServ.getById(id);
|
||||
|
||||
if (toDelete == null)
|
||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||
|
||||
inscriptionServ.delete(toDelete);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package ovh.herisson.Clyde.EndPoints;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
|
||||
import ovh.herisson.Clyde.Services.AuthenticatorService;
|
||||
import ovh.herisson.Clyde.Services.ProtectionService;
|
||||
import ovh.herisson.Clyde.Tables.InscriptionRequest;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
|
||||
public class LoginController {
|
||||
private final AuthenticatorService authServ;
|
||||
|
||||
static public class RequestLogin{
|
||||
private final String identifier;
|
||||
private final String password;
|
||||
@JsonFormat(pattern="yyyy-MM-dd'T'HH:mm:ss")
|
||||
private final Date expirationDate;
|
||||
public RequestLogin(String identifier, String password, Date expirationDate){
|
||||
this.identifier = identifier;
|
||||
this.password = password;
|
||||
this.expirationDate = expirationDate;
|
||||
}
|
||||
}
|
||||
|
||||
public LoginController(AuthenticatorService authServ){
|
||||
this.authServ = authServ;
|
||||
}
|
||||
|
||||
@PostMapping(value = "/login")
|
||||
public ResponseEntity<String> login(@RequestBody RequestLogin requestLogin){
|
||||
|
||||
String sessionToken = authServ.login(requestLogin.identifier,requestLogin.password,requestLogin.expirationDate);
|
||||
if (sessionToken == null){
|
||||
return new UnauthorizedResponse<>("Identifier or Password incorrect");
|
||||
}
|
||||
|
||||
HttpHeaders responseHeaders = new HttpHeaders();
|
||||
responseHeaders.set("Set-Cookie",String.format("session_token=%s",sessionToken));
|
||||
return ResponseEntity.ok().headers(responseHeaders).build();
|
||||
}
|
||||
|
||||
@PostMapping("/register")
|
||||
public ResponseEntity<Map<String,Object>> register(@RequestBody InscriptionRequest inscriptionRequest){
|
||||
|
||||
InscriptionRequest returnedInscriptionRequest = authServ.register(inscriptionRequest);
|
||||
|
||||
return new ResponseEntity<>(ProtectionService.requestWithoutPassword(returnedInscriptionRequest), HttpStatus.CREATED);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package ovh.herisson.Clyde.EndPoints;
|
||||
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import ovh.herisson.Clyde.Repositories.TokenRepository;
|
||||
import ovh.herisson.Clyde.Repositories.UserRepository;
|
||||
import ovh.herisson.Clyde.Services.*;
|
||||
import ovh.herisson.Clyde.Tables.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
|
||||
@RestController
|
||||
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
|
||||
|
||||
public class MockController {
|
||||
private final BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
|
||||
|
||||
public final UserRepository userRepo;
|
||||
public final TokenRepository tokenRepo;
|
||||
public final TokenService tokenService;
|
||||
public final CurriculumCourseService CurriculumCourseService;
|
||||
public final CurriculumService curriculumService;
|
||||
public final CourseService courseService;
|
||||
|
||||
public final InscriptionService inscriptionService;
|
||||
ArrayList<User> mockUsers;
|
||||
|
||||
|
||||
public MockController(UserRepository userRepo, TokenRepository tokenRepo, TokenService tokenService, CurriculumCourseService CurriculumCourseService, CurriculumService curriculumService, CourseService courseService, InscriptionService inscriptionService){
|
||||
this.tokenRepo = tokenRepo;
|
||||
this.userRepo = userRepo;
|
||||
this.tokenService = tokenService;
|
||||
this.CurriculumCourseService = CurriculumCourseService;
|
||||
this.curriculumService = curriculumService;
|
||||
this.courseService = courseService;
|
||||
this.inscriptionService = inscriptionService;
|
||||
}
|
||||
|
||||
/** Saves an example of each user type by :
|
||||
* email : FooRole@FooRole.com, password : FooRole and token : FooRole
|
||||
* For example the admin as "admin@admin.com" as email and "admin" as both password and token
|
||||
* They all have silly names
|
||||
*/
|
||||
|
||||
@PostMapping("/mock")
|
||||
public void postMock(){
|
||||
|
||||
// user part
|
||||
|
||||
|
||||
User herobrine = new User("brine","hero","admin@admin.com","behind","ShadowsLand",new Date(0), null,Role.Admin,passwordEncoder.encode("admin"));
|
||||
User joe = new User("Mama","Joe","student@student.com","roundabout","England",new Date(0), null,Role.Student,passwordEncoder.encode("student"));
|
||||
User meh = new User("Polo","Marco","secretary@secretary.com","a Box","Monaco",new Date(0), null,Role.Secretary,passwordEncoder.encode("secretary"));
|
||||
User joke = new User("Gaillard","Corentin","teacher@teacher.com","lab","faculty",new Date(0), null,Role.Teacher,passwordEncoder.encode("teacher"));
|
||||
User jojo = new User("Bridoux","Justin","teacher2@teacher2.com","lab","faculty",new Date(0), null,Role.Teacher,passwordEncoder.encode("teacher"));
|
||||
User lena = new User("Louille","Lena","inscriptionService@InscriptionService.com","no","yes",new Date(0), null,Role.InscriptionService,passwordEncoder.encode("inscriptionService"));
|
||||
mockUsers = new ArrayList<>(Arrays.asList(herobrine,joe,meh,joke,lena,jojo));
|
||||
|
||||
userRepo.saveAll(mockUsers);
|
||||
|
||||
// Course / Curriculum part
|
||||
|
||||
Curriculum infoBab1 = new Curriculum(1,"info");
|
||||
Curriculum chemistryBab1 = new Curriculum(1,"chemistry");
|
||||
Curriculum psychologyBab1 = new Curriculum(1,"psychology");
|
||||
|
||||
curriculumService.save(infoBab1);
|
||||
curriculumService.save(chemistryBab1);
|
||||
curriculumService.save(psychologyBab1);
|
||||
|
||||
|
||||
Course progra1 = new Course(5,"Programmation et algorithmique 1",joke);
|
||||
Course chemistry1 = new Course(12, "Thermochimie",joke);
|
||||
Course psycho1 = new Course(21, "Neuroreaction of isolated brain cells",joke);
|
||||
Course commun = new Course(2, "cours commun",joke);
|
||||
|
||||
courseService.save(progra1);
|
||||
courseService.save(chemistry1);
|
||||
courseService.save(psycho1);
|
||||
courseService.save(commun);
|
||||
|
||||
|
||||
CurriculumCourseService.save(new CurriculumCourse(infoBab1,progra1));
|
||||
CurriculumCourseService.save(new CurriculumCourse(infoBab1,commun));
|
||||
|
||||
CurriculumCourseService.save(new CurriculumCourse(psychologyBab1,psycho1));
|
||||
CurriculumCourseService.save(new CurriculumCourse(psychologyBab1,commun));
|
||||
|
||||
|
||||
CurriculumCourseService.save(new CurriculumCourse(chemistryBab1,commun));
|
||||
CurriculumCourseService.save(new CurriculumCourse(chemistryBab1,chemistry1));
|
||||
|
||||
|
||||
InscriptionRequest inscriptionRequest = new InscriptionRequest("helen","prenom","non","helen@gmail.com","america",new Date(),(long) 1,RequestState.Pending,"yes.png","password");
|
||||
|
||||
inscriptionService.save(inscriptionRequest);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package ovh.herisson.Clyde.EndPoints;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import ovh.herisson.Clyde.Responses.PingResponse;
|
||||
|
||||
@RestController
|
||||
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
|
||||
public class PingController {
|
||||
|
||||
@GetMapping("/ping")
|
||||
public PingResponse ping(){
|
||||
return new PingResponse(1, "pong");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package ovh.herisson.Clyde.EndPoints;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import ovh.herisson.Clyde.Services.StorageService;
|
||||
import ovh.herisson.Clyde.Tables.FileType;
|
||||
import ovh.herisson.Clyde.Tables.StorageFile;
|
||||
|
||||
@RestController
|
||||
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
|
||||
public class StorageController {
|
||||
private final StorageService storageServ;
|
||||
|
||||
public StorageController(StorageService storageServ){
|
||||
this.storageServ= storageServ;
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/upload/{fileType}")
|
||||
public ResponseEntity<StorageFile> handleFileUpload(@RequestParam("file") MultipartFile file, @PathVariable FileType fileType) {
|
||||
|
||||
StorageFile fileEntry;
|
||||
try {
|
||||
fileEntry = storageServ.store(file,fileType);
|
||||
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
return new ResponseEntity<>(null,HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
||||
|
||||
return new ResponseEntity<>(fileEntry, HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package ovh.herisson.Clyde.EndPoints;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
|
||||
import ovh.herisson.Clyde.Services.AuthenticatorService;
|
||||
import ovh.herisson.Clyde.Services.TokenService;
|
||||
import ovh.herisson.Clyde.Tables.Role;
|
||||
import ovh.herisson.Clyde.Tables.Token;
|
||||
|
||||
@RestController
|
||||
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
|
||||
public class TokenController {
|
||||
|
||||
private final TokenService tokenServ;
|
||||
|
||||
private final AuthenticatorService authServ;
|
||||
|
||||
public TokenController(TokenService tokenServ, AuthenticatorService authServ){
|
||||
this.tokenServ = tokenServ;
|
||||
this.authServ = authServ;
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/tokens")
|
||||
public ResponseEntity<Iterable<Token>> getTokens(@RequestHeader("Authorization")String token){
|
||||
|
||||
if (authServ.isNotIn(new Role[]{Role.Admin},token))
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
return new ResponseEntity<>(tokenServ.getAllTokens(), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package ovh.herisson.Clyde.EndPoints;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
|
||||
import ovh.herisson.Clyde.Services.AuthenticatorService;
|
||||
import ovh.herisson.Clyde.Services.ProtectionService;
|
||||
import ovh.herisson.Clyde.Services.UserService;
|
||||
import ovh.herisson.Clyde.Tables.Role;
|
||||
import ovh.herisson.Clyde.Tables.User;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@RestController
|
||||
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
|
||||
public class UserController {
|
||||
|
||||
private final UserService userService;
|
||||
private final AuthenticatorService authServ;
|
||||
public UserController(UserService userService, AuthenticatorService authServ){
|
||||
this.userService = userService;
|
||||
this.authServ = authServ;
|
||||
}
|
||||
|
||||
/** returns information about the connected user
|
||||
*
|
||||
* @param token the session token of the user
|
||||
* @return the user information except his password
|
||||
*/
|
||||
@GetMapping("/user")
|
||||
public ResponseEntity<HashMap<String,Object>> getUser(@RequestHeader("Authorization") String token){
|
||||
|
||||
User user = authServ.getUserFromToken(token);
|
||||
if (user == null) return new UnauthorizedResponse<>(null);
|
||||
|
||||
return new ResponseEntity<>(ProtectionService.userWithoutPassword(user), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/user/{id}")
|
||||
public ResponseEntity<HashMap<String ,Object>> getUserById(@RequestHeader("Authorization") String token, @PathVariable Long id){
|
||||
|
||||
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary,Role.InscriptionService},token))
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
return new ResponseEntity<>(ProtectionService.userWithoutPassword(userService.getUserById(id)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/user")
|
||||
public ResponseEntity<Map<String ,Object>> postUser(@RequestBody User user,@RequestHeader("Authorization") String token){
|
||||
|
||||
if (authServ.isNotIn(new Role[]{Role.Admin,Role.InscriptionService,Role.Secretary},token))
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
return new ResponseEntity<>(ProtectionService.userWithoutPassword(userService.save(user)),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@GetMapping("/users")
|
||||
public ResponseEntity<Iterable<HashMap<String,Object>>> getAllUsers(@RequestHeader("Authorization") String token){
|
||||
|
||||
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token))
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
Role posterRole = authServ.getUserFromToken(token).getRole();
|
||||
|
||||
Iterable<User> users = new ArrayList<>();
|
||||
|
||||
if (posterRole == Role.Admin)
|
||||
users = userService.getAll();
|
||||
|
||||
else if (posterRole == Role.Secretary)
|
||||
users = userService.getAllExceptAdmins();
|
||||
|
||||
return new ResponseEntity<>(ProtectionService.usersWithoutPasswords(users), HttpStatus.OK);
|
||||
}
|
||||
|
||||
/** changes the specified user's information
|
||||
*
|
||||
* @param updates the changes to be made
|
||||
* @param token the session token of the user posting the change
|
||||
* @param id the id of the user to change
|
||||
* @return a string clarifying the issue (if there is any)
|
||||
*/
|
||||
@PatchMapping("/user/{id}")
|
||||
public ResponseEntity<String> patchUser(@RequestHeader("Authorization") String token,
|
||||
@RequestBody Map<String,Object> updates,
|
||||
@PathVariable Long id) {
|
||||
|
||||
if (token == null) return new UnauthorizedResponse<>(null);
|
||||
|
||||
User poster = authServ.getUserFromToken(token);
|
||||
if (poster == null) {return new UnauthorizedResponse<>("bad token");}
|
||||
|
||||
if (!userService.modifyData(id, updates, poster))
|
||||
return new UnauthorizedResponse<>("there was an issue with the updates requested");
|
||||
|
||||
return new ResponseEntity<>(null, HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/teachers")
|
||||
public ResponseEntity<Iterable<HashMap<String,Object>>> getAllTeachers(@RequestHeader("Authorization") String token){
|
||||
if (authServ.getUserFromToken(token) == null)
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
Iterable<User> teachers = userService.getAllTeachers();
|
||||
|
||||
return new ResponseEntity<>(ProtectionService.usersWithoutPasswords(teachers), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/students")
|
||||
public ResponseEntity<Iterable<HashMap<String,Object>>> getAllStudent(@RequestHeader("Authorization") String token){
|
||||
if (authServ.getUserFromToken(token) == null)
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
Iterable<User> students = userService.getAllStudents();
|
||||
|
||||
return new ResponseEntity<>(ProtectionService.usersWithoutPasswords(students), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@DeleteMapping("/user/{id}")
|
||||
public ResponseEntity<String> deleteStudent(@RequestHeader("Authorization") String token, @PathVariable Long id){
|
||||
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token) && !id.equals(authServ.getUserFromToken(token).getRegNo()))
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
User toDelete = userService.getUserById(id);
|
||||
|
||||
if (toDelete == null)
|
||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||
|
||||
userService.delete(toDelete);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package ovh.herisson.Clyde;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
import org.springframework.jdbc.datasource.DriverManagerDataSource;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
@Configuration
|
||||
@EnableScheduling
|
||||
public class JdbcConfig {
|
||||
|
||||
@Bean
|
||||
@Profile("!prod")
|
||||
public DataSource psqlSource(){
|
||||
DriverManagerDataSource source = new DriverManagerDataSource();
|
||||
source.setDriverClassName("org.postgresql.Driver");
|
||||
source.setUrl("jdbc:postgresql://localhost:5442/clyde");
|
||||
source.setUsername("devel");
|
||||
source.setPassword("devel");
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Profile("prod")
|
||||
public DataSource psqlSourceProd(){
|
||||
DriverManagerDataSource source = new DriverManagerDataSource();
|
||||
source.setDriverClassName("org.postgresql.Driver");
|
||||
source.setUrl("jdbc:postgresql:clyde?socketFactory=org.newsclub.net.unix.AFUNIXSocketFactory$FactoryArg&socketFactoryArg=/var/run/postgresql/.s.PGSQL.5432");
|
||||
source.setUsername("clyde");
|
||||
|
||||
return source;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package ovh.herisson.Clyde.Repositories;
|
||||
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import ovh.herisson.Clyde.Tables.Course;
|
||||
import ovh.herisson.Clyde.Tables.User;
|
||||
|
||||
public interface CourseRepository extends CrudRepository<Course,Long> {
|
||||
Course findById(long id);
|
||||
|
||||
|
||||
@Query("select c from Course c where c.owner = ?1")
|
||||
Iterable<Course> findAllOwnedCoures(User teacher);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package ovh.herisson.Clyde.Repositories;
|
||||
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import ovh.herisson.Clyde.Tables.Course;
|
||||
import ovh.herisson.Clyde.Tables.Curriculum;
|
||||
import ovh.herisson.Clyde.Tables.CurriculumCourse;
|
||||
|
||||
public interface CurriculumCourseRepository extends CrudRepository<CurriculumCourse,Long> {
|
||||
|
||||
@Query("select distinct cc.course from CurriculumCourse cc where cc.curriculum = ?1")
|
||||
Iterable<Course> findCoursesByCurriculum(Curriculum curriculum);
|
||||
|
||||
|
||||
@Query("select distinct cc.curriculum from CurriculumCourse cc")
|
||||
Iterable<Curriculum> findDistinctCurriculums();
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package ovh.herisson.Clyde.Repositories;
|
||||
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import ovh.herisson.Clyde.Tables.Curriculum;
|
||||
|
||||
public interface CurriculumRepository extends CrudRepository<Curriculum,Long> {
|
||||
Curriculum findById(long id);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package ovh.herisson.Clyde.Repositories;
|
||||
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
|
||||
import ovh.herisson.Clyde.Tables.StorageFile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
public interface FileRepository extends CrudRepository<StorageFile,Long> {
|
||||
public StorageFile getStorageFileByName(String name);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package ovh.herisson.Clyde.Repositories;
|
||||
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import ovh.herisson.Clyde.Tables.InscriptionRequest;
|
||||
|
||||
|
||||
public interface InscriptionRepository extends CrudRepository<InscriptionRequest,Long> {
|
||||
|
||||
InscriptionRequest findById(long aLong);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package ovh.herisson.Clyde.Repositories;
|
||||
|
||||
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import ovh.herisson.Clyde.Tables.Course;
|
||||
import ovh.herisson.Clyde.Tables.TeacherCourse;
|
||||
import ovh.herisson.Clyde.Tables.User;
|
||||
|
||||
public interface TeacherCourseRepository extends CrudRepository<TeacherCourse, Long> {
|
||||
|
||||
@Query("select tc.user from TeacherCourse tc where tc.course = ?1")
|
||||
Iterable<User> findAllAssistantOfCourse(Course course);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package ovh.herisson.Clyde.Repositories;
|
||||
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import ovh.herisson.Clyde.Tables.Token;
|
||||
import ovh.herisson.Clyde.Tables.User;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public interface TokenRepository extends CrudRepository<Token,Long> {
|
||||
|
||||
Token getByToken(String token);
|
||||
|
||||
ArrayList <Token> getByUserOrderByExpirationDate(User user);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package ovh.herisson.Clyde.Repositories;
|
||||
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import ovh.herisson.Clyde.Tables.Curriculum;
|
||||
import ovh.herisson.Clyde.Tables.User;
|
||||
import ovh.herisson.Clyde.Tables.UserCurriculum;
|
||||
|
||||
public interface UserCurriculumRepository extends CrudRepository<UserCurriculum, Long> {
|
||||
|
||||
@Query("select uc.curriculum from UserCurriculum uc where uc.user = ?1")
|
||||
Curriculum findByUser(User student);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package ovh.herisson.Clyde.Repositories;
|
||||
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import ovh.herisson.Clyde.Tables.User;
|
||||
|
||||
public interface UserRepository extends CrudRepository<User, Long> {
|
||||
|
||||
User findById(long id);
|
||||
|
||||
User findByEmail(String email);
|
||||
|
||||
|
||||
|
||||
@Query("select u from User u where u.role = ovh.herisson.Clyde.Tables.Role.Teacher")
|
||||
Iterable<User> findAllTeachers();
|
||||
|
||||
@Query("select u from User u where u.role = ovh.herisson.Clyde.Tables.Role.Student")
|
||||
Iterable<User> findAllStudents();
|
||||
|
||||
@Query("select u from User u where u.role <> ovh.herisson.Clyde.Tables.Role.Admin")
|
||||
Iterable<User> findAllExceptAdmins();
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package ovh.herisson.Clyde.Responses;
|
||||
|
||||
public record PingResponse(int id, String txt){};
|
||||
@@ -0,0 +1,12 @@
|
||||
package ovh.herisson.Clyde.Responses;
|
||||
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
||||
|
||||
public class UnauthorizedResponse<T> extends ResponseEntity<T> {
|
||||
public UnauthorizedResponse(T message) {
|
||||
super(message,HttpStatus.UNAUTHORIZED);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package ovh.herisson.Clyde.Services;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import ovh.herisson.Clyde.Tables.*;
|
||||
import java.util.Date;
|
||||
|
||||
@Service
|
||||
public class AuthenticatorService {
|
||||
|
||||
private final TokenService tokenService;
|
||||
private final UserService userService;
|
||||
private final InscriptionService inscriptionService;
|
||||
|
||||
public AuthenticatorService(TokenService tokenService, UserService userService, InscriptionService inscriptionService){
|
||||
this.tokenService = tokenService;
|
||||
this.userService = userService;
|
||||
this.inscriptionService = inscriptionService;
|
||||
}
|
||||
|
||||
public User getUserFromToken(String token){
|
||||
return tokenService.getUserFromToken(token);
|
||||
}
|
||||
|
||||
|
||||
public String login(String identifier, String password, Date expirationDate){
|
||||
User user = userService.getUser(identifier);
|
||||
if (user == null){return null;}
|
||||
if (!userService.checkPassword(user,password)){return null;}
|
||||
String token = tokenService.generateNewToken();
|
||||
tokenService.saveToken(new Token(user, token,expirationDate));
|
||||
return token;
|
||||
}
|
||||
|
||||
public InscriptionRequest register(InscriptionRequest inscriptionRequest) {
|
||||
inscriptionRequest.setState(RequestState.Pending);
|
||||
return inscriptionService.save(inscriptionRequest);
|
||||
}
|
||||
|
||||
public boolean isNotIn(Role[] roles, String token){
|
||||
if (token == null)
|
||||
return true;
|
||||
|
||||
User poster = getUserFromToken(token);
|
||||
if (poster == null) return true;
|
||||
|
||||
for (Role r:roles){
|
||||
if (poster.getRole() == r)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
package ovh.herisson.Clyde.Services;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import ovh.herisson.Clyde.Repositories.CourseRepository;
|
||||
import ovh.herisson.Clyde.Tables.Course;
|
||||
import ovh.herisson.Clyde.Tables.Role;
|
||||
import ovh.herisson.Clyde.Tables.User;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class CourseService {
|
||||
|
||||
private final CourseRepository courseRepo;
|
||||
|
||||
public CourseService(CourseRepository courseRepo) {
|
||||
this.courseRepo = courseRepo;
|
||||
}
|
||||
|
||||
public Course save(Course course){
|
||||
if (course.getOwner().getRole() != Role.Teacher)
|
||||
return null;
|
||||
return courseRepo.save(course);
|
||||
}
|
||||
|
||||
public Course findById(long id){
|
||||
return courseRepo.findById(id);
|
||||
}
|
||||
|
||||
|
||||
public Iterable<Course> findAll() {
|
||||
return courseRepo.findAll();
|
||||
}
|
||||
|
||||
|
||||
public Iterable<Course> findOwnedCourses(User userFromToken) {
|
||||
return courseRepo.findAllOwnedCoures(userFromToken);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public boolean modifyData(long id, Map<String, Object> updates, Role role) {
|
||||
Course target = courseRepo.findById(id);
|
||||
|
||||
if (target == null)
|
||||
return false;
|
||||
|
||||
if (role == Role.Teacher){
|
||||
for (Map.Entry<String, Object> entry : updates.entrySet()){
|
||||
if (entry.getKey().equals("title")){
|
||||
target.setTitle((String) entry.getValue());
|
||||
courseRepo.save(target);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (role != Role.Secretary)
|
||||
return false;
|
||||
|
||||
for (Map.Entry<String ,Object> entry: updates.entrySet()){
|
||||
switch (entry.getKey()){
|
||||
case "title":
|
||||
target.setTitle((String) entry.getValue());
|
||||
break;
|
||||
case "credits":
|
||||
target.setCredits((Integer) entry.getValue());
|
||||
break;
|
||||
case "owner":
|
||||
if (((User) entry.getValue() ).getRole() != Role.Teacher)
|
||||
break;
|
||||
|
||||
target.setOwner((User) entry.getValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
courseRepo.save(target);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void delete(Course course) {
|
||||
courseRepo.delete(course);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package ovh.herisson.Clyde.Services;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import ovh.herisson.Clyde.Repositories.CourseRepository;
|
||||
import ovh.herisson.Clyde.Repositories.CurriculumCourseRepository;
|
||||
import ovh.herisson.Clyde.Repositories.CurriculumRepository;
|
||||
import ovh.herisson.Clyde.Tables.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class CurriculumCourseService {
|
||||
|
||||
private final CurriculumCourseRepository curriculumCourseRepo;
|
||||
|
||||
private final CourseRepository courseRepo;
|
||||
|
||||
private final CurriculumRepository curriculumRepo;
|
||||
|
||||
public CurriculumCourseService(CurriculumCourseRepository curriculumCourseRepository, CourseRepository courseRepo, CurriculumRepository curriculumRepo) {
|
||||
this.curriculumCourseRepo = curriculumCourseRepository;
|
||||
this.courseRepo = courseRepo;
|
||||
this.curriculumRepo = curriculumRepo;
|
||||
}
|
||||
|
||||
public void save(CurriculumCourse curriculumCourse){
|
||||
curriculumCourseRepo.save(curriculumCourse);
|
||||
}
|
||||
|
||||
|
||||
public Map<String, Object> getDepthCurriculum(Curriculum curriculum){
|
||||
|
||||
if (curriculum == null)
|
||||
return null;
|
||||
|
||||
HashMap<String ,Object> toReturn = new HashMap<>();
|
||||
ArrayList<Map<String ,Object>> courses = new ArrayList<>();
|
||||
Iterable<Course> foundCourses = curriculumCourseRepo.findCoursesByCurriculum(curriculum);
|
||||
|
||||
for (Course c: foundCourses){
|
||||
courses.add(ProtectionService.courseWithoutPassword(c));
|
||||
}
|
||||
toReturn.put("courses",courses);
|
||||
toReturn.put("curriculumId", curriculum.getCurriculumId());
|
||||
toReturn.put("year", curriculum.getYear());
|
||||
toReturn.put("option", curriculum.getOption());
|
||||
|
||||
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
public Iterable<Map<String, Object>> getAllDepthCurriculum(){
|
||||
|
||||
ArrayList<Map<String,Object>> toReturn = new ArrayList<>();
|
||||
|
||||
for (Curriculum curriculum : curriculumRepo.findAll()){
|
||||
toReturn.add(getDepthCurriculum(curriculum));
|
||||
}
|
||||
|
||||
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
/** tries to add all courses to the curriculum
|
||||
*
|
||||
* @param coursesIds the ids of the courses to be added
|
||||
* @param curriculum the curriculum to add the courses to
|
||||
* @return if the changes were made
|
||||
*/
|
||||
public boolean saveAll(Iterable<Long> coursesIds, Curriculum curriculum) {
|
||||
|
||||
if (curriculum == null || coursesIds == null)
|
||||
return false;
|
||||
|
||||
ArrayList<Course> toAdd = new ArrayList<>();
|
||||
for (Long courseId : coursesIds){
|
||||
|
||||
Course course = courseRepo.findById((long) courseId);
|
||||
if (course == null)
|
||||
return false;
|
||||
|
||||
if (!toAdd.contains(course))
|
||||
toAdd.add(course);
|
||||
}
|
||||
|
||||
for (Course course : toAdd){
|
||||
curriculumCourseRepo.save(new CurriculumCourse(curriculum,course));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package ovh.herisson.Clyde.Services;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import ovh.herisson.Clyde.Repositories.CurriculumRepository;
|
||||
import ovh.herisson.Clyde.Tables.Curriculum;
|
||||
|
||||
@Service
|
||||
public class CurriculumService {
|
||||
|
||||
private final CurriculumRepository curriculumRepo;
|
||||
|
||||
public CurriculumService(CurriculumRepository curriculumRepo){
|
||||
this.curriculumRepo = curriculumRepo;
|
||||
}
|
||||
public Curriculum save(Curriculum curriculum){
|
||||
return curriculumRepo.save(curriculum);
|
||||
}
|
||||
public Curriculum findById(long id){
|
||||
return curriculumRepo.findById(id);
|
||||
}
|
||||
|
||||
public void delete(Curriculum curriculum) {
|
||||
curriculumRepo.delete(curriculum);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package ovh.herisson.Clyde.Services;
|
||||
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import ovh.herisson.Clyde.Repositories.CurriculumRepository;
|
||||
import ovh.herisson.Clyde.Repositories.InscriptionRepository;
|
||||
import ovh.herisson.Clyde.Repositories.UserCurriculumRepository;
|
||||
import ovh.herisson.Clyde.Repositories.UserRepository;
|
||||
import ovh.herisson.Clyde.Tables.InscriptionRequest;
|
||||
import ovh.herisson.Clyde.Tables.RequestState;
|
||||
import ovh.herisson.Clyde.Tables.User;
|
||||
import ovh.herisson.Clyde.Tables.UserCurriculum;
|
||||
|
||||
@Service
|
||||
public class InscriptionService {
|
||||
|
||||
private final InscriptionRepository inscriptionRepo;
|
||||
|
||||
private final UserRepository userRepo;
|
||||
|
||||
private final UserCurriculumRepository userCurriculumRepo;
|
||||
|
||||
private final CurriculumRepository curriculumRepo;
|
||||
|
||||
private final BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
|
||||
|
||||
|
||||
public InscriptionService(InscriptionRepository inscriptionRepo, UserRepository userRepo, UserCurriculumRepository userCurriculumRepo, CurriculumRepository curriculumRepo){
|
||||
this.inscriptionRepo = inscriptionRepo;
|
||||
this.userRepo = userRepo;
|
||||
this.userCurriculumRepo = userCurriculumRepo;
|
||||
this.curriculumRepo = curriculumRepo;
|
||||
}
|
||||
|
||||
public InscriptionRequest save(InscriptionRequest inscriptionRequest){
|
||||
inscriptionRequest.setPassword(passwordEncoder.encode(inscriptionRequest.getPassword()));
|
||||
return inscriptionRepo.save(inscriptionRequest);
|
||||
}
|
||||
|
||||
public InscriptionRequest getById(long id){
|
||||
return inscriptionRepo.findById(id);
|
||||
}
|
||||
|
||||
public Iterable<InscriptionRequest> getAll(){
|
||||
return inscriptionRepo.findAll();
|
||||
}
|
||||
|
||||
public boolean modifyState(long id, RequestState requestState) {
|
||||
InscriptionRequest inscrRequest = getById(id);
|
||||
|
||||
if (inscrRequest == null)
|
||||
return false;
|
||||
|
||||
// if th state is the same we don't send an email
|
||||
if (requestState == inscrRequest.getState())
|
||||
return false;
|
||||
|
||||
/** todo send an email to tell the poster of the inscrRequest (inscrRequest.getEmail())
|
||||
* to notify them that the state of their request changed
|
||||
* FooEmailFormat toSend = (String.format("Your request state changed from %s to %s"),
|
||||
* inscrRequest.getState(), requestState)
|
||||
* FooEmailSender.send(toSend, inscrRequest.getEmail())
|
||||
*/
|
||||
|
||||
|
||||
//saves the user from the request if accepted
|
||||
if (requestState == RequestState.Accepted)
|
||||
{
|
||||
if (curriculumRepo.findById(inscrRequest.getCurriculumId()) == null)
|
||||
return false;
|
||||
|
||||
User userFromRequest = new User(
|
||||
inscrRequest.getLastName(),
|
||||
inscrRequest.getFirstName(),
|
||||
inscrRequest.getEmail(),
|
||||
inscrRequest.getAddress(),
|
||||
inscrRequest.getCountry(),
|
||||
inscrRequest.getBirthDate(),
|
||||
inscrRequest.getProfilePicture(),
|
||||
inscrRequest.getPassword()
|
||||
);
|
||||
|
||||
userRepo.save(userFromRequest);
|
||||
userCurriculumRepo.save(new UserCurriculum(userFromRequest, curriculumRepo.findById(inscrRequest.getCurriculumId())));
|
||||
}
|
||||
inscrRequest.setState(requestState);
|
||||
save(inscrRequest);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void delete(InscriptionRequest toDelete) {
|
||||
inscriptionRepo.delete(toDelete);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package ovh.herisson.Clyde.Services;
|
||||
|
||||
import ovh.herisson.Clyde.Tables.Course;
|
||||
import ovh.herisson.Clyde.Tables.InscriptionRequest;
|
||||
import ovh.herisson.Clyde.Tables.User;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class ProtectionService {
|
||||
|
||||
/** return user's data except password
|
||||
* @param user the user to return
|
||||
* @return all the user data without the password
|
||||
*/
|
||||
public static HashMap<String,Object> userWithoutPassword(User user){
|
||||
|
||||
if (user ==null)
|
||||
return null;
|
||||
|
||||
HashMap<String,Object> toReturn = new HashMap<>();
|
||||
|
||||
toReturn.put("regNo",user.getRegNo());
|
||||
toReturn.put("lastName",user.getLastName());
|
||||
toReturn.put("firstName",user.getFirstName());
|
||||
toReturn.put("email", user.getEmail());
|
||||
toReturn.put("address",user.getAddress());
|
||||
toReturn.put("birthDate",user.getBirthDate());
|
||||
toReturn.put("country",user.getCountry());
|
||||
toReturn.put("profilePictureUrl",user.getProfilePictureUrl());
|
||||
toReturn.put("role",user.getRole());
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
public static Iterable<HashMap<String ,Object>>usersWithoutPasswords(Iterable<User> users){
|
||||
ArrayList<HashMap<String,Object>> toReturn = new ArrayList<>();
|
||||
|
||||
for (User u : users){
|
||||
toReturn.add(userWithoutPassword(u));
|
||||
}
|
||||
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static HashMap<String,Object> courseWithoutPassword(Course course){
|
||||
if (course == null)
|
||||
return null;
|
||||
|
||||
HashMap<String ,Object> toReturn = new HashMap<>();
|
||||
|
||||
toReturn.put("courseId",course.getCourseID());
|
||||
toReturn.put("credits",course.getCredits());
|
||||
toReturn.put("title", course.getTitle());
|
||||
toReturn.put("owner", userWithoutPassword(course.getOwner()));
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
public static Iterable<HashMap<String ,Object>> coursesWithoutPasswords(Iterable<Course> courses){
|
||||
ArrayList<HashMap<String,Object>> toReturn = new ArrayList<>();
|
||||
|
||||
for (Course course: courses){
|
||||
toReturn.add(ProtectionService.courseWithoutPassword(course));
|
||||
}
|
||||
|
||||
return toReturn;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static Map<String, Object> requestWithoutPassword(InscriptionRequest inscriptionRequest) {
|
||||
|
||||
if (inscriptionRequest == null)
|
||||
return null;
|
||||
|
||||
Map<String, Object> toReturn = new HashMap<>();
|
||||
|
||||
toReturn.put("id", inscriptionRequest.getId());
|
||||
toReturn.put("lastName", inscriptionRequest.getLastName());
|
||||
toReturn.put("firstName", inscriptionRequest.getFirstName());
|
||||
toReturn.put("address", inscriptionRequest.getAddress());
|
||||
toReturn.put("email",inscriptionRequest.getEmail());
|
||||
toReturn.put("birthDate", inscriptionRequest.getBirthDate());
|
||||
toReturn.put("country", inscriptionRequest.getCountry());
|
||||
toReturn.put("curriculum", inscriptionRequest.getCurriculumId());
|
||||
toReturn.put("state", inscriptionRequest.getState());
|
||||
toReturn.put("profilePictureUrl", inscriptionRequest.getProfilePicture());
|
||||
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
public static Iterable<Map<String ,Object>> requestsWithoutPasswords(Iterable<InscriptionRequest> inscriptionRequests){
|
||||
|
||||
ArrayList<Map<String,Object>> toReturn = new ArrayList<>();
|
||||
|
||||
for (InscriptionRequest i:inscriptionRequests){
|
||||
toReturn.add(requestWithoutPassword(i));
|
||||
}
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package ovh.herisson.Clyde.Services;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import ovh.herisson.Clyde.Repositories.FileRepository;
|
||||
import ovh.herisson.Clyde.Tables.*;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
@Service
|
||||
public class StorageService {
|
||||
private final Path rootLocation = Paths.get("cdn/");
|
||||
private final FileRepository fileRepo;
|
||||
|
||||
public StorageService(FileRepository filerepo){
|
||||
this.fileRepo = filerepo;
|
||||
|
||||
if(!Files.exists(rootLocation)){
|
||||
try {
|
||||
Files.createDirectories(rootLocation);
|
||||
} catch(IOException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public StorageFile store(MultipartFile file, FileType fileType) {
|
||||
|
||||
if (file == null || file.getOriginalFilename() == null)
|
||||
return null;
|
||||
|
||||
if (file.getOriginalFilename().isEmpty()){return null;}
|
||||
|
||||
UUID uuid = UUID.randomUUID();
|
||||
String stringUuid = uuid + "." + file.getOriginalFilename().split("\\.",2)[1];
|
||||
try {
|
||||
if (file.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Path destinationFile = this.rootLocation.resolve(Paths.get(stringUuid));
|
||||
|
||||
Files.copy(file.getInputStream(), destinationFile,StandardCopyOption.REPLACE_EXISTING);
|
||||
}
|
||||
catch (IOException e) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String url = this.rootLocation.resolve(Paths.get(Objects.requireNonNull(stringUuid)))
|
||||
.normalize().toString();
|
||||
|
||||
return fileRepo.save(new StorageFile(file.getOriginalFilename(),url, fileType));
|
||||
}
|
||||
|
||||
public void delete(StorageFile file) throws SecurityException {
|
||||
File f = new File(file.getUrl());
|
||||
f.delete();
|
||||
|
||||
//Delete l'entité
|
||||
fileRepo.delete(file);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package ovh.herisson.Clyde.Services;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import ovh.herisson.Clyde.Repositories.TeacherCourseRepository;
|
||||
import ovh.herisson.Clyde.Repositories.UserRepository;
|
||||
import ovh.herisson.Clyde.Tables.Course;
|
||||
import ovh.herisson.Clyde.Tables.Role;
|
||||
import ovh.herisson.Clyde.Tables.TeacherCourse;
|
||||
import ovh.herisson.Clyde.Tables.User;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@Controller
|
||||
public class TeacherCourseService {
|
||||
private final TeacherCourseRepository teacherCourseRepo;
|
||||
|
||||
private final UserRepository userRepo;
|
||||
|
||||
public TeacherCourseService(TeacherCourseRepository teacherCourseRepo, UserRepository userRepo) {
|
||||
this.teacherCourseRepo = teacherCourseRepo;
|
||||
this.userRepo = userRepo;
|
||||
}
|
||||
|
||||
public Iterable<User> findCourseAssistants(Course course) {
|
||||
if (course == null)
|
||||
return null;
|
||||
return teacherCourseRepo.findAllAssistantOfCourse(course);
|
||||
}
|
||||
|
||||
|
||||
public boolean saveAll(Iterable<Long> teacherIds, Course course){
|
||||
|
||||
if (course == null || teacherIds == null)
|
||||
return false;
|
||||
|
||||
ArrayList<User> toAdd = new ArrayList<>();
|
||||
for (Long teacherId : teacherIds){
|
||||
User teacher = userRepo.findById((long) teacherId);
|
||||
if ( teacher== null){
|
||||
return false;
|
||||
}
|
||||
if (!toAdd.contains(teacher) && teacher.getRole() == Role.Teacher)
|
||||
{
|
||||
toAdd.add(teacher);
|
||||
}
|
||||
}
|
||||
for (User teacher: toAdd){
|
||||
teacherCourseRepo.save(new TeacherCourse(teacher,course));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package ovh.herisson.Clyde.Services;
|
||||
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
import ovh.herisson.Clyde.Repositories.TokenRepository;
|
||||
import ovh.herisson.Clyde.Tables.Token;
|
||||
import ovh.herisson.Clyde.Tables.User;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Base64;
|
||||
import java.util.Calendar;
|
||||
|
||||
@Service
|
||||
public class TokenService {
|
||||
private final TokenRepository tokenRepo;
|
||||
|
||||
public TokenService(TokenRepository tokenRepo){
|
||||
this.tokenRepo = tokenRepo;
|
||||
}
|
||||
|
||||
public Iterable<Token> getAllTokens() {
|
||||
return tokenRepo.findAll();
|
||||
}
|
||||
|
||||
|
||||
public String generateNewToken(){
|
||||
byte[] bytes = new byte[64];
|
||||
new SecureRandom().nextBytes(bytes);
|
||||
for (int i = 0; i < bytes.length; i++) {
|
||||
bytes[i] = (byte) (((bytes[i]+256)%256 %95+ 32));
|
||||
}
|
||||
// will never end up in the catch because of the way that SecureRandom.nextBytes is implemented
|
||||
try {
|
||||
return new String(Base64.getEncoder().encode(bytes),"ISO_8859_1");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public User getUserFromToken(String token) {
|
||||
Token tokenRep = tokenRepo.getByToken(token);
|
||||
if (tokenRep == null)
|
||||
return null;
|
||||
|
||||
return tokenRep.getUser();
|
||||
}
|
||||
|
||||
public void saveToken(Token token){
|
||||
//Si l'utilisateur a déja 5 token delete celui qui devait expirer le plus vite
|
||||
ArrayList<Token> tokenList = tokenRepo.getByUserOrderByExpirationDate(token.getUser());
|
||||
|
||||
while(tokenList.size() >= 5){
|
||||
tokenRepo.delete(tokenList.getFirst());
|
||||
tokenList.remove(tokenList.getFirst());
|
||||
}
|
||||
tokenRepo.save(token);
|
||||
}
|
||||
|
||||
//Tous les jours a minuit
|
||||
@Scheduled(cron = "0 0 0 * * ?")
|
||||
public void autoDeleteToken() {
|
||||
for (Token t: tokenRepo.findAll()){
|
||||
Calendar cal = Calendar.getInstance();
|
||||
|
||||
Calendar cal2 = Calendar.getInstance();
|
||||
cal2.setTime(t.getExpirationDate());
|
||||
|
||||
if (cal.compareTo(cal2) >= 0){
|
||||
tokenRepo.delete(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package ovh.herisson.Clyde.Services;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import ovh.herisson.Clyde.Repositories.UserCurriculumRepository;
|
||||
import ovh.herisson.Clyde.Tables.Curriculum;
|
||||
import ovh.herisson.Clyde.Tables.User;
|
||||
|
||||
@Service
|
||||
public class UserCurriculumService {
|
||||
|
||||
private final UserCurriculumRepository userCurriculumRepository;
|
||||
|
||||
public UserCurriculumService(UserCurriculumRepository userCurriculumRepository) {
|
||||
this.userCurriculumRepository = userCurriculumRepository;
|
||||
}
|
||||
|
||||
public Curriculum findByUser(User student){
|
||||
return userCurriculumRepository.findByUser(student);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package ovh.herisson.Clyde.Services;
|
||||
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import ovh.herisson.Clyde.Repositories.UserRepository;
|
||||
import ovh.herisson.Clyde.Tables.Role;
|
||||
import ovh.herisson.Clyde.Tables.User;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class UserService {
|
||||
private final UserRepository userRepo;
|
||||
private final BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
|
||||
|
||||
public UserService(UserRepository userRepo){
|
||||
this.userRepo = userRepo;
|
||||
}
|
||||
|
||||
|
||||
/** return the user identified by th identifier
|
||||
*
|
||||
* @param identifier can be an email or the RegNo
|
||||
* @return the identified user
|
||||
*/
|
||||
public User getUser(String identifier){
|
||||
if (identifier == null)
|
||||
return null;
|
||||
|
||||
try {
|
||||
int id = Integer.parseInt(identifier);
|
||||
return userRepo.findById(id);
|
||||
}
|
||||
catch (NumberFormatException nfe){
|
||||
return userRepo.findByEmail(identifier);
|
||||
}
|
||||
}
|
||||
|
||||
/** modify the target data
|
||||
* verify the permission of modifying from the poster
|
||||
*
|
||||
* @param poster the user wanting to modify target's data
|
||||
* @param updates the changes to be made
|
||||
* @param targetId the id of the user to update
|
||||
* @return if the changes were done or not
|
||||
*/
|
||||
public boolean modifyData(long targetId, Map<String ,Object> updates, User poster){
|
||||
|
||||
User target = userRepo.findById(targetId);
|
||||
if (target == null)
|
||||
return false;
|
||||
|
||||
if (poster.getRegNo().equals(target.getRegNo())){
|
||||
for (Map.Entry<String, Object> entry : updates.entrySet()){
|
||||
|
||||
switch (entry.getKey()){
|
||||
case "firstName":
|
||||
target.setFirstName((String) entry.getValue());
|
||||
break;
|
||||
case "lastName":
|
||||
target.setLastName((String) entry.getValue());
|
||||
break;
|
||||
case "email":
|
||||
target.setEmail((String) entry.getValue());
|
||||
break;
|
||||
case "address":
|
||||
target.setAddress((String) entry.getValue());
|
||||
break;
|
||||
case "country":
|
||||
target.setCountry((String) entry.getValue());
|
||||
break;
|
||||
case "birthDate":
|
||||
target.setBirthDate((Date) entry.getValue());
|
||||
break;
|
||||
case "profilePictureUrl":
|
||||
target.setProfilePictureUrl((String) entry.getValue());
|
||||
break;
|
||||
case "password":
|
||||
target.setPassword(passwordEncoder.encode((String) entry.getValue()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
userRepo.save(target);
|
||||
return true;
|
||||
}
|
||||
// the secretary can change roles (for example if a student becomes a teacher)
|
||||
else if (poster.getRole() == Role.Secretary)
|
||||
{
|
||||
for (Map.Entry<String, Object> entry : updates.entrySet()){
|
||||
|
||||
if ( entry.getKey().equals("role")) {
|
||||
|
||||
if (entry.getValue() == Role.Admin) {return false;}
|
||||
|
||||
target.setRole((Role) entry.getValue());
|
||||
userRepo.save(target);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public boolean checkPassword(User user, String tryingPassword){
|
||||
return passwordEncoder.matches(tryingPassword, user.getPassword());
|
||||
}
|
||||
|
||||
public User save(User user){
|
||||
user.setPassword(passwordEncoder.encode(user.getPassword()));
|
||||
return userRepo.save(user);
|
||||
}
|
||||
|
||||
public Iterable<User> getAll(){
|
||||
return userRepo.findAll();
|
||||
}
|
||||
|
||||
public Iterable<User> getAllExceptAdmins(){
|
||||
return userRepo.findAllExceptAdmins();
|
||||
}
|
||||
|
||||
|
||||
public Iterable<User> getAllTeachers (){return userRepo.findAllTeachers();}
|
||||
|
||||
public Iterable<User> getAllStudents(){return userRepo.findAllStudents();}
|
||||
|
||||
|
||||
public User getUserById(long id) {
|
||||
return userRepo.findById(id);
|
||||
}
|
||||
|
||||
public void delete(User user) {
|
||||
userRepo.delete(user);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package ovh.herisson.Clyde.Tables;
|
||||
|
||||
public enum Applications {
|
||||
// without any token
|
||||
Login,
|
||||
Schedule,
|
||||
|
||||
// with any token
|
||||
Profile,
|
||||
|
||||
|
||||
// Students and higher authorization
|
||||
Msg,
|
||||
Forum,
|
||||
Rdv,
|
||||
|
||||
// teachers and Secretary authorization
|
||||
ManageCourses,
|
||||
UsersList,
|
||||
|
||||
// InscriptionService authorization
|
||||
Inscription,
|
||||
StudentsList
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package ovh.herisson.Clyde.Tables;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import org.hibernate.annotations.OnDelete;
|
||||
import org.hibernate.annotations.OnDeleteAction;
|
||||
|
||||
@Entity
|
||||
public class Course {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private int courseID;
|
||||
private int credits;
|
||||
private String title;
|
||||
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@OnDelete(action = OnDeleteAction.SET_NULL)
|
||||
@JoinColumn(name = "Users")
|
||||
private User owner;
|
||||
|
||||
public Course(int credits, String title, User owner){
|
||||
this.credits = credits;
|
||||
this.title = title;
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public Course() {}
|
||||
|
||||
public int getCourseID() {
|
||||
return courseID;
|
||||
}
|
||||
|
||||
public int getCredits() {
|
||||
return credits;
|
||||
}
|
||||
|
||||
public void setCredits(int credits){
|
||||
this.credits = credits;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title){
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public User getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
public void setOwner(User owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package ovh.herisson.Clyde.Tables;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
|
||||
@Entity
|
||||
public class Curriculum {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private int curriculumId;
|
||||
private int year;
|
||||
private String option;
|
||||
public Curriculum(int year, String option){
|
||||
this.year = year;
|
||||
this.option = option;
|
||||
}
|
||||
|
||||
public Curriculum() {}
|
||||
|
||||
public int getCurriculumId(){
|
||||
return this.curriculumId;
|
||||
}
|
||||
|
||||
public int getYear(){
|
||||
return this.year;
|
||||
}
|
||||
|
||||
public void setYear(int year){
|
||||
this.year = year;
|
||||
}
|
||||
|
||||
public String getOption(){
|
||||
return this.option;
|
||||
}
|
||||
|
||||
public void setOption(String option){
|
||||
this.option = option;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package ovh.herisson.Clyde.Tables;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import org.hibernate.annotations.OnDelete;
|
||||
import org.hibernate.annotations.OnDeleteAction;
|
||||
|
||||
@Entity
|
||||
public class CurriculumCourse {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private int id;
|
||||
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@JoinColumn(name = "Curriculum")
|
||||
@OnDelete(action = OnDeleteAction.CASCADE)
|
||||
private Curriculum curriculum;
|
||||
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@OnDelete(action = OnDeleteAction.CASCADE)
|
||||
@JoinColumn(name = "Course")
|
||||
private Course course;
|
||||
|
||||
public CurriculumCourse(Curriculum curriculum, Course course){
|
||||
this.curriculum = curriculum;
|
||||
this.course = course;
|
||||
}
|
||||
|
||||
public CurriculumCourse() {}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public Course getCourse() {
|
||||
return course;
|
||||
}
|
||||
|
||||
public void setCourse(Course course){
|
||||
this.course = course;
|
||||
}
|
||||
|
||||
public Curriculum getCurriculum() {
|
||||
return curriculum;
|
||||
}
|
||||
|
||||
public void setCurriculum(Curriculum curriculum) {
|
||||
this.curriculum = curriculum;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package ovh.herisson.Clyde.Tables;
|
||||
|
||||
public enum FileType {
|
||||
|
||||
ProfilePicture,
|
||||
|
||||
EducationCertificate
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package ovh.herisson.Clyde.Tables;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Entity
|
||||
public class InscriptionRequest {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private int id;
|
||||
private String firstName;
|
||||
private String lastName;
|
||||
private String address;
|
||||
private String email;
|
||||
private String country;
|
||||
private Date birthDate;
|
||||
|
||||
private Long curriculumId;
|
||||
private RequestState state;
|
||||
private String profilePicture;
|
||||
|
||||
private String password;
|
||||
public InscriptionRequest(){}
|
||||
public InscriptionRequest(String lastName, String firstName, String address, String email, String country, Date birthDate,Long curriculumId, RequestState state, String profilePicture, String password){
|
||||
this.lastName = lastName;
|
||||
this.firstName = firstName;
|
||||
this.address = address;
|
||||
this.email = email;
|
||||
this.country = country;
|
||||
this.birthDate = birthDate;
|
||||
this.curriculumId = curriculumId;
|
||||
this.state = state;
|
||||
this.profilePicture = profilePicture;
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
|
||||
public void setFirstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
public void setCountry(String country) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
public Date getBirthDate() {
|
||||
return birthDate;
|
||||
}
|
||||
|
||||
public void setBirthDate(Date birthDate) {
|
||||
this.birthDate = birthDate;
|
||||
}
|
||||
|
||||
public long getCurriculumId() {
|
||||
return curriculumId;
|
||||
}
|
||||
|
||||
public void setCurriculumId(long curriculum) {
|
||||
this.curriculumId = curriculum;
|
||||
}
|
||||
|
||||
public RequestState getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(RequestState state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public String getProfilePicture() {
|
||||
return profilePicture;
|
||||
}
|
||||
|
||||
public void setProfilePicture(String profilePicture) {
|
||||
this.profilePicture = profilePicture;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package ovh.herisson.Clyde.Tables;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import org.hibernate.annotations.OnDelete;
|
||||
import org.hibernate.annotations.OnDeleteAction;
|
||||
|
||||
@Entity
|
||||
public class ReInscriptionRequest {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private int id;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "Users")
|
||||
@OnDelete(action = OnDeleteAction.CASCADE)
|
||||
private User user;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "Curriculum")
|
||||
@OnDelete(action = OnDeleteAction.CASCADE)
|
||||
private Curriculum newCurriculum;
|
||||
private RequestState state;
|
||||
|
||||
//Permet de différencier les demandes de changement et une réinscription dans le même Curriculum
|
||||
//Pour la réinscription on va le mettre a 0
|
||||
private boolean type = false;
|
||||
|
||||
public ReInscriptionRequest(){}
|
||||
|
||||
public ReInscriptionRequest(User user, Curriculum newCurriculum, RequestState state, boolean type){
|
||||
this.user = user;
|
||||
this.newCurriculum = newCurriculum;
|
||||
this.state = state;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public ReInscriptionRequest(User user, Curriculum newCurriculum, RequestState state){
|
||||
this.user = user;
|
||||
this.newCurriculum = newCurriculum;
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public Curriculum getNewCurriculum() {
|
||||
return newCurriculum;
|
||||
}
|
||||
|
||||
public void setNewCurriculum(Curriculum newCurriculum) {
|
||||
this.newCurriculum = newCurriculum;
|
||||
}
|
||||
|
||||
public RequestState getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(RequestState state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public boolean isType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(boolean type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package ovh.herisson.Clyde.Tables;
|
||||
|
||||
public enum RequestState {
|
||||
Accepted,
|
||||
Refused,
|
||||
Pending
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package ovh.herisson.Clyde.Tables;
|
||||
|
||||
public enum Role {
|
||||
Teacher,
|
||||
Student,
|
||||
Admin,
|
||||
InscriptionService,
|
||||
Secretary
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package ovh.herisson.Clyde.Tables;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
|
||||
|
||||
@Entity
|
||||
public class StorageFile {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String url;
|
||||
|
||||
private FileType fileType;
|
||||
|
||||
public StorageFile(String name, String url, FileType fileType){
|
||||
this.name = name;
|
||||
this.url = url;
|
||||
this.fileType = fileType;
|
||||
}
|
||||
|
||||
public StorageFile(){}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public FileType getFileType() {
|
||||
return fileType;
|
||||
}
|
||||
|
||||
public void setFileType(FileType fileType) {
|
||||
this.fileType = fileType;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package ovh.herisson.Clyde.Tables;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import org.hibernate.annotations.OnDelete;
|
||||
import org.hibernate.annotations.OnDeleteAction;
|
||||
|
||||
@Entity
|
||||
public class TeacherCourse {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private int id;
|
||||
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@OnDelete(action = OnDeleteAction.CASCADE)
|
||||
@JoinColumn(name = "Users")
|
||||
private User user;
|
||||
|
||||
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@OnDelete(action = OnDeleteAction.CASCADE)
|
||||
@JoinColumn(name = "Course")
|
||||
private Course course;
|
||||
|
||||
public TeacherCourse(User user, Course course){
|
||||
this.user = user;
|
||||
this.course = course;
|
||||
}
|
||||
|
||||
public TeacherCourse() {}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public Course getCourse() {
|
||||
return course;
|
||||
}
|
||||
|
||||
public void setCourse(Course course) {
|
||||
this.course = course;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package ovh.herisson.Clyde.Tables;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import org.hibernate.annotations.OnDelete;
|
||||
import org.hibernate.annotations.OnDeleteAction;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Entity
|
||||
public class Token {
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
@Id
|
||||
private int id;
|
||||
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@OnDelete(action = OnDeleteAction.CASCADE)
|
||||
@JoinColumn(name ="Users")
|
||||
private User user;
|
||||
private String token;
|
||||
private Date expirationDate;
|
||||
|
||||
public Token(User user, String token, Date expirationDate){
|
||||
this.user = user;
|
||||
this.token = token;
|
||||
this.expirationDate = expirationDate;
|
||||
}
|
||||
|
||||
public Token(){}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(User regNo) {
|
||||
this.user = regNo;
|
||||
}
|
||||
|
||||
public String getToken(){
|
||||
return token;
|
||||
}
|
||||
|
||||
public void setToken(String data) {
|
||||
this.token = data;
|
||||
}
|
||||
|
||||
public void setExpirationDate(Date date){
|
||||
this.expirationDate = date;
|
||||
}
|
||||
|
||||
public Date getExpirationDate(){
|
||||
return expirationDate;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package ovh.herisson.Clyde.Tables;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Entity
|
||||
@Table(name = "Users")
|
||||
public class User {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long regNo;
|
||||
private String lastName;
|
||||
private String firstName;
|
||||
@Column(unique = true)
|
||||
private String email;
|
||||
private String address;
|
||||
private String country;
|
||||
private Date birthDate;
|
||||
private String profilePictureUrl;
|
||||
private ovh.herisson.Clyde.Tables.Role role;
|
||||
private String password;
|
||||
public User(String lastName, String firstName, String email, String address,
|
||||
String country, Date birthDate, String profilePictureUrl, Role role, String password)
|
||||
{
|
||||
this.lastName = lastName;
|
||||
this.firstName = firstName;
|
||||
this.email = email;
|
||||
this.address = address;
|
||||
this.country = country;
|
||||
this.birthDate = birthDate;
|
||||
this.profilePictureUrl = profilePictureUrl;
|
||||
this.role = role;
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public User(String lastName, String firstName, String email, String address,
|
||||
String country, Date birthDate, String profilePictureUrl, String password)
|
||||
{
|
||||
this.lastName = lastName;
|
||||
this.firstName = firstName;
|
||||
this.email = email;
|
||||
this.address = address;
|
||||
this.country = country;
|
||||
this.birthDate = birthDate;
|
||||
this.profilePictureUrl = profilePictureUrl;
|
||||
this.password = password;
|
||||
this.role = Role.Student;
|
||||
}
|
||||
public User() {}
|
||||
|
||||
public Long getRegNo(){
|
||||
return this.regNo;
|
||||
}
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
|
||||
public void setFirstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
public void setCountry(String country) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
public Date getBirthDate() {
|
||||
return birthDate;
|
||||
}
|
||||
|
||||
public void setBirthDate(Date birthDate) {
|
||||
this.birthDate = birthDate;
|
||||
}
|
||||
|
||||
public String getProfilePictureUrl(){return this.profilePictureUrl;}
|
||||
|
||||
public void setProfilePictureUrl(String profilePictureUrl){
|
||||
this.profilePictureUrl = profilePictureUrl;
|
||||
}
|
||||
public ovh.herisson.Clyde.Tables.Role getRole() {
|
||||
return role;
|
||||
}
|
||||
|
||||
public void setRole(ovh.herisson.Clyde.Tables.Role role) {
|
||||
this.role = role;
|
||||
}
|
||||
public String getPassword(){
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package ovh.herisson.Clyde.Tables;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import org.hibernate.annotations.OnDelete;
|
||||
import org.hibernate.annotations.OnDeleteAction;
|
||||
|
||||
@Entity
|
||||
public class UserCurriculum {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private int id;
|
||||
|
||||
//Un étudiant peut avoir plusieurs curriculums
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@OnDelete(action = OnDeleteAction.CASCADE)
|
||||
@JoinColumn(name = "Users")
|
||||
private User user;
|
||||
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@JoinColumn(name = "Curriculum")
|
||||
@OnDelete(action = OnDeleteAction.CASCADE)
|
||||
private Curriculum curriculum;
|
||||
|
||||
public UserCurriculum(User user, Curriculum curriculum){
|
||||
this.user = user;
|
||||
this.curriculum = curriculum;
|
||||
}
|
||||
|
||||
public UserCurriculum() {}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public Curriculum getCurriculum() {
|
||||
return curriculum;
|
||||
}
|
||||
|
||||
public void setCurriculum(Curriculum curriculum) {
|
||||
this.curriculum = curriculum;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
spring.jpa.hibernate.ddl-auto=create-drop
|
||||
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
|
||||
spring.sql.init.mode=always
|
||||
@@ -0,0 +1,192 @@
|
||||
var jK=Object.defineProperty;var MK=(e,t,r)=>t in e?jK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ie=(e,t,r)=>(MK(e,typeof t!="symbol"?t+"":t,r),r),DK=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var fp=(e,t,r)=>(DK(e,t,"read from private field"),r?r.call(e):t.get(e)),RE=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)};function M2(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var en=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Tt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function FK(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var nd={},LK=nd.byteLength=qK,BK=nd.toByteArray=KK,UK=nd.fromByteArray=GK,so=[],is=[],VK=typeof Uint8Array<"u"?Uint8Array:Array,IE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var zu=0,zK=IE.length;zu<zK;++zu)so[zu]=IE[zu],is[IE.charCodeAt(zu)]=zu;is[45]=62;is[95]=63;function E3(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function qK(e){var t=E3(e),r=t[0],n=t[1];return(r+n)*3/4-n}function WK(e,t,r){return(t+r)*3/4-r}function KK(e){var t,r=E3(e),n=r[0],i=r[1],s=new VK(WK(e,n,i)),o=0,l=i>0?n-4:n,c;for(c=0;c<l;c+=4)t=is[e.charCodeAt(c)]<<18|is[e.charCodeAt(c+1)]<<12|is[e.charCodeAt(c+2)]<<6|is[e.charCodeAt(c+3)],s[o++]=t>>16&255,s[o++]=t>>8&255,s[o++]=t&255;return i===2&&(t=is[e.charCodeAt(c)]<<2|is[e.charCodeAt(c+1)]>>4,s[o++]=t&255),i===1&&(t=is[e.charCodeAt(c)]<<10|is[e.charCodeAt(c+1)]<<4|is[e.charCodeAt(c+2)]>>2,s[o++]=t>>8&255,s[o++]=t&255),s}function HK(e){return so[e>>18&63]+so[e>>12&63]+so[e>>6&63]+so[e&63]}function JK(e,t,r){for(var n,i=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),i.push(HK(n));return i.join("")}function GK(e){for(var t,r=e.length,n=r%3,i=[],s=16383,o=0,l=r-n;o<l;o+=s)i.push(JK(e,o,o+s>l?l:o+s));return n===1?(t=e[r-1],i.push(so[t>>2]+so[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(so[t>>10]+so[t>>4&63]+so[t<<2&63]+"=")),i.join("")}const YK=M2({__proto__:null,byteLength:LK,default:nd,fromByteArray:UK,toByteArray:BK},[nd]);var yy={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var XK=yy.read=function(e,t,r,n,i){var s,o,l=i*8-n-1,c=(1<<l)-1,h=c>>1,v=-7,y=r?i-1:0,S=r?-1:1,b=e[t+y];for(y+=S,s=b&(1<<-v)-1,b>>=-v,v+=l;v>0;s=s*256+e[t+y],y+=S,v-=8);for(o=s&(1<<-v)-1,s>>=-v,v+=n;v>0;o=o*256+e[t+y],y+=S,v-=8);if(s===0)s=1-h;else{if(s===c)return o?NaN:(b?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-h}return(b?-1:1)*o*Math.pow(2,s-n)},QK=yy.write=function(e,t,r,n,i,s){var o,l,c,h=s*8-i-1,v=(1<<h)-1,y=v>>1,S=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=n?0:s-1,_=n?1:-1,$=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,o=v):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+y>=1?t+=S/c:t+=S*Math.pow(2,1-y),t*c>=2&&(o++,c/=2),o+y>=v?(l=0,o=v):o+y>=1?(l=(t*c-1)*Math.pow(2,i),o=o+y):(l=t*Math.pow(2,y-1)*Math.pow(2,i),o=0));i>=8;e[r+b]=l&255,b+=_,l/=256,i-=8);for(o=o<<i|l,h+=i;h>0;e[r+b]=o&255,b+=_,o/=256,h-=8);e[r+b-_]|=$*128};const ZK=M2({__proto__:null,default:yy,read:XK,write:QK},[yy]);var S3={exports:{}},Yt={};/**
|
||||
* @license React
|
||||
* react.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Ud=Symbol.for("react.element"),eH=Symbol.for("react.portal"),tH=Symbol.for("react.fragment"),rH=Symbol.for("react.strict_mode"),nH=Symbol.for("react.profiler"),iH=Symbol.for("react.provider"),sH=Symbol.for("react.context"),oH=Symbol.for("react.forward_ref"),aH=Symbol.for("react.suspense"),lH=Symbol.for("react.memo"),uH=Symbol.for("react.lazy"),iP=Symbol.iterator;function cH(e){return e===null||typeof e!="object"?null:(e=iP&&e[iP]||e["@@iterator"],typeof e=="function"?e:null)}var w3={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_3=Object.assign,x3={};function Qc(e,t,r){this.props=e,this.context=t,this.refs=x3,this.updater=r||w3}Qc.prototype.isReactComponent={};Qc.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Qc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function A3(){}A3.prototype=Qc.prototype;function D2(e,t,r){this.props=e,this.context=t,this.refs=x3,this.updater=r||w3}var F2=D2.prototype=new A3;F2.constructor=D2;_3(F2,Qc.prototype);F2.isPureReactComponent=!0;var sP=Array.isArray,O3=Object.prototype.hasOwnProperty,L2={current:null},C3={key:!0,ref:!0,__self:!0,__source:!0};function $3(e,t,r){var n,i={},s=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)O3.call(t,n)&&!C3.hasOwnProperty(n)&&(i[n]=t[n]);var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){for(var c=Array(l),h=0;h<l;h++)c[h]=arguments[h+2];i.children=c}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)i[n]===void 0&&(i[n]=l[n]);return{$$typeof:Ud,type:e,key:s,ref:o,props:i,_owner:L2.current}}function fH(e,t){return{$$typeof:Ud,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function B2(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ud}function pH(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var oP=/\/+/g;function NE(e,t){return typeof e=="object"&&e!==null&&e.key!=null?pH(""+e.key):t.toString(36)}function Ug(e,t,r,n,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Ud:case eH:o=!0}}if(o)return o=e,i=i(o),e=n===""?"."+NE(o,0):n,sP(i)?(r="",e!=null&&(r=e.replace(oP,"$&/")+"/"),Ug(i,t,r,"",function(h){return h})):i!=null&&(B2(i)&&(i=fH(i,r+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(oP,"$&/")+"/")+e)),t.push(i)),1;if(o=0,n=n===""?".":n+":",sP(e))for(var l=0;l<e.length;l++){s=e[l];var c=n+NE(s,l);o+=Ug(s,t,r,c,i)}else if(c=cH(e),typeof c=="function")for(e=c.call(e),l=0;!(s=e.next()).done;)s=s.value,c=n+NE(s,l++),o+=Ug(s,t,r,c,i);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Qm(e,t,r){if(e==null)return e;var n=[],i=0;return Ug(e,n,"","",function(s){return t.call(r,s,i++)}),n}function dH(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Zn={current:null},Vg={transition:null},hH={ReactCurrentDispatcher:Zn,ReactCurrentBatchConfig:Vg,ReactCurrentOwner:L2};Yt.Children={map:Qm,forEach:function(e,t,r){Qm(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Qm(e,function(){t++}),t},toArray:function(e){return Qm(e,function(t){return t})||[]},only:function(e){if(!B2(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Yt.Component=Qc;Yt.Fragment=tH;Yt.Profiler=nH;Yt.PureComponent=D2;Yt.StrictMode=rH;Yt.Suspense=aH;Yt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hH;Yt.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=_3({},e.props),i=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=L2.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)O3.call(t,c)&&!C3.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){l=Array(c);for(var h=0;h<c;h++)l[h]=arguments[h+2];n.children=l}return{$$typeof:Ud,type:e.type,key:i,ref:s,props:n,_owner:o}};Yt.createContext=function(e){return e={$$typeof:sH,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:iH,_conLine truncated
|
||||
|
||||
`+e.mark.snippet),n+" "+r):n}function id(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=LD(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}id.prototype=Object.create(Error.prototype);id.prototype.constructor=id;id.prototype.toString=function(t){return this.name+": "+LD(this,t)};var Hn=id;function LE(e,t,r,n,i){var s="",o="",l=Math.floor(i/2)-1;return n-t>l&&(s=" ... ",t=n-l+s.length),r-n>l&&(o=" ...",r=n+l-o.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+o,pos:n-t+s.length}}function BE(e,t){return ln.repeat(" ",t-e.length)+e}function oue(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],s,o=-1;s=r.exec(e.buffer);)i.push(s.index),n.push(s.index+s[0].length),e.position<=s.index&&o<0&&(o=n.length-2);o<0&&(o=n.length-1);var l="",c,h,v=Math.min(e.line+t.linesAfter,i.length).toString().length,y=t.maxLength-(t.indent+v+3);for(c=1;c<=t.linesBefore&&!(o-c<0);c++)h=LE(e.buffer,n[o-c],i[o-c],e.position-(n[o]-n[o-c]),y),l=ln.repeat(" ",t.indent)+BE((e.line-c+1).toString(),v)+" | "+h.str+`
|
||||
`+l;for(h=LE(e.buffer,n[o],i[o],e.position,y),l+=ln.repeat(" ",t.indent)+BE((e.line+1).toString(),v)+" | "+h.str+`
|
||||
`,l+=ln.repeat("-",t.indent+v+3+h.pos)+`^
|
||||
`,c=1;c<=t.linesAfter&&!(o+c>=i.length);c++)h=LE(e.buffer,n[o+c],i[o+c],e.position-(n[o]-n[o+c]),y),l+=ln.repeat(" ",t.indent)+BE((e.line+c+1).toString(),v)+" | "+h.str+`
|
||||
`;return l.replace(/\n$/,"")}var aue=oue,lue=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],uue=["scalar","sequence","mapping"];function cue(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}function fue(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(lue.indexOf(r)===-1)throw new Hn('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=cue(t.styleAliases||null),uue.indexOf(this.kind)===-1)throw new Hn('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var An=fue;function pR(e,t){var r=[];return e[t].forEach(function(n){var i=r.length;r.forEach(function(s,o){s.tag===n.tag&&s.kind===n.kind&&s.multi===n.multi&&(i=o)}),r[i]=n}),r}function pue(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function n(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(n);return e}function Hw(e){return this.extend(e)}Hw.prototype.extend=function(t){var r=[],n=[];if(t instanceof An)n.push(t);else if(Array.isArray(t))n=n.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(n=n.concat(t.explicit));else throw new Hn("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof An))throw new Hn("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new Hn("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new Hn("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(s){if(!(s instanceof An))throw new Hn("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Hw.prototype);return i.implicit=(this.implicit||[]).concat(r),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=pR(i,"implicit"),i.compiledExplicit=pR(i,"explicit"),i.compiledTypeMap=pue(i.compiledImplicit,i.compiledExplicit),i};var BD=Hw,UD=new An("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),VD=new An("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),zD=new An("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),qD=new BD({explicit:[UD,VD,zD]});function due(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function hue(){return null}function mue(e){return e===null}var WD=new An("tag:yaml.org,2002:null",{kind:"scalar",resolve:due,construct:hue,predicate:mue,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function gue(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function yue(e){return e==="true"||e==="True"||e==="TRUE"}function vue(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var KD=new An("tag:yaml.org,2002:bool",{kind:"scalar",resolve:gue,construct:yue,predicate:vue,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function bue(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Eue(e){return 48<=e&&e<=55}function Sue(e){return 48<=e&&e<=57}function wue(e){if(e===null)return!1;var t=e.length,r=0,n=!1,i;if(!t)return!1;if(i=e[r],(i==="-"||i==="+")&&(i=e[++r]),i==="0"){if(r+1===t)return!0;if(i=e[++r],i==="b"){for(r++;r<t;r++)if(i=e[r],i!=="_"){if(i!=="0"&&i!=="1")return!1;n=!0}return n&&i!=="_"}if(i==="x"){for(r++;r<t;r++)if(i=e[r],i!=="_"){if(!bue(e.charCodeAt(r)))return!1;n=!0}return n&&i!=="_"}if(i==="o"){for(r++;r<t;r++)if(i=e[r],i!=="_"){if(!Eue(e.charCodeAt(r)))return!1;n=!0}return n&&i!=="_"}}if(i==="_")return!1;for(;r<t;r++)if(i=e[r],i!=="_"){if(!Sue(e.charCodeAt(r)))return!1;n=!0}return!(!n||i==="_")}function _ue(e){var t=e,r=1,n;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),n=t[0],(n==="-"||n==="+")&&(n==="-"&&(r=-1),t=t.slice(1),n=t[0]),t==="0")return 0;if(n==="0"){if
Line truncated
|
||||
\r`;function jue(e){if(e===null)return!1;var t,r,n=0,i=e.length,s=hA;for(r=0;r<i;r++)if(t=s.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;n+=6}return n%8===0}function Mue(e){var t,r,n=e.replace(/[\r\n=]/g,""),i=n.length,s=hA,o=0,l=[];for(t=0;t<i;t++)t%4===0&&t&&(l.push(o>>16&255),l.push(o>>8&255),l.push(o&255)),o=o<<6|s.indexOf(n.charAt(t));return r=i%4*6,r===0?(l.push(o>>16&255),l.push(o>>8&255),l.push(o&255)):r===18?(l.push(o>>10&255),l.push(o>>2&255)):r===12&&l.push(o>>4&255),new Uint8Array(l)}function Due(e){var t="",r=0,n,i,s=e.length,o=hA;for(n=0;n<s;n++)n%3===0&&n&&(t+=o[r>>18&63],t+=o[r>>12&63],t+=o[r>>6&63],t+=o[r&63]),r=(r<<8)+e[n];return i=s%3,i===0?(t+=o[r>>18&63],t+=o[r>>12&63],t+=o[r>>6&63],t+=o[r&63]):i===2?(t+=o[r>>10&63],t+=o[r>>4&63],t+=o[r<<2&63],t+=o[64]):i===1&&(t+=o[r>>2&63],t+=o[r<<4&63],t+=o[64],t+=o[64]),t}function Fue(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var tF=new An("tag:yaml.org,2002:binary",{kind:"scalar",resolve:jue,construct:Mue,predicate:Fue,represent:Due}),Lue=Object.prototype.hasOwnProperty,Bue=Object.prototype.toString;function Uue(e){if(e===null)return!0;var t=[],r,n,i,s,o,l=e;for(r=0,n=l.length;r<n;r+=1){if(i=l[r],o=!1,Bue.call(i)!=="[object Object]")return!1;for(s in i)if(Lue.call(i,s))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}function Vue(e){return e!==null?e:[]}var rF=new An("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Uue,construct:Vue}),zue=Object.prototype.toString;function que(e){if(e===null)return!0;var t,r,n,i,s,o=e;for(s=new Array(o.length),t=0,r=o.length;t<r;t+=1){if(n=o[t],zue.call(n)!=="[object Object]"||(i=Object.keys(n),i.length!==1))return!1;s[t]=[i[0],n[i[0]]]}return!0}function Wue(e){if(e===null)return[];var t,r,n,i,s,o=e;for(s=new Array(o.length),t=0,r=o.length;t<r;t+=1)n=o[t],i=Object.keys(n),s[t]=[i[0],n[i[0]]];return s}var nF=new An("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:que,construct:Wue}),Kue=Object.prototype.hasOwnProperty;function Hue(e){if(e===null)return!0;var t,r=e;for(t in r)if(Kue.call(r,t)&&r[t]!==null)return!1;return!0}function Jue(e){return e!==null?e:{}}var iF=new An("tag:yaml.org,2002:set",{kind:"mapping",resolve:Hue,construct:Jue}),mA=YD.extend({implicit:[ZD,eF],explicit:[tF,rF,nF,iF]}),Ja=Object.prototype.hasOwnProperty,_y=1,sF=2,oF=3,xy=4,UE=1,Gue=2,dR=3,Yue=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Xue=/[\x85\u2028\u2029]/,Que=/[,\[\]\{\}]/,aF=/^(?:!|!!|![a-z\-]+!)$/i,lF=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function hR(e){return Object.prototype.toString.call(e)}function co(e){return e===10||e===13}function Jl(e){return e===9||e===32}function di(e){return e===9||e===32||e===10||e===13}function ic(e){return e===44||e===91||e===93||e===123||e===125}function Zue(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function ece(e){return e===120?2:e===117?4:e===85?8:0}function tce(e){return 48<=e&&e<=57?e-48:-1}function mR(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
||||
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function rce(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var uF=new Array(256),cF=new Array(256);for(var qu=0;qu<256;qu++)uF[qu]=mR(qu)?1:0,cF[qu]=mR(qu);function nce(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||mA,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function fF(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=aue(r),new Hn(t,r)}function Et(e,t){throw fF(e,t)}function Ay(e,t){e.onWarning&&e.onWarning.call(null,fF(e,t))}var gR={YAML:function(t,r,n){var i,s,o;t.version!==null&&Et(t,"duplication of %YAML directive"),n.length!==1&&Et(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&Et(t,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),o=parseInt(i[2],10),s!==1&&Et(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&Ay(t,"unsupported YAML version of the document")},TAG:function(t,r,n){var i,s;n.length!==2&&Et(t,"TAG directive accepts exactly two arguments"),i=n[0],s=n[1],aF.test(i)||Et(t,"ill-formed tag handle (first argument) of the TAG directive"),Ja.call(t.tagMap,i)&&Et(t,'there is a previously declared suffix for "'+i+'" tag handle'),lF.test(s)||Et(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{Et(t,"tag prefix is malformed: "+s)}t.tagMap[i]=s}};function La(e,t,r,n){var i,s,o,l;if(t<r){if(l=e.input.slice(t,r),n)for(i=0,s=l.length;i<s;i+=1)o=l.charCodeAt(i),o===9||32<=o&&o<=1114111||Et(e,"expected valid JSON character");else Yue.test(l)&&Et(e,"the stream contains non-printable characters");e.result+=l}}function yR(e,t,r,n){var i,s,o,l;for(ln.isObject(r)||Et(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(r),o=0,l=i.length;o<l;o+=1)s=i[o],Ja.call(t,s)||(t[s]=r[s],n[s]=!0)}function sc(e,t,r,n,i,s,o,l,c){var h,v;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),h=0,v=i.length;h<v;h+=1)Array.isArray(i[h])&&Et(e,"nested arrays are not supported inside keys"),typeof i=="object"&&hR(i[h])==="[object Object]"&&(i[h]="[object Object]");if(typeof i=="object"&&hR(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(h=0,v=s.length;h<v;h+=1)yR(e,t,s[h],r);else yR(e,t,s,r);else!e.json&&!Ja.call(r,i)&&Ja.call(t,i)&&(e.line=o||e.line,e.lineStart=l||e.lineStart,e.position=c||e.position,Et(e,"duplicated mapping key")),i==="__proto__"?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,writable:!0,value:s}):t[i]=s,delete r[i];return t}function gA(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):Et(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function Qr(e,t,r){for(var n=0,i=e.input.charCodeAt(e.position);i!==0;){for(;Jl(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(co(i))for(gA(e),i=e.input.charCodeAt(e.position),n++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return r!==-1&&n!==0&&e.lineIndent<r&&Ay(e,"deficient indentation"),n}function I0(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||di(r)))}function yA(e,t){t===1?e.result+=" ":t>1&&(e.result+=ln.repeat(`
|
||||
`,t-1))}function ice(e,t,r){var n,i,s,o,l,c,h,v,y=e.kind,S=e.result,b;if(b=e.input.charCodeAt(e.position),di(b)||ic(b)||b===35||b===38||b===42||b===33||b===124||b===62||b===39||b===34||b===37||b===64||b===96||(b===63||b===45)&&(i=e.input.charCodeAt(e.position+1),di(i)||r&&ic(i)))return!1;for(e.kind="scalar",e.result="",s=o=e.position,l=!1;b!==0;){if(b===58){if(i=e.input.charCodeAt(e.position+1),di(i)||r&&ic(i))break}else if(b===35){if(n=e.input.charCodeAt(e.position-1),di(n))break}else{if(e.position===e.lineStart&&I0(e)||r&&ic(b))break;if(co(b))if(c=e.line,h=e.lineStart,v=e.lineIndent,Qr(e,!1,-1),e.lineIndent>=t){l=!0,b=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=c,e.lineStart=h,e.lineIndent=v;break}}l&&(La(e,s,o,!1),yA(e,e.line-c),s=o=e.position,l=!1),Jl(b)||(o=e.position+1),b=e.input.charCodeAt(++e.position)}return La(e,s,o,!1),e.result?!0:(e.kind=y,e.result=S,!1)}function sce(e,t){var r,n,i;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(La(e,n,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)n=e.position,e.position++,i=e.position;else return!0;else co(r)?(La(e,n,i,!0),yA(e,Qr(e,!1,t)),n=i=e.position):e.position===e.lineStart&&I0(e)?Et(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);Et(e,"unexpected end of the stream within a single quoted scalar")}function oce(e,t){var r,n,i,s,o,l;if(l=e.input.charCodeAt(e.position),l!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=n=e.position;(l=e.input.charCodeAt(e.position))!==0;){if(l===34)return La(e,r,e.position,!0),e.position++,!0;if(l===92){if(La(e,r,e.position,!0),l=e.input.charCodeAt(++e.position),co(l))Qr(e,!1,t);else if(l<256&&uF[l])e.result+=cF[l],e.position++;else if((o=ece(l))>0){for(i=o,s=0;i>0;i--)l=e.input.charCodeAt(++e.position),(o=Zue(l))>=0?s=(s<<4)+o:Et(e,"expected hexadecimal character");e.result+=rce(s),e.position++}else Et(e,"unknown escape sequence");r=n=e.position}else co(l)?(La(e,r,n,!0),yA(e,Qr(e,!1,t)),r=n=e.position):e.position===e.lineStart&&I0(e)?Et(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}Et(e,"unexpected end of the stream within a double quoted scalar")}function ace(e,t){var r=!0,n,i,s,o=e.tag,l,c=e.anchor,h,v,y,S,b,_=Object.create(null),$,P,x,A;if(A=e.input.charCodeAt(e.position),A===91)v=93,b=!1,l=[];else if(A===123)v=125,b=!0,l={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=l),A=e.input.charCodeAt(++e.position);A!==0;){if(Qr(e,!0,t),A=e.input.charCodeAt(e.position),A===v)return e.position++,e.tag=o,e.anchor=c,e.kind=b?"mapping":"sequence",e.result=l,!0;r?A===44&&Et(e,"expected the node content, but found ','"):Et(e,"missed comma between flow collection entries"),P=$=x=null,y=S=!1,A===63&&(h=e.input.charCodeAt(e.position+1),di(h)&&(y=S=!0,e.position++,Qr(e,!0,t))),n=e.line,i=e.lineStart,s=e.position,Nc(e,t,_y,!1,!0),P=e.tag,$=e.result,Qr(e,!0,t),A=e.input.charCodeAt(e.position),(S||e.line===n)&&A===58&&(y=!0,A=e.input.charCodeAt(++e.position),Qr(e,!0,t),Nc(e,t,_y,!1,!0),x=e.result),b?sc(e,l,_,P,$,x,n,i,s):y?l.push(sc(e,null,_,P,$,x,n,i,s)):l.push($),Qr(e,!0,t),A=e.input.charCodeAt(e.position),A===44?(r=!0,A=e.input.charCodeAt(++e.position)):r=!1}Et(e,"unexpected end of the stream within a flow collection")}function lce(e,t){var r,n,i=UE,s=!1,o=!1,l=t,c=0,h=!1,v,y;if(y=e.input.charCodeAt(e.position),y===124)n=!1;else if(y===62)n=!0;else return!1;for(e.kind="scalar",e.result="";y!==0;)if(y=e.input.charCodeAt(++e.position),y===43||y===45)UE===i?i=y===43?dR:Gue:Et(e,"repeat of a chomping mode identifier");else if((v=tce(y))>=0)v===0?Et(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?Et(e,"repeat of an indentation width identifier"):(l=t+v-1,o=!0);else break;if(Jl(y)){do y=e.input.charCodeAt(++e.position);while(Jl(y));if(y===35)do y=e.input.charCodeAt(++e.position);while(!co(y)&&y!==0)}for(;y!==0;){for(gA(e),e.lineIndent=0,y=e.input.charCodeAt(e.position);(!o||e.lineIndent<l)&&y===32;)e.lineIndent++,y=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>l&&(l=e.lineIndent),co(y)){c++;continue}if(e.lineIndent<l){i===dR?e.result+=ln.repeat(`
|
||||
`,s?1+c:c):i===UE&&s&&(e.result+=`
|
||||
`);break}for(n?Jl(y)?(h=!0,e.result+=ln.repeat(`
|
||||
`,s?1+c:c)):h?(h=!1,e.result+=ln.repeat(`
|
||||
`,c+1)):c===0?s&&(e.result+=" "):e.result+=ln.repeat(`
|
||||
`,c):e.result+=ln.repeat(`
|
||||
`,s?1+c:c),s=!0,o=!0,c=0,r=e.position;!co(y)&&y!==0;)y=e.input.charCodeAt(++e.position);La(e,r,e.position,!1)}return!0}function vR(e,t){var r,n=e.tag,i=e.anchor,s=[],o,l=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Et(e,"tab characters must not be used in indentation")),!(c!==45||(o=e.input.charCodeAt(e.position+1),!di(o))));){if(l=!0,e.position++,Qr(e,!0,-1)&&e.lineIndent<=t){s.push(null),c=e.input.charCodeAt(e.position);continue}if(r=e.line,Nc(e,t,oF,!1,!0),s.push(e.result),Qr(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&c!==0)Et(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return l?(e.tag=n,e.anchor=i,e.kind="sequence",e.result=s,!0):!1}function uce(e,t,r){var n,i,s,o,l,c,h=e.tag,v=e.anchor,y={},S=Object.create(null),b=null,_=null,$=null,P=!1,x=!1,A;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=y),A=e.input.charCodeAt(e.position);A!==0;){if(!P&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Et(e,"tab characters must not be used in indentation")),n=e.input.charCodeAt(e.position+1),s=e.line,(A===63||A===58)&&di(n))A===63?(P&&(sc(e,y,S,b,_,null,o,l,c),b=_=$=null),x=!0,P=!0,i=!0):P?(P=!1,i=!0):Et(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,A=n;else{if(o=e.line,l=e.lineStart,c=e.position,!Nc(e,r,sF,!1,!0))break;if(e.line===s){for(A=e.input.charCodeAt(e.position);Jl(A);)A=e.input.charCodeAt(++e.position);if(A===58)A=e.input.charCodeAt(++e.position),di(A)||Et(e,"a whitespace character is expected after the key-value separator within a block mapping"),P&&(sc(e,y,S,b,_,null,o,l,c),b=_=$=null),x=!0,P=!1,i=!1,b=e.tag,_=e.result;else if(x)Et(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=h,e.anchor=v,!0}else if(x)Et(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=h,e.anchor=v,!0}if((e.line===s||e.lineIndent>t)&&(P&&(o=e.line,l=e.lineStart,c=e.position),Nc(e,t,xy,!0,i)&&(P?_=e.result:$=e.result),P||(sc(e,y,S,b,_,$,o,l,c),b=_=$=null),Qr(e,!0,-1),A=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&A!==0)Et(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return P&&sc(e,y,S,b,_,null,o,l,c),x&&(e.tag=h,e.anchor=v,e.kind="mapping",e.result=y),x}function cce(e){var t,r=!1,n=!1,i,s,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&Et(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(r=!0,o=e.input.charCodeAt(++e.position)):o===33?(n=!0,i="!!",o=e.input.charCodeAt(++e.position)):i="!",t=e.position,r){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(s=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):Et(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!di(o);)o===33&&(n?Et(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),aF.test(i)||Et(e,"named tag handle cannot contain such characters"),n=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),Que.test(s)&&Et(e,"tag suffix cannot contain flow indicator characters")}s&&!lF.test(s)&&Et(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{Et(e,"tag name is malformed: "+s)}return r?e.tag=s:Ja.call(e.tagMap,i)?e.tag=e.tagMap[i]+s:i==="!"?e.tag="!"+s:i==="!!"?e.tag="tag:yaml.org,2002:"+s:Et(e,'undeclared tag handle "'+i+'"'),!0}function fce(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&Et(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!di(r)&&!ic(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&Et(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function pce(e){var t,r,n;if(n=e.input.charCodeAt(e.position),n!==42)return!1;for(n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!di(n)&&!ic(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Et(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),Ja.call(e.anchorMap,r)||Et(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],Qr(e,!0,-1),!0}function Nc(e,t,r,n,i){var s,o,l,c=1,h=!1,v=!1,y,S,b,_,$,P;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=o=l=xy===r||oF===r,n&&Qr(e,!0,-1)&&(h=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;cce(e)||fce(e);)Qr(e,!0,-1)?(h=!0,l=s,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):l=!1;if(l&&(l=h||i),(c===1||xy===r)&&(_y===r||sF===r?$=t:$=t+1,P=e.position-e.lineStart,c===1?l&&(vR(e,P)||uce(e,P,$))||ace(e,$)?v=!0:(o&&lce(e,$)||sce(e,$)||oce(e,$)?v=!0:pce(e)?(v=!0,(e.tag!==null||e.anchor!=
Line truncated
|
||||
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new nce(e,t),n=e.indexOf("\0");for(n!==-1&&(r.position=n,Et(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)dce(r);return r.documents}function hce(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var n=pF(e,r);if(typeof t!="function")return n;for(var i=0,s=n.length;i<s;i+=1)t(n[i])}function mce(e,t){var r=pF(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new Hn("expected a single document in the stream, but found more")}}var gce=hce,yce=mce,dF={loadAll:gce,load:yce},hF=Object.prototype.toString,mF=Object.prototype.hasOwnProperty,vA=65279,vce=9,sd=10,bce=13,Ece=32,Sce=33,wce=34,Jw=35,_ce=37,xce=38,Ace=39,Oce=42,gF=44,Cce=45,Oy=58,$ce=61,kce=62,Tce=63,Pce=64,yF=91,vF=93,Rce=96,bF=123,Ice=124,EF=125,Bn={};Bn[0]="\\0";Bn[7]="\\a";Bn[8]="\\b";Bn[9]="\\t";Bn[10]="\\n";Bn[11]="\\v";Bn[12]="\\f";Bn[13]="\\r";Bn[27]="\\e";Bn[34]='\\"';Bn[92]="\\\\";Bn[133]="\\N";Bn[160]="\\_";Bn[8232]="\\L";Bn[8233]="\\P";var Nce=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],jce=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Mce(e,t){var r,n,i,s,o,l,c;if(t===null)return{};for(r={},n=Object.keys(t),i=0,s=n.length;i<s;i+=1)o=n[i],l=String(t[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),c=e.compiledTypeMap.fallback[o],c&&mF.call(c.styleAliases,l)&&(l=c.styleAliases[l]),r[o]=l;return r}function Dce(e){var t,r,n;if(t=e.toString(16).toUpperCase(),e<=255)r="x",n=2;else if(e<=65535)r="u",n=4;else if(e<=4294967295)r="U",n=8;else throw new Hn("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+ln.repeat("0",n-t.length)+t}var Fce=1,od=2;function Lce(e){this.schema=e.schema||mA,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=ln.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Mce(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?od:Fce,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function bR(e,t){for(var r=ln.repeat(" ",t),n=0,i=-1,s="",o,l=e.length;n<l;)i=e.indexOf(`
|
||||
`,n),i===-1?(o=e.slice(n),n=l):(o=e.slice(n,i+1),n=i+1),o.length&&o!==`
|
||||
`&&(s+=r),s+=o;return s}function Gw(e,t){return`
|
||||
`+ln.repeat(" ",e.indent*t)}function Bce(e,t){var r,n,i;for(r=0,n=e.implicitTypes.length;r<n;r+=1)if(i=e.implicitTypes[r],i.resolve(t))return!0;return!1}function Cy(e){return e===Ece||e===vce}function ad(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==vA||65536<=e&&e<=1114111}function ER(e){return ad(e)&&e!==vA&&e!==bce&&e!==sd}function SR(e,t,r){var n=ER(e),i=n&&!Cy(e);return(r?n:n&&e!==gF&&e!==yF&&e!==vF&&e!==bF&&e!==EF)&&e!==Jw&&!(t===Oy&&!i)||ER(t)&&!Cy(t)&&e===Jw||t===Oy&&i}function Uce(e){return ad(e)&&e!==vA&&!Cy(e)&&e!==Cce&&e!==Tce&&e!==Oy&&e!==gF&&e!==yF&&e!==vF&&e!==bF&&e!==EF&&e!==Jw&&e!==xce&&e!==Oce&&e!==Sce&&e!==Ice&&e!==$ce&&e!==kce&&e!==Ace&&e!==wce&&e!==_ce&&e!==Pce&&e!==Rce}function Vce(e){return!Cy(e)&&e!==Oy}function Tp(e,t){var r=e.charCodeAt(t),n;return r>=55296&&r<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1),n>=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}function SF(e){var t=/^\n* /;return t.test(e)}var wF=1,Yw=2,_F=3,xF=4,rc=5;function zce(e,t,r,n,i,s,o,l){var c,h=0,v=null,y=!1,S=!1,b=n!==-1,_=-1,$=Uce(Tp(e,0))&&Vce(Tp(e,e.length-1));if(t||o)for(c=0;c<e.length;h>=65536?c+=2:c++){if(h=Tp(e,c),!ad(h))return rc;$=$&&SR(h,v,l),v=h}else{for(c=0;c<e.length;h>=65536?c+=2:c++){if(h=Tp(e,c),h===sd)y=!0,b&&(S=S||c-_-1>n&&e[_+1]!==" ",_=c);else if(!ad(h))return rc;$=$&&SR(h,v,l),v=h}S=S||b&&c-_-1>n&&e[_+1]!==" "}return!y&&!S?$&&!o&&!i(e)?wF:s===od?rc:Yw:r>9&&SF(e)?rc:o?s===od?rc:Yw:S?xF:_F}function qce(e,t,r,n,i){e.dump=function(){if(t.length===0)return e.quotingType===od?'""':"''";if(!e.noCompatMode&&(Nce.indexOf(t)!==-1||jce.test(t)))return e.quotingType===od?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,r),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),l=n||e.flowLevel>-1&&r>=e.flowLevel;function c(h){return Bce(e,h)}switch(zce(t,l,e.indent,o,c,e.quotingType,e.forceQuotes&&!n,i)){case wF:return t;case Yw:return"'"+t.replace(/'/g,"''")+"'";case _F:return"|"+wR(t,e.indent)+_R(bR(t,s));case xF:return">"+wR(t,e.indent)+_R(bR(Wce(t,o),s));case rc:return'"'+Kce(t)+'"';default:throw new Hn("impossible error: invalid scalar style")}}()}function wR(e,t){var r=SF(e)?String(t):"",n=e[e.length-1]===`
|
||||
`,i=n&&(e[e.length-2]===`
|
||||
`||e===`
|
||||
`),s=i?"+":n?"":"-";return r+s+`
|
||||
`}function _R(e){return e[e.length-1]===`
|
||||
`?e.slice(0,-1):e}function Wce(e,t){for(var r=/(\n+)([^\n]*)/g,n=function(){var h=e.indexOf(`
|
||||
`);return h=h!==-1?h:e.length,r.lastIndex=h,xR(e.slice(0,h),t)}(),i=e[0]===`
|
||||
`||e[0]===" ",s,o;o=r.exec(e);){var l=o[1],c=o[2];s=c[0]===" ",n+=l+(!i&&!s&&c!==""?`
|
||||
`:"")+xR(c,t),i=s}return n}function xR(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,n,i=0,s,o=0,l=0,c="";n=r.exec(e);)l=n.index,l-i>t&&(s=o>i?o:l,c+=`
|
||||
`+e.slice(i,s),i=s+1),o=l;return c+=`
|
||||
`,e.length-i>t&&o>i?c+=e.slice(i,o)+`
|
||||
`+e.slice(o+1):c+=e.slice(i),c.slice(1)}function Kce(e){for(var t="",r=0,n,i=0;i<e.length;r>=65536?i+=2:i++)r=Tp(e,i),n=Bn[r],!n&&ad(r)?(t+=e[i],r>=65536&&(t+=e[i+1])):t+=n||Dce(r);return t}function Hce(e,t,r){var n="",i=e.tag,s,o,l;for(s=0,o=r.length;s<o;s+=1)l=r[s],e.replacer&&(l=e.replacer.call(r,String(s),l)),(qo(e,t,l,!1,!1)||typeof l>"u"&&qo(e,t,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=i,e.dump="["+n+"]"}function AR(e,t,r,n){var i="",s=e.tag,o,l,c;for(o=0,l=r.length;o<l;o+=1)c=r[o],e.replacer&&(c=e.replacer.call(r,String(o),c)),(qo(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&qo(e,t+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=Gw(e,t)),e.dump&&sd===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=s,e.dump=i||"[]"}function Jce(e,t,r){var n="",i=e.tag,s=Object.keys(r),o,l,c,h,v;for(o=0,l=s.length;o<l;o+=1)v="",n!==""&&(v+=", "),e.condenseFlow&&(v+='"'),c=s[o],h=r[c],e.replacer&&(h=e.replacer.call(r,c,h)),qo(e,t,c,!1,!1)&&(e.dump.length>1024&&(v+="? "),v+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),qo(e,t,h,!1,!1)&&(v+=e.dump,n+=v));e.tag=i,e.dump="{"+n+"}"}function Gce(e,t,r,n){var i="",s=e.tag,o=Object.keys(r),l,c,h,v,y,S;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new Hn("sortKeys must be a boolean or a function");for(l=0,c=o.length;l<c;l+=1)S="",(!n||i!=="")&&(S+=Gw(e,t)),h=o[l],v=r[h],e.replacer&&(v=e.replacer.call(r,h,v)),qo(e,t+1,h,!0,!0,!0)&&(y=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,y&&(e.dump&&sd===e.dump.charCodeAt(0)?S+="?":S+="? "),S+=e.dump,y&&(S+=Gw(e,t)),qo(e,t+1,v,!0,y)&&(e.dump&&sd===e.dump.charCodeAt(0)?S+=":":S+=": ",S+=e.dump,i+=S));e.tag=s,e.dump=i||"{}"}function OR(e,t,r){var n,i,s,o,l,c;for(i=r?e.explicitTypes:e.implicitTypes,s=0,o=i.length;s<o;s+=1)if(l=i[s],(l.instanceOf||l.predicate)&&(!l.instanceOf||typeof t=="object"&&t instanceof l.instanceOf)&&(!l.predicate||l.predicate(t))){if(r?l.multi&&l.representName?e.tag=l.representName(t):e.tag=l.tag:e.tag="?",l.represent){if(c=e.styleMap[l.tag]||l.defaultStyle,hF.call(l.represent)==="[object Function]")n=l.represent(t,c);else if(mF.call(l.represent,c))n=l.represent[c](t,c);else throw new Hn("!<"+l.tag+'> tag resolver accepts not "'+c+'" style');e.dump=n}return!0}return!1}function qo(e,t,r,n,i,s,o){e.tag=null,e.dump=r,OR(e,r,!1)||OR(e,r,!0);var l=hF.call(e.dump),c=n,h;n&&(n=e.flowLevel<0||e.flowLevel>t);var v=l==="[object Object]"||l==="[object Array]",y,S;if(v&&(y=e.duplicates.indexOf(r),S=y!==-1),(e.tag!==null&&e.tag!=="?"||S||e.indent!==2&&t>0)&&(i=!1),S&&e.usedDuplicates[y])e.dump="*ref_"+y;else{if(v&&S&&!e.usedDuplicates[y]&&(e.usedDuplicates[y]=!0),l==="[object Object]")n&&Object.keys(e.dump).length!==0?(Gce(e,t,e.dump,i),S&&(e.dump="&ref_"+y+e.dump)):(Jce(e,t,e.dump),S&&(e.dump="&ref_"+y+" "+e.dump));else if(l==="[object Array]")n&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?AR(e,t-1,e.dump,i):AR(e,t,e.dump,i),S&&(e.dump="&ref_"+y+e.dump)):(Hce(e,t,e.dump),S&&(e.dump="&ref_"+y+" "+e.dump));else if(l==="[object String]")e.tag!=="?"&&qce(e,e.dump,t,s,c);else{if(l==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Hn("unacceptable kind of an object to dump "+l)}e.tag!==null&&e.tag!=="?"&&(h=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?h="!"+h:h.slice(0,18)==="tag:yaml.org,2002:"?h="!!"+h.slice(18):h="!<"+h+">",e.dump=h+" "+e.dump)}return!0}function Yce(e,t){var r=[],n=[],i,s;for(Xw(e,r,n),i=0,s=n.length;i<s;i+=1)t.duplicates.push(r[n[i]]);t.usedDuplicates=new Array(s)}function Xw(e,t,r){var n,i,s;if(e!==null&&typeof e=="object")if(i=t.indexOf(e),i!==-1)r.indexOf(i)===-1&&r.push(i);else if(t.push(e),Array.isArray(e))for(i=0,s=e.length;i<s;i+=1)Xw(e[i],t,r);else for(n=Object.keys(e),i=0,s=n.length;i<s;i+=1)Xw(e[n[i]],t,r)}function Xce(e,t){t=t||{};var r=new Lce(t);r.noRefs||Yce(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),qo(r,0,n,!0,!0)?r.dump+`
|
||||
`:""}var Qce=Xce,Zce={dump:Qce};function bA(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var efe=An,tfe=BD,rfe=qD,ld=GD,nfe=YD,ife=mA,sfe=dF.load,ofe=dF.loadAll,afe=Zce.dump,lfe=Hn,ufe={binary:tF,float:JD,map:zD,null:WD,pairs:nF,set:iF,timestamp:ZD,bool:KD,int:HD,merge:eF,omap:rF,seq:VD,str:UD},cfe=bA("safeLoad","load"),ffe=bA("safeLoadAll","loadAll"),pfe=bA("safeDump","dump"),tu={Type:efe,Schema:tfe,FAILSAFE_SCHEMA:rfe,JSON_SCHEMA:ld,CORE_SCHEMA:nfe,DEFAULT_SCHEMA:ife,load:sfe,loadAll:ofe,dump:afe,YAMLException:lfe,types:ufe,safeLoad:cfe,safeLoadAll:ffe,safeDump:pfe},AF={exports:{}};(function(e){(function(t,r){e.exports?e.exports=r():function n(){document&&document.body?t.zenscroll=r():setTimeout(n,9)}()})(en,function(){var t=function(h){return h&&"getComputedStyle"in window&&window.getComputedStyle(h)["scroll-behavior"]==="smooth"};if(typeof window>"u"||!("document"in window))return{};var r=function(h,v,y){v=v||999,!y&&y!==0&&(y=9);var S,b=function(U){S=U},_=function(){clearTimeout(S),b(0)},$=function(U){return Math.max(0,h.getTopOf(U)-y)},P=function(U,z,J){if(_(),z===0||z&&z<0||t(h.body))h.toY(U),J&&J();else{var ee=h.getY(),Q=Math.max(0,U)-ee,f=new Date().getTime();z=z||Math.min(Math.abs(Q),v),function ce(){b(setTimeout(function(){var L=Math.min(1,(new Date().getTime()-f)/z),Fe=Math.max(0,Math.floor(ee+Q*(L<.5?2*L*L:L*(4-L*2)-1)));h.toY(Fe),L<1&&h.getHeight()+Fe<h.body.scrollHeight?ce():(setTimeout(_,99),J&&J())},9))}()}},x=function(U,z,J){P($(U),z,J)},A=function(U,z,J){var ee=U.getBoundingClientRect().height,Q=h.getTopOf(U)+ee,f=h.getHeight(),ce=h.getY(),L=ce+f;$(U)<ce||ee+y>f?x(U,z,J):Q+y>L?P(Q-f+y,z,J):J&&J()},C=function(U,z,J,ee){P(Math.max(0,h.getTopOf(U)-h.getHeight()/2+(J||U.getBoundingClientRect().height/2)),z,ee)},j=function(U,z){return(U===0||U)&&(v=U),(z===0||z)&&(y=z),{defaultDuration:v,edgeOffset:y}};return{setup:j,to:x,toY:P,intoView:A,center:C,stop:_,moving:function(){return!!S},getY:h.getY,getTopOf:h.getTopOf}},n=document.documentElement,i=function(){return window.scrollY||n.scrollTop},s=r({body:document.scrollingElement||document.body,toY:function(h){window.scrollTo(0,h)},getY:i,getHeight:function(){return window.innerHeight||n.clientHeight},getTopOf:function(h){return h.getBoundingClientRect().top+i()-n.offsetTop}});if(s.createScroller=function(h,v,y){return r({body:h,toY:function(S){h.scrollTop=S},getY:function(){return h.scrollTop},getHeight:function(){return Math.min(h.clientHeight,window.innerHeight||n.clientHeight)},getTopOf:function(S){return S.offsetTop}},v,y)},"addEventListener"in window&&!window.noZensmooth&&!t(document.body)){var o="history"in window&&"pushState"in history,l=o&&"scrollRestoration"in history;l&&(history.scrollRestoration="auto"),window.addEventListener("load",function(){l&&(setTimeout(function(){history.scrollRestoration="manual"},9),window.addEventListener("popstate",function(h){h.state&&"zenscrollY"in h.state&&s.toY(h.state.zenscrollY)},!1)),window.location.hash&&setTimeout(function(){var h=s.setup().edgeOffset;if(h){var v=document.getElementById(window.location.href.split("#")[1]);if(v){var y=Math.max(0,s.getTopOf(v)-h),S=s.getY()-y;0<=S&&S<9&&window.scrollTo(0,y)}}},9)},!1);var c=new RegExp("(^|\\s)noZensmooth(\\s|$)");window.addEventListener("click",function(h){for(var v=h.target;v&&v.tagName!=="A";)v=v.parentNode;if(!(!v||h.which!==1||h.shiftKey||h.metaKey||h.ctrlKey||h.altKey)){if(l){var y=history.state&&typeof history.state=="object"?history.state:{};y.zenscrollY=s.getY();try{history.replaceState(y,"")}catch{}}var S=v.getAttribute("href")||"";if(S.indexOf("#")===0&&!c.test(v.className)){var b=0,_=document.getElementById(S.substring(1));if(S!=="#"){if(!_)return;b=s.getTopOf(_)}h.preventDefault();var $=function(){window.location=S},P=s.setup().edgeOffset;P&&(b=Math.max(0,b-P),o&&($=function(){history.pushState({},"",S)})),s.toY(b,null,$)}}},!1)}return s})})(AF);var dfe=AF.exports;const hfe=Tt(dfe);var N0=ss,mfe="<<anonymous>>",j0;{var Zi=function(){invariant(!1,"ImmutablePropTypes type checking code is stripped in production.")};Zi.isRequired=Zi;var es=function(){return Zi};j0={listOf:es,mapOf:es,orderedMapOf:es,setOf:es,orderedSetOf:es,stackOf:es,iterableOf:es,recordOf:es,shape:es,contains:es,mapContains:es,orderedMapContains:es,list:Zi,map:Zi,orderedMap:Zi,set:Zi,orderedSet:Zi,stack:Zi,seq:Zi,record:Zi,iterable:Zi}}j0.iterable.indexed=OF("Indexed",N0.Iterable.isIndexed);j0.iterable.keyed=OF("Keyed",N0.Iterable.isKeyed);function gfe(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":e instanceof N0.Iterable?"Immutable."+e.toSource().split(" ")[0]:t}function yfe(e){function t(n,i,s,o,l,c){for(var h=arguments.length,v=Array(h>6?h-6:0),y=6;y<h;y++)v[y-6]=arguments[y];if(c=c||s,o=o||mfe,i[s]==null){var S=l;if(n)return new Error("Required "+S+" `"+c+"` was not specified in "+("`"+o+"`."))}else return e.apply(void 0,[i,s,o,l,c].concat(v
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bme(e){return mme(e)||gme(e)||yme(e)||vme()}function ud(e){"@babel/helpers - typeof";return ud=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ud(e)}function Eme(e,t){if(ud(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ud(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sme(e){var t=Eme(e,"string");return ud(t)=="symbol"?t:String(t)}function rL(e,t,r){return t=Sme(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s_(){return s_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s_.apply(this,arguments)}function sI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ac(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sI(Object(r),!0).forEach(function(n){rL(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function wme(e){var t=e.length;if(t===0||t===1)return e;if(t===2)return[e[0],e[1],"".concat(e[0],".").concat(e[1]),"".concat(e[1],".").concat(e[0])];if(t===3)return[e[0],e[1],e[2],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0])];if(t>=4)return[e[0],e[1],e[2],e[3],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[2],".").concat(e[3]),"".concat(e[3],".").concat(e[0]),"".concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[0]),"".concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").con
Line truncated
|
||||
`))})}function Pme(e){var t=e.codeString,r=e.codeStyle,n=e.containerStyle,i=n===void 0?{float:"left",paddingRight:"10px"}:n,s=e.numberStyle,o=s===void 0?{}:s,l=e.startingLineNumber;return ls.createElement("code",{style:Object.assign({},r,i)},Tme({lines:t.replace(/\n$/,"").split(`
|
||||
`),style:o,startingLineNumber:l}))}function Rme(e){return"".concat(e.toString().length,".25em")}function iL(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function sL(e,t,r){var n={display:"inline-block",minWidth:Rme(r),paddingRight:"1em",textAlign:"right",userSelect:"none"},i=typeof e=="function"?e(t):e,s=no(no({},n),i);return s}function qg(e){var t=e.children,r=e.lineNumber,n=e.lineNumberStyle,i=e.largestLineNumber,s=e.showInlineLineNumbers,o=e.lineProps,l=o===void 0?{}:o,c=e.className,h=c===void 0?[]:c,v=e.showLineNumbers,y=e.wrapLongLines,S=typeof l=="function"?l(r):l;if(S.className=h,r&&s){var b=sL(n,r,i);t.unshift(iL(r,b))}return y&v&&(S.style=no(no({},S.style),{},{display:"flex"})),{type:"element",tagName:"span",properties:S,children:t}}function oL(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=0;n<e.length;n++){var i=e[n];if(i.type==="text")r.push(qg({children:[i],className:bme(new Set(t))}));else if(i.children){var s=t.concat(i.properties.className);oL(i.children,s).forEach(function(o){return r.push(o)})}}return r}function Ime(e,t,r,n,i,s,o,l,c){var h,v=oL(e.value),y=[],S=-1,b=0;function _(U,z){var J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return qg({children:U,lineNumber:z,lineNumberStyle:l,largestLineNumber:o,showInlineLineNumbers:i,lineProps:r,className:J,showLineNumbers:n,wrapLongLines:c})}function $(U,z){if(n&&z&&i){var J=sL(l,z,o);U.unshift(iL(z,J))}return U}function P(U,z){var J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return t||J.length>0?_(U,z,J):$(U,z)}for(var x=function(){var z=v[b],J=z.children[0].value,ee=kme(J);if(ee){var Q=J.split(`
|
||||
`);Q.forEach(function(f,ce){var L=n&&y.length+s,Fe={type:"text",value:"".concat(f,`
|
||||
`)};if(ce===0){var Xe=v.slice(S+1,b).concat(qg({children:[Fe],className:z.properties.className})),Ye=P(Xe,L);y.push(Ye)}else if(ce===Q.length-1){var he=v[b+1]&&v[b+1].children&&v[b+1].children[0],de={type:"text",value:"".concat(f)};if(he){var ge=qg({children:[de],className:z.properties.className});v.splice(b+1,0,ge)}else{var pe=[de],be=P(pe,L,z.properties.className);y.push(be)}}else{var ye=[Fe],Le=P(ye,L,z.properties.className);y.push(Le)}}),S=b}b++};b<v.length;)x();if(S!==v.length-1){var A=v.slice(S+1,v.length);if(A&&A.length){var C=n&&y.length+s,j=P(A,C);y.push(j)}}return t?y:(h=[]).concat.apply(h,y)}function Nme(e){var t=e.rows,r=e.stylesheet,n=e.useInlineStyles;return t.map(function(i,s){return nL({node:i,stylesheet:r,useInlineStyles:n,key:"code-segement".concat(s)})})}function aL(e){return e&&typeof e.highlightAuto<"u"}function jme(e){var t=e.astGenerator,r=e.language,n=e.code,i=e.defaultCodeValue;if(aL(t)){var s=Ome(t,r);return r==="text"?{value:i,language:"text"}:s?t.highlight(r,n):t.highlightAuto(n)}try{return r&&r!=="text"?{value:t.highlight(n,r)}:{value:i}}catch{return{value:i}}}function Mme(e,t){return function(n){var i=n.language,s=n.children,o=n.style,l=o===void 0?t:o,c=n.customStyle,h=c===void 0?{}:c,v=n.codeTagProps,y=v===void 0?{className:i?"language-".concat(i):void 0,style:no(no({},l['code[class*="language-"]']),l['code[class*="language-'.concat(i,'"]')])}:v,S=n.useInlineStyles,b=S===void 0?!0:S,_=n.showLineNumbers,$=_===void 0?!1:_,P=n.showInlineLineNumbers,x=P===void 0?!0:P,A=n.startingLineNumber,C=A===void 0?1:A,j=n.lineNumberContainerStyle,U=n.lineNumberStyle,z=U===void 0?{}:U,J=n.wrapLines,ee=n.wrapLongLines,Q=ee===void 0?!1:ee,f=n.lineProps,ce=f===void 0?{}:f,L=n.renderer,Fe=n.PreTag,Xe=Fe===void 0?"pre":Fe,Ye=n.CodeTag,he=Ye===void 0?"code":Ye,de=n.code,ge=de===void 0?(Array.isArray(s)?s[0]:s)||"":de,pe=n.astGenerator,be=hme(n,Cme);pe=pe||e;var ye=$?ls.createElement(Pme,{containerStyle:j,codeStyle:y.style||{},numberStyle:z,startingLineNumber:C,codeString:ge}):null,Le=l.hljs||l['pre[class*="language-"]']||{backgroundColor:"#fff"},se=aL(pe)?"hljs":"prismjs",_e=b?Object.assign({},be,{style:Object.assign({},Le,h)}):Object.assign({},be,{className:be.className?"".concat(se," ").concat(be.className):se,style:Object.assign({},h)});if(Q?y.style=no(no({},y.style),{},{whiteSpace:"pre-wrap"}):y.style=no(no({},y.style),{},{whiteSpace:"pre"}),!pe)return ls.createElement(Xe,_e,ye,ls.createElement(he,y,ge));(J===void 0&&L||Q)&&(J=!0),L=L||Nme;var Z=[{type:"text",value:ge}],V=jme({astGenerator:pe,language:i,code:ge,defaultCodeValue:Z});V.language===null&&(V.value=Z);var q=V.value.length+C,Ae=Ime(V,J,ce,$,x,C,q,z,Q);return ls.createElement(Xe,_e,ls.createElement(he,y,!x&&ye,L({rows:Ae,stylesheet:l,useInlineStyles:b})))}}var gu={};function NA(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(function(t){var r=e[t];typeof r=="object"&&!Object.isFrozen(r)&&NA(r)}),e}var lL=NA,Dme=NA;lL.default=Dme;let lI=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function Sc(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Na(e,...t){const r=Object.create(null);for(const n in e)r[n]=e[n];return t.forEach(function(n){for(const i in n)r[i]=n[i]}),r}const Fme="</span>",uI=e=>!!e.kind;class Lme{constructor(t,r){this.buffer="",this.classPrefix=r.classPrefix,t.walk(this)}addText(t){this.buffer+=Sc(t)}openNode(t){if(!uI(t))return;let r=t.kind;t.sublanguage||(r=`${this.classPrefix}${r}`),this.span(r)}closeNode(t){uI(t)&&(this.buffer+=Fme)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}class jA{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const r={kind:t,children:[]};this.add(r),this.stack.push(r)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,r){return typeof r=="string"?t.addText(r):r.children&&(t.openNode(r),r.children.forEach(n=>this._walk(t,n)),t.closeNode(r)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(r=>typeof r=="string")?t.children=[t.children.join("")]:t.children.forEach(r=>{jA._collapse(r)}))}}class Bme extends jA{constructor(t){super(),this.options=t}addKeyword(t,r){t!==""&&(this.openNode(r),this.addText(t),this.closeNode())}addText(t){t!==""&&this.add(t)}addSublanguage(t,r){const n=t.root;n.kind=r,n.sublanguage=!0,this.add(n)}toHTML(){return new Lme(this,this.options).value()}finalize(){r
Line truncated
|
||||
https://github.com/highlightjs/highlight.js/issues/2277`),Ae=se,q=_e);const Ee={code:q,language:Ae};be("before:highlight",Ee);const We=Ee.result?Ee.result:S(Ee.language,Ee.code,Z,V);return We.code=Ee.code,be("after:highlight",We),We}function S(se,_e,Z,V){function q(ut,nt){const vt=T.case_insensitive?nt[0].toLowerCase():nt[0];return Object.prototype.hasOwnProperty.call(ut.keywords,vt)&&ut.keywords[vt]}function Ae(){if(!te.keywords){me.addText(Ke);return}let ut=0;te.keywordPatternRe.lastIndex=0;let nt=te.keywordPatternRe.exec(Ke),vt="";for(;nt;){vt+=Ke.substring(ut,nt.index);const Lt=q(te,nt);if(Lt){const[Mr,zt]=Lt;if(me.addText(vt),vt="",yt+=zt,Mr.startsWith("_"))vt+=nt[0];else{const si=T.classNameAliases[Mr]||Mr;me.addKeyword(nt[0],si)}}else vt+=nt[0];ut=te.keywordPatternRe.lastIndex,nt=te.keywordPatternRe.exec(Ke)}vt+=Ke.substr(ut),me.addText(vt)}function Ee(){if(Ke==="")return;let ut=null;if(typeof te.subLanguage=="string"){if(!t[te.subLanguage]){me.addText(Ke);return}ut=S(te.subLanguage,Ke,!0,ue[te.subLanguage]),ue[te.subLanguage]=ut.top}else ut=_(Ke,te.subLanguage.length?te.subLanguage:null);te.relevance>0&&(yt+=ut.relevance),me.addSublanguage(ut.emitter,ut.language)}function We(){te.subLanguage!=null?Ee():Ae(),Ke=""}function lt(ut){return ut.className&&me.openNode(T.classNameAliases[ut.className]||ut.className),te=Object.create(ut,{parent:{value:te}}),te}function ze(ut,nt,vt){let Lt=Wme(ut.endRe,vt);if(Lt){if(ut["on:end"]){const Mr=new lI(ut);ut["on:end"](nt,Mr),Mr.isMatchIgnored&&(Lt=!1)}if(Lt){for(;ut.endsParent&&ut.parent;)ut=ut.parent;return ut}}if(ut.endsWithParent)return ze(ut.parent,nt,vt)}function rt(ut){return te.matcher.regexIndex===0?(Ke+=ut[0],1):(At=!0,0)}function Pt(ut){const nt=ut[0],vt=ut.rule,Lt=new lI(vt),Mr=[vt.__beforeBegin,vt["on:begin"]];for(const zt of Mr)if(zt&&(zt(ut,Lt),Lt.isMatchIgnored))return rt(nt);return vt&&vt.endSameAsBegin&&(vt.endRe=Ume(nt)),vt.skip?Ke+=nt:(vt.excludeBegin&&(Ke+=nt),We(),!vt.returnBegin&&!vt.excludeBegin&&(Ke=nt)),lt(vt),vt.returnBegin?0:nt.length}function mt(ut){const nt=ut[0],vt=_e.substr(ut.index),Lt=ze(te,ut,vt);if(!Lt)return hI;const Mr=te;Mr.skip?Ke+=nt:(Mr.returnEnd||Mr.excludeEnd||(Ke+=nt),We(),Mr.excludeEnd&&(Ke=nt));do te.className&&me.closeNode(),!te.skip&&!te.subLanguage&&(yt+=te.relevance),te=te.parent;while(te!==Lt.parent);return Lt.starts&&(Lt.endSameAsBegin&&(Lt.starts.endRe=Lt.endRe),lt(Lt.starts)),Mr.returnEnd?0:nt.length}function Rt(){const ut=[];for(let nt=te;nt!==T;nt=nt.parent)nt.className&&ut.unshift(nt.className);ut.forEach(nt=>me.openNode(nt))}let Ur={};function K(ut,nt){const vt=nt&&nt[0];if(Ke+=ut,vt==null)return We(),0;if(Ur.type==="begin"&&nt.type==="end"&&Ur.index===nt.index&&vt===""){if(Ke+=_e.slice(nt.index,nt.index+1),!i){const Lt=new Error("0 width match regex");throw Lt.languageName=se,Lt.badRule=Ur.rule,Lt}return 1}if(Ur=nt,nt.type==="begin")return Pt(nt);if(nt.type==="illegal"&&!Z){const Lt=new Error('Illegal lexeme "'+vt+'" for mode "'+(te.className||"<unnamed>")+'"');throw Lt.mode=te,Lt}else if(nt.type==="end"){const Lt=mt(nt);if(Lt!==hI)return Lt}if(nt.type==="illegal"&&vt==="")return 1;if(Ct>1e5&&Ct>nt.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ke+=vt,vt.length}const T=Ye(se);if(!T)throw oS(o.replace("{}",se)),new Error('Unknown language: "'+se+'"');const I=Ege(T,{plugins:n});let Y="",te=V||I;const ue={},me=new c.__emitter(c);Rt();let Ke="",yt=0,_t=0,Ct=0,At=!1;try{for(te.matcher.considerAll();;){Ct++,At?At=!1:te.matcher.considerAll(),te.matcher.lastIndex=_t;const ut=te.matcher.exec(_e);if(!ut)break;const nt=_e.substring(_t,ut.index),vt=K(nt,ut);_t=ut.index+vt}return K(_e.substr(_t)),me.closeAllNodes(),me.finalize(),Y=me.toHTML(),{relevance:Math.floor(yt),value:Y,language:se,illegal:!1,emitter:me,top:te}}catch(ut){if(ut.message&&ut.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:ut.message,context:_e.slice(_t-100,_t+100),mode:ut.mode},sofar:Y,relevance:0,value:aS(_e),emitter:me};if(i)return{illegal:!1,relevance:0,value:aS(_e),emitter:me,language:se,top:te,errorRaised:ut};throw ut}}function b(se){const _e={relevance:0,emitter:new c.__emitter(c),value:aS(se),illegal:!1,top:l};return _e.emitter.addText(se),_e}function _(se,_e){_e=_e||c.languages||Object.keys(t);const Z=b(se),V=_e.filter(Ye).filter(de).map(lt=>S(lt,se,!1));V.unshift(Z);const q=V.sort((lt,ze)=>{if(lt.relevance!==ze.relevance)return ze.relevance-lt.relevance;if(lt.language&&ze.language){if(Ye(lt.language).supersetOf===ze.language)return 1;if(Ye(ze.language).supersetOf===lt.language)return-1}return 0}),[Ae,Ee]=q,We=Ae;return We.second_best=Ee,We}function $(se){return c.tabReplace||c.useBR?se.replace(s,_e=>_e===`
|
||||
`?c.useBR?"<br>":_e:c.tabReplace?_e.replace(/\t/g,c.tabReplace):_e):se}function P(se,_e,Z){const V=_e?r[_e]:Z;se.classList.add("hljs"),V&&se.classList.add(V)}const x={"before:highlightElement":({el:se})=>{c.useBR&&(se.innerHTML=se.innerHTML.replace(/\n/g,"").replace(/<br[ /]*>/g,`
|
||||
`))},"after:highlightElement":({result:se})=>{c.useBR&&(se.value=se.value.replace(/\n/g,"<br>"))}},A=/^(<[^>]+>|\t)+/gm,C={"after:highlightElement":({result:se})=>{c.tabReplace&&(se.value=se.value.replace(A,_e=>_e.replace(/\t/g,c.tabReplace)))}};function j(se){let _e=null;const Z=v(se);if(h(Z))return;be("before:highlightElement",{el:se,language:Z}),_e=se;const V=_e.textContent,q=Z?y(V,{language:Z,ignoreIllegals:!0}):_(V);be("after:highlightElement",{el:se,result:q,text:V}),se.innerHTML=q.value,P(se,Z,q.language),se.result={language:q.language,re:q.relevance,relavance:q.relevance},q.second_best&&(se.second_best={language:q.second_best.language,re:q.second_best.relevance,relavance:q.second_best.relevance})}function U(se){se.useBR&&(ts("10.3.0","'useBR' will be removed entirely in v11.0"),ts("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),c=dI(c,se)}const z=()=>{if(z.called)return;z.called=!0,ts("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead."),document.querySelectorAll("pre code").forEach(j)};function J(){ts("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),ee=!0}let ee=!1;function Q(){if(document.readyState==="loading"){ee=!0;return}document.querySelectorAll("pre code").forEach(j)}function f(){ee&&Q()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",f,!1);function ce(se,_e){let Z=null;try{Z=_e(e)}catch(V){if(oS("Language definition for '{}' could not be registered.".replace("{}",se)),i)oS(V);else throw V;Z=l}Z.name||(Z.name=se),t[se]=Z,Z.rawDefinition=_e.bind(null,e),Z.aliases&&he(Z.aliases,{languageName:se})}function L(se){delete t[se];for(const _e of Object.keys(r))r[_e]===se&&delete r[_e]}function Fe(){return Object.keys(t)}function Xe(se){ts("10.4.0","requireLanguage will be removed entirely in v11."),ts("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const _e=Ye(se);if(_e)return _e;throw new Error("The '{}' language is required, but not loaded.".replace("{}",se))}function Ye(se){return se=(se||"").toLowerCase(),t[se]||t[r[se]]}function he(se,{languageName:_e}){typeof se=="string"&&(se=[se]),se.forEach(Z=>{r[Z.toLowerCase()]=_e})}function de(se){const _e=Ye(se);return _e&&!_e.disableAutodetect}function ge(se){se["before:highlightBlock"]&&!se["before:highlightElement"]&&(se["before:highlightElement"]=_e=>{se["before:highlightBlock"](Object.assign({block:_e.el},_e))}),se["after:highlightBlock"]&&!se["after:highlightElement"]&&(se["after:highlightElement"]=_e=>{se["after:highlightBlock"](Object.assign({block:_e.el},_e))})}function pe(se){ge(se),n.push(se)}function be(se,_e){const Z=se;n.forEach(function(V){V[Z]&&V[Z](_e)})}function ye(se){return ts("10.2.0","fixMarkup will be removed entirely in v11.0"),ts("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),$(se)}function Le(se){return ts("10.7.0","highlightBlock will be removed entirely in v12.0"),ts("10.7.0","Please use highlightElement now."),j(se)}Object.assign(e,{highlight:y,highlightAuto:_,highlightAll:Q,fixMarkup:ye,highlightElement:j,highlightBlock:Le,configure:U,initHighlighting:z,initHighlightingOnLoad:J,registerLanguage:ce,unregisterLanguage:L,listLanguages:Fe,getLanguage:Ye,registerAliases:he,requireLanguage:Xe,autoDetection:de,inherit:dI,addPlugin:pe,vuePlugin:xge(e).VuePlugin}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=wge;for(const se in ig)typeof ig[se]=="object"&&lL(ig[se]);return Object.assign(e,ig),e.addPlugin(x),e.addPlugin(Age),e.addPlugin(C),e};var $ge=Cge({}),kge=$ge,mL={exports:{}};(function(e){(function(){var t;t=e.exports=i,t.format=i,t.vsprintf=n,typeof console<"u"&&typeof console.log=="function"&&(t.printf=r);function r(){console.log(i.apply(null,arguments))}function n(s,o){return i.apply(null,[s].concat(o))}function i(s){for(var o=1,l=[].slice.call(arguments),c=0,h=s.length,v="",y,S=!1,b,_,$=!1,P,x=function(){return l[o++]},A=function(){for(var C="";/\d/.test(s[c]);)C+=s[c++],y=s[c];return C.length>0?parseInt(C):null};c<h;++c)if(y=s[c],S)switch(S=!1,y=="."?($=!1,y=s[++c]):y=="0"&&s[c+1]=="."?($=!0,c+=2,y=s[c]):$=!0,P=A(),y){case"b":v+=parseInt(x(),10).toString(2);break;case"c":b=x(),typeof b=="string"||b instanceof String?v+=b:v+=String.fromCharCode(parseInt(b,10));break;case"d":v+=parseInt(x(),10);break;case"f":_=String(parseFloat(x()).toFixed(P||6)),v+=$?_:_.replace(/^0/,"");break;case"j":v+=JSON.stringify(x());break;case"o":v+="0"+parseInt(x(),10).toString(8);break;case"s":v+=x();break;case"x":v+="0x"+parseInt(x(),10).toString(16);break;case"X":v+="0x"+parseInt(x(),10).toString(16).toUpperCase();break;default:v+=y;break}else y==="%"?S=!0:v+=y;return v}})()})(mL);var Tge=mL.exports,Pge=Tge,rl=nl(Error),Rge=rl;rl.eval=nl(EvalError);rl.range=nl(RangeError);rl.reference=nl(ReferenceError);rl.syntax=nl(SyntaxError);rl.type=nl(TypeError);rl.uri=nl(URIError);rl.create=nl;function nl(e){return t.displayName=e.displayName||e
Line truncated
|
||||
/* [wrapped with `+t+`] */
|
||||
`)}var D0e=M0e;function F0e(e){return e!==e}var L0e=F0e;function B0e(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}var U0e=B0e,V0e=gD,z0e=L0e,q0e=U0e;function W0e(e,t,r){return t===t?q0e(e,t,r):V0e(e,z0e,r)}var K0e=W0e,H0e=K0e;function J0e(e,t){var r=e==null?0:e.length;return!!r&&H0e(e,t,0)>-1}var G0e=J0e,Y0e=pA,X0e=G0e,Q0e=1,Z0e=2,e1e=8,t1e=16,r1e=32,n1e=64,i1e=128,s1e=256,o1e=512,a1e=[["ary",i1e],["bind",Q0e],["bindKey",Z0e],["curry",e1e],["curryRight",t1e],["flip",o1e],["partial",r1e],["partialRight",n1e],["rearg",s1e]];function l1e(e,t){return Y0e(a1e,function(r){var n="_."+r[0];t&r[1]&&!X0e(e,n)&&e.push(n)}),e.sort()}var u1e=l1e,c1e=N0e,f1e=D0e,p1e=Z2,d1e=u1e;function h1e(e,t,r){var n=t+"";return p1e(e,f1e(n,d1e(c1e(n),r)))}var NL=h1e,m1e=C0e,g1e=IL,y1e=NL,v1e=1,b1e=2,E1e=4,S1e=8,$I=32,kI=64;function w1e(e,t,r,n,i,s,o,l,c,h){var v=t&S1e,y=v?o:void 0,S=v?void 0:o,b=v?s:void 0,_=v?void 0:s;t|=v?$I:kI,t&=~(v?kI:$I),t&E1e||(t&=~(v1e|b1e));var $=[e,t,i,b,y,_,S,l,c,h],P=r.apply(void 0,$);return m1e(e)&&g1e(P,$),P.placeholder=n,y1e(P,e,t)}var jL=w1e;function _1e(e){var t=e;return t.placeholder}var ML=_1e,x1e=zd,A1e=Kd,O1e=Math.min;function C1e(e,t){for(var r=e.length,n=O1e(t.length,r),i=x1e(e);n--;){var s=t[n];e[n]=A1e(s,r)?i[s]:void 0}return e}var $1e=C1e,TI="__lodash_placeholder__";function k1e(e,t){for(var r=-1,n=e.length,i=0,s=[];++r<n;){var o=e[r];(o===t||o===TI)&&(e[r]=TI,s[i++]=r)}return s}var VA=k1e,T1e=kL,P1e=TL,R1e=Kve,PI=B0,I1e=jL,N1e=ML,j1e=$1e,M1e=VA,D1e=ei,F1e=1,L1e=2,B1e=8,U1e=16,V1e=128,z1e=512;function DL(e,t,r,n,i,s,o,l,c,h){var v=t&V1e,y=t&F1e,S=t&L1e,b=t&(B1e|U1e),_=t&z1e,$=S?void 0:PI(e);function P(){for(var x=arguments.length,A=Array(x),C=x;C--;)A[C]=arguments[C];if(b)var j=N1e(P),U=R1e(A,j);if(n&&(A=T1e(A,n,i,b)),s&&(A=P1e(A,s,o,b)),x-=U,b&&x<h){var z=M1e(A,j);return I1e(e,t,DL,P.placeholder,r,A,z,l,c,h-x)}var J=y?r:this,ee=S?J[e]:e;return x=A.length,l?A=j1e(A,l):_&&x>1&&A.reverse(),v&&c<x&&(A.length=c),this&&this!==D1e&&this instanceof P&&(ee=$||PI(ee)),ee.apply(J,A)}return P}var FL=DL,q1e=Q2,W1e=B0,K1e=FL,H1e=jL,J1e=ML,G1e=VA,Y1e=ei;function X1e(e,t,r){var n=W1e(e);function i(){for(var s=arguments.length,o=Array(s),l=s,c=J1e(i);l--;)o[l]=arguments[l];var h=s<3&&o[0]!==c&&o[s-1]!==c?[]:G1e(o,c);if(s-=h.length,s<r)return H1e(e,t,K1e,i.placeholder,void 0,o,h,void 0,void 0,r-s);var v=this&&this!==Y1e&&this instanceof i?n:e;return q1e(v,this,o)}return i}var Q1e=X1e,Z1e=Q2,ebe=B0,tbe=ei,rbe=1;function nbe(e,t,r,n){var i=t&rbe,s=ebe(e);function o(){for(var l=-1,c=arguments.length,h=-1,v=n.length,y=Array(v+c),S=this&&this!==tbe&&this instanceof o?s:e;++h<v;)y[h]=n[h];for(;c--;)y[h++]=arguments[++l];return Z1e(S,i?r:this,y)}return o}var ibe=nbe,sbe=kL,obe=TL,RI=VA,II="__lodash_placeholder__",pS=1,abe=2,lbe=4,NI=8,gp=128,jI=256,ube=Math.min;function cbe(e,t){var r=e[1],n=t[1],i=r|n,s=i<(pS|abe|gp),o=n==gp&&r==NI||n==gp&&r==jI&&e[7].length<=t[8]||n==(gp|jI)&&t[7].length<=t[8]&&r==NI;if(!(s||o))return e;n&pS&&(e[2]=t[2],i|=r&pS?0:lbe);var l=t[3];if(l){var c=e[3];e[3]=c?sbe(c,l,t[4]):l,e[4]=c?RI(e[3],II):t[4]}return l=t[5],l&&(c=e[5],e[5]=c?obe(c,l,t[6]):l,e[6]=c?RI(e[5],II):t[6]),l=t[7],l&&(e[7]=l),n&gp&&(e[8]=e[8]==null?t[8]:ube(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e}var fbe=cbe,pbe=$L,dbe=Bve,hbe=Q1e,mbe=FL,gbe=ibe,ybe=PL,vbe=fbe,bbe=IL,Ebe=NL,MI=uA,Sbe="Expected a function",DI=1,wbe=2,dS=8,hS=16,mS=32,FI=64,LI=Math.max;function _be(e,t,r,n,i,s,o,l){var c=t&wbe;if(!c&&typeof e!="function")throw new TypeError(Sbe);var h=n?n.length:0;if(h||(t&=~(mS|FI),n=i=void 0),o=o===void 0?o:LI(MI(o),0),l=l===void 0?l:MI(l),h-=i?i.length:0,t&FI){var v=n,y=i;n=i=void 0}var S=c?void 0:ybe(e),b=[e,t,r,n,i,v,y,s,o,l];if(S&&vbe(b,S),e=b[0],t=b[1],r=b[2],n=b[3],i=b[4],l=b[9]=b[9]===void 0?c?0:e.length:LI(b[9]-h,0),!l&&t&(dS|hS)&&(t&=~(dS|hS)),!t||t==DI)var _=dbe(e,t,r);else t==dS||t==hS?_=hbe(e,t,l):(t==mS||t==(DI|mS))&&!i.length?_=gbe(e,t,r,n):_=mbe.apply(void 0,b);var $=S?pbe:bbe;return Ebe($(_,b),e,t)}var zA=_be,xbe=zA,Abe=128;function Obe(e,t,r){return t=r?void 0:t,t=e&&t==null?e.length:t,xbe(e,Abe,void 0,void 0,void 0,void 0,t)}var Cbe=Obe,$be=dA,kbe=4;function Tbe(e){return $be(e,kbe)}var Pbe=Tbe,Rbe=zA,Ibe=8;function qA(e,t,r){t=r?void 0:t;var n=Rbe(e,Ibe,void 0,void 0,void 0,void 0,void 0,t);return n.placeholder=qA.placeholder,n}qA.placeholder={};var Nbe=qA,jbe=So,Mbe=ri,Dbe=$0,Fbe="[object DOMException]",Lbe="[object Error]";function Bbe(e){if(!Mbe(e))return!1;var t=jbe(e);return t==Lbe||t==Fbe||typeof e.message=="string"&&typeof e.name=="string"&&!Dbe(e)}var Ube=Bbe,Vbe=uf,zbe=ri,qbe="[object WeakMap]";function Wbe(e){return zbe(e)&&Vbe(e)==qbe}var Kbe=Wbe,Hbe=dA,Jbe=Xd,Gbe=1;function Ybe(e){return Jbe(typeof e=="function"?e:Hbe(e,Gbe))}var Xbe=Ybe,Qbe=zA,Zbe=DD,eEe=256,tEe=Zbe(function(e,t){return Qbe(e,eEe,void 0,void 0,void 0,t)}),rEe=tEe,nEe=tA,iEe=zd,sEe=vn,oEe=Gd,aEe=hD,lEe=hu,uEe=P0;function cEe(e){return sEe(e)?nEe(e,lEe):oEe(e)?[e]:iEe(aEe(uEe(e)))}var fEe=
Line truncated
|
||||
* https://github.com/Starcounter-Jack/JSON-Patch
|
||||
* (c) 2017-2022 Joachim Wester
|
||||
* MIT licensed
|
||||
*/var SEe=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)i.hasOwnProperty(s)&&(n[s]=i[s])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),wEe=Object.prototype.hasOwnProperty;function u_(e,t){return wEe.call(e,t)}function c_(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);var n=[];for(var i in e)u_(e,i)&&n.push(i);return n}function Ti(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function f_(e){for(var t=0,r=e.length,n;t<r;){if(n=e.charCodeAt(t),n>=48&&n<=57){t++;continue}return!1}return!0}function Ml(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function BL(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function p_(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(p_(e[t]))return!0}else if(typeof e=="object"){for(var n=c_(e),i=n.length,s=0;s<i;s++)if(p_(e[n[s]]))return!0}}return!1}function BI(e,t){var r=[e];for(var n in t){var i=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof i<"u"&&r.push(n+": "+i)}return r.join(`
|
||||
`)}var UL=function(e){SEe(t,e);function t(r,n,i,s,o){var l=this.constructor,c=e.call(this,BI(r,{name:n,index:i,operation:s,tree:o}))||this;return c.name=n,c.index=i,c.operation=s,c.tree=o,Object.setPrototypeOf(c,l.prototype),c.message=BI(r,{name:n,index:i,operation:s,tree:o}),c}return t}(Error),zr=UL,_Ee=Ti,lc={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=pd(r,this.path);n&&(n=Ti(n));var i=Gl(r,{op:"remove",path:this.from}).removed;return Gl(r,{op:"add",path:this.path,value:i}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=pd(r,this.from);return Gl(r,{op:"add",path:this.path,value:Ti(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:dd(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},xEe={add:function(e,t,r){return f_(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){var n=e.splice(t,1);return{newDocument:r,removed:n[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:lc.move,copy:lc.copy,test:lc.test,_get:lc._get};function pd(e,t){if(t=="")return e;var r={op:"_get",path:t};return Gl(e,r),r.value}function Gl(e,t,r,n,i,s){if(r===void 0&&(r=!1),n===void 0&&(n=!0),i===void 0&&(i=!0),s===void 0&&(s=0),r&&(typeof r=="function"?r(t,0,e,t.path):Iy(t,0)),t.path===""){var o={newDocument:e};if(t.op==="add")return o.newDocument=t.value,o;if(t.op==="replace")return o.newDocument=t.value,o.removed=e,o;if(t.op==="move"||t.op==="copy")return o.newDocument=pd(e,t.from),t.op==="move"&&(o.removed=e),o;if(t.op==="test"){if(o.test=dd(e,t.value),o.test===!1)throw new zr("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o.newDocument=e,o}else{if(t.op==="remove")return o.removed=e,o.newDocument=null,o;if(t.op==="_get")return t.value=e,o;if(r)throw new zr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,t,e);return o}}else{n||(e=Ti(e));var l=t.path||"",c=l.split("/"),h=e,v=1,y=c.length,S=void 0,b=void 0,_=void 0;for(typeof r=="function"?_=r:_=Iy;;){if(b=c[v],b&&b.indexOf("~")!=-1&&(b=BL(b)),i&&(b=="__proto__"||b=="prototype"&&v>0&&c[v-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&S===void 0&&(h[b]===void 0?S=c.slice(0,v).join("/"):v==y-1&&(S=t.path),S!==void 0&&_(t,0,e,S)),v++,Array.isArray(h)){if(b==="-")b=h.length;else{if(r&&!f_(b))throw new zr("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",s,t,e);f_(b)&&(b=~~b)}if(v>=y){if(r&&t.op==="add"&&b>h.length)throw new zr("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);var o=xEe[t.op].call(t,h,b,e);if(o.test===!1)throw new zr("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}}else if(v>=y){var o=lc[t.op].call(t,h,b,e);if(o.test===!1)throw new zr("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}if(h=h[b],r&&v<y&&(!h||typeof h!="object"))throw new zr("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,t,e)}}}function Pa(e,t,r,n,i){if(n===void 0&&(n=!0),i===void 0&&(i=!0),r&&!Array.isArray(t))throw new zr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=Ti(e));for(var s=new Array(t.length),o=0,l=t.length;o<l;o++)s[o]=Gl(e,t[o],r,!0,i,o),e=s[o].newDocument;return s.newDocument=e,s}function AEe(e,t,r){var n=Gl(e,t);if(n.test===!1)throw new zr("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function Iy(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new zr("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(lc[e.op]){if(typeof e.path!="string")throw new zr("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new zr('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,r);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new zr("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new zr("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&p_(e.value))throw new zr("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERA
Line truncated
|
||||
* https://github.com/Starcounter-Jack/JSON-Patch
|
||||
* (c) 2017-2021 Joachim Wester
|
||||
* MIT license
|
||||
*/var WA=new WeakMap,CEe=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),$Ee=function(){function e(t,r){this.callback=t,this.observer=r}return e}();function kEe(e){return WA.get(e)}function TEe(e,t){return e.observers.get(t)}function PEe(e,t){e.observers.delete(t.callback)}function REe(e,t){t.unobserve()}function IEe(e,t){var r=[],n,i=kEe(e);if(!i)i=new CEe(e),WA.set(e,i);else{var s=TEe(i,t);n=s&&s.observer}if(n)return n;if(n={},i.value=Ti(e),t){n.callback=t,n.next=null;var o=function(){d_(n)},l=function(){clearTimeout(n.next),n.next=setTimeout(o)};typeof window<"u"&&(window.addEventListener("mouseup",l),window.addEventListener("keyup",l),window.addEventListener("mousedown",l),window.addEventListener("keydown",l),window.addEventListener("change",l))}return n.patches=r,n.object=e,n.unobserve=function(){d_(n),clearTimeout(n.next),PEe(i,n),typeof window<"u"&&(window.removeEventListener("mouseup",l),window.removeEventListener("keyup",l),window.removeEventListener("mousedown",l),window.removeEventListener("keydown",l),window.removeEventListener("change",l))},i.observers.set(t,new $Ee(t,n)),n}function d_(e,t){t===void 0&&(t=!1);var r=WA.get(e.object);KA(r.value,e.object,e.patches,"",t),e.patches.length&&Pa(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function KA(e,t,r,n,i){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var s=c_(t),o=c_(e),l=!1,c=o.length-1;c>=0;c--){var h=o[c],v=e[h];if(u_(t,h)&&!(t[h]===void 0&&v!==void 0&&Array.isArray(t)===!1)){var y=t[h];typeof v=="object"&&v!=null&&typeof y=="object"&&y!=null&&Array.isArray(v)===Array.isArray(y)?KA(v,y,r,n+"/"+Ml(h),i):v!==y&&(i&&r.push({op:"test",path:n+"/"+Ml(h),value:Ti(v)}),r.push({op:"replace",path:n+"/"+Ml(h),value:Ti(y)}))}else Array.isArray(e)===Array.isArray(t)?(i&&r.push({op:"test",path:n+"/"+Ml(h),value:Ti(v)}),r.push({op:"remove",path:n+"/"+Ml(h)}),l=!0):(i&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}))}if(!(!l&&s.length==o.length))for(var c=0;c<s.length;c++){var h=s[c];!u_(e,h)&&t[h]!==void 0&&r.push({op:"add",path:n+"/"+Ml(h),value:Ti(t[h])})}}}function NEe(e,t,r){r===void 0&&(r=!1);var n=[];return KA(e,t,n,"",r),n}const jEe=Object.freeze(Object.defineProperty({__proto__:null,compare:NEe,generate:d_,observe:IEe,unobserve:REe},Symbol.toStringTag,{value:"Module"}));Object.assign({},OEe,jEe,{JsonPatchError:UL,deepClone:Ti,escapePathComponent:Ml,unescapePathComponent:BL});var MEe=function(t){return DEe(t)&&!FEe(t)};function DEe(e){return!!e&&typeof e=="object"}function FEe(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||UEe(e)}var LEe=typeof Symbol=="function"&&Symbol.for,BEe=LEe?Symbol.for("react.element"):60103;function UEe(e){return e.$$typeof===BEe}function VEe(e){return Array.isArray(e)?[]:{}}function hd(e,t){return t.clone!==!1&&t.isMergeableObject(e)?jc(VEe(e),e,t):e}function zEe(e,t,r){return e.concat(t).map(function(n){return hd(n,r)})}function qEe(e,t){if(!t.customMerge)return jc;var r=t.customMerge(e);return typeof r=="function"?r:jc}function WEe(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function UI(e){return Object.keys(e).concat(WEe(e))}function zL(e,t){try{return t in e}catch{return!1}}function KEe(e,t){return zL(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function HEe(e,t,r){var n={};return r.isMergeableObject(e)&&UI(e).forEach(function(i){n[i]=hd(e[i],r)}),UI(t).forEach(function(i){KEe(e,i)||(zL(e,i)&&r.isMergeableObject(t[i])?n[i]=qEe(i,r)(e[i],t[i],r):n[i]=hd(t[i],r))}),n}function jc(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||zEe,r.isMergeableObject=r.isMergeableObject||MEe,r.cloneUnlessOtherwiseSpecified=hd;var n=Array.isArray(t),i=Array.isArray(e),s=n===i;return s?n?r.arrayMerge(e,t,r):HEe(e,t,r):hd(t,r)}jc.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(n,i){return jc(n,i,r)},{})};var JEe=jc,GEe=JEe;const YEe=Tt(GEe),ar={add:QEe,replace:Hg,remove:ZEe,merge:eSe,mergeDeep:tSe,context:rSe,getIn:oSe,applyPatch:XEe,parentPathMatch:sSe,flatten:ah,fullyNormalizeArray:aSe,normalizeArray:WL,isPromise:lSe,forEachNew:nSe,forEachNewPrimitive:iSe,isJsonPatch:JL,isContextPatch:fSe,isPatch:U0,isMutation:GL,isAdditiveMutation:Ny,isGenerator:cSe,isFunction:HL,isObject:Yl,isError:uSe};function XEe(e,t,r){if(r=r||{},t={...t,path:t.path&&VI(t.path)},t.op==="merge"){const n=gS(e,t.path);Object.assign(n,t.value),Pa(e,[Hg(t.path,n)])}else if(t.op==="mergeDeep"){const n=gS(e,t.path),i=YEe(n,t.value);e=Pa(e,[Hg(t.path,i)]).newDocument}else if(t.op==="add"&&t.path===""&&Yl(t.value)){const n=Object.keys(t.value).reduce((i,s)=>(i.push({op:"add",path:`/${VI(s)}`,value:t.value[s]}),i),[]);Pa(e,n)}else if(t.op==="replace"&&t.path===""){let{value:n}=t;r.allowMetaPatches&&t.meta&&Ny(t)&&(Array.isArray(tLine truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function X_e(e,t){if(e){if(typeof e=="string")return b_(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b_(e,t)}}function Q_e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Z_e(e){if(Array.isArray(e))return b_(e)}function b_(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var exe=swe(function(e,t){return e.length>t.length}),txe=bn(n_e(exe),cwe,fh("length")),rxe=sO(function(e,t,r){var n=r.apply(void 0,G_e(e));return d_e(n)?r_e(n):t}),nxe=function(t){var r=txe(t);return Sr(r,function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return yu(rxe(i),void 0,t)})},vB=oO(w_e,nxe,mh),G0=Mwe(Uwe),By=Sr(3,function(e,t,r){var n=Gn(e,r),i=Gn(Vwe(e),r);if(!$_e(n)&&!b_e(e)){var s=ph(n,i);return YSe(s,t)}}),ixe=c_e(bu,Dc(/[.*+?^${}()|[\]\\-]/g,"\\$&"));const sxe=ixe;var oxe=function(t,r,n){if(n==null||t==null||r==null)throw TypeError("Input values must not be `null` or `undefined`")},XI=function(t,r){if(typeof t!="string"&&!(t instanceof String))throw TypeError("`".concat(r,"` must be a string"))},axe=function(t){if(typeof t!="string"&&!(t instanceof String)&&!(t instanceof RegExp))throw TypeError("`searchValue` must be a string or an regexp")},lxe=function(t,r,n){oxe(t,r,n),XI(n,"str"),XI(r,"replaceValue"),axe(t);var i=new RegExp(W_e(t)?t:sxe(t),"g");return Dc(i,r,n)};const uxe=lxe;var cxe=Sr(3,uxe),fxe=aO(2,"replaceAll"),pxe=aa(String.prototype.replaceAll)?fxe:cxe,dxe=sO(function(e,t){return bn(lO(""),Cwe(G0(e)),iB(""))(t)}),cO=sO(function(e,t){return bn(lO(""),Twe(G0(e)),iB(""))(t)}),bB={exports:{}},Yr=bB.exports={},to,ro;function E_(){throw new Error("setTimeout has not been defined")}function S_(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?to=setTimeout:to=E_}catch{to=E_}try{typeof clearTimeout=="function"?ro=clearTimeout:ro=S_}catch{ro=S_}})();function EB(e){if(to===setTimeout)return setTimeout(e,0);if((to===E_||!to)&&setTimeout)return to=setTimeout,setTimeout(e,0);try{return to(e,0)}catch{try{return to.call(null,e,0)}catch{return to.call(this,e,0)}}}function hxe(e){if(ro===clearTimeout)return clearTimeout(e);if((ro===S_||!ro)&&clearTimeout)return ro=clearTimeout,clearTimeout(e);try{return ro(e)}catch{try{return ro.call(null,e)}catch{return ro.call(this,e)}}}var Mo=[],wc=!1,ql,Jg=-1;function mxe(){!wc||!ql||(wc=!1,ql.length?Mo=ql.concat(Mo):Jg=-1,Mo.length&&SB())}function SB(){if(!wc){var e=EB(mxe);wc=!0;for(var t=Mo.length;t;){for(ql=Mo,Mo=[];++Jg<t;)ql&&ql[Jg].run();Jg=-1,t=Mo.length}ql=null,wc=!1,hxe(e)}}Yr.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];Mo.push(new wB(e,t)),Mo.length===1&&!wc&&EB(SB)};function wB(e,t){this.fun=e,this.array=t}wB.prototype.run=function(){this.fun.apply(null,this.array)};Yr.title="browser";Yr.browser=!0;Yr.env={};Yr.argv=[];Yr.version="";Yr.versions={};function la(){}Yr.on=la;Yr.addListener=la;Yr.once=la;Yr.off=la;Yr.removeListener=la;Yr.removeAllListeners=la;Yr.emit=la;Yr.prependListener=la;Yr.prependOnceListener=la;Yr.listeners=function(e){return[]};Yr.binding=function(e){throw new Error("process.binding is not supported")};Yr.cwd=function(){return"/"};Yr.chdir=function(e){throw new Error("process.chdir is not supported")};Yr.umask=function(){return 0};var gxe=bB.exports;const Uy=Tt(gxe),fO=()=>H0(s_e(/^win/),["platform"],Uy),pO=e=>{try{const t=new URL(e);return dxe(":",t.protocol)}catch{return}};bn(pO,cB);const yxe=e=>{const t=e.lastIndexOf(".");return t>=0?e.substring(t).toLowerCase():""},Vp=e=>{if(Uy.browser)return!1;const t=pO(e);return oa(t)||t==="file"||/^[a-zA-Z]$/.test(t)},_c=e=>{const t=pO(e);return t==="http"||t==="https"},_B=(e,t)=>{const r=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],n=y_(!1,"keepFileProtocol",t),i=y_(fO,"isWindows",t);let s=decodeURI(e);for(let l=0;l<r.length;l+=2)s=s.replace(r[l],r[l+1]);let o=s.substring(0,7).toLowerCase()==="file://";return o&&(s=s[7]==="/"?s.substring(8):s.substring(7),i()&&s[1]==="/"&&(s=`${s[0]}:${s.substring(1)}`),n?s=`file:///${s}`:(o=!1,s=i()?s:`/${s}`)),i()&&!o&&(s=pxe("/","\\",s),s.substring(1,3)===":\\"&&(s=s[0].toUpperCase()+s.substring(1))),s},vxe=e=>{const t=[/\?/g,"%3F",/#/g,"%23"];let r=e;fO()&&(r=r.replace(/\\/g,"/")),r=encodeURI(r);for(let n=0;n<t.length;n+=2)r=r.replace(t[n],t[n+1]);return r},xB=e=>{const t=e.indexOf("#");return t!==-1?e.substring(t):"#"},qr=e=>{const t=e.indexOf("#");let r=e;return t>=0&&(r=e.substring(0,t)),r},w_=()=>{if(Uy.browser)return qr(globalThis.location.href);const e=Uy.cwd(),t=K0(e);return["/","\\"].includes(t)?e:e+(fO()?"\\":"/")},gn=(e,t)=>{c
Line truncated
|
||||
CAUSE: ${i.stack}`)}}}class SCe extends Error{static[Symbol.hasInstance](t){return super[Symbol.hasInstance](t)||Function.prototype[Symbol.hasInstance].call(ECe,t)}constructor(t,r){if(super(t,r),this.name=this.constructor.name,typeof t=="string"&&(this.message=t),typeof Error.captureStackTrace=="function"?Error.captureStackTrace(this,this.constructor):this.stack=new Error(t).stack,r!=null&&typeof r=="object"&&Object.hasOwn(r,"cause")&&!("cause"in this)){const{cause:n}=r;this.cause=n,n instanceof Error&&"stack"in n&&(this.stack=`${this.stack}
|
||||
CAUSE: ${n.stack}`)}}}const Kr=SCe;class wCe extends Kr{constructor(t,r){if(super(t,r),r!=null&&typeof r=="object"){const{cause:n,...i}=r;Object.assign(this,i)}}}const yh=wCe;class wn extends Kr{}class _Ce extends wn{}const fo=_Ce;class xCe extends Kr{constructor(r,n){super(r,{cause:n.cause});ie(this,"plugin");this.plugin=n.plugin}}const AO=async(e,t,r)=>{const n=await Promise.all(r.map(By([e],[t])));return r.filter((i,s)=>n[s])},OO=async(e,t,r)=>{let n;for(const i of r)try{const s=await i[e].call(i,...t);return{plugin:i,result:s}}catch(s){n=new xCe("Error while running plugin",{cause:s,plugin:i})}return Promise.reject(n)};class T_ extends Kr{}class CO extends Kr{}class ACe extends CO{}const t6=ACe;class OCe extends t6{}const r6=OCe,CCe=async(e,t)=>{const r=t.resolve.resolvers.map(i=>{const s=Object.create(i);return Object.assign(s,t.resolve.resolverOpts)}),n=await AO("canRead",e,r);if(hh(n))throw new r6(e.uri);try{const{result:i}=await OO("read",[e],n);return i}catch(i){throw new CO(`Error while reading file "${e.uri}"`,{cause:i})}},$Ce=async(e,t)=>{const r=t.parse.parsers.map(i=>{const s=Object.create(i);return Object.assign(s,t.parse.parserOpts)}),n=await AO("canParse",e,r);if(hh(n))throw new r6(e.uri);try{const{plugin:i,result:s}=await OO("parse",[e],n);return!i.allowEmpty&&s.isEmpty?Promise.reject(new T_(`Error while parsing file "${e.uri}". File is empty.`)):s}catch(i){throw new T_(`Error while parsing file "${e.uri}"`,{cause:i})}},n6=async(e,t)=>{const r=nu({uri:gh(qr(e)),mediaType:t.parse.mediaType}),n=await CCe(r,t);return $Ce(nu({...r,data:n}),t)};function kCe(e){return e===null}var TCe=kCe,PCe=So,RCe=ri,ICe="[object Number]";function NCe(e){return typeof e=="number"||RCe(e)&&PCe(e)==ICe}var jCe=NCe,MCe=So,DCe=ri,FCe="[object Boolean]";function LCe(e){return e===!0||e===!1||DCe(e)&&MCe(e)==FCe}var BCe=LCe;let UCe=class{constructor(t){this.namespace=t||new this.Namespace}serialise(t){if(!(t instanceof this.namespace.elements.Element))throw new TypeError(`Given element \`${t}\` is not an Element instance`);const r={element:t.element};t._meta&&t._meta.length>0&&(r.meta=this.serialiseObject(t.meta)),t._attributes&&t._attributes.length>0&&(r.attributes=this.serialiseObject(t.attributes));const n=this.serialiseContent(t.content);return n!==void 0&&(r.content=n),r}deserialise(t){if(!t.element)throw new Error("Given value is not an object containing an element name");const r=this.namespace.getElementClass(t.element),n=new r;n.element!==t.element&&(n.element=t.element),t.meta&&this.deserialiseObject(t.meta,n.meta),t.attributes&&this.deserialiseObject(t.attributes,n.attributes);const i=this.deserialiseContent(t.content);return(i!==void 0||n.content===null)&&(n.content=i),n}serialiseContent(t){if(t instanceof this.namespace.elements.Element)return this.serialise(t);if(t instanceof this.namespace.KeyValuePair){const r={key:this.serialise(t.key)};return t.value&&(r.value=this.serialise(t.value)),r}return t&&t.map?t.length===0?void 0:t.map(this.serialise,this):t}deserialiseContent(t){if(t){if(t.element)return this.deserialise(t);if(t.key){const r=new this.namespace.KeyValuePair(this.deserialise(t.key));return t.value&&(r.value=this.deserialise(t.value)),r}if(t.map)return t.map(this.deserialise,this)}return t}serialiseObject(t){const r={};if(t.forEach((n,i)=>{n&&(r[i.toValue()]=this.serialise(n))}),Object.keys(r).length!==0)return r}deserialiseObject(t,r){Object.keys(t).forEach(n=>{r.set(n,this.deserialise(t[n]))})}};var VCe=UCe,zCe=oA;function qCe(e,t){return zCe(e,t)}var WCe=qCe;let KCe=class i6{constructor(t,r){this.key=t,this.value=r}clone(){const t=new i6;return this.key&&(t.key=this.key.clone()),this.value&&(t.value=this.value.clone()),t}};var Y0=KCe,HCe="Expected a function";function JCe(e){if(typeof e!="function")throw new TypeError(HCe);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}var X0=JCe;const GCe=X0;function $S(e){return typeof e=="string"?t=>t.element===e:e.constructor&&e.extend?t=>t instanceof e:e}let s6=class P_{constructor(t){this.elements=t||[]}toValue(){return this.elements.map(t=>t.toValue())}map(t,r){return this.elements.map(t,r)}flatMap(t,r){return this.map(t,r).reduce((n,i)=>n.concat(i),[])}compactMap(t,r){const n=[];return this.forEach(i=>{const s=t.bind(r)(i);s&&n.push(s)}),n}filter(t,r){return t=$S(t),new P_(this.elements.filter(t,r))}reject(t,r){return t=$S(t),new P_(this.elements.filter(GCe(t),r))}find(t,r){return t=$S(t),this.elements.find(t,r)}forEach(t,r){this.elements.forEach(t,r)}reduce(t,r){return this.elements.reduce(t,r)}includes(t){return this.elements.some(r=>r.equals(t))}shift(){return this.elements.shift()}unshift(t){this.elements.unshift(this.refract(t))}push(t){return this.elements.push(this.refract(t)),this}add(t){this.push(t)}get(t){return this.elements[t]}getValue(t){const r=this.elements[t];if(r)retuLine truncated
|
||||
`));const Xe=ce-9,Ye=Math.round(Math.random()*(Xe>15?15:Xe)),he=this.randomUUID(Xe);return`${he.substring(0,Ye)}${Fe}${he.substring(Ye)}${Ye.toString(16)}`}),b(this,"parseStamp",(ce,L)=>{if(L&&!/t0|t[1-9]\d{1,}/.test(L))throw new Error("Cannot extract date from a formated UUID with no timestamp in the format");const Fe=L?L.replace(/\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,Ye=>{const he={$r:pe=>[...Array(pe)].map(()=>"r").join(""),$s:pe=>[...Array(pe)].map(()=>"s").join(""),$t:pe=>[...Array(pe)].map(()=>"t").join("")},de=Ye.slice(0,2),ge=parseInt(Ye.slice(2),10);return he[de](ge)}).replace(/^(.*?)(t{8,})(.*)$/g,(Ye,he,de)=>ce.substring(he.length,he.length+de.length)):ce;if(Fe.length===8)return new Date(parseInt(Fe,16)*1e3);if(Fe.length<10)throw new Error("Stamp length invalid");const Xe=parseInt(Fe.substring(Fe.length-1),16);return new Date(parseInt(Fe.substring(Xe,Xe+8),16)*1e3)}),b(this,"setCounter",ce=>{this.counter=ce});const z=h(h({},x),U);this.counter=0,this.debug=!1,this.dict=[],this.version=$;const{dictionary:J,shuffle:ee,length:Q,counter:f}=z;return this.uuidLength=Q,this.setDictionary(J,ee),this.setCounter(f),this.debug=z.debug,this.log(this.dict),this.log(`Generator instantiated with Dictionary Size ${this.dictLength} and counter set to ${this.counter}`),this.log=this.log.bind(this),this.setDictionary=this.setDictionary.bind(this),this.setCounter=this.setCounter.bind(this),this.seq=this.seq.bind(this),this.sequentialUUID=this.sequentialUUID.bind(this),this.rnd=this.rnd.bind(this),this.randomUUID=this.randomUUID.bind(this),this.fmt=this.fmt.bind(this),this.formattedUUID=this.formattedUUID.bind(this),this.availableUUIDs=this.availableUUIDs.bind(this),this.approxMaxBeforeCollision=this.approxMaxBeforeCollision.bind(this),this.collisionProbability=this.collisionProbability.bind(this),this.uniqueness=this.uniqueness.bind(this),this.getVersion=this.getVersion.bind(this),this.stamp=this.stamp.bind(this),this.parseStamp=this.parseStamp.bind(this),this}};b(A,"default",A);var C=A;return S(_)})();e.exports=t.default,typeof window<"u"&&(t=t.default)})(M6);var Z$e=M6.exports;const eke=Tt(Z$e);class tke extends yh{constructor(r,n){super(r,n);ie(this,"value");typeof n<"u"&&(this.value=n.value)}}const rke=tke,jO=Vt({props:{uuid:null,length:null,identityMap:null},init({length:e=6}={}){this.length=6,this.uuid=new eke({length:e}),this.identityMap=new WeakMap},methods:{identify(e){if(!un(e))throw new rke("Cannot not identify the element. `element` is neither structurally compatible nor a subclass of an Element class.",{value:e});if(e.meta.hasKey("id")&&Ft(e.meta.get("id"))&&!e.meta.get("id").equals(""))return e.id;if(this.identityMap.has(e))return this.identityMap.get(e);const t=new Wo(this.generateId());return this.identityMap.set(e,t),t},forget(e){return this.identityMap.has(e)?(this.identityMap.delete(e),!0):!1},generateId(){return this.uuid.randomUUID()}}});jO({length:6});class nke extends Array{constructor(){super(...arguments);ie(this,"unknownMediaType","application/octet-stream")}filterByFormat(){throw new fo("filterByFormat method in MediaTypes class is not yet implemented.")}findBy(){throw new fo("findBy method in MediaTypes class is not yet implemented.")}latest(){throw new fo("latest method in MediaTypes class is not yet implemented.")}}const ike=(e,{Type:t,plugins:r=[]})=>{const n=new t(e);return un(e)&&(e.meta.length>0&&(n.meta=Ge(e.meta)),e.attributes.length>0&&(n.attributes=Ge(e.attributes))),Sh(n,r,{toolboxCreator:C6,visitorOptions:{nodeTypeGetter:mf}})},bs=e=>(t,r={})=>ike(t,{...r,Type:e});et.refract=bs(et);mr.refract=bs(mr);Wo.refract=bs(Wo);Ko.refract=bs(Ko);I_.refract=bs(I_);R_.refract=bs(R_);j_.refract=bs(j_);N_.refract=bs(N_);Jy.refract=bs(Jy);Gy.refract=bs(Gy);js.refract=bs(js);Yy.refract=bs(Yy);const ske=(e,t)=>{const r=new j6({predicate:e});return $n(t,r),new yd(r.result)},D6=(e,t)=>{const r=new j6({predicate:e,returnOnTrue:qt});return $n(t,r),aB(void 0,[0],r.result)},F6=e=>typeof(e==null?void 0:e.type)=="string"?e.type:mf(e),L6={EphemeralObject:["content"],EphemeralArray:["content"],...gf},B6=(e,t,{keyMap:r=L6,...n}={})=>$n(e,t,{keyMap:r,nodeTypeGetter:F6,nodePredicate:na,detectCycles:!1,deleteNodeSymbol:Symbol.for("delete-node"),skipVisitingNodeSymbol:Symbol.for("skip-visiting-node"),...n});B6[Symbol.for("nodejs.util.promisify.custom")]=async(e,{keyMap:t=L6,...r}={})=>$n[Symbol.for("nodejs.util.promisify.custom")](e,visitor,{keyMap:t,nodeTypeGetter:F6,nodePredicate:na,detectCycles:!1,deleteNodeSymbol:Symbol.for("delete-node"),skipVisitingNodeSymbol:Symbol.for("skip-visiting-node"),...r});class oke{constructor(t){ie(this,"type","EphemeralArray");ie(this,"content",[]);ie(this,"reference");this.content=t,this.reference=[]}toReference(){return this.reference}toArray(){return this.reference.push(...this.content),this.reference}}class ake{constructor(t){ie(this,"type","EphemeralObject");ie(this,"content",[]);ie(this,"reference");this.content=t,this.reference={}}toReference(){return this.reference}toOb
Line truncated
|
||||
`)>=0)return!1;return!0}function eRe(e,t){var r;if(e.indent===" ")r=" ";else if(typeof e.indent=="number"&&e.indent>0)r=io.call(Array(e.indent+1)," ");else return null;return{base:r,prev:io.call(Array(t+1),r)}}function q_(e,t){if(e.length===0)return"";var r=`
|
||||
`+t.prev+t.base;return r+io.call(e,","+r)+`
|
||||
`+t.prev}function pg(e,t){var r=z_(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=Ca(e,i)?t(e[i],e):""}var s=typeof FS=="function"?FS(e):[],o;if(Uc){o={};for(var l=0;l<s.length;l++)o["$"+s[l]]=s[l]}for(var c in e)Ca(e,c)&&(r&&String(Number(c))===c&&c<e.length||Uc&&o["$"+c]instanceof Symbol||(f8.call(/[^\w$]/,c)?n.push(t(c,e)+": "+t(e[c],e)):n.push(c+": "+t(e[c],e))));if(typeof FS=="function")for(var h=0;h<s.length;h++)p8.call(e,s[h])&&n.push("["+t(s[h])+"]: "+t(e[s[h]],e));return n}var y8=bf,Ef=_Pe,tRe=MPe,rRe=_h,dg=y8("%WeakMap%",!0),hg=y8("%Map%",!0),nRe=Ef("WeakMap.prototype.get",!0),iRe=Ef("WeakMap.prototype.set",!0),sRe=Ef("WeakMap.prototype.has",!0),oRe=Ef("Map.prototype.get",!0),aRe=Ef("Map.prototype.set",!0),lRe=Ef("Map.prototype.has",!0),WO=function(e,t){for(var r=e,n;(n=r.next)!==null;r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n},uRe=function(e,t){var r=WO(e,t);return r&&r.value},cRe=function(e,t,r){var n=WO(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}},fRe=function(e,t){return!!WO(e,t)},pRe=function(){var t,r,n,i={assert:function(s){if(!i.has(s))throw new rRe("Side channel does not contain "+tRe(s))},get:function(s){if(dg&&s&&(typeof s=="object"||typeof s=="function")){if(t)return nRe(t,s)}else if(hg){if(r)return oRe(r,s)}else if(n)return uRe(n,s)},has:function(s){if(dg&&s&&(typeof s=="object"||typeof s=="function")){if(t)return sRe(t,s)}else if(hg){if(r)return lRe(r,s)}else if(n)return fRe(n,s);return!1},set:function(s,o){dg&&s&&(typeof s=="object"||typeof s=="function")?(t||(t=new dg),iRe(t,s,o)):hg?(r||(r=new hg),aRe(r,s,o)):(n||(n={key:{},next:null}),cRe(n,s,o))}};return i},dRe=String.prototype.replace,hRe=/%20/g,BS={RFC1738:"RFC1738",RFC3986:"RFC3986"},KO={default:BS.RFC3986,formatters:{RFC1738:function(e){return dRe.call(e,hRe,"+")},RFC3986:function(e){return String(e)}},RFC1738:BS.RFC1738,RFC3986:BS.RFC3986},mRe=KO,US=Object.prototype.hasOwnProperty,zl=Array.isArray,Ys=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),gRe=function(t){for(;t.length>1;){var r=t.pop(),n=r.obj[r.prop];if(zl(n)){for(var i=[],s=0;s<n.length;++s)typeof n[s]<"u"&&i.push(n[s]);r.obj[r.prop]=i}}},v8=function(t,r){for(var n=r&&r.plainObjects?Object.create(null):{},i=0;i<t.length;++i)typeof t[i]<"u"&&(n[i]=t[i]);return n},yRe=function e(t,r,n){if(!r)return t;if(typeof r!="object"){if(zl(t))t.push(r);else if(t&&typeof t=="object")(n&&(n.plainObjects||n.allowPrototypes)||!US.call(Object.prototype,r))&&(t[r]=!0);else return[t,r];return t}if(!t||typeof t!="object")return[t].concat(r);var i=t;return zl(t)&&!zl(r)&&(i=v8(t,n)),zl(t)&&zl(r)?(r.forEach(function(s,o){if(US.call(t,o)){var l=t[o];l&&typeof l=="object"&&s&&typeof s=="object"?t[o]=e(l,s,n):t.push(s)}else t[o]=s}),t):Object.keys(r).reduce(function(s,o){var l=r[o];return US.call(s,o)?s[o]=e(s[o],l,n):s[o]=l,s},i)},vRe=function(t,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},t)},bRe=function(e,t,r){var n=e.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},ERe=function(t,r,n,i,s){if(t.length===0)return t;var o=t;if(typeof t=="symbol"?o=Symbol.prototype.toString.call(t):typeof t!="string"&&(o=String(t)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(v){return"%26%23"+parseInt(v.slice(2),16)+"%3B"});for(var l="",c=0;c<o.length;++c){var h=o.charCodeAt(c);if(h===45||h===46||h===95||h===126||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||s===mRe.RFC1738&&(h===40||h===41)){l+=o.charAt(c);continue}if(h<128){l=l+Ys[h];continue}if(h<2048){l=l+(Ys[192|h>>6]+Ys[128|h&63]);continue}if(h<55296||h>=57344){l=l+(Ys[224|h>>12]+Ys[128|h>>6&63]+Ys[128|h&63]);continue}c+=1,h=65536+((h&1023)<<10|o.charCodeAt(c)&1023),l+=Ys[240|h>>18]+Ys[128|h>>12&63]+Ys[128|h>>6&63]+Ys[128|h&63]}return l},SRe=function(t){for(var r=[{obj:{o:t},prop:"o"}],n=[],i=0;i<r.length;++i)for(var s=r[i],o=s.obj[s.prop],l=Object.keys(o),c=0;c<l.length;++c){var h=l[c],v=o[h];typeof v=="object"&&v!==null&&n.indexOf(v)===-1&&(r.push({obj:o,prop:h}),n.push(v))}return gRe(r),t},wRe=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},_Re=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},xRe=function(t,r){return[].concat(t,r)},ARe=function(t,r){if(zl(t)){for(var n=[],i=0;i<t.length;i+=1)n.push(r(t[i]));return n}return r(t)},b8={arrayToObject:v8,assign:vRe,combine:xRe,compact:SRe,decode:bRe,encode:ERe,isBuffer:_Re,isRegExp:wRe,maybeMap:ARe,merge:yRe},E8=pRe,ty=b8,Wp=KO,ORe=Object.prototype.hasOwnProperty,oj={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,r){return t+"["+r+"]"},repeat:function(t){return t}},No=Array.isArray,CRe=Array.prototype.push,S8=function(e,t){CRe.apply(e,No(t)?t:[t])},$Re=Date.prototype.toISOString,aj=Wp.default,Nn={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,
Line truncated
|
||||
* cookie
|
||||
* Copyright(c) 2012-2014 Roman Shtylman
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/dC.parse=z6e;dC.serialize=q6e;var V6e=Object.prototype.toString,gg=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function z6e(e,t){if(typeof e!="string")throw new TypeError("argument str must be a string");for(var r={},n=t||{},i=n.decode||W6e,s=0;s<e.length;){var o=e.indexOf("=",s);if(o===-1)break;var l=e.indexOf(";",s);if(l===-1)l=e.length;else if(l<o){s=e.lastIndexOf(";",o-1)+1;continue}var c=e.slice(s,o).trim();if(r[c]===void 0){var h=e.slice(o+1,l).trim();h.charCodeAt(0)===34&&(h=h.slice(1,-1)),r[c]=J6e(h,i)}s=l+1}return r}function q6e(e,t,r){var n=r||{},i=n.encode||K6e;if(typeof i!="function")throw new TypeError("option encode is invalid");if(!gg.test(e))throw new TypeError("argument name is invalid");var s=i(t);if(s&&!gg.test(s))throw new TypeError("argument val is invalid");var o=e+"="+s;if(n.maxAge!=null){var l=n.maxAge-0;if(isNaN(l)||!isFinite(l))throw new TypeError("option maxAge is invalid");o+="; Max-Age="+Math.floor(l)}if(n.domain){if(!gg.test(n.domain))throw new TypeError("option domain is invalid");o+="; Domain="+n.domain}if(n.path){if(!gg.test(n.path))throw new TypeError("option path is invalid");o+="; Path="+n.path}if(n.expires){var c=n.expires;if(!H6e(c)||isNaN(c.valueOf()))throw new TypeError("option expires is invalid");o+="; Expires="+c.toUTCString()}if(n.httpOnly&&(o+="; HttpOnly"),n.secure&&(o+="; Secure"),n.partitioned&&(o+="; Partitioned"),n.priority){var h=typeof n.priority=="string"?n.priority.toLowerCase():n.priority;switch(h){case"low":o+="; Priority=Low";break;case"medium":o+="; Priority=Medium";break;case"high":o+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(n.sameSite){var v=typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite;switch(v){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return o}function W6e(e){return e.indexOf("%")!==-1?decodeURIComponent(e):e}function K6e(e){return encodeURIComponent(e)}function H6e(e){return V6e.call(e)==="[object Date]"||e instanceof Date}function J6e(e,t){try{return t(e)}catch{return e}}/*!
|
||||
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
||||
*
|
||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/function _j(e){return Object.prototype.toString.call(e)==="[object Object]"}function Y8(e){var t,r;return _j(e)===!1?!1:(t=e.constructor,t===void 0?!0:(r=t.prototype,!(_j(r)===!1||r.hasOwnProperty("isPrototypeOf")===!1)))}const G6e={body:Y6e,header:Q6e,query:e8e,path:Z6e,formData:X6e};function Y6e({req:e,value:t}){e.body=t}function X6e({req:e,value:t,parameter:r}){(t||r.allowEmptyValue)&&(e.form=e.form||{},e.form[r.name]={value:t,allowEmptyValue:r.allowEmptyValue,collectionFormat:r.collectionFormat})}function Q6e({req:e,parameter:t,value:r}){e.headers=e.headers||{},typeof r<"u"&&(e.headers[t.name]=r)}function Z6e({req:e,value:t,parameter:r}){e.url=e.url.split(`{${r.name}}`).join(encodeURIComponent(t))}function e8e({req:e,value:t,parameter:r}){if(e.query=e.query||{},t===!1&&r.type==="boolean"&&(t="false"),t===0&&["number","integer"].indexOf(r.type)>-1&&(t="0"),t)e.query[r.name]={collectionFormat:r.collectionFormat,value:t};else if(r.allowEmptyValue&&t!==void 0){const n=r.name;e.query[n]=e.query[n]||{},e.query[n].allowEmptyValue=!0}}function H1(e,t){return t.includes("application/json")?typeof e=="string"?e:JSON.stringify(e):e.toString()}function t8e({req:e,value:t,parameter:r}){const{name:n,style:i,explode:s,content:o}=r;if(o){const c=Object.keys(o)[0];e.url=e.url.split(`{${n}}`).join(zc(H1(t,c),{escape:!0}));return}const l=HO({key:r.name,value:t,style:i||"simple",explode:s||!1,escape:!0});e.url=e.url.split(`{${n}}`).join(l)}function r8e({req:e,value:t,parameter:r}){if(e.query=e.query||{},r.content){const n=Object.keys(r.content)[0],i=H1(t,n);if(i)e.query[r.name]=i;else if(r.allowEmptyValue&&t!==void 0){const s=r.name;e.query[s]=e.query[s]||{},e.query[s].allowEmptyValue=!0}return}if(t===!1&&(t="false"),t===0&&(t="0"),t){const{style:n,explode:i,allowReserved:s}=r;e.query[r.name]={value:t,serializationOption:{style:n,explode:i,allowReserved:s}}}else if(r.allowEmptyValue&&t!==void 0){const n=r.name;e.query[n]=e.query[n]||{},e.query[n].allowEmptyValue=!0}}const n8e=["accept","authorization","content-type"];function i8e({req:e,parameter:t,value:r}){if(e.headers=e.headers||{},!(n8e.indexOf(t.name.toLowerCase())>-1)){if(t.content){const n=Object.keys(t.content)[0];e.headers[t.name]=H1(r,n);return}r!==void 0&&!(Array.isArray(r)&&r.length===0)&&(e.headers[t.name]=HO({key:t.name,value:r,style:t.style||"simple",explode:typeof t.explode>"u"?!1:t.explode,escape:!1}))}}function s8e({req:e,parameter:t,value:r}){e.headers=e.headers||{};const n=typeof r;if(t.content){const i=Object.keys(t.content)[0];e.headers.Cookie=`${t.name}=${H1(r,i)}`;return}if(r!==void 0&&!(Array.isArray(r)&&r.length===0)){const i=n==="object"&&!Array.isArray(r)&&t.explode?"":`${t.name}=`;e.headers.Cookie=i+HO({key:t.name,value:r,escape:!1,style:t.style||"form",explode:typeof t.explode>"u"?!1:t.explode})}}const o8e=Object.freeze(Object.defineProperty({__proto__:null,cookie:s8e,header:i8e,path:t8e,query:r8e},Symbol.toStringTag,{value:"Module"})),a8e=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window,{btoa:X8}=a8e;function l8e(e,t){const{operation:r,requestBody:n,securities:i,spec:s,attachContentTypeForEmptyPayload:o}=e;let{requestContentType:l}=e;t=u8e({request:t,securities:i,operation:r,spec:s});const c=r.requestBody||{},h=Object.keys(c.content||{}),v=l&&h.indexOf(l)>-1;if(n||o){if(l&&v)t.headers["Content-Type"]=l;else if(!l){const b=h[0];b&&(t.headers["Content-Type"]=b,l=b)}}else l&&v&&(t.headers["Content-Type"]=l);if(!e.responseContentType&&r.responses){const b=Object.entries(r.responses).filter(([_,$])=>{const P=parseInt(_,10);return P>=200&&P<300&&Y8($.content)}).reduce((_,[,$])=>_.concat(Object.keys($.content)),[]);b.length>0&&(t.headers.accept=b.join(", "))}if(n)if(l){if(h.indexOf(l)>-1)if(l==="application/x-www-form-urlencoded"||l==="multipart/form-data")if(typeof n=="object"){var y,S;const b=(y=(S=c.content[l])===null||S===void 0?void 0:S.encoding)!==null&&y!==void 0?y:{};t.form={},Object.keys(n).forEach(_=>{t.form[_]={value:n[_],encoding:b[_]||{}}})}else t.form=n;else t.body=n}else t.body=n;return t}function u8e({request:e,securities:t={},operation:r={},spec:n}){var i;const s={...e},{authorized:o={}}=t,l=r.security||n.security||[],c=o&&!!Object.keys(o).length,h=(n==null||(i=n.components)===null||i===void 0?void 0:i.securitySchemes)||{};return s.headers=s.headers||{},s.query=s.query||{},!Object.keys(t).length||!c||!l||Array.isArray(r.security)&&!r.security.length?e:(l.forEach(v=>{Object.keys(v).forEach(y=>{const S=o[y],b=h[y];if(!S)return;const _=S.value||S,{type:$}=b;if(S){if($==="apiKey")b.in==="query"&&(s.query[b.name]=_),b.in==="header"&&(s.headers[b.name]=_),b.in==="cookie"&&(s.cookies[b.name]=_);else if($==="http"){if(/^basic$/i.test(b.scheme)){const P=_.username||"",x=_.password||"",A=X8(`${P}:${x}`);s.headers.Authorization=`Basic ${A}`}/^bearer$/i.test(b.scheme)&&(s.headers.Authorization=`Bearer ${_}`)}else if($==="oauth2"||$==="openIdConnect"){const P=S.token||{},x=b["x-tokenName"]||"access_token",A=P[x];let C=P.token_typLine truncated
|
||||
* @license React
|
||||
* scheduler.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/(function(e){function t(ge,pe){var be=ge.length;ge.push(pe);e:for(;0<be;){var ye=be-1>>>1,Le=ge[ye];if(0<i(Le,pe))ge[ye]=pe,ge[be]=Le,be=ye;else break e}}function r(ge){return ge.length===0?null:ge[0]}function n(ge){if(ge.length===0)return null;var pe=ge[0],be=ge.pop();if(be!==pe){ge[0]=be;e:for(var ye=0,Le=ge.length,se=Le>>>1;ye<se;){var _e=2*(ye+1)-1,Z=ge[_e],V=_e+1,q=ge[V];if(0>i(Z,be))V<Le&&0>i(q,Z)?(ge[ye]=q,ge[V]=be,ye=V):(ge[ye]=Z,ge[_e]=be,ye=_e);else if(V<Le&&0>i(q,be))ge[ye]=q,ge[V]=be,ye=V;else break e}}return pe}function i(ge,pe){var be=ge.sortIndex-pe.sortIndex;return be!==0?be:ge.id-pe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],h=[],v=1,y=null,S=3,b=!1,_=!1,$=!1,P=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(ge){for(var pe=r(h);pe!==null;){if(pe.callback===null)n(h);else if(pe.startTime<=ge)n(h),pe.sortIndex=pe.expirationTime,t(c,pe);else break;pe=r(h)}}function j(ge){if($=!1,C(ge),!_)if(r(c)!==null)_=!0,he(U);else{var pe=r(h);pe!==null&&de(j,pe.startTime-ge)}}function U(ge,pe){_=!1,$&&($=!1,x(ee),ee=-1),b=!0;var be=S;try{for(C(pe),y=r(c);y!==null&&(!(y.expirationTime>pe)||ge&&!ce());){var ye=y.callback;if(typeof ye=="function"){y.callback=null,S=y.priorityLevel;var Le=ye(y.expirationTime<=pe);pe=e.unstable_now(),typeof Le=="function"?y.callback=Le:y===r(c)&&n(c),C(pe)}else n(c);y=r(c)}if(y!==null)var se=!0;else{var _e=r(h);_e!==null&&de(j,_e.startTime-pe),se=!1}return se}finally{y=null,S=be,b=!1}}var z=!1,J=null,ee=-1,Q=5,f=-1;function ce(){return!(e.unstable_now()-f<Q)}function L(){if(J!==null){var ge=e.unstable_now();f=ge;var pe=!0;try{pe=J(!0,ge)}finally{pe?Fe():(z=!1,J=null)}}else z=!1}var Fe;if(typeof A=="function")Fe=function(){A(L)};else if(typeof MessageChannel<"u"){var Xe=new MessageChannel,Ye=Xe.port2;Xe.port1.onmessage=L,Fe=function(){Ye.postMessage(null)}}else Fe=function(){P(L,0)};function he(ge){J=ge,z||(z=!0,Fe())}function de(ge,pe){ee=P(function(){ge(e.unstable_now())},pe)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(ge){ge.callback=null},e.unstable_continueExecution=function(){_||b||(_=!0,he(U))},e.unstable_forceFrameRate=function(ge){0>ge||125<ge?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<ge?Math.floor(1e3/ge):5},e.unstable_getCurrentPriorityLevel=function(){return S},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(ge){switch(S){case 1:case 2:case 3:var pe=3;break;default:pe=S}var be=S;S=pe;try{return ge()}finally{S=be}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(ge,pe){switch(ge){case 1:case 2:case 3:case 4:case 5:break;default:ge=3}var be=S;S=ge;try{return pe()}finally{S=be}},e.unstable_scheduleCallback=function(ge,pe,be){var ye=e.unstable_now();switch(typeof be=="object"&&be!==null?(be=be.delay,be=typeof be=="number"&&0<be?ye+be:ye):be=ye,ge){case 1:var Le=-1;break;case 2:Le=250;break;case 5:Le=1073741823;break;case 4:Le=1e4;break;default:Le=5e3}return Le=be+Le,ge={id:v++,callback:pe,priorityLevel:ge,startTime:be,expirationTime:Le,sortIndex:-1},be>ye?(ge.sortIndex=be,t(h,ge),r(c)===null&&ge===r(h)&&($?(x(ee),ee=-1):$=!0,de(j,be-ye))):(ge.sortIndex=Le,t(c,ge),_||b||(_=!0,he(U))),ge},e.unstable_shouldYield=ce,e.unstable_wrapCallback=function(ge){var pe=S;return function(){var be=S;S=pe;try{return ge.apply(this,arguments)}finally{S=be}}}})(r4);t4.exports=r4;var C8e=t4.exports;/**
|
||||
* @license React
|
||||
* react-dom.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var n4=xn,ji=C8e;function He(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i4=new Set,wd={};function Su(e,t){Wc(e,t),Wc(e+"Capture",t)}function Wc(e,t){for(wd[e]=t,e=0;e<t.length;e++)i4.add(t[e])}var Go=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Tx=Object.prototype.hasOwnProperty,$8e=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Aj={},Oj={};function k8e(e){return Tx.call(Oj,e)?!0:Tx.call(Aj,e)?!1:$8e.test(e)?Oj[e]=!0:(Aj[e]=!0,!1)}function T8e(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function P8e(e,t,r,n){if(t===null||typeof t>"u"||T8e(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ii(e,t,r,n,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var Cn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Cn[e]=new ii(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Cn[t]=new ii(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Cn[e]=new ii(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Cn[e]=new ii(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Cn[e]=new ii(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Cn[e]=new ii(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Cn[e]=new ii(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Cn[e]=new ii(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Cn[e]=new ii(e,5,!1,e.toLowerCase(),null,!1,!1)});var hC=/[\-:]([a-z])/g;function mC(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(hC,mC);Cn[t]=new ii(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(hC,mC);Cn[t]=new ii(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(hC,mC);Cn[t]=new ii(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Cn[e]=new ii(e,1,!1,e.toLowerCase(),null,!1,!1)});Cn.xlinkHref=new ii("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Cn[e]=new ii(e,1,!1,e.toLowerCase(),null,!0,!0)});function gC(e,t,r,n){var i=Cn.hasOwnProperty(t)?Cn[t]:null;(i!==null?i.type!==0:n||!(2<t.length)||t[0]!=="o"&
Line truncated
|
||||
`+YS+e}var XS=!1;function QS(e,t){if(!e||XS)return"";XS=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(h){var n=h}Reflect.construct(e,[],t)}else{try{t.call()}catch(h){n=h}e.call(t.prototype)}else{try{throw Error()}catch(h){n=h}e()}}catch(h){if(h&&n&&typeof h.stack=="string"){for(var i=h.stack.split(`
|
||||
`),s=n.stack.split(`
|
||||
`),o=i.length-1,l=s.length-1;1<=o&&0<=l&&i[o]!==s[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==s[l]){if(o!==1||l!==1)do if(o--,l--,0>l||i[o]!==s[l]){var c=`
|
||||
`+i[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{XS=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?jp(e):""}function R8e(e){switch(e.tag){case 5:return jp(e.type);case 16:return jp("Lazy");case 13:return jp("Suspense");case 19:return jp("SuspenseList");case 0:case 2:case 15:return e=QS(e.type,!1),e;case 11:return e=QS(e.type.render,!1),e;case 1:return e=QS(e.type,!0),e;default:return""}}function Nx(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case cc:return"Fragment";case uc:return"Portal";case Px:return"Profiler";case yC:return"StrictMode";case Rx:return"Suspense";case Ix:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case o4:return(e.displayName||"Context")+".Consumer";case s4:return(e._context.displayName||"Context")+".Provider";case vC:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case bC:return t=e.displayName||null,t!==null?t:Nx(e.type)||"Memo";case $a:t=e._payload,e=e._init;try{return Nx(e(t))}catch{}}return null}function I8e(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Nx(t);case 8:return t===yC?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Xa(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function l4(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function N8e(e){var t=l4(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function vg(e){e._valueTracker||(e._valueTracker=N8e(e))}function u4(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=l4(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function fv(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function jx(e,t){var r=t.checked;return Br({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function $j(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Xa(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function c4(e,t){t=t.checked,t!=null&&gC(e,"checked",t,!1)}function Mx(e,t){c4(e,t);var r=Xa(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Dx(e,t.type,r):t.hasOwnProperty("defaultValue")&&Dx(e,t.type,Xa(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function kj(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Dx(e,t,r){(t!=="number"||fv(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Mp=Array.isArray;function $c(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Xa(r),t=null,i=0;i<e.length;i++){if(e[i].value===r){e[i].selected=!0,n&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Fx(e,t){if(t
Line truncated
|
||||
`).replace(q4e,"")}function Og(e,t,r){if(t=Qj(t),Qj(e)!==t&&r)throw Error(He(425))}function bv(){}var Xx=null,Qx=null;function Zx(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var e2=typeof setTimeout=="function"?setTimeout:void 0,W4e=typeof clearTimeout=="function"?clearTimeout:void 0,Zj=typeof Promise=="function"?Promise:void 0,K4e=typeof queueMicrotask=="function"?queueMicrotask:typeof Zj<"u"?function(e){return Zj.resolve(null).then(e).catch(H4e)}:e2;function H4e(e){setTimeout(function(){throw e})}function fw(e,t){var r=t,n=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(n===0){e.removeChild(i),Cd(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);Cd(t)}function za(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function eM(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Cf=Math.random().toString(36).slice(2),lo="__reactFiber$"+Cf,Rd="__reactProps$"+Cf,Yo="__reactContainer$"+Cf,t2="__reactEvents$"+Cf,J4e="__reactListeners$"+Cf,G4e="__reactHandles$"+Cf;function Wl(e){var t=e[lo];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Yo]||r[lo]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=eM(e);e!==null;){if(r=e[lo])return r;e=eM(e)}return t}e=r,r=e.parentNode}return null}function Qh(e){return e=e[lo]||e[Yo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function hc(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(He(33))}function Q1(e){return e[Rd]||null}var r2=[],mc=-1;function ul(e){return{current:e}}function Ir(e){0>mc||(e.current=r2[mc],r2[mc]=null,mc--)}function $r(e,t){mc++,r2[mc]=e.current,e.current=t}var Qa={},Ln=ul(Qa),yi=ul(!1),ou=Qa;function Kc(e,t){var r=e.type.contextTypes;if(!r)return Qa;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=t[s];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function vi(e){return e=e.childContextTypes,e!=null}function Ev(){Ir(yi),Ir(Ln)}function tM(e,t,r){if(Ln.current!==Qa)throw Error(He(168));$r(Ln,t),$r(yi,r)}function Q4(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(He(108,I8e(e)||"Unknown",i));return Br({},r,n)}function Sv(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Qa,ou=Ln.current,$r(Ln,e),$r(yi,yi.current),!0}function rM(e,t,r){var n=e.stateNode;if(!n)throw Error(He(169));r?(e=Q4(e,t,ou),n.__reactInternalMemoizedMergedChildContext=e,Ir(yi),Ir(Ln),$r(Ln,e)):Ir(yi),$r(yi,r)}var jo=null,Z1=!1,pw=!1;function Z4(e){jo===null?jo=[e]:jo.push(e)}function Y4e(e){Z1=!0,Z4(e)}function cl(){if(!pw&&jo!==null){pw=!0;var e=0,t=pr;try{var r=jo;for(pr=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}jo=null,Z1=!1}catch(i){throw jo!==null&&(jo=jo.slice(e+1)),x4(SC,cl),i}finally{pr=t,pw=!1}}return null}var gc=[],yc=0,wv=null,_v=0,os=[],as=0,au=null,Fo=1,Lo="";function Dl(e,t){gc[yc++]=_v,gc[yc++]=wv,wv=e,_v=t}function e9(e,t,r){os[as++]=Fo,os[as++]=Lo,os[as++]=au,au=e;var n=Fo;e=Lo;var i=32-Is(n)-1;n&=~(1<<i),r+=1;var s=32-Is(t)+i;if(30<s){var o=i-i%5;s=(n&(1<<o)-1).toString(32),n>>=o,i-=o,Fo=1<<32-Is(t)+i|r<<i|n,Lo=s+e}else Fo=1<<s|r<<i|n,Lo=e}function TC(e){e.return!==null&&(Dl(e,1),e9(e,1,0))}function PC(e){for(;e===wv;)wv=gc[--yc],gc[yc]=null,_v=gc[--yc],gc[yc]=null;for(;e===au;)au=os[--as],os[as]=null,Lo=os[--as],os[as]=null,Fo=os[--as],os[as]=null}var Ri=null,Pi=null,jr=!1,Rs=null;function t9(e,t){var r=fs(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function nM(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ri=e,Pi=za(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ri=e,Pi=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=au!==null?{id:Fo,overflow:Lo}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=fs(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Ri=e,Pi=null,!0):!1;default:return!1}}function n2(e){return(e.mode&1)!==0&&(e.flags&128)===0}function i2(e){if(jr){var t=Pi;if(t){var r=t;if(!nM(e,t)){if(n2(e))throw Error(He(418));t=za(r.nextSibling);var n=Ri;t&&nM(e,t)?t9(n,r):(e.flags=e.flags&-4097|2,jr=!1,Ri=e)}}else{if(n2(e))throw Error(He(418));e.flags=e.flags&-4097|2,jr=!1,Ri=e}}}functi
Line truncated
|
||||
Error generating stack: `+s.message+`
|
||||
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function yw(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function l2(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var s9e=typeof WeakMap=="function"?WeakMap:Map;function k9(e,t,r){r=zo(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Pv||(Pv=!0,v2=n),l2(e,t)},r}function T9(e,t,r){r=zo(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){l2(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(r.callback=function(){l2(e,t),typeof n!="function"&&(Wa===null?Wa=new Set([this]):Wa.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function pM(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new s9e;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=b9e.bind(null,e,t,r),t.then(e,e))}function dM(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function hM(e,t,r,n,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=zo(-1,1),t.tag=2,qa(r,t,1))),r.lanes|=1),e)}var o9e=da.ReactCurrentOwner,hi=!1;function Wn(e,t,r,n){t.child=e===null?l9(t,null,r,n):Jc(t,e.child,r,n)}function mM(e,t,r,n,i){r=r.render;var s=t.ref;return Rc(t,i),n=VC(e,t,r,n,s,i),r=zC(),e!==null&&!hi?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Qo(e,t,i)):(jr&&r&&TC(t),t.flags|=1,Wn(e,t,n,i),t.child)}function gM(e,t,r,n,i){if(e===null){var s=r.type;return typeof s=="function"&&!ZC(s)&&s.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=s,P9(e,t,s,n,i)):(e=hy(r.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(r=r.compare,r=r!==null?r:kd,r(o,n)&&e.ref===t.ref)return Qo(e,t,i)}return t.flags|=1,e=Ha(s,n),e.ref=t.ref,e.return=t,t.child=e}function P9(e,t,r,n,i){if(e!==null){var s=e.memoizedProps;if(kd(s,n)&&e.ref===t.ref)if(hi=!1,t.pendingProps=n=s,(e.lanes&i)!==0)e.flags&131072&&(hi=!0);else return t.lanes=e.lanes,Qo(e,t,i)}return u2(e,t,r,n,i)}function R9(e,t,r){var n=t.pendingProps,i=n.children,s=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},$r(Ec,ki),ki|=r;else{if(!(r&1073741824))return e=s!==null?s.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,$r(Ec,ki),ki|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=s!==null?s.baseLanes:r,$r(Ec,ki),ki|=n}else s!==null?(n=s.baseLanes|r,t.memoizedState=null):n=r,$r(Ec,ki),ki|=n;return Wn(e,t,i,r),t.child}function I9(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function u2(e,t,r,n,i){var s=vi(r)?ou:Ln.current;return s=Kc(t,s),Rc(t,i),r=VC(e,t,r,n,s,i),n=zC(),e!==null&&!hi?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Qo(e,t,i)):(jr&&n&&TC(t),t.flags|=1,Wn(e,t,r,i),t.child)}function yM(e,t,r,n,i){if(vi(r)){var s=!0;Sv(t)}else s=!1;if(Rc(t,i),t.stateNode===null)fy(e,t),o9(t,r,n),a2(t,r,n,i),n=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,h=r.contextType;typeof h=="object"&&h!==null?h=ms(h):(h=vi(r)?ou:Ln.current,h=Kc(t,h));var v=r.getDerivedStateFromProps,y=typeof v=="function"||typeof o.getSnapshotBeforeUpdate=="function";y||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||c!==h)&&lM(t,o,n,h),ka=!1;var S=t.memoizedState;o.state=S,Ov(t,n,o,i),c=t.memoizedState,l!==n||S!==c||yi.current||ka?(typeof v=="function"&&(o2(t,r,v,n),c=t.memoizedState),(l=ka||aM(t,r,l,n,S,c,h))?(y||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),o.props=n,o.state=c,o.context=h,n=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,i9(e,t),l=t.memoizedProps,h=t.type===t.elementType?l:$s(t.type,l),o.props=h,y=t.pendingProps,S=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=ms(c):(c=vi(r)?ou:Ln.current,c=Kc(t,c));var b=r.getDerivedStateFromProps;(v=typeof b=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==y||S!==c)&&lM(t,o,n,c),ka=!1,S=t.memoizedState,o.state=S,Ov(t,n,o,i);var _=t.memoi
Line truncated
|
||||
* @license React
|
||||
* use-sync-external-store-with-selector.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var em=xn;function I9e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var N9e=typeof Object.is=="function"?Object.is:I9e,j9e=em.useSyncExternalStore,M9e=em.useRef,D9e=em.useEffect,F9e=em.useMemo,L9e=em.useDebugValue;R9e.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var s=M9e(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=F9e(function(){function c(b){if(!h){if(h=!0,v=b,b=n(b),i!==void 0&&o.hasValue){var _=o.value;if(i(_,b))return y=_}return y=b}if(_=y,N9e(v,b))return _;var $=n(b);return i!==void 0&&i(_,$)?_:(v=b,y=$)}var h=!1,v,y,S=r===void 0?null:r;return[function(){return c(t())},S===null?void 0:function(){return c(S())}]},[t,r,n,i]);var l=j9e(e,s[0],s[1]);return D9e(function(){o.hasValue=!0,o.value=l},[l]),L9e(l),l};var nr="default"in aP?ls:aP,TM=Symbol.for("react-redux-context"),PM=typeof globalThis<"u"?globalThis:{};function B9e(){if(!nr.createContext)return{};const e=PM[TM]??(PM[TM]=new Map);let t=e.get(nr.createContext);return t||(t=nr.createContext(null),e.set(nr.createContext,t)),t}var nU=B9e(),U9e=()=>{throw new Error("uSES not initialized!")},V9e=Symbol.for("react.element"),z9e=Symbol.for("react.portal"),q9e=Symbol.for("react.fragment"),W9e=Symbol.for("react.strict_mode"),K9e=Symbol.for("react.profiler"),H9e=Symbol.for("react.provider"),J9e=Symbol.for("react.context"),G9e=Symbol.for("react.server_context"),iU=Symbol.for("react.forward_ref"),Y9e=Symbol.for("react.suspense"),X9e=Symbol.for("react.suspense_list"),i$=Symbol.for("react.memo"),Q9e=Symbol.for("react.lazy"),Z9e=iU,eUe=i$;function tUe(e){if(typeof e=="object"&&e!==null){const t=e.$$typeof;switch(t){case V9e:{const r=e.type;switch(r){case q9e:case K9e:case W9e:case Y9e:case X9e:return r;default:{const n=r&&r.$$typeof;switch(n){case G9e:case J9e:case iU:case Q9e:case i$:case H9e:return n;default:return t}}}}case z9e:return t}}}function rUe(e){return tUe(e)===i$}function nUe(e,t,r,n,{areStatesEqual:i,areOwnPropsEqual:s,areStatePropsEqual:o}){let l=!1,c,h,v,y,S;function b(A,C){return c=A,h=C,v=e(c,h),y=t(n,h),S=r(v,y,h),l=!0,S}function _(){return v=e(c,h),t.dependsOnOwnProps&&(y=t(n,h)),S=r(v,y,h),S}function $(){return e.dependsOnOwnProps&&(v=e(c,h)),t.dependsOnOwnProps&&(y=t(n,h)),S=r(v,y,h),S}function P(){const A=e(c,h),C=!o(A,v);return v=A,C&&(S=r(v,y,h)),S}function x(A,C){const j=!s(C,h),U=!i(A,c,C,h);return c=A,h=C,j&&U?_():j?$():U?P():S}return function(C,j){return l?x(C,j):b(C,j)}}function iUe(e,{initMapStateToProps:t,initMapDispatchToProps:r,initMergeProps:n,...i}){const s=t(e,i),o=r(e,i),l=n(e,i);return nUe(s,o,l,e,i)}function sUe(e,t){const r={};for(const n in e){const i=e[n];typeof i=="function"&&(r[n]=(...s)=>t(i(...s)))}return r}function w2(e){return function(r){const n=e(r);function i(){return n}return i.dependsOnOwnProps=!1,i}}function RM(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function sU(e,t){return function(n,{displayName:i}){const s=function(l,c){return s.dependsOnOwnProps?s.mapToProps(l,c):s.mapToProps(l,void 0)};return s.dependsOnOwnProps=!0,s.mapToProps=function(l,c){s.mapToProps=e,s.dependsOnOwnProps=RM(e);let h=s(l,c);return typeof h=="function"&&(s.mapToProps=h,s.dependsOnOwnProps=RM(h),h=s(l,c)),h},s}}function s$(e,t){return(r,n)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${n.wrappedComponentName}.`)}}function oUe(e){return e&&typeof e=="object"?w2(t=>sUe(e,t)):e?typeof e=="function"?sU(e):s$(e,"mapDispatchToProps"):w2(t=>({dispatch:t}))}function aUe(e){return e?typeof e=="function"?sU(e):s$(e,"mapStateToProps"):w2(()=>({}))}function lUe(e,t,r){return{...r,...e,...t}}function uUe(e){return function(r,{displayName:n,areMergedPropsEqual:i}){let s=!1,o;return function(c,h,v){const y=e(c,h,v);return s?i(y,o)||(o=y):(s=!0,o=y),o}}}function cUe(e){return e?typeof e=="function"?uUe(e):s$(e,"mergeProps"):()=>lUe}function fUe(e){e()}function pUe(){let e=null,t=null;return{clear(){e=null,t=null},notify(){fUe(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const i=t={callback:r,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!n||e===null||(n=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var IM={notify(){},get:()=>[]};function oU(e,t){let r,n=IM,i=0,s=!1;function o($){v();const P=n.subscribe($);let x=!1;return()=>{x||(x=!0,P(),y())}}function l(){n.notify()}function c(){_.onStateChange&&_.onStateChange()}function h(){return s}function v(){i++,r||(r=t?t.addNestedSub(c):e.subscribe(c),n=pUe())}function y(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=IM)}function S(){s||(s=!0,v())}function b(){s&&(s=!1,y())}const _={addNestedSub:o,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:h,trySubscribe:S,tryUnsubscribe:b,getListeners:()=>n};return _}var dUe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",jv=dUe?nr.useLayoutEffect:nr.useEffect;fuLine truncated
|
||||
The error may be correlated with this previous error:
|
||||
${V.current.stack}
|
||||
|
||||
`),ze}jv(()=>{V.current=void 0,se.current=void 0,ye.current=Ee});const We=nr.useMemo(()=>nr.createElement(P,{...Ee,ref:Q}),[Q,P,Ee]);return nr.useMemo(()=>_?nr.createElement(ce.Provider,{value:be},We):We,[ce,We,be])}const z=nr.memo(j);if(z.WrappedComponent=P,z.displayName=j.displayName=A,c){const ee=nr.forwardRef(function(f,ce){return nr.createElement(z,{...f,reactReduxForwardedRef:ce})});return ee.displayName=A,ee.WrappedComponent=P,_2(ee,P)}return _2(z,P)}}var kUe=$Ue;function TUe({store:e,context:t,children:r,serverState:n,stabilityCheck:i="once",identityFunctionCheck:s="once"}){const o=nr.useMemo(()=>{const h=oU(e);return{store:e,subscription:h,getServerState:n?()=>n:void 0,stabilityCheck:i,identityFunctionCheck:s}},[e,n,i,s]),l=nr.useMemo(()=>e.getState(),[e]);jv(()=>{const{subscription:h}=o;return h.onStateChange=h.notifyNestedSubs,h.trySubscribe(),l!==e.getState()&&h.notifyNestedSubs(),()=>{h.tryUnsubscribe(),h.onStateChange=void 0}},[o,l]);const c=t||nU;return nr.createElement(c.Provider,{value:o},r)}var PUe=TUe;wUe(xn.useSyncExternalStore);function RUe(e,t,r){for(var n=-1,i=e.length,s=t.length,o={};++n<i;){var l=n<s?t[n]:void 0;r(o,e[n],l)}return o}var IUe=RUe,NUe=T0,jUe=IUe;function MUe(e,t){return jUe(e||[],t||[],NUe)}var DUe=MUe;const FUe=Tt(DUe);var uU={exports:{}};/*!
|
||||
Copyright (c) 2018 Jed Watson.
|
||||
Licensed under the MIT License (MIT), see
|
||||
http://jedwatson.github.io/classnames
|
||||
*/(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var s="",o=0;o<arguments.length;o++){var l=arguments[o];l&&(s=i(s,n(l)))}return s}function n(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return r.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var l in s)t.call(s,l)&&s[l]&&(o=i(o,l));return o}function i(s,o){return o?s?s+" "+o:s+o:s}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(uU);var LUe=uU.exports;const BUe=Tt(LUe);var UUe=function(e,t,r,n){var i=typeof n<"u"?[n,e]:[e],s=new Blob(i,{type:r||"application/octet-stream"});if(typeof window.navigator.msSaveBlob<"u")window.navigator.msSaveBlob(s,t);else{var o=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(s):window.webkitURL.createObjectURL(s),l=document.createElement("a");l.style.display="none",l.href=o,l.setAttribute("download",t),typeof l.download>"u"&&l.setAttribute("target","_blank"),document.body.appendChild(l),l.click(),setTimeout(function(){document.body.removeChild(l),window.URL.revokeObjectURL(o)},200)}};const VUe=Tt(UUe);/*!
|
||||
* repeat-string <https://github.com/jonschlinkert/repeat-string>
|
||||
*
|
||||
* Copyright (c) 2014-2015, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/var Ro="",ww,zUe=qUe;function qUe(e,t){if(typeof e!="string")throw new TypeError("expected a string");if(t===1)return e;if(t===2)return e+e;var r=e.length*t;if(ww!==e||typeof ww>"u")ww=e,Ro="";else if(Ro.length>=r)return Ro.substr(0,r);for(;r>Ro.length&&t>1;)t&1&&(Ro+=e),t>>=1,e+=e;return Ro+=e,Ro=Ro.substr(0,r),Ro}var WUe=zUe,KUe=function(t){return t.split(/(<\/?[^>]+>)/g).filter(function(r){return r.trim()!==""})},HUe=function(t){return/<[^>!]+>/.test(t)},cU=function(t){return/<\/+[^>]+>/.test(t)},fU=function(t){return/<[^>]+\/>/.test(t)},JUe=function(t){return HUe(t)&&!cU(t)&&!fU(t)},GUe=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.indentor,n=t.textNodesOnSameLine,i=0,s=[];r=r||" ";var o=YUe(e).map(function(l,c,h){var v=l.value,y=l.type;y==="ClosingTag"&&i--;var S=WUe(r,i),b=S+v;if(y==="OpeningTag"&&i++,n){var _=h[c-1],$=h[c-2];y==="ClosingTag"&&_.type==="Text"&&$.type==="OpeningTag"&&(b=""+S+$.value+_.value+v,s.push(c-2,c-1))}return b});return s.forEach(function(l){return o[l]=null}),o.filter(function(l){return!!l}).join(`
|
||||
`)};function YUe(e){var t=KUe(e);return t.map(function(r){return{value:r,type:XUe(r)}})}function XUe(e){return cU(e)?"ClosingTag":JUe(e)?"OpeningTag":fU(e)?"SelfClosingTag":"Text"}const QUe=Tt(GUe);var ZUe=P0;function e5e(e){return ZUe(e).toLowerCase()}var t5e=e5e;const r5e=Tt(t5e);function my(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?my=function(t){return typeof t}:my=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},my(e)}function n5e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FM(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i5e(e,t,r){return t&&FM(e.prototype,t),r&&FM(e,r),e}function s5e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function LM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function o5e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?LM(r,!0).forEach(function(n){s5e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):LM(r).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function a5e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&A2(e,t)}function x2(e){return x2=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},x2(e)}function A2(e,t){return A2=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},A2(e,t)}function l5e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u5e(e,t){return t&&(typeof t=="object"||typeof t=="function")?t:l5e(e)}var BM={};function c5e(e){return e!==null&&my(e)==="object"&&typeof e.get=="function"&&typeof e.has=="function"}function f5e(e){return e==null}function p5e(e,t,r){return f5e(e)?r:c5e(e)?e.has(t)?e.get(t):r:hasOwnProperty.call(e,t)?e[t]:r}function UM(e,t,r){for(var n=0;n!==t.length;)if(e=p5e(e,t[n++],BM),e===BM)return r;return e}function VM(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=d5e(t,r),i=e||Object.keys(o5e({},r,{},t));return i.every(n)}function d5e(e,t){return function(r){if(typeof r=="string")return ss.is(t[r],e[r]);if(Array.isArray(r))return ss.is(UM(t,r),UM(e,r));throw new TypeError("Invalid key: expected Array or string: "+r)}}var h5e=function(e){a5e(t,e);function t(){return n5e(this,t),u5e(this,x2(t).apply(this,arguments))}return i5e(t,[{key:"shouldComponentUpdate",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return!VM(this.updateOnProps,this.props,n,"updateOnProps")||!VM(this.updateOnStates,this.state,i,"updateOnStates")}}]),t}(ls.Component),Ig;function pU(e){return Ig=Ig||document.createElement("textarea"),Ig.innerHTML="&"+e+";",Ig.value}var m5e=Object.prototype.hasOwnProperty;function g5e(e,t){return e?m5e.call(e,t):!1}function dU(e){var t=[].slice.call(arguments,1);return t.forEach(function(r){if(r){if(typeof r!="object")throw new TypeError(r+"must be object");Object.keys(r).forEach(function(n){e[n]=r[n]})}}),e}var y5e=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;function Ld(e){return e.indexOf("\\")<0?e:e.replace(y5e,"$1")}function hU(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function O2(e){if(e>65535){e-=65536;var t=55296+(e>>10),r=56320+(e&1023);return String.fromCharCode(t,r)}return String.fromCharCode(e)}var v5e=/&([a-z#][a-z0-9]{1,31});/gi,b5e=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;function E5e(e,t){var r=0,n=pU(t);return t!==n?n:t.charCodeAt(0)===35&&b5e.test(t)&&(r=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10),hU(r))?O2(r):e}function fu(e){return e.indexOf("&")<0?e:e.replace(v5e,E5e)}var S5e=/[&<>"]/,w5e=/[&<>"]/g,_5e={"&":"&","<":"<",">":">",'"':"""};function x5e(e){return _5e[e]}function Ei(e){return S5e.test(e)?e.replace(w5e,x5e):e}var dt={};dt.blockquote_open=function(){return`<blockquote>
|
||||
`};dt.blockquote_close=function(e,t){return"</blockquote>"+_u(e,t)};dt.code=function(e,t){return e[t].block?"<pre><code>"+Ei(e[t].content)+"</code></pre>"+_u(e,t):"<code>"+Ei(e[t].content)+"</code>"};dt.fence=function(e,t,r,n,i){var s=e[t],o="",l=r.langPrefix,c="",h,v,y;if(s.params){if(h=s.params.split(/\s+/g),v=h.join(" "),g5e(i.rules.fence_custom,h[0]))return i.rules.fence_custom[h[0]](e,t,r,n,i);c=Ei(fu(Ld(v))),o=' class="'+l+c+'"'}return r.highlight?y=r.highlight.apply(r.highlight,[s.content].concat(h))||Ei(s.content):y=Ei(s.content),"<pre><code"+o+">"+y+"</code></pre>"+_u(e,t)};dt.fence_custom={};dt.heading_open=function(e,t){return"<h"+e[t].hLevel+">"};dt.heading_close=function(e,t){return"</h"+e[t].hLevel+`>
|
||||
`};dt.hr=function(e,t,r){return(r.xhtmlOut?"<hr />":"<hr>")+_u(e,t)};dt.bullet_list_open=function(){return`<ul>
|
||||
`};dt.bullet_list_close=function(e,t){return"</ul>"+_u(e,t)};dt.list_item_open=function(){return"<li>"};dt.list_item_close=function(){return`</li>
|
||||
`};dt.ordered_list_open=function(e,t){var r=e[t],n=r.order>1?' start="'+r.order+'"':"";return"<ol"+n+`>
|
||||
`};dt.ordered_list_close=function(e,t){return"</ol>"+_u(e,t)};dt.paragraph_open=function(e,t){return e[t].tight?"":"<p>"};dt.paragraph_close=function(e,t){var r=!(e[t].tight&&t&&e[t-1].type==="inline"&&!e[t-1].content);return(e[t].tight?"":"</p>")+(r?_u(e,t):"")};dt.link_open=function(e,t,r){var n=e[t].title?' title="'+Ei(fu(e[t].title))+'"':"",i=r.linkTarget?' target="'+r.linkTarget+'"':"";return'<a href="'+Ei(e[t].href)+'"'+n+i+">"};dt.link_close=function(){return"</a>"};dt.image=function(e,t,r){var n=' src="'+Ei(e[t].src)+'"',i=e[t].title?' title="'+Ei(fu(e[t].title))+'"':"",s=' alt="'+(e[t].alt?Ei(fu(Ld(e[t].alt))):"")+'"',o=r.xhtmlOut?" /":"";return"<img"+n+s+i+o+">"};dt.table_open=function(){return`<table>
|
||||
`};dt.table_close=function(){return`</table>
|
||||
`};dt.thead_open=function(){return`<thead>
|
||||
`};dt.thead_close=function(){return`</thead>
|
||||
`};dt.tbody_open=function(){return`<tbody>
|
||||
`};dt.tbody_close=function(){return`</tbody>
|
||||
`};dt.tr_open=function(){return"<tr>"};dt.tr_close=function(){return`</tr>
|
||||
`};dt.th_open=function(e,t){var r=e[t];return"<th"+(r.align?' style="text-align:'+r.align+'"':"")+">"};dt.th_close=function(){return"</th>"};dt.td_open=function(e,t){var r=e[t];return"<td"+(r.align?' style="text-align:'+r.align+'"':"")+">"};dt.td_close=function(){return"</td>"};dt.strong_open=function(){return"<strong>"};dt.strong_close=function(){return"</strong>"};dt.em_open=function(){return"<em>"};dt.em_close=function(){return"</em>"};dt.del_open=function(){return"<del>"};dt.del_close=function(){return"</del>"};dt.ins_open=function(){return"<ins>"};dt.ins_close=function(){return"</ins>"};dt.mark_open=function(){return"<mark>"};dt.mark_close=function(){return"</mark>"};dt.sub=function(e,t){return"<sub>"+Ei(e[t].content)+"</sub>"};dt.sup=function(e,t){return"<sup>"+Ei(e[t].content)+"</sup>"};dt.hardbreak=function(e,t,r){return r.xhtmlOut?`<br />
|
||||
`:`<br>
|
||||
`};dt.softbreak=function(e,t,r){return r.breaks?r.xhtmlOut?`<br />
|
||||
`:`<br>
|
||||
`:`
|
||||
`};dt.text=function(e,t){return Ei(e[t].content)};dt.htmlblock=function(e,t){return e[t].content};dt.htmltag=function(e,t){return e[t].content};dt.abbr_open=function(e,t){return'<abbr title="'+Ei(fu(e[t].title))+'">'};dt.abbr_close=function(){return"</abbr>"};dt.footnote_ref=function(e,t){var r=Number(e[t].id+1).toString(),n="fnref"+r;return e[t].subId>0&&(n+=":"+e[t].subId),'<sup class="footnote-ref"><a href="#fn'+r+'" id="'+n+'">['+r+"]</a></sup>"};dt.footnote_block_open=function(e,t,r){var n=r.xhtmlOut?`<hr class="footnotes-sep" />
|
||||
`:`<hr class="footnotes-sep">
|
||||
`;return n+`<section class="footnotes">
|
||||
<ol class="footnotes-list">
|
||||
`};dt.footnote_block_close=function(){return`</ol>
|
||||
</section>
|
||||
`};dt.footnote_open=function(e,t){var r=Number(e[t].id+1).toString();return'<li id="fn'+r+'" class="footnote-item">'};dt.footnote_close=function(){return`</li>
|
||||
`};dt.footnote_anchor=function(e,t){var r=Number(e[t].id+1).toString(),n="fnref"+r;return e[t].subId>0&&(n+=":"+e[t].subId),' <a href="#'+n+'" class="footnote-backref">↩</a>'};dt.dl_open=function(){return`<dl>
|
||||
`};dt.dt_open=function(){return"<dt>"};dt.dd_open=function(){return"<dd>"};dt.dl_close=function(){return`</dl>
|
||||
`};dt.dt_close=function(){return`</dt>
|
||||
`};dt.dd_close=function(){return`</dd>
|
||||
`};function mU(e,t){return++t>=e.length-2?t:e[t].type==="paragraph_open"&&e[t].tight&&e[t+1].type==="inline"&&e[t+1].content.length===0&&e[t+2].type==="paragraph_close"&&e[t+2].tight?mU(e,t+2):t}var _u=dt.getBreak=function(t,r){return r=mU(t,r),r<t.length&&t[r].type==="list_item_close"?"":`
|
||||
`};function o$(){this.rules=dU({},dt),this.getBreak=dt.getBreak}o$.prototype.renderInline=function(e,t,r){for(var n=this.rules,i=e.length,s=0,o="";i--;)o+=n[e[s].type](e,s++,t,r,this);return o};o$.prototype.render=function(e,t,r){for(var n=this.rules,i=e.length,s=-1,o="";++s<i;)e[s].type==="inline"?o+=this.renderInline(e[s].children,t,r):o+=n[e[s].type](e,s,t,r,this);return o};function Ui(){this.__rules__=[],this.__cache__=null}Ui.prototype.__find__=function(e){for(var t=this.__rules__.length,r=-1;t--;)if(this.__rules__[++r].name===e)return r;return-1};Ui.prototype.__compile__=function(){var e=this,t=[""];e.__rules__.forEach(function(r){r.enabled&&r.alt.forEach(function(n){t.indexOf(n)<0&&t.push(n)})}),e.__cache__={},t.forEach(function(r){e.__cache__[r]=[],e.__rules__.forEach(function(n){n.enabled&&(r&&n.alt.indexOf(r)<0||e.__cache__[r].push(n.fn))})})};Ui.prototype.at=function(e,t,r){var n=this.__find__(e),i=r||{};if(n===-1)throw new Error("Parser rule not found: "+e);this.__rules__[n].fn=t,this.__rules__[n].alt=i.alt||[],this.__cache__=null};Ui.prototype.before=function(e,t,r,n){var i=this.__find__(e),s=n||{};if(i===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:r,alt:s.alt||[]}),this.__cache__=null};Ui.prototype.after=function(e,t,r,n){var i=this.__find__(e),s=n||{};if(i===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:r,alt:s.alt||[]}),this.__cache__=null};Ui.prototype.push=function(e,t,r){var n=r||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:n.alt||[]}),this.__cache__=null};Ui.prototype.enable=function(e,t){e=Array.isArray(e)?e:[e],t&&this.__rules__.forEach(function(r){r.enabled=!1}),e.forEach(function(r){var n=this.__find__(r);if(n<0)throw new Error("Rules manager: invalid rule name "+r);this.__rules__[n].enabled=!0},this),this.__cache__=null};Ui.prototype.disable=function(e){e=Array.isArray(e)?e:[e],e.forEach(function(t){var r=this.__find__(t);if(r<0)throw new Error("Rules manager: invalid rule name "+t);this.__rules__[r].enabled=!1},this),this.__cache__=null};Ui.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function A5e(e){e.inlineMode?e.tokens.push({type:"inline",content:e.src.replace(/\n/g," ").trim(),level:0,lines:[0,1],children:[]}):e.block.parse(e.src,e.options,e.env,e.tokens)}function xu(e,t,r,n,i){this.src=e,this.env=n,this.options=r,this.parser=t,this.tokens=i,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.isInLabel=!1,this.linkLevel=0,this.linkContent="",this.labelUnmatchedScopes=0}xu.prototype.pushPending=function(){this.tokens.push({type:"text",content:this.pending,level:this.pendingLevel}),this.pending=""};xu.prototype.push=function(e){this.pending&&this.pushPending(),this.tokens.push(e),this.pendingLevel=this.level};xu.prototype.cacheSet=function(e,t){for(var r=this.cache.length;r<=e;r++)this.cache.push(0);this.cache[e]=t};xu.prototype.cacheGet=function(e){return e<this.cache.length?this.cache[e]:0};function Bd(e,t){var r,n,i,s=-1,o=e.posMax,l=e.pos,c=e.isInLabel;if(e.isInLabel)return-1;if(e.labelUnmatchedScopes)return e.labelUnmatchedScopes--,-1;for(e.pos=t+1,e.isInLabel=!0,r=1;e.pos<o;){if(i=e.src.charCodeAt(e.pos),i===91)r++;else if(i===93&&(r--,r===0)){n=!0;break}e.parser.skipToken(e)}return n?(s=e.pos,e.labelUnmatchedScopes=0):e.labelUnmatchedScopes=r-1,e.pos=l,e.isInLabel=c,s}function O5e(e,t,r,n){var i,s,o,l,c,h;if(e.charCodeAt(0)!==42||e.charCodeAt(1)!==91||e.indexOf("]:")===-1||(i=new xu(e,t,r,n,[]),s=Bd(i,1),s<0||e.charCodeAt(s+1)!==58))return-1;for(l=i.posMax,o=s+2;o<l&&i.src.charCodeAt(o)!==10;o++);return c=e.slice(2,s),h=e.slice(s+2,o).trim(),h.length===0?-1:(n.abbreviations||(n.abbreviations={}),typeof n.abbreviations[":"+c]>"u"&&(n.abbreviations[":"+c]=h),o)}function C5e(e){var t=e.tokens,r,n,i,s;if(!e.inlineMode){for(r=1,n=t.length-1;r<n;r++)if(t[r-1].type==="paragraph_open"&&t[r].type==="inline"&&t[r+1].type==="paragraph_close"){for(i=t[r].content;i.length&&(s=O5e(i,e.inline,e.options,e.env),!(s<0));)i=i.slice(s).trim();t[r].content=i,i.length||(t[r-1].tight=!0,t[r+1].tight=!0)}}}function C2(e){var t=fu(e);try{t=decodeURI(t)}catch{}return encodeURI(t)}function gU(e,t){var r,n,i,s=t,o=e.posMax;if(e.src.charCodeAt(t)===60){for(t++;t<o;){if(r=e.src.charCodeAt(t),r===10)return!1;if(r===62)return i=C2(Ld(e.src.slice(s+1,t))),e.parser.validateLink(i)?(e.pos=t+1,e.linkContent=i,!0):!1;if(r===92&&t+1<o){t+=2;continue}t++}return!1}for(n=0;t<o&&(r=e.src.charCodeAt(t),!(r===32||r<32||r===127));){if(r===92&&t+1<o){t+=2;continue}if(r===40&&(n++,n>1)||r===41&&(n--,n<0))break;t++}return s===t||(i=Ld(e.src.slice(s,t)),!e.parser.validateLink(i))?!1:(e.linkContent=i,e.pos=t,!0)}function yU(e,t){var r,n=t,i=e.posMax,s=e.src.charCodeAt(t);if(s!==34&&s!==39&&s!==40)return!1;for(t++,s===40&&(s=41);t<i;){if(r=e.src.charCodeAt(t),r===s)return e.pos=t+1,e.linkContent=Ld(e.sr
Line truncated
|
||||
()[]'".,!?-`;function _w(e){return e.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1")}function R5e(e){var t,r,n,i,s,o,l,c,h,v,y,S,b=e.tokens;if(e.env.abbreviations){for(e.env.abbrRegExp||(S="(^|["+zM.split("").map(_w).join("")+"])("+Object.keys(e.env.abbreviations).map(function(_){return _.substr(1)}).sort(function(_,$){return $.length-_.length}).map(_w).join("|")+")($|["+zM.split("").map(_w).join("")+"])",e.env.abbrRegExp=new RegExp(S,"g")),v=e.env.abbrRegExp,r=0,n=b.length;r<n;r++)if(b[r].type==="inline"){for(i=b[r].children,t=i.length-1;t>=0;t--)if(s=i[t],s.type==="text"){for(c=0,o=s.content,v.lastIndex=0,h=s.level,l=[];y=v.exec(o);)v.lastIndex>c&&l.push({type:"text",content:o.slice(c,y.index+y[1].length),level:h}),l.push({type:"abbr_open",title:e.env.abbreviations[":"+y[2]],level:h++}),l.push({type:"text",content:y[2],level:h}),l.push({type:"abbr_close",level:--h}),c=v.lastIndex-y[3].length;l.length&&(c<o.length&&l.push({type:"text",content:o.slice(c),level:h}),b[r].children=i=[].concat(i.slice(0,t),l,i.slice(t+1)))}}}}var I5e=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,N5e=/\((c|tm|r|p)\)/ig,j5e={c:"©",r:"®",p:"§",tm:"™"};function M5e(e){return e.indexOf("(")<0?e:e.replace(N5e,function(t,r){return j5e[r.toLowerCase()]})}function D5e(e){var t,r,n,i,s;if(e.options.typographer){for(s=e.tokens.length-1;s>=0;s--)if(e.tokens[s].type==="inline")for(i=e.tokens[s].children,t=i.length-1;t>=0;t--)r=i[t],r.type==="text"&&(n=r.content,n=M5e(n),I5e.test(n)&&(n=n.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/mg,"$1—$2").replace(/(^|\s)--(\s|$)/mg,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/mg,"$1–$2")),r.content=n)}}var F5e=/['"]/,qM=/['"]/g,L5e=/[-\s()\[\]]/,WM="’";function KM(e,t){return t<0||t>=e.length?!1:!L5e.test(e[t])}function tc(e,t,r){return e.substr(0,t)+r+e.substr(t+1)}function B5e(e){var t,r,n,i,s,o,l,c,h,v,y,S,b,_,$,P,x;if(e.options.typographer){for(x=[],$=e.tokens.length-1;$>=0;$--)if(e.tokens[$].type==="inline"){for(P=e.tokens[$].children,x.length=0,t=0;t<P.length;t++)if(r=P[t],!(r.type!=="text"||F5e.test(r.text))){for(l=P[t].level,b=x.length-1;b>=0&&!(x[b].level<=l);b--);x.length=b+1,n=r.content,s=0,o=n.length;e:for(;s<o&&(qM.lastIndex=s,i=qM.exec(n),!!i);){if(c=!KM(n,i.index-1),s=i.index+1,_=i[0]==="'",h=!KM(n,s),!h&&!c){_&&(r.content=tc(r.content,i.index,WM));continue}if(y=!h,S=!c,S){for(b=x.length-1;b>=0&&(v=x[b],!(x[b].level<l));b--)if(v.single===_&&x[b].level===l){v=x[b],_?(P[v.token].content=tc(P[v.token].content,v.pos,e.options.quotes[2]),r.content=tc(r.content,i.index,e.options.quotes[3])):(P[v.token].content=tc(P[v.token].content,v.pos,e.options.quotes[0]),r.content=tc(r.content,i.index,e.options.quotes[1])),x.length=b;continue e}}y?x.push({token:t,pos:i.index,single:_,level:l}):S&&_&&(r.content=tc(r.content,i.index,WM))}}}}}var xw=[["block",A5e],["abbr",C5e],["references",k5e],["inline",T5e],["footnote_tail",P5e],["abbr2",R5e],["replacements",D5e],["smartquotes",B5e]];function bU(){this.options={},this.ruler=new Ui;for(var e=0;e<xw.length;e++)this.ruler.push(xw[e][0],xw[e][1])}bU.prototype.process=function(e){var t,r,n;for(n=this.ruler.getRules(""),t=0,r=n.length;t<r;t++)n[t](e)};function Au(e,t,r,n,i){var s,o,l,c,h,v,y;for(this.src=e,this.parser=t,this.options=r,this.env=n,this.tokens=i,this.bMarks=[],this.eMarks=[],this.tShift=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.parentType="root",this.ddIndent=-1,this.level=0,this.result="",o=this.src,v=0,y=!1,l=c=v=0,h=o.length;c<h;c++){if(s=o.charCodeAt(c),!y)if(s===32){v++;continue}else y=!0;(s===10||c===h-1)&&(s!==10&&c++,this.bMarks.push(l),this.eMarks.push(c),this.tShift.push(v),y=!1,v=0,l=c+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.lineMax=this.bMarks.length-1}Au.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]};Au.prototype.skipEmptyLines=function(t){for(var r=this.lineMax;t<r&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t};Au.prototype.skipSpaces=function(t){for(var r=this.src.length;t<r&&this.src.charCodeAt(t)===32;t++);return t};Au.prototype.skipChars=function(t,r){for(var n=this.src.length;t<n&&this.src.charCodeAt(t)===r;t++);return t};Au.prototype.skipCharsBack=function(t,r,n){if(t<=n)return t;for(;t>n;)if(r!==this.src.charCodeAt(--t))return t+1;return t};Au.prototype.getLines=function(t,r,n,i){var s,o,l,c,h,v=t;if(t>=r)return"";if(v+1===r)return o=this.bMarks[v]+Math.min(this.tShift[v],n),l=i?this.eMarks[v]+1:this.eMarks[v],this.src.slice(o,l);for(c=new Array(r-t),s=0;v<r;v++,s++)h=this.tShift[v],h>n&&(h=n),h<0&&(h=0),o=this.bMarks[v]+h,v+1<r||i?l=this.eMarks[v]+1:l=this.eMarks[v],c[s]=this.src.slice(o,l);return c.join("")};function U5e(e,t,r){var n,i;if(e.tShift[t]-e.blkIndent<4)return!1;for(i=n=t+1;n<r;){if(e.isEmpty(n)){n++;continue}if(e.tShift[n]-e.blkIndent>=4){n++,i=n;continue}break}return e.line=n,e.tokens.pushLine truncated
|
||||
`),e.indexOf(" ")>=0&&(e=e.replace(iVe,function(l,c){var h;return e.charCodeAt(c)===10?(s=c+1,o=0,l):(h=" ".slice((c-s-o)%4),o=c-s+1,h)})),i=new Au(e,this,t,r,n),this.tokenize(i,i.line,i.lineMax)};function aVe(e){switch(e){case 10:case 92:case 96:case 42:case 95:case 94:case 91:case 93:case 33:case 38:case 60:case 62:case 123:case 125:case 36:case 37:case 64:case 126:case 43:case 61:case 58:return!0;default:return!1}}function lVe(e,t){for(var r=e.pos;r<e.posMax&&!aVe(e.src.charCodeAt(r));)r++;return r===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,r)),e.pos=r,!0)}function uVe(e,t){var r,n,i=e.pos;if(e.src.charCodeAt(i)!==10)return!1;if(r=e.pending.length-1,n=e.posMax,!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){for(var s=r-2;s>=0;s--)if(e.pending.charCodeAt(s)!==32){e.pending=e.pending.substring(0,s+1);break}e.push({type:"hardbreak",level:e.level})}else e.pending=e.pending.slice(0,-1),e.push({type:"softbreak",level:e.level});else e.push({type:"softbreak",level:e.level});for(i++;i<n&&e.src.charCodeAt(i)===32;)i++;return e.pos=i,!0}var l$=[];for(var GM=0;GM<256;GM++)l$.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){l$[e.charCodeAt(0)]=1});function cVe(e,t){var r,n=e.pos,i=e.posMax;if(e.src.charCodeAt(n)!==92)return!1;if(n++,n<i){if(r=e.src.charCodeAt(n),r<256&&l$[r]!==0)return t||(e.pending+=e.src[n]),e.pos+=2,!0;if(r===10){for(t||e.push({type:"hardbreak",level:e.level}),n++;n<i&&e.src.charCodeAt(n)===32;)n++;return e.pos=n,!0}}return t||(e.pending+="\\"),e.pos++,!0}function fVe(e,t){var r,n,i,s,o,l=e.pos,c=e.src.charCodeAt(l);if(c!==96)return!1;for(r=l,l++,n=e.posMax;l<n&&e.src.charCodeAt(l)===96;)l++;for(i=e.src.slice(r,l),s=o=l;(s=e.src.indexOf("`",o))!==-1;){for(o=s+1;o<n&&e.src.charCodeAt(o)===96;)o++;if(o-s===i.length)return t||e.push({type:"code",content:e.src.slice(l,s).replace(/[ \n]+/g," ").trim(),block:!1,level:e.level}),e.pos=o,!0}return t||(e.pending+=i),e.pos+=i.length,!0}function pVe(e,t){var r,n,i,s=e.posMax,o=e.pos,l,c;if(e.src.charCodeAt(o)!==126||t||o+4>=s||e.src.charCodeAt(o+1)!==126||e.level>=e.options.maxNesting||(l=o>0?e.src.charCodeAt(o-1):-1,c=e.src.charCodeAt(o+2),l===126)||c===126||c===32||c===10)return!1;for(n=o+2;n<s&&e.src.charCodeAt(n)===126;)n++;if(n>o+3)return e.pos+=n-o,t||(e.pending+=e.src.slice(o,n)),!0;for(e.pos=o+2,i=1;e.pos+1<s;){if(e.src.charCodeAt(e.pos)===126&&e.src.charCodeAt(e.pos+1)===126&&(l=e.src.charCodeAt(e.pos-1),c=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1,c!==126&&l!==126&&(l!==32&&l!==10?i--:c!==32&&c!==10&&i++,i<=0))){r=!0;break}e.parser.skipToken(e)}return r?(e.posMax=e.pos,e.pos=o+2,t||(e.push({type:"del_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"del_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=o,!1)}function dVe(e,t){var r,n,i,s=e.posMax,o=e.pos,l,c;if(e.src.charCodeAt(o)!==43||t||o+4>=s||e.src.charCodeAt(o+1)!==43||e.level>=e.options.maxNesting||(l=o>0?e.src.charCodeAt(o-1):-1,c=e.src.charCodeAt(o+2),l===43)||c===43||c===32||c===10)return!1;for(n=o+2;n<s&&e.src.charCodeAt(n)===43;)n++;if(n!==o+2)return e.pos+=n-o,t||(e.pending+=e.src.slice(o,n)),!0;for(e.pos=o+2,i=1;e.pos+1<s;){if(e.src.charCodeAt(e.pos)===43&&e.src.charCodeAt(e.pos+1)===43&&(l=e.src.charCodeAt(e.pos-1),c=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1,c!==43&&l!==43&&(l!==32&&l!==10?i--:c!==32&&c!==10&&i++,i<=0))){r=!0;break}e.parser.skipToken(e)}return r?(e.posMax=e.pos,e.pos=o+2,t||(e.push({type:"ins_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"ins_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=o,!1)}function hVe(e,t){var r,n,i,s=e.posMax,o=e.pos,l,c;if(e.src.charCodeAt(o)!==61||t||o+4>=s||e.src.charCodeAt(o+1)!==61||e.level>=e.options.maxNesting||(l=o>0?e.src.charCodeAt(o-1):-1,c=e.src.charCodeAt(o+2),l===61)||c===61||c===32||c===10)return!1;for(n=o+2;n<s&&e.src.charCodeAt(n)===61;)n++;if(n!==o+2)return e.pos+=n-o,t||(e.pending+=e.src.slice(o,n)),!0;for(e.pos=o+2,i=1;e.pos+1<s;){if(e.src.charCodeAt(e.pos)===61&&e.src.charCodeAt(e.pos+1)===61&&(l=e.src.charCodeAt(e.pos-1),c=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1,c!==61&&l!==61&&(l!==32&&l!==10?i--:c!==32&&c!==10&&i++,i<=0))){r=!0;break}e.parser.skipToken(e)}return r?(e.posMax=e.pos,e.pos=o+2,t||(e.push({type:"mark_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"mark_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=o,!1)}function YM(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}function XM(e,t){var r=t,n,i,s,o=!0,l=!0,c=e.posMax,h=e.src.charCodeAt(t);for(n=t>0?e.src.charCodeAt(t-1):-1;r<c&&e.src.charCodeAt(r)===h;)r++;return r>=c&&(o=!1),s=r-t,s>=4?o=l=!1:(i=r<c?e.src.charCodeAt(r):-1,(i===32||i===10)&&(o=!1),(n===32||n===10)&&(l=!1),h===95&&(YM(n)&&(o=!1),YM(i)&&(l=!1))),{can_open:o,can_close:l,delims:s}}function mVe(e,t){var r,n,i,s,o,l,c,h=e.posMax,v=e.pos,y=e.src.charCodeAt(v);if(y!==95&&y!==42||t)return!1;if(c=XM(e,v),r=c.delims,!c.can_open)return e.pos+=r,t||(e.pending+=e.src
Line truncated
|
||||
|
||||
import Remarkable from 'remarkable';
|
||||
import linkify from 'remarkable/linkify';
|
||||
new Remarkable().use(linkify)
|
||||
`),this.inline=new cb,this.block=new a$,this.core=new bU,this.renderer=new o$,this.ruler=new Ui,this.options={},this.configure(GVe[e]),this.set(t||{})}fl.prototype.set=function(e){dU(this.options,e)};fl.prototype.configure=function(e){var t=this;if(!e)throw new Error("Wrong `remarkable` preset, check name/content");e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(r){e.components[r].rules&&t[r].ruler.enable(e.components[r].rules,!0)})};fl.prototype.use=function(e,t){return e(this,t),this};fl.prototype.parse=function(e,t){var r=new SU(this,e,t);return this.core.process(r),r.tokens};fl.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)};fl.prototype.parseInline=function(e,t){var r=new SU(this,e,t);return r.inlineMode=!0,this.core.process(r),r.tokens};fl.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};var YVe="3.16.2";function XVe(e,t){for(var r in t)t.hasOwnProperty(r)&&e[r]===void 0&&(e[r]=t[r]);return e}function QVe(e,t,r){var n;return e.length>t&&(r==null?(r="…",n=3):n=r.length,e=e.substring(0,t-n)+r),e}function QM(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function Il(e,t){for(var r=e.length-1;r>=0;r--)t(e[r])===!0&&e.splice(r,1)}function ZVe(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var r=[],n=0,i;i=t.exec(e);)r.push(e.substring(n,i.index)),r.push(i[0]),n=i.index+i[0].length;return r.push(e.substring(n)),r}function u$(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var $2=function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.whitespaceRegex=/\s+/,this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(t,r){var n=this.getAttrs();return n[t]=r,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var r=this.getClass(),n=this.whitespaceRegex,i=r?r.split(n):[],s=t.split(n),o;o=s.shift();)QM(i,o)===-1&&i.push(o);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var r=this.getClass(),n=this.whitespaceRegex,i=r?r.split(n):[],s=t.split(n),o;i.length&&(o=s.shift());){var l=QM(i,o);l!==-1&&i.splice(l,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),r=this.buildAttrsStr();return r=r?" "+r:"",["<",t,r,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var t=this.getAttrs(),r=[];for(var n in t)t.hasOwnProperty(n)&&r.push(n+'="'+t[n]+'"');return r.join(" ")},e}();function e7e(e,t,r){var n,i;r==null?(r="…",i=3,n=8):(i=r.length,n=r.length);var s=function(A){var C={},j=A,U=j.match(/^([a-z]+):\/\//i);return U&&(C.scheme=U[1],j=j.substr(U[0].length)),U=j.match(/^(.*?)(?=(\?|#|\/|$))/i),U&&(C.host=U[1],j=j.substr(U[0].length)),U=j.match(/^\/(.*?)(?=(\?|#|$))/i),U&&(C.path=U[1],j=j.substr(U[0].length)),U=j.match(/^\?(.*?)(?=(#|$))/i),U&&(C.query=U[1],j=j.substr(U[0].length)),U=j.match(/^#(.*?)$/i),U&&(C.fragment=U[1]),C},o=function(A){var C="";return A.scheme&&A.host&&(C+=A.scheme+"://"),A.host&&(C+=A.host),A.path&&(C+="/"+A.path),A.query&&(C+="?"+A.query),A.fragment&&(C+="#"+A.fragment),C},l=function(A,C){var j=C/2,U=Math.ceil(j),z=-1*Math.floor(j),J="";return z<0&&(J=A.substr(z)),A.substr(0,U)+r+J};if(e.length<=t)return e;var c=t-i,h=s(e);if(h.query){var v=h.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);v&&(h.query=h.query.substr(0,v[1].length),e=o(h))}if(e.length<=t||(h.host&&(h.host=h.host.replace(/^www\./,""),e=o(h)),e.length<=t))return e;var y="";if(h.host&&(y+=h.host),y.length>=c)return h.host.length==t?(h.host.substr(0,t-i)+r).substr(0,c+n):l(y,c).substr(0,c+n);var S="";if(h.path&&(S+="/"+h.path),h.query&&(S+="?"+h.query),S)if((y+S).length>=c){if((y+S).length==t)return(y+S).substr(0,t);var b=c-y.length;return(y+l(S,b)).substr(0,c+n)}else y+=S;if(h.fragment){var _="#"+h.fragment;if((y+_).length>=c){if((y+_).length==t)return(y+_).substr(0,t);var $=c-y.length;return(y+l(_,$)).substr(0,c+n)}else
Line truncated
|
||||
`+kr),We&&Fg([ce,L,Fe],Un=>{kr=$p(kr,Un," ")}),C&&Rt?C.createHTML(kr):kr},t.setConfig=function(){let ht=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};tr(ht),ze=!0},t.clearConfig=function(){yr=null,ze=!1},t.isValidAttribute=function(ht,oe,Ne){yr||tr({});const ft=ur(ht),Xt=ur(oe);return oi(ft,Xt,Ne)},t.addHook=function(ht,oe){typeof oe=="function"&&(f[ht]=f[ht]||[],Cp(f[ht],oe))},t.removeHook=function(ht){if(f[ht])return l3(f[ht])},t.removeHooks=function(ht){f[ht]&&(f[ht]=[])},t.removeAllHooks=function(){f={}},t}var Q7e=NU(),fb={},Z7e="Expected a function",h3=NaN,eze="[object Symbol]",tze=/^\s+|\s+$/g,rze=/^[-+]0x[0-9a-f]+$/i,nze=/^0b[01]+$/i,ize=/^0o[0-7]+$/i,sze=parseInt,oze=typeof en=="object"&&en&&en.Object===Object&&en,aze=typeof self=="object"&&self&&self.Object===Object&&self,lze=oze||aze||Function("return this")(),uze=Object.prototype,cze=uze.toString,fze=Math.max,pze=Math.min,jw=function(){return lze.Date.now()};function dze(e,t,r){var n,i,s,o,l,c,h=0,v=!1,y=!1,S=!0;if(typeof e!="function")throw new TypeError(Z7e);t=m3(t)||0,R2(r)&&(v=!!r.leading,y="maxWait"in r,s=y?fze(m3(r.maxWait)||0,t):s,S="trailing"in r?!!r.trailing:S);function b(z){var J=n,ee=i;return n=i=void 0,h=z,o=e.apply(ee,J),o}function _(z){return h=z,l=setTimeout(x,t),v?b(z):o}function $(z){var J=z-c,ee=z-h,Q=t-J;return y?pze(Q,s-ee):Q}function P(z){var J=z-c,ee=z-h;return c===void 0||J>=t||J<0||y&&ee>=s}function x(){var z=jw();if(P(z))return A(z);l=setTimeout(x,$(z))}function A(z){return l=void 0,S&&n?b(z):(n=i=void 0,o)}function C(){l!==void 0&&clearTimeout(l),h=0,n=c=i=l=void 0}function j(){return l===void 0?o:A(jw())}function U(){var z=jw(),J=P(z);if(n=arguments,i=this,c=z,J){if(l===void 0)return _(c);if(y)return l=setTimeout(x,t),b(c)}return l===void 0&&(l=setTimeout(x,t)),o}return U.cancel=C,U.flush=j,U}function R2(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function hze(e){return!!e&&typeof e=="object"}function mze(e){return typeof e=="symbol"||hze(e)&&cze.call(e)==eze}function m3(e){if(typeof e=="number")return e;if(mze(e))return h3;if(R2(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=R2(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(tze,"");var r=nze.test(e);return r||ize.test(e)?sze(e.slice(2),r?2:8):rze.test(e)?h3:+e}var gze=dze;function I2(e){"@babel/helpers - typeof";return I2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I2(e)}Object.defineProperty(fb,"__esModule",{value:!0});fb.DebounceInput=void 0;var g3=jU(xn),yze=jU(gze),vze=["element","onChange","value","minLength","debounceTimeout","forceNotifyByEnter","forceNotifyOnBlur","onKeyDown","onBlur","inputRef"];function jU(e){return e&&e.__esModule?e:{default:e}}function bze(e,t){if(e==null)return{};var r=Eze(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Eze(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s<n.length;s++)i=n[s],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function y3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function rs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?y3(Object(r),!0).forEach(function(n){Ta(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y3(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Sze(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v3(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function wze(e,t,r){return t&&v3(e.prototype,t),r&&v3(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _ze(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&N2(e,t)}function N2(e,t){return N2=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},N2(e,t)}function xze(e){var t=Oze();return function(){var n=Dv(e),i;if(t){var s=Dv(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return Aze(this,i)}}function Aze(e,t){if(t&&(I2(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Bl(e)}function Bl(e){if(e===void 0)throw new ReferenceError("this hasn't been initi
Line truncated
|
||||
Use Chrome, Firefox or Internet Explorer 11`)}},48:function(e){var t={};function r(i,s,o){o||(o=Error);var l=function(c){function h(v,y,S){return c.call(this,function(_,$,P){return typeof s=="string"?s:s(_,$,P)}(v,y,S))||this}return function(y,S){y.prototype=Object.create(S.prototype),y.prototype.constructor=y,y.__proto__=S}(h,c),h}(o);l.prototype.name=o.name,l.prototype.code=i,t[i]=l}function n(i,s){if(Array.isArray(i)){var o=i.length;return i=i.map(function(l){return String(l)}),o>2?"one of ".concat(s," ").concat(i.slice(0,o-1).join(", "),", or ")+i[o-1]:o===2?"one of ".concat(s," ").concat(i[0]," or ").concat(i[1]):"of ".concat(s," ").concat(i[0])}return"of ".concat(s," ").concat(String(i))}r("ERR_INVALID_OPT_VALUE",function(i,s){return'The value "'+s+'" is invalid for option "'+i+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(i,s,o){var l,c;if(typeof s=="string"&&function(y,S,b){return y.substr(!b||b<0?0:+b,S.length)===S}(s,"not ")?(l="must not be",s=s.replace(/^not /,"")):l="must be",function(y,S,b){return(b===void 0||b>y.length)&&(b=y.length),y.substring(b-S.length,b)===S}(i," argument"))c="The ".concat(i," ").concat(l," ").concat(n(s,"type"));else{var h=function(y,S,b){return typeof b!="number"&&(b=0),!(b+S.length>y.length)&&y.indexOf(S,b)!==-1}(i,".")?"property":"argument";c='The "'.concat(i,'" ').concat(h," ").concat(l," ").concat(n(s,"type"))}return c+=". Received type ".concat(typeof o)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(i){return"The "+i+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(i){return"Cannot call "+i+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(i){return"Unknown encoding: "+i},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},382:function(e,t,r){var n=r(606),i=Object.keys||function(b){var _=[];for(var $ in b)_.push($);return _};e.exports=v;var s=r(412),o=r(708);r(698)(v,s);for(var l=i(o.prototype),c=0;c<l.length;c++){var h=l[c];v.prototype[h]||(v.prototype[h]=o.prototype[h])}function v(b){if(!(this instanceof v))return new v(b);s.call(this,b),o.call(this,b),this.allowHalfOpen=!0,b&&(b.readable===!1&&(this.readable=!1),b.writable===!1&&(this.writable=!1),b.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",y)))}function y(){this._writableState.ended||n.nextTick(S,this)}function S(b){b.end()}Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(v.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(v.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(v.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(_){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=_,this._writableState.destroyed=_)}})},600:function(e,t,r){e.exports=i;var n=r(610);function i(s){if(!(this instanceof i))return new i(s);n.call(this,s)}r(698)(i,n),i.prototype._transform=function(s,o,l){l(null,s)}},412:function(e,t,r){var n,i=r(606);e.exports=Q,Q.ReadableState=ee,r(7).EventEmitter;var s=function(q,Ae){return q.listeners(Ae).length},o=r(345),l=r(287).Buffer,c=(r.g!==void 0?r.g:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){},h,v=r(838);h=v&&v.debuglog?v.debuglog("stream"):function(){};var y,S,b,_=r(726),$=r(896),P=r(291).getHighWaterMark,x=r(48).F,A=x.ERR_INVALID_ARG_TYPE,C=x.ERR_STREAM_PUSH_AFTER_EOF,j=x.ERR_METHOD_NOT_IMPLEMENTED,U=x.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(698)(Q,o);var z=$.errorOrDestroy,J=["error","close","destroy","pause","resume"];function ee(V,q,Ae){n=n||r(382),V=V||{},typeof Ae!="boolean"&&(Ae=q instanceof n),this.objectMode=!!V.objectMode,Ae&&(this.objectMode=this.objectMode||!!V.readableObjectMode),this.highWaterMark=P(this,V,"readableHighWaterMark",Ae),this.buffer=new _,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=V.emitClose!==!1,this.autoDestroy=!!V.autoDestroy,this.destroyed=!1,this.defaultEncoding=V.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,V.encoding&&(y||(y=r(141).I),this.decoder=new y(V.encoding),this.encoding=V.en
Line truncated
|
||||
`:"")),v&&v()}function b(_){return!!_.interrupt&&(_.interrupt.append=c,_.interrupt.end=S,_.interrupt=!1,c(!0),!0)}if(c(!1,h.indents+(h.name?"<"+h.name:"")+(h.attributes.length?" "+h.attributes.join(" "):"")+(y?h.name?">":"":h.name?"/>":"")+(h.indent&&y>1?`
|
||||
`:"")),!y)return c(!1,h.indent?`
|
||||
`:"");b(h)||S()}e.exports=function(h,v){typeof v!="object"&&(v={indent:v});var y=v.stream?new s:null,S="",b=!1,_=v.indent?v.indent===!0?" ":v.indent:"",$=!0;function P(j){$?n.nextTick(j):j()}function x(j,U){if(U!==void 0&&(S+=U),j&&!b&&(y=y||new s,b=!0),j&&b){var z=S;P(function(){y.emit("data",z)}),S=""}}function A(j,U){l(x,o(j,_,_?1:0),U)}function C(){if(y){var j=S;P(function(){y.emit("data",j),y.emit("end"),y.readable=!1,y.emit("close")})}}return P(function(){$=!1}),v.declaration&&function(U){var z={version:"1.0",encoding:U.encoding||"UTF-8"};U.standalone&&(z.standalone=U.standalone),A({"?xml":{_attr:z}}),S=S.replace("/>","?>")}(v.declaration),h&&h.forEach?h.forEach(function(j,U){var z;U+1===h.length&&(z=C),A(j,z)}):A(h,C),y?(y.readable=!0,y):S},e.exports.element=e.exports.Element=function(){var h={_elem:o(Array.prototype.slice.call(arguments)),push:function(v){if(!this.append)throw new Error("not assigned to a parent!");var y=this,S=this._elem.indent;l(this.append,o(v,S,this._elem.icount+(S?1:0)),function(){y.append(!0)})},close:function(v){v!==void 0&&this.push(v),this.end&&this.end()}};return h}},987:function(e){e.exports=YK},362:function(e){e.exports=ZK},340:function(){},838:function(){}},b3={};function Ce(e){var t=b3[e];if(t!==void 0)return t.exports;var r=b3[e]={exports:{}};return Tze[e](r,r.exports,Ce),r.exports}Ce.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return Ce.d(t,{a:t}),t},Ce.d=function(e,t){for(var r in t)Ce.o(t,r)&&!Ce.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},Ce.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),Ce.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},Ce.r=function(e){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var DU={};(function(){var lp,rP,up,nP;Ce.d(DU,{A:function(){return PK}});var e={};Ce.r(e),Ce.d(e,{CLEAR:function(){return ye},CLEAR_BY:function(){return Le},NEW_AUTH_ERR:function(){return be},NEW_SPEC_ERR:function(){return ge},NEW_SPEC_ERR_BATCH:function(){return pe},NEW_THROWN_ERR:function(){return he},NEW_THROWN_ERR_BATCH:function(){return de},clear:function(){return Ae},clearBy:function(){return Ee},newAuthErr:function(){return q},newSpecErr:function(){return Z},newSpecErrBatch:function(){return V},newThrownErr:function(){return se},newThrownErrBatch:function(){return _e}});var t={};Ce.r(t),Ce.d(t,{AUTHORIZE:function(){return oe},AUTHORIZE_OAUTH2:function(){return Xt},CONFIGURE_AUTH:function(){return _r},LOGOUT:function(){return Ne},PRE_AUTHORIZE_OAUTH2:function(){return ft},RESTORE_AUTHORIZATION:function(){return kr},SHOW_AUTH_POPUP:function(){return ht},VALIDATE:function(){return St},authPopup:function(){return Cu},authorize:function(){return ai},authorizeAccessCodeWithBasicAuthentication:function(){return im},authorizeAccessCodeWithFormParams:function(){return Pf},authorizeApplication:function(){return nm},authorizeOauth2:function(){return Tf},authorizeOauth2WithPersistOption:function(){return rm},authorizePassword:function(){return Ai},authorizeRequest:function(){return Rf},authorizeWithPersistOption:function(){return xr},configureAuth:function(){return pb},logout:function(){return ga},logoutWithPersistOption:function(){return ya},persistAuthorizationIfNeeded:function(){return hb},preAuthorizeImplicit:function(){return tm},restoreAuthorization:function(){return db},showDefinitions:function(){return Un}});var r={};Ce.r(r),Ce.d(r,{authorized:function(){return gb},definitionsForRequirements:function(){return mb},definitionsToAuthorize:function(){return am},getConfigs:function(){return vb},getDefinitionsByNames:function(){return lm},isAuthorized:function(){return yb},shownDefinitions:function(){return om}});var n={};Ce.r(n),Ce.d(n,{TOGGLE_CONFIGS:function(){return va},UPDATE_CONFIGS:function(){return qi},loaded:function(){return fm},toggle:function(){return Dr},update:function(){return yl}});var i={};Ce.r(i),Ce.d(i,{downloadConfig:function(){return Df},getConfigByUrl:function(){return pm}});var s={};Ce.r(s),Ce.d(s,{get:function(){return ku}});var o={};Ce.r(o),Ce.d(o,{transform:function(){return hm}});var l={};Ce.r(l),Ce.d(l,{transform:function(){return mm}});var c={};Ce.r(c),Ce.d(c,{allErrors:function(){return bl},lastError:function(){return gm}});var h={};Ce.r(h),Ce.d(h,{SHOW:function(){return dr},UPDATE_FILTER:function(){return qf},UPDATE_LAYOUT:function(){return Ru},UPDATE_MODE:function(){return Wf},changeMode:function(){return Hf},show:function(){return zn},updateFilter:function(){return Em},updateLayout:function(){return Kf}});var v={};Ce.r(v),Ce.d(v,{current:function(){return wm},currentFilter:function(){return Jf},isShown:function(){return Oi},showSummary:function(){return Iu},whatMode:function(){return _m}});var y={};Ce.r(y),Ce.d(y,{taggedOperations:function(){retur
Line truncated
|
||||
url: "https://petstore.swagger.io/v2/swagger.json"
|
||||
dom_id: "#swagger-ui"
|
||||
validatorUrl: "https://validator.swagger.io/validator"
|
||||
`)};function $o(){return{statePlugins:{spec:{actions:i,selectors:li},configs:{reducers:dm,actions:n,selectors:s}}}}const zs=a=>a?history.pushState(null,null,`#${a}`):window.location.hash="";var ba=function(a){var u={};return Ce.d(u,a),u}({default:function(){return hfe}});const Ff="layout_scroll_to",Lf="layout_clear_scroll";var Bf={fn:{getScrollParent:function(u,p){const d=document.documentElement;let g=getComputedStyle(u);const E=g.position==="absolute",O=p?/(auto|scroll|hidden)/:/(auto|scroll)/;if(g.position==="fixed")return d;for(let k=u;k=k.parentElement;)if(g=getComputedStyle(k),(!E||g.position!=="static")&&O.test(g.overflow+g.overflowY+g.overflowX))return k;return d}},statePlugins:{layout:{actions:{scrollToElement:(a,u)=>p=>{try{u=u||p.fn.getScrollParent(a),ba.default.createScroller(u).to(a)}catch(d){console.error(d)}},scrollTo:a=>({type:Ff,payload:Array.isArray(a)?a:[a]}),clearScrollTo:()=>({type:Lf}),readyToScroll:(a,u)=>p=>{const d=p.layoutSelectors.getScrollToKey();L.default.is(d,(0,L.fromJS)(a))&&(p.layoutActions.scrollToElement(u),p.layoutActions.clearScrollTo())},parseDeepLinkHash:a=>({layoutActions:u,layoutSelectors:p,getConfigs:d})=>{if(d().deepLinking&&a){let g=a.slice(1);g[0]==="!"&&(g=g.slice(1)),g[0]==="/"&&(g=g.slice(1));const E=g.split("/").map(F=>F||""),O=p.isShownKeyFromUrlHashArray(E),[k,N="",D=""]=O;if(k==="operations"){const F=p.isShownKeyFromUrlHashArray([N]);N.indexOf("_")>-1&&(console.warn("Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead."),u.show(F.map(W=>W.replace(/_/g," ")),!0)),u.show(F,!0)}(N.indexOf("_")>-1||D.indexOf("_")>-1)&&(console.warn("Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead."),u.show(O.map(F=>F.replace(/_/g," ")),!0)),u.show(O,!0),u.scrollTo(O)}}},selectors:{getScrollToKey:a=>a.get("scrollToKey"),isShownKeyFromUrlHashArray(a,u){const[p,d]=u;return d?["operations",p,d]:p?["operations-tag",p]:[]},urlHashArrayFromIsShownKey(a,u){let[p,d,g]=u;return p=="operations"?[d,g]:p=="operations-tag"?[d]:[]}},reducers:{[Ff]:(a,u)=>a.set("scrollToKey",L.default.fromJS(u.payload)),[Lf]:a=>a.delete("scrollToKey")},wrapActions:{show:(a,{getConfigs:u,layoutSelectors:p})=>(...d)=>{if(a(...d),u().deepLinking)try{let[g,E]=d;g=Array.isArray(g)?g:[g];const O=p.urlHashArrayFromIsShownKey(g);if(!O.length)return;const[k,N]=O;if(!E)return zs("/");O.length===2?zs(xi(`/${encodeURIComponent(k)}/${encodeURIComponent(N)}`)):O.length===1&&zs(xi(`/${encodeURIComponent(k)}`))}catch(g){console.error(g)}}}}}},Uf=function(a){var u={};return Ce.d(u,a),u}({default:function(){return Efe}}),Sb=(a,u)=>class extends f.default.Component{constructor(){super(...arguments);ie(this,"onLoad",g=>{const{operation:E}=this.props,{tag:O,operationId:k}=E.toObject();let{isShownKey:N}=E.toObject();N=N||["operations",O,k],u.layoutActions.readyToScroll(N,g)})}render(){return f.default.createElement("span",{ref:this.onLoad},f.default.createElement(a,this.props))}},wb=(a,u)=>class extends f.default.Component{constructor(){super(...arguments);ie(this,"onLoad",g=>{const{tag:E}=this.props,O=["operations-tag",E];u.layoutActions.readyToScroll(O,g)})}render(){return f.default.createElement("span",{ref:this.onLoad},f.default.createElement(a,this.props))}};function Tu(){return[Bf,{statePlugins:{configs:{wrapActions:{loaded:(a,u)=>(...p)=>{a(...p);const d=decodeURIComponent(window.location.hash);u.layoutActions.parseDeepLinkHash(d)}}}},wrapComponents:{operation:Sb,OperationTag:wb}}]}var _b=function(a){var u={};return Ce.d(u,a),u}({default:function(){return Tfe}});function hm(a){return a.map(u=>{let p="is not of a type(s)",d=u.get("message").indexOf(p);if(d>-1){let g=u.get("message").slice(d+19).split(",");return u.set("message",u.get("message").slice(0,d)+function(O){return O.reduce((k,N,D,F)=>D===F.length-1&&F.length>1?k+"or "+N:F[D+1]&&F.length>2?k+N+", ":F[D+1]?k+N+" ":k+N,"should be a")}(g))}return u})}var Wi=function(a){var u={};return Ce.d(u,a),u}({default:function(){return dne}});function mm(a,{jsSpec:u}){return a}const xb=[o,l];function vl(a){let u={jsSpec:{}};return(0,_b.default)(xb,(d,g)=>{try{return g.transform(d,u).filter(E=>!!E)}catch(E){return console.error("Transformer error:",E),d}},a).filter(d=>!!d).map(d=>(!d.get("line")&&d.get("path"),d))}let qs={line:0,level:"error",message:"Unknown error"};const bl=(0,wt.createSelector)(a=>a,a=>a.get("errors",(0,L.List)())),gm=(0,wt.createSelector)(bl,a=>a.last());function Pu(a){return{statePlugins:{err:{reducers:{[he]:(u,{payload:p})=>{let d=Object.assign(qs,p,{type:"thrown"});return u.update("errors",g=>(g||(0,L.List)()).push((0,L.fromJS)(d))).update("errors",g=>vl(g))},[de]:(u,{payload:p})=>(p=p.map(d=>(0,L.fromJS)(Object.assign(qs,d,{type:"thrown"}))),u.update("errors",d=>(d||(0,L.List)()).concat((0,L.fromJS)(p))).update("errors",d=>vl(d))),[ge]:(u,{payload:p})=>{let d=(0,L.fromJS)(p);return d=d.set("type","spec"),u.update("errors",g=>(g||(0,L.List)()).push((0,L.fromJS)(d)).sor
Line truncated
|
||||
`))==="-d "?a.replace(/-d /g,`-d ^
|
||||
`):/^[_\/-]/g.test(a)?a:'"'+a+'"',Am=a=>a==="-d "?a:/\n/.test(a)?`@"
|
||||
`+a.replace(/"/g,'\\"').replace(/`/g,"``").replace(/\$/,"`$")+`
|
||||
"@`:/^[_\/-]/g.test(a)?a:"'"+a.replace(/"/g,'""').replace(/'/g,"''")+"'",wl=(a,u,p,d="")=>{let g=!1,E="";const O=(...G)=>E+=" "+G.map(u).join(" "),k=(...G)=>E+=G.map(u).join(" "),N=()=>E+=` ${p}`,D=(G=1)=>E+=" ".repeat(G);let F=a.get("headers");if(E+="curl"+d,a.has("curlOptions")&&O(...a.get("curlOptions")),O("-X",a.get("method")),N(),D(),k(`${a.get("url")}`),F&&F.size)for(let G of a.get("headers").entries()){N(),D();let[H,ne]=G;k("-H",`${H}: ${ne}`),g=g||/^content-type$/i.test(H)&&/^multipart\/form-data$/i.test(ne)}const W=a.get("body");if(W)if(g&&["POST","PUT","PATCH"].includes(a.get("method")))for(let[G,H]of W.entrySeq()){let ne=Xf(G);N(),D(),k("-F"),H instanceof We.File&&typeof H.valueOf()=="string"?O(`${ne}=${H.data}${H.type?`;type=${H.type}`:""}`):H instanceof We.File?O(`${ne}=@${H.name}${H.type?`;type=${H.type}`:""}`):O(`${ne}=${H}`)}else if(W instanceof We.File)N(),D(),k(`--data-binary '@${W.name}'`);else{N(),D(),k("-d ");let G=W;L.Map.isMap(G)?k(function(ne){let le=[];for(let[ae,Re]of ne.get("body").entrySeq()){let Oe=Xf(ae);Re instanceof We.File?le.push(` "${Oe}": {
|
||||
"name": "${Re.name}"${Re.type?`,
|
||||
"type": "${Re.type}"`:""}
|
||||
}`):le.push(` "${Oe}": ${JSON.stringify(Re,null,2).replace(/(\r\n|\r|\n)/g,`
|
||||
`)}`)}return`{
|
||||
${le.join(`,
|
||||
`)}
|
||||
}`}(a)):(typeof G!="string"&&(G=JSON.stringify(G)),k(G))}else W||a.get("method")!=="POST"||(N(),D(),k("-d ''"));return E},Hi=a=>wl(a,Am,"`\n",".exe"),fn=a=>wl(a,Ea,`\\
|
||||
`),ju=a=>wl(a,Sl,`^
|
||||
`),Qf=a=>a||(0,L.Map)(),Om=(0,wt.createSelector)(Qf,a=>{const u=a.get("languages"),p=a.get("generators",(0,L.Map)());return!u||u.isEmpty()?p:p.filter((d,g)=>u.includes(g))}),Mu=a=>({fn:u})=>Om(a).map((p,d)=>{const g=(E=>u[`requestSnippetGenerator_${E}`])(d);return typeof g!="function"?null:p.set("fn",g)}).filter(p=>p),Cm=(0,wt.createSelector)(Qf,a=>a.get("activeLanguage")),$m=(0,wt.createSelector)(Qf,a=>a.get("defaultExpanded"));var Du=function(a){var u={};return Ce.d(u,a),u}({CopyToClipboard:function(){return pme.CopyToClipboard}}),ui=function(a){var u={};return Ce.d(u,a),u}({default:function(){return qge}}),km=function(a){var u={};return Ce.d(u,a),u}({default:function(){return tye}}),Ab=function(a){var u={};return Ce.d(u,a),u}({default:function(){return iye}}),Tm=function(a){var u={};return Ce.d(u,a),u}({default:function(){return uye}}),Ob=function(a){var u={};return Ce.d(u,a),u}({default:function(){return hye}}),m=function(a){var u={};return Ce.d(u,a),u}({default:function(){return yye}}),w=function(a){var u={};return Ce.d(u,a),u}({default:function(){return wye}}),R=function(a){var u={};return Ce.d(u,a),u}({default:function(){return Aye}}),M=function(a){var u={};return Ce.d(u,a),u}({default:function(){return Oye}}),B=function(a){var u={};return Ce.d(u,a),u}({default:function(){return Cye}}),X=function(a){var u={};return Ce.d(u,a),u}({default:function(){return $ye}}),re=function(a){var u={};return Ce.d(u,a),u}({default:function(){return kye}}),fe=function(a){var u={};return Ce.d(u,a),u}({default:function(){return Tye}}),ke=function(a){var u={};return Ce.d(u,a),u}({default:function(){return Pye}}),Ie=function(a){var u={};return Ce.d(u,a),u}({default:function(){return Rye}});ui.default.registerLanguage("json",Ab.default),ui.default.registerLanguage("js",km.default),ui.default.registerLanguage("xml",Tm.default),ui.default.registerLanguage("yaml",m.default),ui.default.registerLanguage("http",w.default),ui.default.registerLanguage("bash",Ob.default),ui.default.registerLanguage("powershell",R.default),ui.default.registerLanguage("javascript",km.default);const Be={agate:M.default,arta:B.default,monokai:X.default,nord:re.default,obsidian:fe.default,"tomorrow-night":ke.default,idea:Ie.default},ot=Object.keys(Be),ct=a=>ot.includes(a)?Be[a]:(console.warn(`Request style '${a}' is not available, returning default instead`),M.default),jt={cursor:"pointer",lineHeight:1,display:"inline-flex",backgroundColor:"rgb(250, 250, 250)",paddingBottom:"0",paddingTop:"0",border:"1px solid rgb(51, 51, 51)",borderRadius:"4px 4px 0 0",boxShadow:"none",borderBottom:"none"},Ut={cursor:"pointer",lineHeight:1,display:"inline-flex",backgroundColor:"rgb(51, 51, 51)",boxShadow:"none",border:"1px solid rgb(51, 51, 51)",paddingBottom:"0",paddingTop:"0",borderRadius:"4px 4px 0 0",marginTop:"-5px",marginRight:"-5px",marginLeft:"-5px",zIndex:"9999",borderBottom:"none"};var Ar=({request:a,requestSnippetsSelectors:u,getConfigs:p,getComponent:d})=>{var ve;const g=(0,Rt.default)(p)?p():null,E=(0,Wi.default)(g,"syntaxHighlight")!==!1&&(0,Wi.default)(g,"syntaxHighlight.activated",!0),O=(0,f.useRef)(null),k=d("ArrowUpIcon"),N=d("ArrowDownIcon"),[D,F]=(0,f.useState)((ve=u.getSnippetGenerators())==null?void 0:ve.keySeq().first()),[W,G]=(0,f.useState)(u==null?void 0:u.getDefaultExpanded());(0,f.useEffect)(()=>{},[]),(0,f.useEffect)(()=>{const Se=Array.from(O.current.childNodes).filter(Ue=>{var xe;return!!Ue.nodeType&&((xe=Ue.classList)==null?void 0:xe.contains("curl-command"))});return Se.forEach(Ue=>Ue.addEventListener("mousewheel",Oe,{passive:!1})),()=>{Se.forEach(Ue=>Ue.removeEventListener("mousewheel",Oe))}},[a]);const H=u.getSnippetGenerators(),ne=H.get(D),le=ne.get("fn")(a),ae=()=>{G(!W)},Re=Se=>Se===D?Ut:jt,Oe=Se=>{const{target:Ue,deltaY:xe}=Se,{scrollHeight:Te,offsetHeight:Pe,scrollTop:je}=Ue;Te>Pe&&(je===0&&xe<0||Pe+je>=Te&&xe>0)&&Se.preventDefault()},Me=E?f.default.createElement(ui.default,{language:ne.get("syntax"),className:"curl microlight",style:ct((0,Wi.default)(g,"syntaxHighlight.theme"))},le):f.default.createElement("textarea",{readOnly:!0,className:"curl",value:le});return f.default.createElement("div",{className:"request-snippets",ref:O},f.default.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-start",alignItems:"center",marginBottom:"15px"}},f.default.createElement("h4",{onClick:()=>ae(),style:{cursor:"pointer"}},"Snippets"),f.default.createElement("button",{onClick:()=>ae(),style:{border:"none",background:"none"},title:W?"Collapse operation":"Expand operation"},W?f.default.createElement(N,{className:"arrow",width:"10",height:"10"}):f.default.createElement(k,{className:"arrow",width:"10",height:"10"}))),W&&f.default.createElement("div",{className:"curl-command"},f.default.createElement("div",{style:{paddingLeft:"15px",paddingRight:"10px",width:"100%",display:"flex"}},H.entrySeq().map(([Se,Ue])=>f.default.createElement("div",{style:Re(Se),className:"btn",key:Se,onClick:()=>(xe=>{D!==xe&&F(xe)})(Se)},f.default
Line truncated
|
||||
`&&(k=k.slice(0,k.length-1))}catch(N){return console.error(N),"error: could not generate yaml example"}return k.replace(/\t/g," ")},KU=a=>(u,p,d)=>{const{fn:g}=a();if(u&&!u.xml&&(u.xml={}),u&&!u.xml.name){if(!u.$$ref&&(u.type||u.items||u.properties||u.additionalProperties))return`<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- XML example cannot be generated; root element name is undefined -->`;if(u.$$ref){let E=u.$$ref.match(/\S*\/(\S+)$/);u.xml.name=E[1]}}return g.memoizedCreateXMLExample(u,p,d)},HU=a=>(u,p="",d={},g=void 0)=>{const{fn:E}=a();return typeof(u==null?void 0:u.toJS)=="function"&&(u=u.toJS()),typeof(g==null?void 0:g.toJS)=="function"&&(g=g.toJS()),/xml/.test(p)?E.getXmlSampleSchema(u,d,g):/(yaml|yml)/.test(p)?E.getYamlSampleSchema(u,d,p,g):E.getJsonSampleSchema(u,d,p,g)},E$=({getSystem:a})=>{const u=qU(a),p=WU(a),d=KU(a),g=HU(a);return{fn:{jsonSchema5:{inferSchema:g$,sampleFromSchema:kb,sampleFromSchemaGeneric:Gi,createXMLExample:$b,memoizedSampleFromSchema:b$,memoizedCreateXMLExample:v$,getJsonSampleSchema:u,getYamlSampleSchema:p,getXmlSampleSchema:d,getSampleSchema:g},inferSchema:g$,sampleFromSchema:kb,sampleFromSchemaGeneric:Gi,createXMLExample:$b,memoizedSampleFromSchema:b$,memoizedCreateXMLExample:v$,getJsonSampleSchema:u,getYamlSampleSchema:p,getXmlSampleSchema:d,getSampleSchema:g}}},Rm=function(a){var u={};return Ce.d(u,a),u}({default:function(){return $Z}});const JU=["get","put","post","delete","options","head","patch","trace"],Ks=a=>a||(0,L.Map)(),GU=(0,wt.createSelector)(Ks,a=>a.get("lastError")),YU=(0,wt.createSelector)(Ks,a=>a.get("url")),XU=(0,wt.createSelector)(Ks,a=>a.get("spec")||""),QU=(0,wt.createSelector)(Ks,a=>a.get("specSource")||"not-editor"),Tb=(0,wt.createSelector)(Ks,a=>a.get("json",(0,L.Map)())),ZU=(0,wt.createSelector)(Tb,a=>a.toJS()),e5=(0,wt.createSelector)(Ks,a=>a.get("resolved",(0,L.Map)())),t5=(a,u)=>a.getIn(["resolvedSubtrees",...u],void 0),S$=(a,u)=>L.Map.isMap(a)&&L.Map.isMap(u)?u.get("$$ref")?u:(0,L.OrderedMap)().mergeWith(S$,a,u):u,ws=(0,wt.createSelector)(Ks,a=>(0,L.OrderedMap)().mergeWith(S$,a.get("json"),a.get("resolvedSubtrees"))),fi=a=>Tb(a),r5=(0,wt.createSelector)(fi,()=>!1),w$=(0,wt.createSelector)(fi,a=>B$(a&&a.get("info"))),n5=(0,wt.createSelector)(fi,a=>B$(a&&a.get("externalDocs"))),_$=(0,wt.createSelector)(w$,a=>a&&a.get("version")),i5=(0,wt.createSelector)(_$,a=>/v?([0-9]*)\.([0-9]*)\.([0-9]*)/i.exec(a).slice(1)),x$=(0,wt.createSelector)(ws,a=>a.get("paths")),s5=(0,Rm.default)(["get","put","post","delete","options","head","patch"]),A$=(0,wt.createSelector)(x$,a=>{if(!a||a.size<1)return(0,L.List)();let u=(0,L.List)();return a&&a.forEach?(a.forEach((p,d)=>{if(!p||!p.forEach)return{};p.forEach((g,E)=>{JU.indexOf(E)<0||(u=u.push((0,L.fromJS)({path:d,method:E,operation:g,id:`${E}-${d}`})))})}),u):(0,L.List)()}),O$=(0,wt.createSelector)(fi,a=>(0,L.Set)(a.get("consumes"))),C$=(0,wt.createSelector)(fi,a=>(0,L.Set)(a.get("produces"))),o5=(0,wt.createSelector)(fi,a=>a.get("security",(0,L.List)())),a5=(0,wt.createSelector)(fi,a=>a.get("securityDefinitions")),l5=(a,u)=>{const p=a.getIn(["resolvedSubtrees","definitions",u],null),d=a.getIn(["json","definitions",u],null);return p||d||null},u5=(0,wt.createSelector)(fi,a=>{const u=a.get("definitions");return L.Map.isMap(u)?u:(0,L.Map)()}),c5=(0,wt.createSelector)(fi,a=>a.get("basePath")),f5=(0,wt.createSelector)(fi,a=>a.get("host")),p5=(0,wt.createSelector)(fi,a=>a.get("schemes",(0,L.Map)())),$$=(0,wt.createSelector)([A$,O$,C$],(a,u,p)=>a.map(d=>d.update("operation",g=>g?L.Map.isMap(g)?g.withMutations(E=>(E.get("consumes")||E.update("consumes",O=>(0,L.Set)(O).merge(u)),E.get("produces")||E.update("produces",O=>(0,L.Set)(O).merge(p)),E)):void 0:(0,L.Map)()))),Pb=(0,wt.createSelector)(fi,a=>{const u=a.get("tags",(0,L.List)());return L.List.isList(u)?u.filter(p=>L.Map.isMap(p)):(0,L.List)()}),k$=(a,u)=>(Pb(a)||(0,L.List)()).filter(L.Map.isMap).find(p=>p.get("name")===u,(0,L.Map)()),T$=(0,wt.createSelector)($$,Pb,(a,u)=>a.reduce((p,d)=>{let g=(0,L.Set)(d.getIn(["operation","tags"]));return g.count()<1?p.update("default",(0,L.List)(),E=>E.push(d)):g.reduce((E,O)=>E.update(O,(0,L.List)(),k=>k.push(d)),p)},u.reduce((p,d)=>p.set(d.get("name"),(0,L.List)()),(0,L.OrderedMap)()))),d5=a=>({getConfigs:u})=>{let{tagsSorter:p,operationsSorter:d}=u();return T$(a).sortBy((g,E)=>E,(g,E)=>{let O=typeof p=="function"?p:yr.tagsSorter[p];return O?O(g,E):null}).map((g,E)=>{let O=typeof d=="function"?d:yr.operationsSorter[d],k=O?g.sort(O):g;return(0,L.Map)({tagDetails:k$(a,E),operations:k})})},P$=(0,wt.createSelector)(Ks,a=>a.get("responses",(0,L.Map)())),R$=(0,wt.createSelector)(Ks,a=>a.get("requests",(0,L.Map)())),I$=(0,wt.createSelector)(Ks,a=>a.get("mutatedRequests",(0,L.Map)())),h5=(a,u,p)=>P$(a).getIn([u,p],null),m5=(a,u,p)=>R$(a).getIn([u,p],null),g5=(a,u,p)=>I$(a).getIn([u,p],null),y5=()=>!0,Rb=(a,u,p)=>{const d=ws(a).getIn(["paths",...u,"parameters"],(0,L.OrderedMap)()),g=a.getIn(["meta","paths",...u,"parameters"],(0,L.OrderedMap)());return d.map(E=>{const O=g.get(`${p.get("in")}.${p.get("name")}`),k=g.get(`${p.get("in")}.${p.get("name")}.hash-${p.hashCode()}`);return(0,L.OrderedMap)().merge(E,O,k)}).find(E=>E.get("in")===p.get("in")&&E.get("name")===p.get("name"),(0,L.OrderedMap)())},N$=(a,u,p,d)=>{const g=`${d}.${p}`;return a.getIn(["meta",
Line truncated
|
||||
**Possible Reasons:**
|
||||
- CORS
|
||||
- Network Failure
|
||||
- URL scheme must be "http" or "https" for CORS request.`),p.setResponse(a.pathName,a.method,{error:!0,err:ne})})},rV=({path:a,method:u,...p}={})=>d=>{let{fn:{fetch:g},specSelectors:E,specActions:O}=d,k=E.specJsonWithResolvedSubtrees().toJS(),N=E.operationScheme(a,u),{requestContentType:D,responseContentType:F}=E.contentTypeValues([a,u]).toJS(),W=/xml/i.test(D),G=E.parameterValues([a,u],W).toJS();return O.executeRequest({...p,fetch:g,spec:k,pathName:a,method:u,parameters:G,requestContentType:D,scheme:N,responseContentType:F})};function nV(a,u){return{type:Vb,payload:{path:a,method:u}}}function iV(a,u){return{type:zb,payload:{path:a,method:u}}}function sV(a,u,p){return{type:Kb,payload:{scheme:a,path:u,method:p}}}var oV={[Nb]:(a,u)=>typeof u.payload=="string"?a.set("spec",u.payload):a,[jb]:(a,u)=>a.set("url",u.payload+""),[Mb]:(a,u)=>a.set("json",Ct(u.payload)),[Wb]:(a,u)=>a.setIn(["resolved"],Ct(u.payload)),[jm]:(a,u)=>{const{value:p,path:d}=u.payload;return a.setIn(["resolvedSubtrees",...d],Ct(p))},[Im]:(a,{payload:u})=>{let{path:p,paramName:d,paramIn:g,param:E,value:O,isXml:k}=u,N=E?Bs(E):`${g}.${d}`;const D=k?"value_xml":"value";return a.setIn(["meta","paths",...p,"parameters",N,D],(0,L.fromJS)(O))},[Db]:(a,{payload:u})=>{let{pathMethod:p,paramName:d,paramIn:g,includeEmptyValue:E}=u;if(!d||!g)return console.warn("Warning: UPDATE_EMPTY_PARAM_INCLUSION could not generate a paramKey."),a;const O=`${g}.${d}`;return a.setIn(["meta","paths",...p,"parameter_inclusions",O],E)},[Fb]:(a,{payload:{pathMethod:u,isOAS3:p}})=>{const d=ws(a).getIn(["paths",...u]),g=M$(a,u).toJS();return a.updateIn(["meta","paths",...u,"parameters"],(0,L.fromJS)({}),E=>d.get("parameters",(0,L.List)()).reduce((O,k)=>{const N=ha(k,g),D=N$(a,u,k.get("name"),k.get("in")),F=((W,G,{isOAS3:H=!1,bypassRequiredCheck:ne=!1}={})=>{let le=W.get("required"),{schema:ae,parameterContentMediaType:Re}=ue(W,{isOAS3:H});return Oo(G,ae,le,ne,Re)})(k,N,{bypassRequiredCheck:D,isOAS3:p});return O.setIn([Bs(k),"errors"],(0,L.fromJS)(F))},E))},[qb]:(a,{payload:{pathMethod:u}})=>a.updateIn(["meta","paths",...u,"parameters"],(0,L.fromJS)([]),p=>p.map(d=>d.set("errors",(0,L.fromJS)([])))),[Lb]:(a,{payload:{res:u,path:p,method:d}})=>{let g;g=u.error?Object.assign({error:!0,name:u.err.name,message:u.err.message,statusCode:u.err.statusCode},u.err.response):u,g.headers=g.headers||{};let E=a.setIn(["responses",p,d],Ct(g));return We.Blob&&g.data instanceof We.Blob&&(E=E.setIn(["responses",p,d,"text"],g.data)),E},[Bb]:(a,{payload:{req:u,path:p,method:d}})=>a.setIn(["requests",p,d],Ct(u)),[Ub]:(a,{payload:{req:u,path:p,method:d}})=>a.setIn(["mutatedRequests",p,d],Ct(u)),[Nm]:(a,{payload:{path:u,value:p,key:d}})=>{let g=["paths",...u],E=["meta","paths",...u];return a.getIn(["json",...g])||a.getIn(["resolved",...g])||a.getIn(["resolvedSubtrees",...g])?a.setIn([...E,d],(0,L.fromJS)(p)):a},[Vb]:(a,{payload:{path:u,method:p}})=>a.deleteIn(["responses",u,p]),[zb]:(a,{payload:{path:u,method:p}})=>a.deleteIn(["requests",u,p]),[Kb]:(a,{payload:{scheme:u,path:p,method:d}})=>p&&d?a.setIn(["scheme",p,d],u):p||d?void 0:a.setIn(["scheme","_defaultScheme"],u)};const aV=(a,{specActions:u})=>(...p)=>{a(...p),u.parseToJson(...p)},lV=(a,{specActions:u})=>(...p)=>{a(...p),u.invalidateResolvedSubtreeCache();const[d]=p,g=(0,Wi.default)(d,["paths"])||{};Object.keys(g).forEach(E=>{(0,Wi.default)(g,[E]).$ref&&u.requestResolvedSubtree(["paths",E])}),u.requestResolvedSubtree(["components","securitySchemes"])},uV=(a,{specActions:u})=>p=>(u.logRequest(p),a(p)),cV=(a,{specSelectors:u})=>p=>a(p,u.isOAS3());var z$=()=>({statePlugins:{spec:{wrapActions:{...P},reducers:{...oV},actions:{...$},selectors:{..._}}}}),q$=function(a){var u={};return Ce.d(u,a),u}({default:function(){return $8}}),W$=function(a){var u={};return Ce.d(u,a),u}({default:function(){return R8}}),K$=function(a){var u={};return Ce.d(u,a),u}({default:function(){return I8}}),H$=function(a){var u={};return Ce.d(u,a),u}({default:function(){return L6e}}),fV=function(a){var u={};return Ce.d(u,a),u}({makeResolve:function(){return G8}}),J$=function(a){var u={};return Ce.d(u,a),u}({buildRequest:function(){return Z8},execute:function(){return b8e}}),Hb=function(a){var u={};return Ce.d(u,a),u}({default:function(){return l1},makeHttp:function(){return iIe},serializeRes:function(){return _8}}),pV=function(a){var u={};return Ce.d(u,a),u}({makeResolveSubtree:function(){return O8e}}),G$=function(a){var u={};return Ce.d(u,a),u}({opId:function(){return o1}});const dV=(a,u)=>(...p)=>{a(...p);const d=u.getConfigs().withCredentials;d!==void 0&&(u.fn.fetch.withCredentials=typeof d=="string"?d==="true":!!d)};function Y$({configs:a,getConfigs:u}){return{fn:{fetch:(0,Hb.makeHttp)(Hb.default,a.preFetch,a.postFetch),buildRequest:J$.buildRequest,execute:J$.execute,resolve:(0,fV.makeResolve)({strategies:[H$.default,K$.default,W$.default,q$.default]}),resolveSubtree:async(p,d,g={})=>{const E=u(),O={modelPropertyMacro:E.modelPropertyMacro,parameterMacro:E.parameterMac
Line truncated
|
||||
|
||||
`+p}G=f.default.createElement(D,{language:H,downloadable:!0,fileName:`${F}.json`,value:W,getConfigs:O,canCopy:!0})}else/xml/i.test(d)?(W=(0,YV.default)(p,{textNodesOnSameLine:!0,indentor:" "}),G=f.default.createElement(D,{downloadable:!0,fileName:`${F}.xml`,value:W,getConfigs:O,canCopy:!0})):G=(0,Sk.default)(d)==="text/html"||/text\/plain/.test(d)?f.default.createElement(D,{downloadable:!0,fileName:`${F}.html`,value:p,getConfigs:O,canCopy:!0}):(0,Sk.default)(d)==="text/csv"||/text\/csv/.test(d)?f.default.createElement(D,{downloadable:!0,fileName:`${F}.csv`,value:p,getConfigs:O,canCopy:!0}):/^image\//i.test(d)?d.includes("svg")?f.default.createElement("div",null," ",p," "):f.default.createElement("img",{src:window.URL.createObjectURL(p)}):/^audio\//i.test(d)?f.default.createElement("pre",{className:"microlight"},f.default.createElement("audio",{controls:!0,key:g},f.default.createElement("source",{src:g,type:d}))):typeof p=="string"?f.default.createElement(D,{downloadable:!0,fileName:`${F}.txt`,value:p,getConfigs:O,canCopy:!0}):p.size>0?N?f.default.createElement("div",null,f.default.createElement("p",{className:"i"},"Unrecognized response type; displaying content as text."),f.default.createElement(D,{downloadable:!0,fileName:`${F}.txt`,value:N,getConfigs:O,canCopy:!0})):f.default.createElement("p",{className:"i"},"Unrecognized response type; unable to display."):null;return G?f.default.createElement("div",null,f.default.createElement("h5",null,"Response body"),G):null}}class wk extends f.Component{constructor(p){super(p);ie(this,"onChange",(p,d,g)=>{let{specActions:{changeParamByIdentity:E},onChangeKey:O}=this.props;E(O,p,d,g)});ie(this,"onChangeConsumesWrapper",p=>{let{specActions:{changeConsumesValue:d},onChangeKey:g}=this.props;d(g,p)});ie(this,"toggleTab",p=>p==="parameters"?this.setState({parametersVisible:!0,callbackVisible:!1}):p==="callbacks"?this.setState({callbackVisible:!0,parametersVisible:!1}):void 0);ie(this,"onChangeMediaType",({value:p,pathMethod:d})=>{let{specActions:g,oas3Selectors:E,oas3Actions:O}=this.props;const k=E.hasUserEditedBody(...d),N=E.shouldRetainRequestBodyValue(...d);O.setRequestContentType({value:p,pathMethod:d}),O.initRequestBodyValidateError({pathMethod:d}),k||(N||O.setRequestBodyValue({value:void 0,pathMethod:d}),g.clearResponse(...d),g.clearRequest(...d),g.clearValidateParams(d))});this.state={callbackVisible:!1,parametersVisible:!0}}render(){let{onTryoutClick:p,onResetClick:d,parameters:g,allowTryItOut:E,tryItOutEnabled:O,specPath:k,fn:N,getComponent:D,getConfigs:F,specSelectors:W,specActions:G,pathMethod:H,oas3Actions:ne,oas3Selectors:le,operation:ae}=this.props;const Re=D("parameterRow"),Oe=D("TryItOutButton"),Me=D("contentType"),ve=D("Callbacks",!0),Se=D("RequestBody",!0),Ue=O&&E,xe=W.isOAS3(),Te=`${Qb(`${H[1]}${H[0]}_requests`)}_select`,Pe=ae.get("requestBody"),je=Object.values(g.reduce((Ze,it)=>{const we=it.get("in");return Ze[we]??(Ze[we]=[]),Ze[we].push(it),Ze},{})).reduce((Ze,it)=>Ze.concat(it),[]);return f.default.createElement("div",{className:"opblock-section"},f.default.createElement("div",{className:"opblock-section-header"},xe?f.default.createElement("div",{className:"tab-header"},f.default.createElement("div",{onClick:()=>this.toggleTab("parameters"),className:`tab-item ${this.state.parametersVisible&&"active"}`},f.default.createElement("h4",{className:"opblock-title"},f.default.createElement("span",null,"Parameters"))),ae.get("callbacks")?f.default.createElement("div",{onClick:()=>this.toggleTab("callbacks"),className:`tab-item ${this.state.callbackVisible&&"active"}`},f.default.createElement("h4",{className:"opblock-title"},f.default.createElement("span",null,"Callbacks"))):null):f.default.createElement("div",{className:"tab-header"},f.default.createElement("h4",{className:"opblock-title"},"Parameters")),E?f.default.createElement(Oe,{isOAS3:W.isOAS3(),hasUserEditedBody:le.hasUserEditedBody(...H),enabled:O,onCancelClick:this.props.onCancelClick,onTryoutClick:p,onResetClick:()=>d(H)}):null),this.state.parametersVisible?f.default.createElement("div",{className:"parameters-container"},je.length?f.default.createElement("div",{className:"table-container"},f.default.createElement("table",{className:"parameters"},f.default.createElement("thead",null,f.default.createElement("tr",null,f.default.createElement("th",{className:"col_header parameters-col_name"},"Name"),f.default.createElement("th",{className:"col_header parameters-col_description"},"Description"))),f.default.createElement("tbody",null,je.map((Ze,it)=>f.default.createElement(Re,{fn:N,specPath:k.push(it.toString()),getComponent:D,getConfigs:F,rawParam:Ze,param:W.parameterWithMetaByIdentity(H,Ze),key:`${Ze.get("in")}.${Ze.get("name")}`,onChange:this.onChange,onChangeConsumes:this.onChangeConsumesWrapper,specSelectors:W,specActions:G,oas3Actions:ne,oas3Selectors:le,pathMethod:H,isExecute:Ue}))))):f.default.createElement("div",{className:"opblock-description-wrapper"},f.default.createElement("p",null,"No
Line truncated
|
||||
`).map((W,G)=>G>0?Array(D+1).join(" ")+W:W).join(`
|
||||
`)}(0,JSON.stringify(O,null,2))||"{}",f.default.createElement("br",null)))}}var bz=vz,Ez=({servers:a,currentServer:u,setSelectedServer:p,setServerVariableValue:d,getServerVariable:g,getEffectiveServerValue:E})=>{const O=(a.find(F=>F.get("url")===u)||(0,L.OrderedMap)()).get("variables")||(0,L.OrderedMap)(),k=O.size!==0;(0,f.useEffect)(()=>{var F;u||p((F=a.first())==null?void 0:F.get("url"))},[]),(0,f.useEffect)(()=>{const F=a.find(W=>W.get("url")===u);if(!F)return void p(a.first().get("url"));(F.get("variables")||(0,L.OrderedMap)()).map((W,G)=>{d({server:u,key:G,val:W.get("default")||""})})},[u,a]);const N=(0,f.useCallback)(F=>{p(F.target.value)},[p]),D=(0,f.useCallback)(F=>{const W=F.target.getAttribute("data-variable"),G=F.target.value;d({server:u,key:W,val:G})},[d,u]);return f.default.createElement("div",{className:"servers"},f.default.createElement("label",{htmlFor:"servers"},f.default.createElement("select",{onChange:N,value:u,id:"servers"},a.valueSeq().map(F=>f.default.createElement("option",{value:F.get("url"),key:F.get("url")},F.get("url"),F.get("description")&&` - ${F.get("description")}`)).toArray())),k&&f.default.createElement("div",null,f.default.createElement("div",{className:"computed-url"},"Computed URL:",f.default.createElement("code",null,E(u))),f.default.createElement("h4",null,"Server variables"),f.default.createElement("table",null,f.default.createElement("tbody",null,O.entrySeq().map(([F,W])=>f.default.createElement("tr",{key:F},f.default.createElement("td",null,F),f.default.createElement("td",null,W.get("enum")?f.default.createElement("select",{"data-variable":F,onChange:D},W.get("enum").map(G=>f.default.createElement("option",{selected:G===g(u,F),key:G,value:G},G))):f.default.createElement("input",{type:"text",value:g(u,F)||"",onChange:D,"data-variable":F}))))))))};class Sz extends f.default.Component{render(){const{specSelectors:u,oas3Selectors:p,oas3Actions:d,getComponent:g}=this.props,E=u.servers(),O=g("Servers");return E&&E.size?f.default.createElement("div",null,f.default.createElement("span",{className:"servers-title"},"Servers"),f.default.createElement(O,{servers:E,currentServer:p.selectedServer(),setSelectedServer:d.setSelectedServer,setServerVariableValue:d.setServerVariableValue,getServerVariable:p.serverVariableValue,getEffectiveServerValue:p.serverEffectiveValue})):null}}const wz=Function.prototype;class zk extends f.PureComponent{constructor(p,d){super(p,d);ie(this,"applyDefaultValue",p=>{const{onChange:d,defaultValue:g}=p||this.props;return this.setState({value:g}),d(g)});ie(this,"onChange",p=>{this.props.onChange(vr(p))});ie(this,"onDomChange",p=>{const d=p.target.value;this.setState({value:d},()=>this.onChange(d))});this.state={value:vr(p.value)||p.defaultValue},p.onChange(p.value)}UNSAFE_componentWillReceiveProps(p){this.props.value!==p.value&&p.value!==this.state.value&&this.setState({value:vr(p.value)}),!p.value&&p.defaultValue&&this.state.value&&this.applyDefaultValue(p)}render(){let{getComponent:p,errors:d}=this.props,{value:g}=this.state,E=d.size>0;const O=p("TextArea");return f.default.createElement("div",{className:"body-param"},f.default.createElement(O,{className:(0,Er.default)("body-param__text",{invalid:E}),title:d.size?d.join(", "):"",value:g,onChange:this.onDomChange}))}}ie(zk,"defaultProps",{onChange:wz,userHasEditedBody:!1});class _z extends f.default.Component{constructor(p,d){super(p,d);ie(this,"onChange",p=>{let{onChange:d}=this.props,{value:g,name:E}=p.target,O=Object.assign({},this.state.value);E?O[E]=g:O=g,this.setState({value:O},()=>d(this.state))});let{name:g,schema:E}=this.props,O=this.getValue();this.state={name:g,schema:E,value:O}}getValue(){let{name:p,authorized:d}=this.props;return d&&d.getIn([p,"value"])}render(){let{schema:p,getComponent:d,errSelectors:g,name:E}=this.props;const O=d("Input"),k=d("Row"),N=d("Col"),D=d("authError"),F=d("Markdown",!0),W=d("JumpToPath",!0),G=(p.get("scheme")||"").toLowerCase();let H=this.getValue(),ne=g.allErrors().filter(le=>le.get("authId")===E);if(G==="basic"){let le=H?H.get("username"):null;return f.default.createElement("div",null,f.default.createElement("h4",null,f.default.createElement("code",null,E||p.get("name"))," (http, Basic)",f.default.createElement(W,{path:["securityDefinitions",E]})),le&&f.default.createElement("h6",null,"Authorized"),f.default.createElement(k,null,f.default.createElement(F,{source:p.get("description")})),f.default.createElement(k,null,f.default.createElement("label",{htmlFor:"auth-basic-username"},"Username:"),le?f.default.createElement("code",null," ",le," "):f.default.createElement(N,null,f.default.createElement(O,{id:"auth-basic-username",type:"text",required:"required",name:"username","aria-label":"auth-basic-username",onChange:this.onChange,autoFocus:!0}))),f.default.createElement(k,null,f.default.createElement("label",{htmlFor:"auth-basic-password"},"Password:"),le?f.default.createElement("code",null," ****** "):f.default.createElement(N,null,f.default.createElement(O,
Line truncated
|
||||
`;else if(d>126){const g=unescape(encodeURIComponent(a.charAt(p)));for(let E=0;E<g.length;E++)u+="="+("0"+g.charCodeAt(E).toString(16)).slice(-2).toUpperCase()}else u+="="+("0"+d.toString(16)).slice(-2).toUpperCase()}return u},QW=Ce(287).Buffer,ZW=a=>QW.from(a).toString("hex"),eK=Ce(287).Buffer,tK=a=>{const u=eK.from(a).toString("utf8"),p="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";let d=0,g="",E=0,O=0;for(let k=0;k<u.length;k++)for(E=E<<8|u.charCodeAt(k),O+=8;O>=5;)g+=p.charAt(E>>>O-5&31),O-=5;O>0&&(g+=p.charAt(E<<5-O&31),d=(8-8*u.length%5)%5);for(let k=0;k<d;k++)g+="=";return g},rK=Ce(287).Buffer,nK=a=>rK.from(a).toString("base64"),iK=Ce(287).Buffer,sK=a=>iK.from(a).toString("base64url");const Wm=new(rP=class extends AE{constructor(){super(...arguments);RE(this,lp,{"7bit":KW,"8bit":JW,binary:YW,"quoted-printable":XW,base16:ZW,base32:tK,base64:nK,base64url:sK});ie(this,"data",{...fp(this,lp)})}get defaults(){return{...fp(this,lp)}}},lp=new WeakMap,rP),qT=(a,u)=>typeof u=="function"?Wm.register(a,u):u===null?Wm.unregister(a):Wm.get(a);qT.getDefaults=()=>Wm.defaults;var WT=qT,oK={"text/plain":()=>"string","text/css":()=>".selector { border: 1px solid red }","text/csv":()=>"value1,value2,value3","text/html":()=>"<p>content</p>","text/calendar":()=>"BEGIN:VCALENDAR","text/javascript":()=>"console.dir('Hello world!');","text/xml":()=>'<person age="30">John Doe</person>',"text/*":()=>"string"},aK={"image/*":()=>Vm(25).toString("binary")},lK={"audio/*":()=>Vm(25).toString("binary")},uK={"video/*":()=>Vm(25).toString("binary")},cK={"application/json":()=>'{"key":"value"}',"application/ld+json":()=>'{"name": "John Doe"}',"application/x-httpd-php":()=>"<?php echo '<p>Hello World!</p>'; ?>","application/rtf":()=>String.raw`{\rtf1\adeflang1025\ansi\ansicpg1252\uc1`,"application/x-sh":()=>'echo "Hello World!"',"application/xhtml+xml":()=>"<p>content</p>","application/*":()=>Vm(25).toString("binary")};const Uu=new(nP=class extends AE{constructor(){super(...arguments);RE(this,up,{...oK,...aK,...lK,...uK,...cK});ie(this,"data",{...fp(this,up)})}get defaults(){return{...fp(this,up)}}},up=new WeakMap,nP),KT=(a,u)=>{if(typeof u=="function")return Uu.register(a,u);if(u===null)return Uu.unregister(a);const p=a.split(";").at(0),d=`${p.split("/").at(0)}/*`;return Uu.get(a)||Uu.get(p)||Uu.get(d)};KT.getDefaults=()=>Uu.defaults;var HT=KT,fK=(a,{sample:u}={})=>{const{contentEncoding:p,contentMediaType:d,contentSchema:g}=a,{pattern:E,format:O}=a,k=WT(p)||ek.default;let N;if(typeof E=="string")N=(D=>{try{return new c$.default(D).gen()}catch{return"string"}})(E);else if(typeof O=="string")N=(D=>{const{format:F}=D,W=qm(F);if(typeof W=="function")return W(D);switch(F){case"email":return AW();case"idn-email":return OW();case"hostname":return CW();case"idn-hostname":return $W();case"ipv4":return kW();case"ipv6":return TW();case"uri":return PW();case"uri-reference":return RW();case"iri":return IW();case"iri-reference":return NW();case"uuid":return jW();case"uri-template":return MW();case"json-pointer":return DW();case"relative-json-pointer":return FW();case"date-time":return LW();case"date":return BW();case"time":return UW();case"duration":return VW();case"password":return zW();case"regex":return qW()}return"string"})(a);else if(To(g)&&typeof d=="string"&&u!==void 0)N=Array.isArray(u)||typeof u=="object"?JSON.stringify(u):String(u);else if(typeof d=="string"){const D=HT(d);typeof D=="function"&&(N=D(a))}else N="string";return k(((D,F={})=>{const{maxLength:W,minLength:G}=F;let H=D;if(Number.isInteger(W)&&W>0&&(H=H.slice(0,W)),Number.isInteger(G)&&G>0){let ne=0;for(;H.length<G;)H+=H[ne++%H.length]}return H})(N,a))},pK=()=>.1,dK=()=>.1,hK=a=>{const{format:u}=a;let p;return p=typeof u=="string"?(d=>{const{format:g}=d,E=qm(g);if(typeof E=="function")return E(d);switch(g){case"float":return pK();case"double":return dK()}return 0})(a):0,((d,g={})=>{const{minimum:E,maximum:O,exclusiveMinimum:k,exclusiveMaximum:N}=g,{multipleOf:D}=g,F=Number.isInteger(d)?1:Number.EPSILON;let W=typeof E=="number"?E:null,G=typeof O=="number"?O:null,H=d;if(typeof k=="number"&&(W=W!==null?Math.max(W,k+F):k+F),typeof N=="number"&&(G=G!==null?Math.min(G,N-F):N-F),H=W>G&&d||W||G||H,typeof D=="number"&&D>0){const ne=H%D;H=ne===0?H:H+D-ne}return H})(p,a)},mK=()=>2**30>>>0,gK=()=>2**53-1,yK=a=>{const{format:u}=a;return typeof u=="string"?(p=>{const{format:d}=p,g=qm(d);if(typeof g=="function")return g(p);switch(d){case"int32":return mK();case"int64":return gK()}return 0})(a):0},vK=a=>typeof a.default!="boolean"||a.default,Km=new Proxy({array:_W,object:xW,string:fK,number:hK,integer:yK,boolean:vK,null:()=>null},{get:(a,u)=>typeof u=="string"&&Object.hasOwn(a,u)?a[u]:()=>`Unknown Type: ${u}`});const JT=["array","object","number","integer","string","boolean","null"],sp=a=>{if(!xs(a))return!1;const{examples:u,example:p,default:d}=a;return!!(Array.isArray(u)&&u.length>=1)||d!==void 0||p!==void 0},CE=a=>{if(!xs(a))return null;const{examples:u,example:p,default:d}=a;return Array.isArray(u)&
Line truncated
|
||||
`&&(k=k.slice(0,k.length-1))}catch(N){return console.error(N),"error: could not generate yaml example"}return k.replace(/\t/g," ")},AK=a=>(u,p,d)=>{const{fn:g}=a();if(u&&!u.xml&&(u.xml={}),u&&!u.xml.name){if(!u.$$ref&&(u.type||u.items||u.properties||u.additionalProperties))return`<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- XML example cannot be generated; root element name is undefined -->`;if(u.$$ref){let E=u.$$ref.match(/\S*\/(\S+)$/);u.xml.name=E[1]}}return g.jsonSchema202012.memoizedCreateXMLExample(u,p,d)},OK=a=>(u,p="",d={},g=void 0)=>{const{fn:E}=a();return typeof(u==null?void 0:u.toJS)=="function"&&(u=u.toJS()),typeof(g==null?void 0:g.toJS)=="function"&&(g=g.toJS()),/xml/.test(p)?E.jsonSchema202012.getXmlSampleSchema(u,d,g):/(yaml|yml)/.test(p)?E.jsonSchema202012.getYamlSampleSchema(u,d,p,g):E.jsonSchema202012.getJsonSampleSchema(u,d,p,g)},eP=({getSystem:a})=>{const u=_K(a),p=xK(a),d=AK(a),g=OK(a);return{fn:{jsonSchema202012:{sampleFromSchema:QT,sampleFromSchemaGeneric:En,sampleEncoderAPI:WT,sampleFormatAPI:qm,sampleMediaTypeAPI:HT,createXMLExample:XT,memoizedSampleFromSchema:EK,memoizedCreateXMLExample:bK,getJsonSampleSchema:u,getYamlSampleSchema:p,getXmlSampleSchema:d,getSampleSchema:g}}}};function tP(){return[Uk,EE,VT,eP,hW]}const{GIT_DIRTY:CK,GIT_COMMIT:$K,PACKAGE_VERSION:kK,BUILD_TIME:TK}={PACKAGE_VERSION:"5.11.8",GIT_COMMIT:"g925ff51d",GIT_DIRTY:!0,BUILD_TIME:"Fri, 23 Feb 2024 11:44:58 GMT"};function Jm(a){We.versions=We.versions||{},We.versions.swaggerUi={version:kK,gitRevision:$K,gitDirty:CK,buildTimestamp:TK};const u={dom_id:null,domNode:null,spec:{},url:"",urls:null,layout:"BaseLayout",docExpansion:"list",maxDisplayedTags:null,filter:null,validatorUrl:"https://validator.swagger.io/validator",oauth2RedirectUrl:`${window.location.protocol}//${window.location.host}${window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))}/oauth2-redirect.html`,persistAuthorization:!1,configs:{},custom:{},displayOperationId:!1,displayRequestDuration:!1,deepLinking:!1,tryItOutEnabled:!1,requestInterceptor:W=>W,responseInterceptor:W=>W,showMutatedRequest:!0,defaultModelRendering:"example",defaultModelExpandDepth:1,defaultModelsExpandDepth:1,showExtensions:!1,showCommonExtensions:!1,withCredentials:void 0,requestSnippetsEnabled:!1,requestSnippets:{generators:{curl_bash:{title:"cURL (bash)",syntax:"bash"},curl_powershell:{title:"cURL (PowerShell)",syntax:"powershell"},curl_cmd:{title:"cURL (CMD)",syntax:"bash"}},defaultExpanded:!0,languages:null},supportedSubmitMethods:["get","put","post","delete","options","head","patch","trace"],queryConfigEnabled:!1,presets:[tP],plugins:[],pluginsOptions:{pluginLoadType:"legacy"},initialState:{},fn:{},components:{},syntaxHighlight:{activated:!0,theme:"agate"}};let p=a.queryConfigEnabled?(()=>{let W={},G=We.location.search;if(!G)return{};if(G!=""){let H=G.substr(1).split("&");for(let ne in H)Object.prototype.hasOwnProperty.call(H,ne)&&(ne=H[ne].split("="),W[decodeURIComponent(ne[0])]=ne[1]&&decodeURIComponent(ne[1])||"")}return W})():{};const d=a.domNode;delete a.domNode;const g=Q()({},u,a,p),E={system:{configs:g.configs},plugins:g.presets,pluginsOptions:g.pluginsOptions,state:Q()({layout:{layout:g.layout,filter:g.filter},spec:{spec:"",url:g.url},requestSnippets:g.requestSnippets},g.initialState)};if(g.initialState)for(var O in g.initialState)Object.prototype.hasOwnProperty.call(g.initialState,O)&&g.initialState[O]===void 0&&delete E.state[O];var k=new kn(E);k.register([g.plugins,()=>({fn:g.fn,components:g.components,state:g.state})]);var N=k.getSystem();const D=W=>{let G=N.specSelectors.getLocalConfig?N.specSelectors.getLocalConfig():{},H=Q()({},G,g,W||{},p);if(d&&(H.domNode=d),k.setConfigs(H),N.configsActions.loaded(),W!==null&&(!p.url&&typeof H.spec=="object"&&Object.keys(H.spec).length?(N.specActions.updateUrl(""),N.specActions.updateLoadingStatus("success"),N.specActions.updateSpec(JSON.stringify(H.spec))):N.specActions.download&&H.url&&!H.urls&&(N.specActions.updateUrl(H.url),N.specActions.download(H.url))),H.domNode)N.render(H.domNode,"App");else if(H.dom_id){let ne=document.querySelector(H.dom_id);N.render(ne,"App")}else H.dom_id===null||H.domNode===null||console.error("Skipped rendering: no `dom_id` or `domNode` was specified");return N},F=p.config||g.configUrl;return F&&N.specActions&&N.specActions.getConfigByUrl?(N.specActions.getConfigByUrl({url:F,loadRemoteConfig:!0,requestInterceptor:g.requestInterceptor,responseInterceptor:g.responseInterceptor},D),N):D()}Jm.System=kn,Jm.presets={base:Uk,apis:tP},Jm.plugins={Auth:$u,Configs:$o,DeepLining:Tu,Err:Pu,Filter:Vf,Icons:El,JSONSchema5Samples:E$,JSONSchema202012:VT,JSONSchema202012Samples:eP,Layout:Gf,Logs:Nu,OpenAPI30:EE,OpenAPI31:EE,OnComplete:Yf,RequestSnippets:ci,Spec:z$,SwaggerClient:Y$,Util:X$,View:nk,ViewLegacy:ik,DownloadUrl:sk,SafeRender:uk};var PK=Jm})();var Pze=DU.A;Pze({url:"openapi.yaml",dom_id:"#app"});
|
||||
@@ -0,0 +1 @@
|
||||
.swagger-ui{color:#3b4151;font-family:sans-serif}.swagger-ui html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}.swagger-ui body{margin:0}.swagger-ui article,.swagger-ui aside,.swagger-ui footer,.swagger-ui header,.swagger-ui nav,.swagger-ui section{display:block}.swagger-ui h1{font-size:2em;margin:.67em 0}.swagger-ui figcaption,.swagger-ui figure,.swagger-ui main{display:block}.swagger-ui figure{margin:1em 40px}.swagger-ui hr{box-sizing:content-box;height:0;overflow:visible}.swagger-ui pre{font-family:monospace,monospace;font-size:1em}.swagger-ui a{background-color:transparent;-webkit-text-decoration-skip:objects}.swagger-ui abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.swagger-ui b,.swagger-ui strong{font-weight:inherit;font-weight:bolder}.swagger-ui code,.swagger-ui kbd,.swagger-ui samp{font-family:monospace,monospace;font-size:1em}.swagger-ui dfn{font-style:italic}.swagger-ui mark{background-color:#ff0;color:#000}.swagger-ui small{font-size:80%}.swagger-ui sub,.swagger-ui sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.swagger-ui sub{bottom:-.25em}.swagger-ui sup{top:-.5em}.swagger-ui audio,.swagger-ui video{display:inline-block}.swagger-ui audio:not([controls]){display:none;height:0}.swagger-ui img{border-style:none}.swagger-ui svg:not(:root){overflow:hidden}.swagger-ui button,.swagger-ui input,.swagger-ui optgroup,.swagger-ui select,.swagger-ui textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}.swagger-ui button,.swagger-ui input{overflow:visible}.swagger-ui button,.swagger-ui select{text-transform:none}.swagger-ui [type=reset],.swagger-ui [type=submit],.swagger-ui button,.swagger-ui html [type=button]{-webkit-appearance:button}.swagger-ui [type=button]::-moz-focus-inner,.swagger-ui [type=reset]::-moz-focus-inner,.swagger-ui [type=submit]::-moz-focus-inner,.swagger-ui button::-moz-focus-inner{border-style:none;padding:0}.swagger-ui [type=button]:-moz-focusring,.swagger-ui [type=reset]:-moz-focusring,.swagger-ui [type=submit]:-moz-focusring,.swagger-ui button:-moz-focusring{outline:1px dotted ButtonText}.swagger-ui fieldset{padding:.35em .75em .625em}.swagger-ui legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}.swagger-ui progress{display:inline-block;vertical-align:baseline}.swagger-ui textarea{overflow:auto}.swagger-ui [type=checkbox],.swagger-ui [type=radio]{box-sizing:border-box;padding:0}.swagger-ui [type=number]::-webkit-inner-spin-button,.swagger-ui [type=number]::-webkit-outer-spin-button{height:auto}.swagger-ui [type=search]{-webkit-appearance:textfield;outline-offset:-2px}.swagger-ui [type=search]::-webkit-search-cancel-button,.swagger-ui [type=search]::-webkit-search-decoration{-webkit-appearance:none}.swagger-ui ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.swagger-ui details,.swagger-ui menu{display:block}.swagger-ui summary{display:list-item}.swagger-ui canvas{display:inline-block}.swagger-ui [hidden],.swagger-ui template{display:none}.swagger-ui .debug *{outline:1px solid gold}.swagger-ui .debug-white *{outline:1px solid #fff}.swagger-ui .debug-black *{outline:1px solid #000}.swagger-ui .debug-grid{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MTRDOTY4N0U2N0VFMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MTRDOTY4N0Q2N0VFMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NjcyQkQ3NjY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NjcyQkQ3NzY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsBS+GMAAAAjSURBVHjaYvz//z8DLsD4gcGXiYEAGBIKGBne//fFpwAgwAB98AaF2pjlUQAAAABJRU5ErkJggg==) repeat 0 0}.swagger-ui .debug-grid-16{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDbLine truncated
|
||||
@@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Clyde's api</title>
|
||||
<script type="module" crossorigin src="assets/index-BP8s9Pse.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="assets/index-rZb_qAw7.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,14 @@
|
||||
package ovh.herisson.Clyde;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
// import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
// @SpringBootTest
|
||||
class ClydeApplicationTests {
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package ovh.herisson.Clyde.Endpoints;
|
||||
|
||||
import com.github.dockerjava.api.model.ExposedPort;
|
||||
import com.github.dockerjava.api.model.HostConfig;
|
||||
import com.github.dockerjava.api.model.PortBinding;
|
||||
import com.github.dockerjava.api.model.Ports;
|
||||
import io.restassured.RestAssured;
|
||||
import io.restassured.http.ContentType;
|
||||
import org.junit.Assert;
|
||||
import org.junit.jupiter.api.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.web.server.LocalServerPort;
|
||||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
import org.testcontainers.containers.PostgreSQLContainer;
|
||||
import org.testcontainers.junit.jupiter.Container;
|
||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import ovh.herisson.Clyde.ClydeApplication;
|
||||
import ovh.herisson.Clyde.EndPoints.StorageController;
|
||||
import ovh.herisson.Clyde.Repositories.FileRepository;
|
||||
import ovh.herisson.Clyde.Services.StorageService;
|
||||
import ovh.herisson.Clyde.Tables.FileType;
|
||||
import ovh.herisson.Clyde.Tables.StorageFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import static io.restassured.RestAssured.with;
|
||||
|
||||
@Testcontainers
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@ActiveProfiles(value ="dev")
|
||||
public class StorageControllerTest {
|
||||
@LocalServerPort
|
||||
private Integer port;
|
||||
|
||||
@Autowired
|
||||
private ClydeApplication controller;
|
||||
|
||||
@Autowired
|
||||
private StorageController storageController;
|
||||
|
||||
@Autowired
|
||||
private StorageService storageService;
|
||||
@Autowired
|
||||
private FileRepository fileRepository;
|
||||
@Container
|
||||
@ServiceConnection
|
||||
static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>("postgres:alpine")
|
||||
.withDatabaseName("clyde")
|
||||
.withUsername("devel")
|
||||
.withPassword("devel")
|
||||
.withCreateContainerCmdModifier(cmd -> cmd.withHostConfig(new HostConfig().withPortBindings(new PortBinding(Ports.Binding.bindPort(5442), new ExposedPort(5432)))));
|
||||
|
||||
@BeforeAll
|
||||
static void beforeAll(){
|
||||
postgres.start();
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
static void afterAll(){
|
||||
postgres.stop();
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
void setup(){
|
||||
RestAssured.baseURI = "http://localhost:" + port;
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
void afterEach(){
|
||||
fileRepository.deleteAll();
|
||||
}
|
||||
@Test
|
||||
public void uploadFileTest() throws IOException {
|
||||
File mmf = new File("test.txt");
|
||||
mmf.createNewFile();
|
||||
|
||||
FileWriter fw = new FileWriter(mmf);
|
||||
fw.write("Ceci est un test");
|
||||
fw.close();
|
||||
|
||||
with().multiPart("file", mmf).pathParam("fileType", FileType.ProfilePicture).when().request("POST", "/upload/{fileType}").then().statusCode(200);
|
||||
|
||||
StorageFile sf = fileRepository.getStorageFileByName("test.txt");
|
||||
|
||||
//On vérifie que le fichier a bien été stocké dans la db
|
||||
Assert.assertFalse(sf == null);
|
||||
|
||||
//On vérifie que le fichier a bel et bien été stocké dans le dossier cdn
|
||||
File extFile = new File(sf.getUrl());
|
||||
Assert.assertTrue(extFile.exists());
|
||||
|
||||
Assert.assertEquals("cdn", extFile.getParent());
|
||||
|
||||
//On delete tranquillement les fichiers (la méthode delete a déja été testée dans StorageServiceTest)
|
||||
storageService.delete(sf);
|
||||
mmf.delete();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
package ovh.herisson.Clyde.Endpoints;
|
||||
|
||||
import com.github.dockerjava.api.model.ExposedPort;
|
||||
import com.github.dockerjava.api.model.HostConfig;
|
||||
import com.github.dockerjava.api.model.PortBinding;
|
||||
import com.github.dockerjava.api.model.Ports;
|
||||
import io.restassured.RestAssured;
|
||||
import io.restassured.http.ContentType;
|
||||
import org.junit.Assert;
|
||||
import org.junit.jupiter.api.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.web.server.LocalServerPort;
|
||||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.HttpStatusCode;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
import org.testcontainers.containers.PostgreSQLContainer;
|
||||
import org.testcontainers.junit.jupiter.Container;
|
||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import ovh.herisson.Clyde.ClydeApplication;
|
||||
import ovh.herisson.Clyde.Repositories.TokenRepository;
|
||||
import ovh.herisson.Clyde.Repositories.UserRepository;
|
||||
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
|
||||
import ovh.herisson.Clyde.Services.TokenService;
|
||||
import ovh.herisson.Clyde.Tables.Role;
|
||||
import ovh.herisson.Clyde.Tables.Token;
|
||||
import ovh.herisson.Clyde.Tables.User;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static io.restassured.RestAssured.with;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
||||
@Testcontainers
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@ActiveProfiles(value = "dev")
|
||||
public class UserControllerTest {
|
||||
@LocalServerPort
|
||||
private Integer port;
|
||||
|
||||
@Autowired
|
||||
private ClydeApplication controller;
|
||||
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
@Autowired
|
||||
private UserRepository userRepository;
|
||||
@Autowired
|
||||
private TokenRepository tokenRepository;
|
||||
@Container
|
||||
@ServiceConnection
|
||||
static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>("postgres:alpine")
|
||||
.withDatabaseName("clyde")
|
||||
.withUsername("devel")
|
||||
.withPassword("devel")
|
||||
.withCreateContainerCmdModifier(cmd -> cmd.withHostConfig(new HostConfig().withPortBindings(new PortBinding(Ports.Binding.bindPort(5442), new ExposedPort(5432)))));
|
||||
|
||||
@BeforeAll
|
||||
static void beforeAll(){
|
||||
postgres.start();
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
static void afterAll(){
|
||||
postgres.stop();
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
void setup(){
|
||||
RestAssured.baseURI = "http://localhost:" + port;
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
void aftereach(){
|
||||
tokenRepository.deleteAll();
|
||||
userRepository.deleteAll();
|
||||
}
|
||||
@Test
|
||||
//Verifie qu'un user qui n'a pas les permissions admin ou secretaire ne peut pas post
|
||||
public void userPostTest(){
|
||||
User god = new User("god","god","admin@admin.com","everywhere","every",new Date(0), null, Role.Admin,"goddoesntneedpassword");
|
||||
Token godToken = new Token(god, tokenService.generateNewToken(), new Date());
|
||||
userRepository.save(god);
|
||||
tokenService.saveToken(godToken);
|
||||
|
||||
//Can god post herobrine himself ?
|
||||
User herobrine = new User("brine","hero","herobrine@student.com","in your WalLs","ShadowsLand",new Date(0), null,Role.Student,"test");
|
||||
|
||||
with().body(herobrine).contentType(ContentType.JSON).header("Authorization", godToken.getToken()).when().request("POST", "/user").then().statusCode(201);
|
||||
|
||||
userRepository.delete(herobrine);
|
||||
|
||||
//Can noob post herobrine without authorizations (no)
|
||||
User noob = new User("boon","noob","noob@student.com","everywhere","every",new Date(0), null, Role.Student,"noob");
|
||||
Token noobToken = new Token(noob, tokenService.generateNewToken(), new Date());
|
||||
userRepository.save(noob);
|
||||
tokenService.saveToken(noobToken);
|
||||
|
||||
with().body(herobrine).contentType(ContentType.JSON).header("Authorization", noobToken.getToken()).when().request("POST", "/user").then().statusCode(401);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void userGetTest(){
|
||||
User herobrine = new User("brine","hero","herobrine@student.com","in your WalLs","ShadowsLand",new Date(0), null,Role.Student,"test");
|
||||
userRepository.save(herobrine);
|
||||
|
||||
Token t = new Token(herobrine, tokenService.generateNewToken(), new Date());
|
||||
tokenRepository.save(t);
|
||||
|
||||
|
||||
with().header("Authorization", t.getToken()).when().request("GET", "/user").then().assertThat().statusCode(200).body("firstName",equalTo("hero"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void userPatchTest(){
|
||||
User herobrine = new User("brine","hero","herobrine@admin.com","in your WalLs","ShadowsLand",new Date(0), null,Role.Admin,"test");
|
||||
userRepository.save(herobrine);
|
||||
|
||||
Token t = new Token(herobrine, tokenService.generateNewToken(), new Date());
|
||||
tokenRepository.save(t);
|
||||
|
||||
Map<String, Object> data = new HashMap<String, Object>();
|
||||
data.put("firstName", "test");
|
||||
|
||||
//Teste que le patch s'execute bien
|
||||
with().body(data).contentType(ContentType.JSON).header("Authorization", t.getToken()).pathParam("id", herobrine.getRegNo()).when().request("PATCH", "/user/{id}").then().statusCode(200);
|
||||
|
||||
//Teste que la donnée a bien été altérée
|
||||
with().header("Authorization", t.getToken()).when().request("GET", "/user").then().body("firstName",equalTo("test"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void UserDeleteTest(){
|
||||
User god = new User("god","god","admin@admin.com","everywhere","every",new Date(0), null, Role.Admin,"goddoesntneedpassword");
|
||||
Token godToken = new Token(god, tokenService.generateNewToken(), new Date());
|
||||
userRepository.save(god);
|
||||
tokenService.saveToken(godToken);
|
||||
|
||||
User herobrine = new User("brine","hero","herobrine@admin.com","in your WalLs","ShadowsLand",new Date(0), null,Role.Student,"test");
|
||||
userRepository.save(herobrine);
|
||||
|
||||
with().header("Authorization", godToken.getToken()).pathParam("id", herobrine.getRegNo()).when().request("DELETE", "/user/{id}").then().statusCode(200);
|
||||
Assert.assertEquals(userRepository.existsById(herobrine.getRegNo()), false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package ovh.herisson.Clyde.Repositories;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
import ovh.herisson.Clyde.Tables.Role;
|
||||
import ovh.herisson.Clyde.Tables.User;
|
||||
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
@DataJpaTest
|
||||
@TestPropertySource(properties = {
|
||||
"spring.test.database.replace=none",
|
||||
"spring.datasource.url=jdbc:tc:postgresql:16-alpine:///db"
|
||||
})
|
||||
public class UserRepoTest {
|
||||
|
||||
@Autowired
|
||||
UserRepository userRepo;
|
||||
|
||||
@BeforeEach
|
||||
public void setup(){
|
||||
User herobrine = new User("brine","hero","admin@admin.com","in your WalLs","ShadowsLand", new GregorianCalendar(2005, 4, 3).getTime(), null, Role.Admin,"admin");
|
||||
userRepo.save(herobrine);
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void clean(){
|
||||
userRepo.deleteAll();
|
||||
}
|
||||
@Test
|
||||
public void usertest(){
|
||||
Assert.assertEquals("brine", userRepo.findById(1).getLastName());
|
||||
Assert.assertTrue(new GregorianCalendar(2005, 4, 3).getTime().equals(userRepo.findById(1).getBirthDate()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package ovh.herisson.Clyde.Services;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.testcontainers.shaded.com.google.common.net.MediaType;
|
||||
import ovh.herisson.Clyde.Repositories.FileRepository;
|
||||
import ovh.herisson.Clyde.Tables.FileType;
|
||||
import ovh.herisson.Clyde.Tables.StorageFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@DataJpaTest
|
||||
@TestPropertySource(properties = {
|
||||
"spring.test.database.replace=none",
|
||||
"spring.datasource.url=jdbc:tc:postgresql:16-alpine:///db"
|
||||
})
|
||||
public class StorageServiceTest {
|
||||
@Autowired
|
||||
FileRepository fileRepo;
|
||||
|
||||
StorageService ss;
|
||||
|
||||
@BeforeEach
|
||||
public void setup(){
|
||||
if (ss == null){
|
||||
ss = new StorageService(fileRepo);
|
||||
}
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void aftereach(){
|
||||
fileRepo.deleteAll();
|
||||
}
|
||||
@Test
|
||||
//Check si le fichier est bien sauvegardé dans la DB et si le fichier est bien sauvegardé au bon endroit
|
||||
public void saveFile(){
|
||||
//Test si le directory a bien été crée a l'init du fileService
|
||||
Path rootloc = Paths.get("cdn/");
|
||||
|
||||
Assert.assertTrue(Files.exists(rootloc));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void deleteFile() throws IOException {
|
||||
File file = new File("cdn/test.txt");
|
||||
file.createNewFile();
|
||||
|
||||
//On vérifie que le fichier a bien été crée
|
||||
Assert.assertTrue(file.exists());
|
||||
|
||||
//StorageFile représentant le fichier
|
||||
StorageFile sf = new StorageFile("testfile",file.getPath(), FileType.ProfilePicture);
|
||||
fileRepo.save(sf);
|
||||
|
||||
//Check that the storagefile is properly saved
|
||||
StorageFile resp = fileRepo.getStorageFileByName("testfile");
|
||||
Assert.assertEquals(sf, resp);
|
||||
|
||||
ss.delete(sf);
|
||||
|
||||
//On vérifie que le fichier a bien été delete et que le StorageFile a été delete de la DB
|
||||
Assert.assertFalse(file.exists());
|
||||
|
||||
resp = fileRepo.getStorageFileByName("testfile");
|
||||
Assert.assertEquals(null, resp);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package ovh.herisson.Clyde.Services;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
import ovh.herisson.Clyde.Repositories.TokenRepository;
|
||||
import ovh.herisson.Clyde.Repositories.UserRepository;
|
||||
import ovh.herisson.Clyde.Tables.Role;
|
||||
import ovh.herisson.Clyde.Tables.Token;
|
||||
import ovh.herisson.Clyde.Tables.User;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
@DataJpaTest
|
||||
@TestPropertySource(properties = {
|
||||
"spring.test.database.replace=none",
|
||||
"spring.datasource.url=jdbc:tc:postgresql:16-alpine:///db"
|
||||
})
|
||||
|
||||
class TokenServiceTest {
|
||||
|
||||
@Autowired
|
||||
TokenRepository tokenRepository;
|
||||
|
||||
@Autowired
|
||||
UserRepository userRepository;
|
||||
|
||||
|
||||
@AfterEach
|
||||
public void aftereach(){
|
||||
tokenRepository.deleteAll();
|
||||
userRepository.deleteAll();
|
||||
}
|
||||
@Test
|
||||
void saveToken() {
|
||||
User herobrine = userRepository.findById(1);
|
||||
|
||||
User herobrinenul = new User("brine","heronul","pasadmin@student.com","in your WalLs","ShadowsLand", new GregorianCalendar(2005, 4, 3).getTime(), null, Role.Admin,"admin");
|
||||
|
||||
TokenService tokenService = new TokenService(tokenRepository);
|
||||
Token testToken = new Token(herobrine, tokenService.generateNewToken(), new Date());
|
||||
tokenService.saveToken(testToken);
|
||||
|
||||
Iterable<Token> t = tokenService.getAllTokens();
|
||||
Token tok = t.iterator().next();
|
||||
|
||||
Assert.assertEquals(herobrine, tok.getUser());
|
||||
Assert.assertNotEquals(herobrinenul, tok.getUser());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void saveTokenLimit(){
|
||||
TokenService tokenService = new TokenService(tokenRepository);
|
||||
|
||||
//On va stocker les token qu'on va sauvegarder au préalable dans une liste pour tester que les tokens remplacés sont bien ceux avec la date d'expi la plus jeune
|
||||
//A la fin il ne devrait donc rester que les 5 derniers tokens de tokenList
|
||||
|
||||
ArrayList<Token> tokenList = new ArrayList<>();
|
||||
GregorianCalendar gc = new GregorianCalendar();
|
||||
|
||||
User malveillant = new User("Cargo", "John", "CargoJ@mail.com", "secret", "secret", null, null, null, "secret");
|
||||
userRepository.save(malveillant);
|
||||
|
||||
for (int i = 0; i < 20; i++){
|
||||
gc.add(Calendar.DAY_OF_WEEK, 1);
|
||||
|
||||
Token t = new Token(malveillant, tokenService.generateNewToken(), gc.getTime());
|
||||
tokenList.add(t);
|
||||
|
||||
tokenService.saveToken(t);
|
||||
}
|
||||
|
||||
//Testons les tokens
|
||||
ArrayList <Token> resp = tokenRepository.getByUserOrderByExpirationDate(malveillant);
|
||||
Assert.assertTrue(resp.size() == 5);
|
||||
|
||||
for (int i = 1; i <= resp.size(); i++){
|
||||
Assert.assertEquals(tokenList.get(tokenList.size()-i), resp.get(resp.size()-i));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
spring.datasource.driver-class-name=org.testcontainers.jdbc.ContainerDatabaseDriver
|
||||
spring.jpa.hibernate.ddl-auto=create-drop
|
||||
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
|
||||
@@ -0,0 +1,30 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
coverage
|
||||
*.local
|
||||
|
||||
/cypress/videos/
|
||||
/cypress/screenshots/
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
*.tsbuildinfo
|
||||
@@ -0,0 +1,21 @@
|
||||
# Clyde
|
||||
|
||||
This is the frontend side of the Clyde management system
|
||||
|
||||
## Project Setup
|
||||
|
||||
```sh
|
||||
npm install
|
||||
```
|
||||
|
||||
### Compile and Hot-Reload for Development
|
||||
|
||||
```sh
|
||||
npm run dev
|
||||
```
|
||||
|
||||
### Compile and Minify for Production
|
||||
|
||||
```sh
|
||||
npm run build
|
||||
```
|
||||
@@ -0,0 +1,20 @@
|
||||
import com.github.gradle.node.npm.task.NpmTask
|
||||
|
||||
plugins {
|
||||
id("com.github.node-gradle.node") version "7.0.2"
|
||||
}
|
||||
|
||||
|
||||
tasks.register<NpmTask>("build") {
|
||||
dependsOn(tasks.npmInstall)
|
||||
args.set(listOf("run", "build"))
|
||||
}
|
||||
|
||||
var dev = tasks.register<NpmTask>("dev") {
|
||||
dependsOn(tasks.npmInstall)
|
||||
args.set(listOf("run", "dev"))
|
||||
}
|
||||
|
||||
tasks.register<NpmTask>("run") {
|
||||
dependsOn(dev)
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="icon" href="/favicon.ico">
|
||||
<title> Clyde 🪦</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
}
|
||||
},
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
Generated
+1591
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "clyde",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"vite-plugin-top-level-await": "^1.4.1",
|
||||
"vue": "^3.4.15",
|
||||
"vue3-toastify": "^0.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-vue": "^5.0.3",
|
||||
"jsdom": "^24.0.0",
|
||||
"vite": "^5.0.11"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 318 B |
@@ -0,0 +1,54 @@
|
||||
login.guest.signin=Sign in
|
||||
login.guest.register=Register
|
||||
login.guest.alregister=Already Registered
|
||||
login.guest.welcome=WELCOME TO THE UNIVERSITY
|
||||
login.guest.email=E-MAIL
|
||||
login.guest.firstname=FIRSTNAME
|
||||
login.guest.surname=SURNAME
|
||||
login.guest.country=COUNTRY
|
||||
login.guest.address=ADDRESS
|
||||
login.guest.password=PASSWORD
|
||||
login.guest.nextpage=Next Page
|
||||
login.guest.lastpage=Last Page
|
||||
login.guest.submit=Submit
|
||||
login.guest.birthday=BIRTHDAY
|
||||
login.guest.confirm=CONFIRM
|
||||
login.cPassword=Confirm Password
|
||||
login.password=Password
|
||||
app.home=Home
|
||||
app.login=Login
|
||||
app.notifications=Notifications
|
||||
app.settings=Settings
|
||||
app.messages=Messages
|
||||
app.forum=Forum
|
||||
app.schedules=Schedules
|
||||
app.inscription.requests=Inscription Requests
|
||||
app.manage.courses=Manage Courses
|
||||
app.language=Language
|
||||
app.manage.profile=Manage profile
|
||||
app.studentList=Students List
|
||||
app.users=Users
|
||||
request.moreInfos=More Infos
|
||||
request.accept=Accept
|
||||
request.refuse=Refuse
|
||||
courses.createCourse=Create course
|
||||
courses.deleteCourse=Delete course
|
||||
courses.modify=Modify
|
||||
courses.toDelete=Course to Delete
|
||||
courses.confirm=Confirm
|
||||
courses.back=Back
|
||||
profile.modify.data=Modify personnal data
|
||||
profile.reRegister=Re-register
|
||||
profile.unRegister=Unregister
|
||||
profile.course.list=Courses list
|
||||
profile.address=Address
|
||||
profile.picture=Profile picture
|
||||
profile.change.curriculum=Change curriculum
|
||||
name=Name
|
||||
Teacher=Teacher
|
||||
Student=Student
|
||||
Secretary=Secretary
|
||||
Curriculum=curriculum
|
||||
Credits=Credits
|
||||
InscriptionService=I.S.
|
||||
faculty=Faculty
|
||||
@@ -0,0 +1,54 @@
|
||||
login.guest.signin=SE CONNECTER
|
||||
login.guest.register=S'enregistrer
|
||||
login.guest.alregister=Déjà Enregistré
|
||||
login.guest.welcome=BIENVENUE A L'UNIVERSITE
|
||||
login.guest.email=E-MAIL
|
||||
login.guest.firstname=PRENOM
|
||||
login.guest.surname=NOM
|
||||
login.guest.country=PAYS
|
||||
login.guest.address=ADRESSE
|
||||
login.guest.password=MOT DE PASSE
|
||||
login.guest.nextpage=Prochaine Page
|
||||
login.guest.lastpage=Derniere Page
|
||||
login.guest.submit=Envoyer
|
||||
login.guest.birthday=DATE DE NAISSANCE
|
||||
login.guest.confirm=CONFIRMER
|
||||
login.cPassword=Confirmer mot de passe
|
||||
login.password=Mot de passe
|
||||
app.home=Home
|
||||
app.login=Se connecter
|
||||
app.notifications=Notifications
|
||||
app.settings=Options
|
||||
app.messages=Messages
|
||||
app.forum=Forum
|
||||
app.schedules=Horaires
|
||||
app.inscription.requests=Demandes d'Inscription
|
||||
app.manage.courses=Gérer les cours
|
||||
app.language=Langue
|
||||
app.manage.profile=Gérer le profil
|
||||
app.studentList=Liste des étudiants
|
||||
app.users=Utilisateurs
|
||||
request.moreInfos=Plus d'Infos
|
||||
request.accept=Accepter
|
||||
request.refuse=Refuser
|
||||
courses.createCourse=Créer un cours
|
||||
courses.deleteCourse=Supprimer un cours
|
||||
courses.modify=Modifier
|
||||
courses.toDelete=Cours à supprimer
|
||||
courses.confirm=Confirmer
|
||||
courses.back=Retour
|
||||
profile.modify.data=Modifier données personnelles
|
||||
profile.reRegister=Réinsciption
|
||||
profile.unRegister=Désinscription
|
||||
profile.course.list=Liste des cours
|
||||
profile.address=Adresse
|
||||
profile.picture=Photo de profil
|
||||
profile.change.curriculum=Changer cursus
|
||||
name=Nom
|
||||
Teacher=Enseignant
|
||||
Student=Etudiant
|
||||
Secretary=Secrétaire
|
||||
Curriculum=Cursus
|
||||
Credits=Credits
|
||||
InscriptionService=S.I.
|
||||
faculty=Faculté
|
||||
@@ -0,0 +1,257 @@
|
||||
<script setup>
|
||||
import { toast } from 'vue3-toastify';
|
||||
import { ref } from 'vue'
|
||||
import i18n, { setLang } from './i18n.js'
|
||||
import { isLogged } from '@/rest/Users.js'
|
||||
|
||||
import { appList, currentView } from '@/rest/apps.js'
|
||||
var prevURL;
|
||||
var currentURL = window.location.hash;
|
||||
|
||||
window.onhashchange = function() {
|
||||
prevURL = currentURL;
|
||||
currentURL = window.location.hash;
|
||||
}
|
||||
const Logged = ref(isLogged());
|
||||
|
||||
window.addEventListener('hashchange', () => {
|
||||
if((location.hash === "#/home" && prevURL === "#/login") || (location.hash === "#/home" && prevURL === "#/profil")){
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
const home=ref(i18n("app.home"))
|
||||
const notifications=ref(i18n("app.notifications"))
|
||||
const settings=ref(i18n("app.settings"))
|
||||
const login=ref(i18n("app.login"))
|
||||
const active=ref(false)
|
||||
|
||||
const apps = ref([])
|
||||
appList().then(e => apps.value = e)
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="container">
|
||||
|
||||
<div class="topBar">
|
||||
<ul class="horizontal">
|
||||
<li title=home>
|
||||
<a class="icon" href="#home">
|
||||
<img class="clyde" src="/Clyde.png" style="width: 40px; height: auto; margin-top:4px">
|
||||
</a></li>
|
||||
<li title=home>
|
||||
<a class="icon" href="#home">
|
||||
<div class=" fa-solid fa-house" style="margin-top: 7px; margin-bottom: 3px;"></div>
|
||||
</a></li>
|
||||
<li style="float: right;" title=login>
|
||||
<a class="icon" href="#/login">
|
||||
<div class="fa-solid fa-user" :style="Logged ? 'color: orange' : 'haha'" style="margin-top: 7px; margin-bottom: 3px; "></div>
|
||||
</a></li>
|
||||
<li style="float: right;" title=notifications>
|
||||
<a class="icon" href="#Notifications">
|
||||
<div class="fa-solid fa-bell" style="margin-top: 7px; margin-bottom: 3px;"></div>
|
||||
</a></li>
|
||||
<li @click="active=!active" class="option"style="float: right;" title=settings>
|
||||
<a class="icon" >
|
||||
<div class="fa-solid fa-gear" style="margin-top: 7px; margin-bottom: 3px;"></div>
|
||||
<div v-if="active" class="dropdown">
|
||||
<div class="dropdown-content">{{i18n("app.language")}}</div>
|
||||
<ul style="list-style-type:none;">
|
||||
<li style=" margin-bottom:10px;margin-right:20px;float:left; font-size:10px; color:black;">
|
||||
<button @:click="setLang('en');" href="#home">EN</button>
|
||||
|
||||
</li>
|
||||
<li style="float:left;font-size:10px; color:black;"><button @:click="setLang('fr');" href="#home">FR</button></li>
|
||||
</ul>
|
||||
<div style='align-items:center;'>
|
||||
<a style="cursor:pointer;font-size:20px;" href="#/profil" class="dropdown-content">
|
||||
{{i18n("app.manage.profile")}}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="leftBar">
|
||||
<ul class="vertical">
|
||||
<li v-for="app in apps">
|
||||
<a :href="app.path">
|
||||
<div class="fa-solid" :class="app.icon" style="font-size: 40px;"></div>
|
||||
<div class="text">{{app.text}}</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="page">
|
||||
<Suspense>
|
||||
<component :is="currentView" />
|
||||
</Suspense>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.container{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display:grid;
|
||||
grid-template-columns:[firstCol-start]70px[firstCol-end secondCol-start]auto[endCol];
|
||||
grid-template-rows:[firstRow-start]61px[firstRow-end secondRow-start] auto [endRow];
|
||||
grid-template-areas:
|
||||
"topBar topBar"
|
||||
"leftBar page";
|
||||
row-gap:0px;
|
||||
column-gap:0px;
|
||||
}
|
||||
|
||||
.page {
|
||||
grid-area:page;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
place-self:center;
|
||||
}
|
||||
|
||||
.topBar{
|
||||
grid-area:topBar;
|
||||
}
|
||||
|
||||
.leftBar{
|
||||
grid-area:leftBar;
|
||||
}
|
||||
.option {
|
||||
position: relative;
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
.dropdown {
|
||||
margin-top:55px;
|
||||
width:160px;
|
||||
display: inline-block;
|
||||
height:110px;
|
||||
font-size: 13px;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
background-color:white;
|
||||
}
|
||||
|
||||
.dropdown-content {
|
||||
min-width: 160px;
|
||||
text-align: center;
|
||||
margin-bottom: 10px;
|
||||
right:0;
|
||||
color:rgb(50,50,50);
|
||||
text-decoration: none;
|
||||
font-size:24px
|
||||
}
|
||||
|
||||
.dropdown-content div{
|
||||
display:block;
|
||||
}
|
||||
|
||||
ul.vertical{
|
||||
list-style-type: none;
|
||||
margin-top: 61px;
|
||||
top:0;
|
||||
left:0;
|
||||
padding: 25px 0 0;
|
||||
width: 70px ;
|
||||
background-color: rgb(53, 53, 53);
|
||||
border-right:5px;
|
||||
border-color:black;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
overflow:;
|
||||
transition-duration: .3s;
|
||||
}
|
||||
|
||||
li a{
|
||||
display: flex;
|
||||
padding: 8px 16px;
|
||||
color:rgb(255, 255, 255);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
ul.vertical li a:hover:not(.active) {
|
||||
background-color: rgb(112, 112, 112);
|
||||
border-radius:6px;
|
||||
color: white;
|
||||
transform: translate(0px ,1px);
|
||||
}
|
||||
|
||||
ul.vertical li a.active {
|
||||
background-color: rgb(239, 60, 168);
|
||||
border-radius:6px;
|
||||
}
|
||||
|
||||
ul.horizontal li a.active {
|
||||
background-color: rgb(57, 57, 57);
|
||||
border-radius:6px;
|
||||
}
|
||||
ul.horizontal {
|
||||
z-index: 101;
|
||||
box-shadow: 0px 3px 3px rgb(0, 0, 0);
|
||||
display: block ;
|
||||
list-style-type:none;
|
||||
margin:0;
|
||||
padding: 0;
|
||||
top: 0;
|
||||
left:0;
|
||||
|
||||
position: fixed;
|
||||
height:61px;
|
||||
width: 100%;
|
||||
background-color: rgb(24, 24, 24);
|
||||
}
|
||||
|
||||
ul.horizontal li {
|
||||
font-size: 35px;
|
||||
float: left;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
ul.horizontal li a.icon:hover:not(.active){
|
||||
background-color: black;
|
||||
border-radius:6px;
|
||||
color:white;
|
||||
transform: translate(0px ,1px);
|
||||
|
||||
}
|
||||
|
||||
ul.vertical:hover {
|
||||
z-index: 100;
|
||||
width: 250px;
|
||||
border-top-right-radius: 40px;
|
||||
box-shadow: 3px 0px 3px rgb(0, 0, 0);
|
||||
transition-duration: .3s;
|
||||
|
||||
}
|
||||
|
||||
.text {
|
||||
right: 0%;
|
||||
width: 0%;
|
||||
opacity: 0;
|
||||
color: white;
|
||||
font-size: 1.2em;
|
||||
font-weight: 600;
|
||||
transition-duration: .3s;
|
||||
}
|
||||
|
||||
ul.vertical:hover .text {
|
||||
opacity: 1;
|
||||
width: 60%;
|
||||
transition-duration: .3s;
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
.clyde:hover{
|
||||
content: url("./assets/angry_clyde.png")
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<!-- vim:set noet sts=0 sw=4 ts=2: -->
|
||||
@@ -0,0 +1,111 @@
|
||||
<script setup>
|
||||
import i18n from "@/i18n.js"
|
||||
import {ref} from 'vue'
|
||||
import {validateRegister, getAllRegisters } from '@/rest/ServiceInscription.js'
|
||||
|
||||
const requests = ref(await getAllRegisters());
|
||||
console.log(requests);
|
||||
|
||||
async function upPage(id,review){
|
||||
await validateRegister(id,review);
|
||||
requests.value = await getAllRegisters();
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<template>
|
||||
<div style='display:flex; justify-content:center; min-width:1140px;' v-for="item of requests">
|
||||
<div class="bodu" v-if="item.state === 'Pending'">
|
||||
<div class="container">
|
||||
<div class="id"><a>{{item.id}}</a></div>
|
||||
<div class="surname"><a>{{item.lastName}}</a></div>
|
||||
<div class="firstname"><a>{{item.firstName}}</a></div>
|
||||
<div class="infos"><button style="background-color:rgb(105,05,105);" >{{i18n("request.moreInfos")}}</button></div>
|
||||
<div class="accept"><button @click="upPage(item.id,'Accepted')" style="background-color:rgb(0,105,50);">{{i18n("request.accept")}}</button></div>
|
||||
<div class="refuse"><button @click="upPage(item.id,'Refused')" style="background-color:rgb(105,0,0);">{{i18n("request.refuse")}}</button></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.container{
|
||||
color:white;
|
||||
height:100px;
|
||||
font-size:20px;
|
||||
display:grid;
|
||||
grid-template-columns:10% 14.2% 19% 14.2% 14.2% 14.2% 14.2%;
|
||||
grid-template-areas:
|
||||
"id type surname firstname infos accept refuse";
|
||||
|
||||
}
|
||||
|
||||
.infos {
|
||||
grid-area:infos;
|
||||
align-self:center;
|
||||
}
|
||||
|
||||
.accept{
|
||||
grid-area:accept;
|
||||
align-self:center;
|
||||
}
|
||||
|
||||
.refuse{
|
||||
grid-area:refuse;
|
||||
align-self:center;
|
||||
}
|
||||
|
||||
.titles {
|
||||
grid-area:titles;
|
||||
background-color:rgb(215,215,215);
|
||||
}
|
||||
.id{
|
||||
grid-area:id;
|
||||
margin-left:40px;
|
||||
align-self:center;
|
||||
}
|
||||
|
||||
.type{
|
||||
grid-area:type;
|
||||
align-self:center;
|
||||
}
|
||||
|
||||
.surname{
|
||||
grid-area:surname;
|
||||
align-self:center;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow:ellipsis;
|
||||
}
|
||||
|
||||
.firstname{
|
||||
grid-area:firstname;
|
||||
align-self:center;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow:ellipsis;
|
||||
}
|
||||
|
||||
button{
|
||||
font-size:15px;
|
||||
height:50px;
|
||||
width:100px;
|
||||
border:none;
|
||||
border-radius:20px;
|
||||
|
||||
}
|
||||
|
||||
.bodu {
|
||||
margin-top:2%;
|
||||
width:66%;
|
||||
border:2px solid black;
|
||||
border-radius:9px;
|
||||
background-color:rgb(50,50,50);
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,270 @@
|
||||
<script setup>
|
||||
import {reactive, ref } from 'vue'
|
||||
import i18n from '@/i18n.js'
|
||||
import { login , register , disconnect, isLogged} from '@/rest/Users.js'
|
||||
import { getAllCurriculums } from '@/rest/curriculum.js'
|
||||
import { uploadProfilePicture } from '@/rest/uploads.js'
|
||||
import {toast} from 'vue3-toastify'
|
||||
import 'vue3-toastify/dist/index.css';
|
||||
|
||||
|
||||
const loginPage= ref(true)
|
||||
const page = ref(0)
|
||||
|
||||
const outputs = reactive({
|
||||
surname:null,
|
||||
firstname:null,
|
||||
password:null,
|
||||
birthday:null,
|
||||
email:null,
|
||||
address:null,
|
||||
country:null,
|
||||
curriculum:null,
|
||||
})
|
||||
|
||||
const submitValue= ref(i18n("login.guest.submit"))
|
||||
const passwordConfirm=ref("")
|
||||
|
||||
const imageSaved = ref(false)
|
||||
const ppData = ref(false)
|
||||
|
||||
const curricula= await getAllCurriculums();
|
||||
|
||||
function goBackHome(){
|
||||
setTimeout(() => {
|
||||
window.location.href="#/home";
|
||||
}, "500");
|
||||
}
|
||||
function verifyInputs(pass){
|
||||
if(pass==passwordConfirm.value){
|
||||
page.value++;
|
||||
return toast('Password and Confirm Password are correct.', {
|
||||
|
||||
type: "success",});
|
||||
}
|
||||
else{
|
||||
return toast('Password and Confirm Password are different',{type: "error",});
|
||||
}
|
||||
}
|
||||
if (isLogged()){
|
||||
disconnect();
|
||||
window.location.reload();}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<template>
|
||||
<div class="setup">
|
||||
<div v-if="loginPage">
|
||||
<div class='loginBox' style="margin-top:30%;">
|
||||
<form @submit.prevent="login(outputs.email,outputs.password);goBackHome();"class="form">
|
||||
<h1 style="color:rgb(239,60,168); font-family: sans-serif;">
|
||||
{{i18n("login.guest.signin")}}
|
||||
</h1>
|
||||
<div class="inputBox">
|
||||
<p>ID / {{i18n("login.guest.email")}}</p>
|
||||
<input type="text" v-model="outputs.email">
|
||||
</div>
|
||||
<div class="inputBox">
|
||||
<p>{{i18n("login.guest.password")}}</p>
|
||||
<input type="password" v-model="outputs.password">
|
||||
</div>
|
||||
<div class="register">
|
||||
<a @click="loginPage=!loginPage">{{i18n("login.guest.register")}}</a>
|
||||
</div>
|
||||
<div class="inputBox" style="margin-bottom:35px;">
|
||||
<input type="submit" v-model="submitValue">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class='loginBox' style="margin-top:30%; margin-bottom:50%;">
|
||||
<form class="form">
|
||||
<h1 style="color:rgb(239,60,168); font-family: sans-serif; text-align:center;">
|
||||
{{i18n("login.guest.welcome")}}
|
||||
</h1>
|
||||
<div v-if="page === 0">
|
||||
<div class="inputBox">
|
||||
<p>{{i18n("login.guest.surname")}}</p>
|
||||
<input type="text" v-model="outputs.surname">
|
||||
</div>
|
||||
<div class="inputBox">
|
||||
<p>{{i18n("login.guest.firstname")}}</p>
|
||||
<input type="text" v-model="outputs.firstname">
|
||||
</div>
|
||||
<div class="inputBox">
|
||||
<p>{{i18n("login.guest.birthday")}}</p>
|
||||
<input type="date" v-model="outputs.birthday">
|
||||
</div>
|
||||
<div class="inputBox">
|
||||
<p>{{i18n("login.guest.password")}}</p>
|
||||
<input type="password" v-model="outputs.password">
|
||||
</div>
|
||||
<div class="inputBox">
|
||||
<p>{{i18n("login.guest.confirm")}} {{i18n("login.guest.password")}}</p>
|
||||
<input type="password" v-model="passwordConfirm">
|
||||
</div>
|
||||
|
||||
<div class="switchpage">
|
||||
<button @click="verifyInputs(outputs.password);">{{i18n("login.guest.nextpage")}}</button>
|
||||
|
||||
</div>
|
||||
<div @click="(loginPage=!loginPage) && (page=0)" class="register">
|
||||
<a>{{i18n("login.guest.alregister")}}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="inputBox">
|
||||
<p>{{i18n("login.guest.email")}}</p>
|
||||
<input type="mail" v-model="outputs.email">
|
||||
</div>
|
||||
<div class="inputBox">
|
||||
<p>{{i18n("login.guest.address")}}</p>
|
||||
<input type="text" v-model="outputs.address">
|
||||
</div>
|
||||
<div class="inputBox">
|
||||
<p>{{i18n("login.guest.country")}}</p>
|
||||
<input type="text" v-model="outputs.country">
|
||||
</div>
|
||||
<form class="inputBox"novalidate enctype="multipart/form-data">
|
||||
<p>{{i18n("profile.picture").toUpperCase()}}</p>
|
||||
<label class="browser">
|
||||
Parcourir . . .
|
||||
<input type="file" :disabled="imageSaved" @change="ppData = uploadProfilePicture($event.target.files); imageSaved = true;" accept="image/*">
|
||||
</label>
|
||||
</form>
|
||||
<div class="inputBox">
|
||||
<p>{{i18n("Curriculum").toUpperCase()}}</p>
|
||||
<select v-model="outputs.curriculum">
|
||||
<option v-for="item in curricula">{{item.curriculumId}}</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div style="align-self:center;" class="inputBox">
|
||||
<button style="margin-top:25px;" @click="register(outputs.firstname, outputs.surname, outputs.birthday, outputs.password, outputs.email, outputs.address, outputs.country, outputs.curriculum, ppData);">
|
||||
{{i18n("login.guest.submit")}}
|
||||
</button>
|
||||
</div>
|
||||
<div class="switchpage">
|
||||
<button @click="page--">{{i18n("login.guest.lastpage")}}</button>
|
||||
</div>
|
||||
<div @click="(loginPage=!loginPage) && (page=0)" class="register">
|
||||
<a>{{i18n("login.guest.alregister")}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.setup {
|
||||
margin-left: auto;
|
||||
margin-right:auto;
|
||||
min-width:400px;
|
||||
|
||||
width:25%;
|
||||
height:60%;
|
||||
}
|
||||
|
||||
.loginBox {
|
||||
background-color: rgb(24,24,24);
|
||||
display:flex;
|
||||
justify-content: center;
|
||||
border-radius: 5%;
|
||||
box-shadow:0 5px 25px #000000;
|
||||
|
||||
}
|
||||
.form {
|
||||
position:relative;
|
||||
width:100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items:center;
|
||||
gap: 3%;
|
||||
}
|
||||
|
||||
|
||||
.inputBox input,button,select {
|
||||
|
||||
width:100%;
|
||||
border: none;
|
||||
margin-right: 12.5%;
|
||||
padding-left: 2.5%;
|
||||
padding-top:2.5%;
|
||||
padding-bottom:2.5%;
|
||||
outline:none;
|
||||
border-radius: 10px;
|
||||
font-size:1.35em;
|
||||
}
|
||||
|
||||
.inputBox p{
|
||||
position:relative;
|
||||
z-index: 100;
|
||||
font-family:sans-serif ;
|
||||
color:rgb(239,60,168);
|
||||
transition:0.5;
|
||||
|
||||
}
|
||||
|
||||
.register{
|
||||
color:rgb(239,60,168);
|
||||
width:70%;
|
||||
margin-bottom:20px;
|
||||
margin-top:20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.switchpage{
|
||||
width:100px;
|
||||
background:rgb(255, 0 255);
|
||||
border: none;
|
||||
padding-right:0;
|
||||
padding-top:10px;
|
||||
padding-bottom:10px;
|
||||
outline:none;
|
||||
border-radius: 4px;
|
||||
font-size:0.8em;
|
||||
align-self:right;
|
||||
|
||||
}
|
||||
|
||||
input[type=submit],button,select{
|
||||
margin-bottom:20px;
|
||||
background-color: rgb(239,60,168);
|
||||
cursor: pointer;
|
||||
padding:10px;
|
||||
font-size:1.35em;
|
||||
border:none;
|
||||
border-radius:20px;
|
||||
|
||||
}
|
||||
|
||||
input[type=file]{
|
||||
display:none;
|
||||
}
|
||||
|
||||
.browser{
|
||||
display:inline-block;
|
||||
cursor:pointer;
|
||||
border-radius:20px;
|
||||
background-color:rgb(239,60,168);
|
||||
padding:5%;
|
||||
font-size:1.35em;
|
||||
font-family:sans-serif;
|
||||
background:#FFFFFF;
|
||||
}
|
||||
|
||||
button:active ,.switchpage:active{
|
||||
opacity:0.8;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,291 @@
|
||||
<script setup>
|
||||
import i18n from "@/i18n.js"
|
||||
import {reactive , ref} from 'vue'
|
||||
import { getCourses,deleteCourse,alterCourse,createCourse } from "@/rest/courses.js"
|
||||
import {getUser, getSelf, getTeachers } from "@/rest/Users.js"
|
||||
|
||||
|
||||
const self = await getSelf();
|
||||
|
||||
const curriculum = ref(await getCourses(self.role));
|
||||
const profList = await getTeachers();
|
||||
|
||||
|
||||
const createMod = ref(false)
|
||||
const deleteMod = ref(false)
|
||||
|
||||
const editElementID = ref("")
|
||||
|
||||
function editItem(id){
|
||||
editElementID = id;
|
||||
}
|
||||
|
||||
//Juste pour montrer le Create Mode
|
||||
|
||||
const pattern = {
|
||||
"title":null,
|
||||
"credits":null,
|
||||
"owner":null,
|
||||
}
|
||||
|
||||
let toModify = Object.assign({},pattern);
|
||||
let toAdd = Object.assign({}, pattern);
|
||||
|
||||
async function addToCourse(){
|
||||
let isnull= false;
|
||||
|
||||
for(const [key, value] of Object.entries(toAdd)){
|
||||
console.log(toAdd.owner);
|
||||
if(value === null){
|
||||
isnull=true;
|
||||
}
|
||||
|
||||
}
|
||||
if (!isnull){
|
||||
await createCourse(toAdd.title,toAdd.credits,toAdd.owner);
|
||||
toAdd= Object.assign({},pattern);
|
||||
|
||||
curriculum.value = await getCourses(self.role);
|
||||
|
||||
|
||||
}}
|
||||
|
||||
function setModify(item){
|
||||
for(const el in profList){
|
||||
|
||||
if(profList[el].regNo === item.owner.regNo){
|
||||
toModify.owner= profList[el];
|
||||
}
|
||||
}
|
||||
toModify.credits= item.credits;
|
||||
toModify.title= item.title;
|
||||
}
|
||||
|
||||
|
||||
async function patchCourse(course){
|
||||
for (let element in toModify){
|
||||
console.log(toModify,1)
|
||||
console.log(toModify[element],2)
|
||||
|
||||
if (element =="owner" && (toModify[element].regNo != course.owner.regNo)){
|
||||
await alterCourse(course.courseId,{owner:toModify[element].regNo});
|
||||
}
|
||||
else if(element == "title" && (toModify[element] != course.title)){
|
||||
await alterCourse(course.courseId,{title:toModify[element]});
|
||||
}
|
||||
else if(element == "credits" && (parseInt(toModify[element]) != course.credits)){
|
||||
await alterCourse(course.courseId,{credits:parseInt(toModify[element])});
|
||||
}
|
||||
}
|
||||
toModify= Object.assign({},pattern);
|
||||
|
||||
curriculum.value = await getCourses(self.role);
|
||||
|
||||
|
||||
}
|
||||
//Juste pour montrer le Delete Mode
|
||||
let toRemove = null;
|
||||
|
||||
async function removeCourse(course) {
|
||||
|
||||
await deleteCourse(course.courseId)
|
||||
curriculum.value = await getCourses(self.role);
|
||||
toRemove = null;
|
||||
}
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<div class="body">
|
||||
<div v-if="!deleteMod && !createMod && (self.role !== 'Teacher')" class="listTitle buttonGrid">
|
||||
<button class="create" @click="editElementID= '';createMod = true;">
|
||||
{{i18n("courses.createCourse")}}
|
||||
</button>
|
||||
<button class="delete" @click="deleteMod=true" >
|
||||
{{i18n("courses.deleteCourse")}}
|
||||
</button>
|
||||
</div>
|
||||
<div v-if="createMod">
|
||||
<form class="listElement" style="width:40%;margin-right:auto;margin-left:auto;">
|
||||
|
||||
<div style="margin-bottom:20px;">
|
||||
{{i18n("name")}} :
|
||||
<input v-model="toAdd.title">
|
||||
</div>
|
||||
<div style="margin-bottom:20px;">
|
||||
{{i18n("Teacher")}} :
|
||||
<select style="max-width:200px;" class="teacher" v-model="toAdd.owner">
|
||||
<option v-for="item in profList" :value="item">{{item.lastName}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div style="margin-bottom:20px;">
|
||||
{{i18n("Credits")}} :
|
||||
<input v-model="toAdd.credits">
|
||||
</div>
|
||||
<button class="create" @click="createMod=!createMod; addToCourse();"> {{i18n("courses.confirm")}} </button>
|
||||
<button style="float:right;" @click="createMod=!createMod">{{i18n("courses.back")}}</button>
|
||||
</form>
|
||||
</div>
|
||||
<div v-if="deleteMod">
|
||||
<form class="listElement" style="width:40%;margin-right:auto;margin-left:auto;">
|
||||
<div style="margin-bottom:20px;">
|
||||
{{i18n("courses.toDelete")}} :
|
||||
<select style="max-width:200px;" class="teacher" v-model="toRemove">
|
||||
<option v-for="item in curriculum" :value='item'>{{item.title}}</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<button class="delete" @click="deleteMod=!deleteMod; removeCourse(toRemove);"> {{i18n("courses.deleteCourse")}} </button>
|
||||
<button style="float:right;" @click="deleteMod=!deleteMod"> {{i18n("courses.back")}}</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div v-if="!createMod && !deleteMod" v-for="item in curriculum" :key="item.title" style="width:50%;margin-left:auto; margin-right:auto;">
|
||||
<div v-if="editElementID !== item.title" style ="padding:15px 15px 15px 15px;">
|
||||
<button @click="editElementID = item.title; setModify(item); ">
|
||||
{{i18n("courses.modify")}}
|
||||
</button>
|
||||
</div>
|
||||
<div v-else>
|
||||
<button @click="editElementID= '';patchCourse(item)"> {{i18n("courses.confirm")}} </button>
|
||||
<button @click="editElementID= '';"> {{i18n("courses.back")}} </button>
|
||||
</div>
|
||||
<div class="listElement" >
|
||||
|
||||
<div class="containerElement" v-if="editElementID !== item.title" >
|
||||
|
||||
<div class="name"> {{item.title}} </div>
|
||||
<div class="teacher">{{item.owner.lastName}}</div>
|
||||
<div class="credits">{{i18n("Credits")}}:{{item.credits}}</div>
|
||||
</div>
|
||||
<div class="containerElement"v-else>
|
||||
<input style="max-width:200px;" class="name" v-model="toModify.title">
|
||||
<select v-if="self.role === 'Secretary'" style="max-width:200px;" class="teacher" v-model="toModify.owner">
|
||||
<option v-for="(item,index) in profList" :value='item'>{{item.lastName}}</option>
|
||||
</select>
|
||||
<div v-else class="teacher">{{item.owner.lastName}}</div>
|
||||
<input v-if="self.role==='Secretary'"style="max-width:100px;"class="credits" v-model="toModify.credits">
|
||||
<div v-else class="credits">{{i18n("Credits")}}:{{item.credits}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.body {
|
||||
width:100%;
|
||||
margin-top:3.5%;
|
||||
}
|
||||
|
||||
.infosContainer {
|
||||
min-width:350px;
|
||||
padding-bottom:50px;
|
||||
border:2px solid black;
|
||||
font-size:25px;
|
||||
color:white;
|
||||
padding:20px;
|
||||
background-color:rgb(50,50,50);
|
||||
border-radius:20px;
|
||||
}
|
||||
|
||||
.containerElement{
|
||||
justify-content:center;
|
||||
display:grid;
|
||||
grid-template-columns:38.8% 38.8% 22.4%;
|
||||
grid-template-areas:
|
||||
"name teacher credits";
|
||||
column-gap:10px; }
|
||||
|
||||
.name {
|
||||
grid-area:name;
|
||||
align-self:center;
|
||||
}
|
||||
|
||||
.teacher{
|
||||
grid-area:teacher;
|
||||
align-self:center;
|
||||
}
|
||||
|
||||
.credits{
|
||||
grid-area:credits;
|
||||
align-self:center;
|
||||
}
|
||||
|
||||
.listElement{
|
||||
min-width:625px;
|
||||
border:2px solid black;
|
||||
font-size:25px;
|
||||
color:white;
|
||||
padding:20px;
|
||||
background-color:rgb(50,50,50);
|
||||
border-radius:20px;
|
||||
margin-bottom:10px;
|
||||
|
||||
}
|
||||
|
||||
.modify{
|
||||
font-size:25px;
|
||||
padding:10px 10px 10px 10px;
|
||||
background-color: rgb(239,60,168);
|
||||
cursor: pointer;
|
||||
border:none;
|
||||
border-radius:15px;
|
||||
}
|
||||
|
||||
input, select{
|
||||
padding:10px 10px 10px 10px;
|
||||
font-size:25px;
|
||||
cursor: pointer;
|
||||
border:none;
|
||||
border-radius:15px;
|
||||
}
|
||||
button{
|
||||
font-size:15px;
|
||||
height:50px;
|
||||
width:100px;
|
||||
border:none;
|
||||
border-radius:20px;
|
||||
|
||||
}
|
||||
|
||||
.buttonGrid{
|
||||
display:grid;
|
||||
grid-template-columns: auto auto;
|
||||
column-gap:50px;
|
||||
grid-template-areas:
|
||||
"create delete";
|
||||
}
|
||||
|
||||
.create{
|
||||
grid-area:create;
|
||||
|
||||
background-color:rgb(0,200,0);
|
||||
|
||||
}
|
||||
|
||||
.delete{
|
||||
grid-area:delete;
|
||||
background-color:rgb(200,0,0);
|
||||
}
|
||||
|
||||
.listTitle{
|
||||
min-width:380px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width:25%;
|
||||
margin-left:auto;
|
||||
margin-right:auto;
|
||||
border:2px solid black;
|
||||
font-size:25px;
|
||||
color:white;
|
||||
padding:20px;
|
||||
background-color:rgb(50,50,50);
|
||||
border-radius:20px;
|
||||
margin-bottom:10px;
|
||||
|
||||
button:hover{
|
||||
opacity:0.8;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,329 @@
|
||||
<script setup>
|
||||
import {reactive, ref } from 'vue'
|
||||
import {getSelf,alterSelf,disconnect,deleteUser} from '../rest/Users.js'
|
||||
import {getSelfCurriculum, getAllCurriculums} from '../rest/curriculum.js'
|
||||
import {getCourses} from "../rest/courses.js"
|
||||
import i18n from "@/i18n.js"
|
||||
import { uploadProfilePicture } from '@/rest/uploads.js'
|
||||
|
||||
const user = ref(await getSelf());
|
||||
const UserCurriculum = ref("");
|
||||
const curricula = ref (await getAllCurriculums());
|
||||
if(user.value.role === "Student"){
|
||||
UserCurriculum.value = await getSelfCurriculum();
|
||||
}
|
||||
|
||||
if(user.role === "Teacher"){
|
||||
UserCurriculum.value = await getCourses("Teacher");
|
||||
}
|
||||
const modif = ref(false);
|
||||
const curric = ref(false);
|
||||
const reg = ref(false);
|
||||
|
||||
const pattern = {
|
||||
profilPictureUrl:null,
|
||||
email:null,
|
||||
address:null,
|
||||
password:null,
|
||||
};
|
||||
|
||||
const patternInfos ={
|
||||
email: null,
|
||||
password: null,
|
||||
passwordConfirm:null,
|
||||
id:null,
|
||||
}
|
||||
|
||||
|
||||
let toModify= Object.assign({}, pattern);
|
||||
let personnalInfos = Object.assign({}, patternInfos);
|
||||
|
||||
function resetInputs(inputs,list){
|
||||
inputs=Object.assign({},list);
|
||||
}
|
||||
|
||||
async function ChangeInfos(){
|
||||
for (let element in toModify){
|
||||
if (element =="email" && (toModify[element] !== null)){
|
||||
await alterSelf(user.value.regNo,{email : toModify[element]});
|
||||
}
|
||||
|
||||
if (element =="profilPictureUrl" && (toModify[element] !== null)){
|
||||
await alterSelf(user.value.regNo,{ profilPictureUrl : toModify[element]});
|
||||
}
|
||||
else if(element == "address" && (toModify[element] !== null)){
|
||||
await alterSelf(user.value.regNo,{address : toModify[element]});
|
||||
}
|
||||
else if(element == "password" && (toModify[element] !== null)){
|
||||
await alterSelf(user.value.regNo,{password : toModify[element]});
|
||||
}
|
||||
}
|
||||
toModify= Object.assign({},pattern);
|
||||
user.value = await getSelf()
|
||||
|
||||
}
|
||||
|
||||
function setModify(item){
|
||||
toModify.address = item.address;
|
||||
toModify.profilPictureUrl = item.profilPictureUrl;
|
||||
toModify.email= item.email;
|
||||
toModify.password= item.password;
|
||||
}
|
||||
|
||||
|
||||
async function unRegister(){
|
||||
deleteUser(user.value.regNo);
|
||||
disconnect()
|
||||
setTimeout(() => {
|
||||
window.location.href="#/home";
|
||||
}, "500");
|
||||
|
||||
}
|
||||
|
||||
function getPP(){
|
||||
if(user.value.profilePictureUrl === null){
|
||||
return "/Clyde.png"
|
||||
}
|
||||
return user.profilePictureUrl
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="body">
|
||||
<div class="container">
|
||||
<div class="profilPic">
|
||||
<img class="subContainter" :src=getPP()>
|
||||
|
||||
</div>
|
||||
<div class="globalInfos">
|
||||
<div v-if="modif==false && curric==false && reg==false " class="infosContainer" >
|
||||
<div>
|
||||
{{user.firstName}} {{user.lastName}}
|
||||
</div>
|
||||
<div>
|
||||
E-mail: {{user.email}}
|
||||
</div>
|
||||
<div v-if="user.role==='Student'">
|
||||
{{user.option}} {{i18n(user.role)}}
|
||||
</div>
|
||||
<div v-else>
|
||||
Role: {{i18n((user.role))}}
|
||||
</div>
|
||||
<div>
|
||||
<button @click="modif=!modif; setModify(user)"> {{i18n("profile.modify.data")}} </button>
|
||||
</div>
|
||||
<div v-if="(user.role==='Student')">
|
||||
<button @click="reg=!reg">{{i18n("profile.reRegister")}}</button>
|
||||
<button @click="unRegister()" style="float:right;background-color:rgb(150,0,0);">{{i18n("profile.unRegister")}}</button>
|
||||
</div>
|
||||
<div v-if="(user.role==='Student')">
|
||||
<button @click="curric=!curric">{{i18n("profile.change.curriculum")}}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="modif" class="infosContainer">
|
||||
<div>
|
||||
{{i18n("profile.picture")}}:
|
||||
<input type="file" @change="user.profilPicture = uploadProfilePicture($event.target.files);" accept="image/*">
|
||||
</div>
|
||||
<div>
|
||||
E-mail:
|
||||
<input type="mail" v-model="toModify.email" />
|
||||
</div>
|
||||
<div>
|
||||
{{i18n("profile.address")}}:
|
||||
<input type="text" v-model="toModify.id">
|
||||
</div>
|
||||
<div>
|
||||
{{i18n("login.password")}}:
|
||||
<input type="password" v-model="toModify.password">
|
||||
</div>
|
||||
<div>
|
||||
{{i18n("login.cPassword")}}:
|
||||
<input type="password" v-model="toModify.passwordConfirm">
|
||||
</div>
|
||||
<div>
|
||||
<button @click=" modif=!modif; ChangeInfos();">{{i18n("courses.confirm")}}</button>
|
||||
<button @click="modif=!modif; resetInputs(toModify,pattern);" style="float:right;">{{i18n("courses.back")}}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="curric" class="infosContainer">
|
||||
<div style="height:40px;">
|
||||
{{i18n("Curriculum")}}:
|
||||
<select v-model="curriculum" >
|
||||
<option v-for="item in curricula" style="font-size:20px;" :value="item">{{item.option}}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button @click=" curric=!curric;">{{i18n("courses.confirm")}}</button>
|
||||
<button @click="curric=!curric; resetInputs(personnalInfos,patternInfos);" style="float:right;">{{i18n("courses.back")}}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="reg" class="infosContainer">
|
||||
<div>
|
||||
E-mail:
|
||||
<input type="mail" v-model="toModify.email" />
|
||||
</div>
|
||||
<div>
|
||||
ID :
|
||||
<input type="text" v-model="toModify.id">
|
||||
</div>
|
||||
<div>
|
||||
{{i18n("login.password")}}:
|
||||
<input type="password" v-model="toModify.password">
|
||||
</div>
|
||||
<div>
|
||||
{{i18n("login.cPassword")}}:
|
||||
<input type="password" id="confirm">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button @click=" reg=!reg;">{{i18n("courses.confirm")}}</button>
|
||||
<button @click=" reg=!reg; resetInputs(personnalInfos,patternInfos);" style="float:right;">{{i18n("courses.back")}}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div v-if="modif==false && curric==false && reg==false "class="moreInfos">
|
||||
|
||||
<div v-if="(user.role ==='Student')">
|
||||
<div class="listTitle">
|
||||
{{i18n("profile.course.list")}}
|
||||
</div>
|
||||
<div class="listElement" v-for="item in UserCurriculum.courses">
|
||||
<div class=" containerElement">
|
||||
<div class="name"> {{item.title}} </div>
|
||||
<div class="teacher">{{item.owner.lastName}}</div>
|
||||
<div class="credits">Credits:{{item.credits}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
|
||||
.container{
|
||||
min-width:675px;
|
||||
display:grid;
|
||||
grid-template-columns:10vw 50vw;
|
||||
grid-template-rows:200px auto;
|
||||
column-gap:2.7%;
|
||||
row-gap:45px;
|
||||
grid-template-areas:
|
||||
"profilPic globalInfos"
|
||||
"minfos minfos";
|
||||
}
|
||||
|
||||
.profilPic{
|
||||
width:100%;
|
||||
grid-area:profilPic;
|
||||
}
|
||||
|
||||
.globalInfos {
|
||||
grid-area:globalInfos;
|
||||
align-self :center;
|
||||
|
||||
}
|
||||
|
||||
.subContainter{
|
||||
width:100%;
|
||||
background-color:rgb(50,50,50);
|
||||
border-radius:20px;
|
||||
border:4px solid black;
|
||||
}
|
||||
|
||||
.moreInfos {
|
||||
grid-area:minfos;
|
||||
}
|
||||
.body {
|
||||
min-width:960px;
|
||||
width:100%;
|
||||
display:flex;
|
||||
align-items:center;
|
||||
justify-content:center;
|
||||
margin-top:5%;
|
||||
}
|
||||
.containerElement{
|
||||
justify-content:center;
|
||||
display:grid;
|
||||
grid-template-columns:38.8% 38.8% 22.4%;
|
||||
grid-template-areas:
|
||||
"name teacher credits";
|
||||
column-gap:10px;
|
||||
|
||||
}
|
||||
|
||||
.name {
|
||||
grid-area:name;
|
||||
align-self:center;
|
||||
}
|
||||
|
||||
.teacher{
|
||||
grid-area:teacher;
|
||||
align-self:center;
|
||||
}
|
||||
|
||||
.credits{
|
||||
grid-area:credits;
|
||||
align-self:center;
|
||||
}
|
||||
|
||||
.listTitle{
|
||||
min-width:197px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width:8vw;
|
||||
margin-left:auto;
|
||||
margin-right:auto;
|
||||
border:2px solid black;
|
||||
font-size:25px;
|
||||
color:white;
|
||||
padding:20px;
|
||||
background-color:rgb(50,50,50);
|
||||
border-radius:20px;margin-bottom:10px;
|
||||
}
|
||||
|
||||
.listElement{
|
||||
min-width:625px;
|
||||
border:2px solid black;
|
||||
font-size:25px;
|
||||
color:white;
|
||||
padding:20px;
|
||||
background-color:rgb(50,50,50);
|
||||
border-radius:20px;
|
||||
margin-bottom:10px;
|
||||
}
|
||||
|
||||
.infosContainer {
|
||||
min-width:350px;
|
||||
padding-bottom:50px;
|
||||
border:2px solid black;
|
||||
font-size:25px;
|
||||
color:white;
|
||||
padding:20px;
|
||||
background-color:rgb(50,50,50);
|
||||
border-radius:20px;
|
||||
}
|
||||
|
||||
|
||||
button{
|
||||
border:none;
|
||||
background-color:rgb(239, 60, 168);
|
||||
border-radius:10px;
|
||||
height:35px;
|
||||
margin-top:10px;
|
||||
|
||||
}
|
||||
|
||||
button:hover{
|
||||
opacity:0.8;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,211 @@
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
|
||||
const schedule = [
|
||||
{course:"Math Pour L'info",
|
||||
start:"Wed Mar 27 2024 10:15 GMT+0100",
|
||||
end:"Wed Mar 27 2024 12:15 GMT+0100"},
|
||||
{
|
||||
course:"Calculus",
|
||||
start:"Wed Mar 27 2024 08:00 GMT+0100",
|
||||
end:"Wed Mar 27 2024 10:00 GMT+0100"
|
||||
|
||||
},
|
||||
{
|
||||
course:"Physique II",
|
||||
start:"Tue Mar 26 2024 10:15 GMT+0100",
|
||||
end:"Tue Mar 26 2024 12:15 GMT+0100"
|
||||
},
|
||||
{
|
||||
course:"Math Pour L'info",
|
||||
start:"Thu Mar 28 2024 10:15 GMT+0100",
|
||||
end:"Thu Mar 28 2024 12:15 GMT+0100"
|
||||
}]
|
||||
function formatDate(date) {
|
||||
var d = new Date(date),
|
||||
month = '' + (d.getMonth() + 1),
|
||||
day = '' + d.getDate(),
|
||||
year = d.getFullYear();
|
||||
|
||||
if (month.length < 2)
|
||||
month = '0' + month;
|
||||
if (day.length < 2)
|
||||
day = '0' + day;
|
||||
|
||||
return [day, month, year].join('-');
|
||||
}
|
||||
function getMonday(d) {
|
||||
d = new Date(d);
|
||||
var day = d.getDay(),
|
||||
diff = d.getDate() - day + (day == 0 ? -6 : 1);
|
||||
return new Date(d.setDate(diff));
|
||||
}
|
||||
|
||||
function getAnyDays(d){
|
||||
|
||||
var day = new Date(mondayOfWeek.value);
|
||||
day.setDate(day.getDate() + d );
|
||||
|
||||
return day;
|
||||
}
|
||||
|
||||
const mondayOfWeek=ref(getMonday(new Date(schedule[1].start)))
|
||||
|
||||
function isNotCourse(element){
|
||||
return element==null;
|
||||
}
|
||||
|
||||
function durationCourse(element){
|
||||
const hour = element.end.substring(3,5) -element.start.substring(3,5);
|
||||
|
||||
|
||||
return (element.end - element.start)%2;
|
||||
}
|
||||
function sortByDate(a, b) {
|
||||
const nameA = a.start; // ignore upper and lowercase
|
||||
const nameB = b.start; // ignore upper and lowercase
|
||||
|
||||
if (nameA < nameB) {
|
||||
return -1;
|
||||
}
|
||||
if (nameA > nameB) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
function transpose(a) {
|
||||
const trans = [[],[],[],[],[],[]];
|
||||
for(let i = 0; i < 6;i++){
|
||||
for(let j=0; j< 7; j++){
|
||||
if(a[j][i] !== null){
|
||||
trans[i].push(a[j][i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return trans;
|
||||
}
|
||||
|
||||
function matrixFromList(list){
|
||||
const matrix = [[],[],[],[],[],[],[]];
|
||||
for(let key in list){
|
||||
const temp = [];
|
||||
const day = new Date(list[key].start);
|
||||
matrix[day.getDay()].push(list[key]);
|
||||
matrix[day.getDay()].sort((a,b) => sortByDate(a,b));
|
||||
}
|
||||
return matrix;
|
||||
}
|
||||
|
||||
|
||||
const schedule2 = matrixFromList(schedule);
|
||||
const scheduleByWeek = transpose(schedule2);
|
||||
|
||||
console.log(scheduleByWeek)
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<div class="grid">
|
||||
<div class="options" >
|
||||
</div>
|
||||
<div class="schedule">
|
||||
<table class="table">
|
||||
<tr style="background-color:rgb(24,24,24)">
|
||||
<th/>
|
||||
<th class="header">Lundi {{formatDate(getAnyDays(0))}}</th>
|
||||
<th class="header">Mardi {{formatDate(getAnyDays(1))}}</th>
|
||||
<th class="header">Mercredi {{formatDate(getAnyDays(2))}}</th>
|
||||
<th class="header">Jeudi {{formatDate(getAnyDays(3))}}</th>
|
||||
<th class="header">Vendredi {{formatDate(getAnyDays(4))}}</th>
|
||||
<th class="header">Samedi {{formatDate(getAnyDays(5))}}</th>
|
||||
<th class="header">Dimanche {{formatDate(getAnyDays(6))}}</th>
|
||||
</tr>
|
||||
<tr v-for="(n,index) in 12">
|
||||
<th class="hour">{{8 + index}}:00-{{9+index}}:00</th>
|
||||
<td v-for="m in 7"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="courseGrid">
|
||||
<div v-for="i in 7">
|
||||
Test
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
.grid{
|
||||
display:grid;
|
||||
margin-top:2%;
|
||||
align-items:center;
|
||||
justify-content:center;
|
||||
grid-template-columns:15vw 70vw;
|
||||
column-gap:2.5vw;
|
||||
|
||||
grid-template-areas:"options schedule";
|
||||
}
|
||||
.schedule{
|
||||
position:relative;
|
||||
border-radius:20px;
|
||||
grid-area:schedule;
|
||||
width:100%;
|
||||
height:85vh;
|
||||
background-color:rgba(255,255,255,0.1);
|
||||
}
|
||||
.options{
|
||||
border-radius:20px;
|
||||
grid-area:options;
|
||||
background-color:rgba(255,255,255,0.1);
|
||||
width:100%;
|
||||
height:85vh;
|
||||
}
|
||||
|
||||
.table{
|
||||
width:100%;
|
||||
height:100%;
|
||||
border-spacing:0;
|
||||
border-collapse:separate;
|
||||
border-radius: 20px;
|
||||
border: 2px solid black
|
||||
}
|
||||
|
||||
.hour{
|
||||
background-color:rgb(72,72,72)
|
||||
|
||||
}
|
||||
|
||||
.header{
|
||||
align-items:center;
|
||||
width:12.5%;
|
||||
color:#FFFFFF;
|
||||
}
|
||||
table th:not(:last-child),
|
||||
table td:not(:last-child) {
|
||||
border-right: 1px solid black;
|
||||
}
|
||||
|
||||
table tr:not(:last-child)>td,
|
||||
table tr:not(:last-child)>th
|
||||
{
|
||||
border-bottom:1px solid black;
|
||||
}
|
||||
|
||||
.courseGrid{
|
||||
top:13.75%;
|
||||
left:12.5%;
|
||||
position:absolute;
|
||||
width:87.5%;
|
||||
height:86.25%;
|
||||
display:grid;
|
||||
grid-template-columns:repeat(7,1fr);
|
||||
}
|
||||
|
||||
|
||||
.course{
|
||||
width:100%;
|
||||
height:100%;
|
||||
background-color:rgb(100,0,100);
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,84 @@
|
||||
<script setup>
|
||||
import i18n from "@/i18n.js"
|
||||
import { reactive } from 'vue'
|
||||
import { getStudents } from '../rest/Users.js'
|
||||
|
||||
const users = await getStudents();
|
||||
</script>
|
||||
<template style="margin-top:5%;">
|
||||
<div style="display:flex; justify-content:center; " v-for="item in users">
|
||||
<div class="bodu">
|
||||
<div class="container">
|
||||
<div class="status"><a style="margin-left:30px">{{item.status}}</a></div>
|
||||
<div class="option"><a>{{item.role}}</a></div>
|
||||
<div class="surname"><a>{{item.lastName}}</a></div>
|
||||
<div class="firstname"><a>{{item.firstName}}</a></div>
|
||||
<div class="infos"><button style="background-color:rgb(105,05,105);" >{{i18n("request.moreInfos")}} </button></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.container{
|
||||
color:white;
|
||||
height:100px;
|
||||
font-size:30px;
|
||||
display:grid;
|
||||
grid-template-columns:21.7% 21.7% 21.7% 21.7% 13.1%;
|
||||
grid-template-areas:
|
||||
"status option surname firstname infos";
|
||||
|
||||
}
|
||||
|
||||
.infos {
|
||||
grid-area:infos;
|
||||
align-self:center;
|
||||
}
|
||||
|
||||
.option{
|
||||
grid-area:option;
|
||||
align-self:center;
|
||||
}
|
||||
|
||||
.status{
|
||||
grid-area:status;
|
||||
align-self:center;
|
||||
}
|
||||
|
||||
.surname{
|
||||
grid-area:surname;
|
||||
align-self:center;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow:ellipsis;
|
||||
}
|
||||
|
||||
.firstname{
|
||||
grid-area:firstname;
|
||||
align-self:center;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow:ellipsis;
|
||||
}
|
||||
|
||||
button{
|
||||
font-size:15px;
|
||||
height:50px;
|
||||
width:75%;
|
||||
border:none;
|
||||
border-radius:20px;
|
||||
|
||||
}
|
||||
|
||||
.bodu {
|
||||
margin-top:2%;
|
||||
width:66%;
|
||||
border:2px solid black;
|
||||
border-radius:9px;
|
||||
background-color:rgb(50,50,50);
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
|
||||
<script setup>
|
||||
import i18n from "@/i18n.js"
|
||||
import { reactive } from 'vue'
|
||||
import { getAllUsers } from '../rest/Users.js'
|
||||
|
||||
const users = await getAllUsers();
|
||||
|
||||
</script>
|
||||
<template style="margin-top:5%;">
|
||||
<div style="display:flex; justify-content:center; min-width:1140px;" v-for="item in users">
|
||||
<div class="bodu">
|
||||
<div class="container">
|
||||
<div class="role"><a style="margin-left:30px">{{i18n(item.role)}}</a></div>
|
||||
<div class="surname"><a>{{item.lastName}}</a></div>
|
||||
<div class="firstname"><a>{{item.firstName}}</a></div>
|
||||
<div class="infos"><button style="background-color:rgb(105,05,105);" >{{i18n("request.moreInfos")}} </button></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.container{
|
||||
color:white;
|
||||
height:100px;
|
||||
font-size:30px;
|
||||
display:grid;
|
||||
grid-template-columns:27.7% 27.7% 27.7% 16.9%;
|
||||
grid-template-areas:
|
||||
"role surname firstname infos";
|
||||
|
||||
}
|
||||
|
||||
.infos {
|
||||
|
||||
grid-area:infos;
|
||||
align-self:center;
|
||||
}
|
||||
|
||||
.role {
|
||||
grid-area:role;
|
||||
align-self:center;
|
||||
}
|
||||
|
||||
.surname{
|
||||
grid-area:surname;
|
||||
align-self:center;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow:ellipsis;
|
||||
|
||||
}
|
||||
|
||||
.firstname{
|
||||
grid-area:firstname;
|
||||
align-self:center;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow:ellipsis;
|
||||
|
||||
}
|
||||
|
||||
button{
|
||||
font-size:15px;
|
||||
height:50px;
|
||||
width:75%;
|
||||
border:none;
|
||||
border-radius:20px;
|
||||
|
||||
}
|
||||
|
||||
.bodu {
|
||||
margin-top:2%;
|
||||
width:66%;
|
||||
border:2px solid black;
|
||||
border-radius:9px;
|
||||
background-color:rgb(50,50,50);
|
||||
}
|
||||
</style>
|
||||
|
||||
Loaded 100 of 119 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user