Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa364b57e8 | ||
|
|
ea973d0de4 | ||
|
|
1a1b64cbb2 | ||
|
|
09c7e11dbc | ||
|
|
3450a56756 | ||
|
|
f37f4466ae | ||
|
|
451834b219 | ||
|
|
91924353e2 | ||
|
|
67cf94fc95 | ||
|
|
36a343c09f | ||
|
|
4a37aebbf1 | ||
|
|
d5fa9f8d72 | ||
|
|
08c244334b | ||
|
|
23dd1c2726 | ||
|
|
23a309d394 | ||
|
|
3c1bb4e145 | ||
|
|
87b320a3e3 | ||
|
|
e4fb9615c7 | ||
|
|
efad4de0af | ||
|
|
04f62700a2 | ||
|
|
08415f7931 | ||
|
|
8bc86af3c8 | ||
|
|
fa2c5e42dc | ||
|
|
e3d3952b81 | ||
|
|
a9171addde | ||
|
|
440ac087ad | ||
|
|
9dd5eb4eeb | ||
|
|
26c2c9abc9 | ||
|
|
663b07c07e | ||
|
|
5add6a0e73 | ||
|
|
5c4912feb4 | ||
|
|
75e115f390 | ||
|
|
8e443d23f4 | ||
|
|
c43c9c319b | ||
|
|
e32b128b0f | ||
|
|
5287421cea | ||
|
|
9bc95ef350 | ||
|
|
028de6addb | ||
|
|
a107605937 | ||
|
|
cec5d0147b | ||
|
|
e46b879fc4 | ||
|
|
b6764fbb29 | ||
|
|
e8899cc314 | ||
|
|
2b2054dd6b | ||
|
|
92705b0ae2 | ||
|
|
2ae8a36b7f | ||
|
|
899139dda1 | ||
|
|
b6b571e84b | ||
|
|
9e098fa997 | ||
|
|
13d00f954f | ||
|
|
fee75d0c8a | ||
|
|
abae3f14cd | ||
|
|
b8a98e2c6e | ||
|
|
d990572b5b | ||
|
|
2d37d392bc | ||
|
|
59015fc3bb | ||
|
|
c3be68f988 | ||
|
|
8610784958 | ||
|
|
f01d71c34a | ||
|
|
a06501e4b1 | ||
|
|
7c2c30fa1b | ||
|
|
903dc714f2 | ||
|
|
b1bd2c8805 | ||
|
|
0e4b4f6d8c | ||
|
|
d8d0eaf247 | ||
|
|
90096faef3 | ||
|
|
f794f75394 | ||
|
|
8de63e486c | ||
|
|
4308efca47 | ||
|
|
877fa292d6 | ||
|
|
df6ea6f497 | ||
|
|
5e9be391e1 | ||
|
|
49960b8234 | ||
|
|
d669dbe54b | ||
|
|
2d1859ac0c | ||
|
|
dc864055a3 | ||
|
|
bad9537aba | ||
|
|
303b1adc0a | ||
|
|
c582904d41 | ||
|
|
65eabf6153 | ||
|
|
cc9c9e2253 | ||
|
|
8747ae9564 | ||
|
|
9253e54958 | ||
|
|
fb774f2caa | ||
|
|
ba120024a6 | ||
|
|
1fe0e69914 | ||
|
|
0fe04e411c | ||
|
|
35074f959f | ||
|
|
0d698fbaf1 | ||
|
|
c9e2a52327 | ||
|
|
a58e06109b | ||
|
|
65375e4836 | ||
|
|
edc517d33f | ||
|
|
354c82dc34 | ||
|
|
fe2acd0665 | ||
|
|
19b5b1a90c | ||
|
|
e7281e2118 | ||
|
|
10f334cf15 | ||
|
|
a057fd6458 | ||
|
|
3bafabeb0a | ||
|
|
edefbe17da | ||
|
|
a65041ffcd | ||
|
|
0962c60844 | ||
|
|
3d72eceac0 | ||
|
|
57b5deff5b | ||
|
|
1163dee352 | ||
|
|
f7fe562bba | ||
|
|
3394f98a8a | ||
|
|
a575b35286 | ||
|
|
0f41e79e98 | ||
|
|
24bf22a31f | ||
|
|
05a1b8802e | ||
|
|
9c409d9507 | ||
|
|
4ee7161c36 | ||
|
|
4cd9ce0ff7 | ||
|
|
a2d0dfd8b2 | ||
|
|
d4164fe0ba | ||
|
|
6bbecdd7c0 | ||
|
|
0784c3ae05 | ||
|
|
679757ccfa | ||
|
|
63a4e693e3 | ||
|
|
b21041d9e0 | ||
|
|
f014bb4587 | ||
|
|
9030f7c4ce | ||
|
|
bde6c38bd4 | ||
|
|
0aefb6c6ec | ||
|
|
da650ccdef | ||
|
|
92d3e70c1f | ||
|
|
cb5dfaf066 | ||
|
|
cd75e5e4cc | ||
|
|
7bd6ab5ec0 | ||
|
|
92f9c89cf1 | ||
|
|
eb2632b23a | ||
|
|
8c90bc6808 | ||
|
|
66146532e1 | ||
|
|
dbf3a41c1d | ||
|
|
942bbf9c6c | ||
|
|
a9d7cc527c | ||
|
|
2d362722ed | ||
|
|
f81638e625 | ||
|
|
8ae77df0ff | ||
|
|
110bd0e5f7 | ||
|
|
1b3a366cb7 | ||
|
|
3b5d9a145f | ||
|
|
fc37fc067a | ||
|
|
bb18a28484 | ||
|
|
86ca08b9aa | ||
|
|
9522df7835 | ||
|
|
55e0fd0226 | ||
|
|
ff9a986a2e | ||
|
|
df31fe2a8b | ||
|
|
1aeaf996bc | ||
|
|
cb0e59e91a | ||
|
|
5f02f49e9d | ||
|
|
ce9f91fe2c | ||
|
|
ac37745721 | ||
|
|
e44aeefda8 | ||
|
|
dbff2b659a | ||
|
|
52ef8e8b76 | ||
|
|
b71567c754 | ||
|
|
d1670c743f | ||
|
|
009b38f471 | ||
|
|
0cf5f30c0d | ||
|
|
cd4e1f179d | ||
|
|
b89f9d6b35 | ||
|
|
c3ece96390 | ||
|
|
770739b44e | ||
|
|
84984c2cde | ||
|
|
86393c8674 | ||
|
|
d4aed3bc45 | ||
|
|
818cd77450 | ||
|
|
dc26c70400 | ||
|
|
6547d713ea | ||
|
|
e8dcb0c242 | ||
|
|
100d0be513 | ||
|
|
fc8db2d977 | ||
|
|
e5d98d7889 | ||
|
|
c7b1a05ed3 | ||
|
|
649a90bd5e | ||
|
|
0fc880cf21 | ||
|
|
0d82a4c2c6 | ||
|
|
fb3aa59683 | ||
|
|
b938792ca8 | ||
|
|
bb74946d54 | ||
|
|
3e78105509 | ||
|
|
c6adf0ac89 | ||
|
|
219b4dca94 | ||
|
|
acec292b0f | ||
|
|
7ba86cbd23 | ||
|
|
3002eaf479 | ||
|
|
15422ca504 | ||
|
|
7067f00bee | ||
|
|
a0616eb251 | ||
|
|
5d4da0e4c7 | ||
|
|
546e3475fb | ||
|
|
56c44ebb58 | ||
|
|
bd03bc730c | ||
|
|
e0e1e58104 | ||
|
|
940de662b6 | ||
|
|
d151c1192b | ||
|
|
15ae10579c |
No files matched your search
@@ -2,12 +2,18 @@
|
||||
example.ts
|
||||
.*sessions
|
||||
.secrets
|
||||
.minio
|
||||
.media
|
||||
tokens
|
||||
files
|
||||
venv
|
||||
.wwebjs_auth
|
||||
src/test.ts
|
||||
src/test.js
|
||||
test.js
|
||||
.wwebjs_cache
|
||||
src/dashboard
|
||||
.eslintcache
|
||||
|
||||
# compiled output
|
||||
/dist
|
||||
|
||||
+27
-1
@@ -6,12 +6,21 @@ exclude: |
|
||||
)$
|
||||
|
||||
repos:
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: commit-message-prefix
|
||||
name: Validate Commit Message for src/plus Changes
|
||||
entry: python ./.precommit/validate_commit_message.py
|
||||
language: python
|
||||
stages: [commit-msg]
|
||||
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: lint
|
||||
stages: [pre-commit]
|
||||
name: lint
|
||||
language: system
|
||||
entry: bash -c '$HOME/.nvm/nvm-exec npm run lint'
|
||||
entry: bash -c '$HOME/.nvm/nvm-exec npm run lint-cache'
|
||||
pass_filenames: false
|
||||
files: |
|
||||
(?x)^(
|
||||
@@ -22,6 +31,7 @@ repos:
|
||||
rev: 'v3.1.0'
|
||||
hooks:
|
||||
- id: prettier
|
||||
stages: [pre-commit]
|
||||
exclude: |
|
||||
(?x)^(
|
||||
docs/.*|
|
||||
@@ -31,11 +41,13 @@ repos:
|
||||
rev: v1.1.2
|
||||
hooks:
|
||||
- id: markdown-toc
|
||||
stages: [pre-commit]
|
||||
name: README.md
|
||||
files: ^README.md$
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: no-plus-in-core
|
||||
stages: [pre-commit]
|
||||
name: No "plus" in core
|
||||
language: pygrep
|
||||
entry: 'plus'
|
||||
@@ -46,3 +58,17 @@ repos:
|
||||
src/structures/.*|
|
||||
src/config.service.ts|
|
||||
)$
|
||||
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: no-console-log
|
||||
stages: [pre-commit]
|
||||
name: No console.log() calls
|
||||
language: pygrep
|
||||
entry: 'console\.log'
|
||||
exclude: |
|
||||
(?x)^(
|
||||
entrypoint.sh|
|
||||
.pre-commit-config.yaml|
|
||||
^src/core/engines/webjs/session.webjs.core.ts|
|
||||
)$
|
||||
@@ -0,0 +1,38 @@
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
def get_staged_files():
|
||||
result = subprocess.run(["git", "diff", "--cached", "--name-only"], stdout=subprocess.PIPE, text=True)
|
||||
files = result.stdout.splitlines()
|
||||
return files
|
||||
|
||||
|
||||
def get_commit_message(commit_msg_filepath):
|
||||
with open(commit_msg_filepath, 'r') as f:
|
||||
return f.readline().strip()
|
||||
|
||||
|
||||
def main():
|
||||
commit_msg_filepath = sys.argv[1]
|
||||
commit_message = get_commit_message(commit_msg_filepath)
|
||||
staged_files = get_staged_files()
|
||||
|
||||
has_plus_changes = any(f.startswith('src/plus') for f in staged_files)
|
||||
print(commit_message)
|
||||
starts_with_plus = commit_message.startswith('[PLUS]')
|
||||
|
||||
if has_plus_changes and not starts_with_plus:
|
||||
print("'[PLUS]' not found in commit message, but there's changes are from 'src/plus'.")
|
||||
return 1
|
||||
|
||||
if starts_with_plus and not all(f.startswith('src/plus') for f in staged_files):
|
||||
print("'[PLUS]' found in commit message, but there's changes from other directories. \n"
|
||||
"Changes MUST be only from 'src/plus'.")
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
+25
-2
@@ -18,6 +18,21 @@ ADD . /src
|
||||
RUN yarn install
|
||||
RUN yarn build && find ./dist -name "*.d.ts" -delete
|
||||
|
||||
#
|
||||
# Dashboard
|
||||
#
|
||||
FROM node:${NODE_VERSION} as dashboard
|
||||
|
||||
# Download WAHA Dashboard
|
||||
ENV WAHA_DASHBOARD_SHA c1a91f879a35f0ae32d46ddb2e061ac1819a3d4f
|
||||
RUN \
|
||||
wget https://github.com/devlikeapro/dashboard/archive/${WAHA_DASHBOARD_SHA}.zip \
|
||||
&& unzip ${WAHA_DASHBOARD_SHA}.zip -d /tmp/dashboard \
|
||||
&& mkdir -p /dashboard \
|
||||
&& mv /tmp/dashboard/dashboard-${WAHA_DASHBOARD_SHA}/* /dashboard/ \
|
||||
&& rm -rf ${WAHA_DASHBOARD_SHA}.zip \
|
||||
&& rm -rf /tmp/dashboard/dashboard-${WAHA_DASHBOARD_SHA}
|
||||
|
||||
#
|
||||
# Final
|
||||
#
|
||||
@@ -33,6 +48,9 @@ RUN echo "USE_BROWSER=$USE_BROWSER"
|
||||
# Install ffmpeg to generate previews for videos
|
||||
RUN apt-get update && apt-get install -y ffmpeg --no-install-recommends && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install zip and unzip
|
||||
RUN apt-get update && apt-get install -y zip unzip --no-install-recommends && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install fonts if using either chromium or chrome
|
||||
RUN if [ "$USE_BROWSER" = "chromium" ] || [ "$USE_BROWSER" = "chrome" ]; then \
|
||||
apt-get update \
|
||||
@@ -53,7 +71,7 @@ RUN if [ "$USE_BROWSER" = "chromium" ]; then \
|
||||
# Install Chrome
|
||||
# Available versions:
|
||||
# https://www.ubuntuupdates.org/package/google_chrome/stable/main/base/google-chrome-stable
|
||||
ARG CHROME_VERSION="122.0.6261.128-1"
|
||||
ARG CHROME_VERSION="126.0.6478.182-1"
|
||||
RUN if [ "$USE_BROWSER" = "chrome" ]; then \
|
||||
wget --no-verbose -O /tmp/chrome.deb https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb \
|
||||
&& apt-get update \
|
||||
@@ -67,11 +85,16 @@ WORKDIR /app
|
||||
COPY package.json ./
|
||||
COPY --from=build /src/node_modules ./node_modules
|
||||
COPY --from=build /src/dist ./dist
|
||||
COPY --from=dashboard /dashboard ./dist/dashboard
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
|
||||
# Chokidar options to monitor file changes
|
||||
ENV CHOKIDAR_USEPOLLING=1
|
||||
ENV CHOKIDAR_INTERVAL=5000
|
||||
|
||||
# WAHA variables
|
||||
ENV WAHA_ZIPPER=ZIPUNZIP
|
||||
|
||||
# Run command, etc
|
||||
EXPOSE 3000
|
||||
CMD yarn start:prod
|
||||
CMD ["/entrypoint.sh"]
|
||||
@@ -31,10 +31,11 @@ push:
|
||||
for-swagger:
|
||||
WHATSAPP_SWAGGER_CONFIG_ADVANCED=true . ${NVM_DIR}/nvm.sh && nvm exec yarn start
|
||||
|
||||
update-dependencies:
|
||||
. ${NVM_DIR}/nvm.sh && nvm exec yarn up whatsapp-web.js@https://github.com/devlikeapro/whatsapp-web.js#main-fork
|
||||
. ${NVM_DIR}/nvm.sh && nvm exec yarn up @adiwajshing/baileys@github:devlikeapro/Baileys#fork-master
|
||||
. ${NVM_DIR}/nvm.sh && nvm exec yarn up venom-bot
|
||||
up-noweb:
|
||||
. ${NVM_DIR}/nvm.sh && nvm exec yarn up @adiwajshing/baileys@github:devlikeapro/Baileys#fork-master-channels-2
|
||||
|
||||
up-webjs:
|
||||
. ${NVM_DIR}/nvm.sh && nvm exec yarn up whatsapp-web.js@github:devlikeapro/whatsapp-web.js#fork-webpack-exodus-channels
|
||||
|
||||
start-proxy:
|
||||
docker run --rm -d --name squid-container -e TZ=UTC -p 3128:3128 ubuntu/squid:5.2-22.04_beta
|
||||
@@ -141,7 +141,7 @@ later:
|
||||
How to log in - the instruction on WhatsApp site
|
||||
</a>
|
||||
|
||||
When your ready - find `POST /api/session/start`, click on **Try it out**, then **Execute** a bit below.
|
||||
When your ready - find `POST /api/sessions`, click on **Try it out**, then **Execute** a bit below.
|
||||
|
||||
|
||||
The example payload:
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
services:
|
||||
waha:
|
||||
# Check available Docker images:
|
||||
# https://waha.devlike.pro/docs/how-to/engines/#docker-images
|
||||
image: devlikeapro/waha
|
||||
container_name: waha
|
||||
ports:
|
||||
- '3000:3000/tcp'
|
||||
environment:
|
||||
# Environment variables from https://waha.devlike.pro/docs/how-to/config/
|
||||
# https://docs.webhook.site/
|
||||
- WHATSAPP_HOOK_URL=https://webhook.site/11111111-1111-1111-1111-11111111
|
||||
- WHATSAPP_HOOK_EVENTS=message
|
||||
- WHATSAPP_DEFAULT_ENGINE=WEBJS
|
||||
restart: always
|
||||
|
||||
waha-plus:
|
||||
# Check available Docker images:
|
||||
# https://waha.devlike.pro/docs/how-to/engines/#docker-images
|
||||
image: devlikeapro/waha-plus:chrome
|
||||
container_name: waha-plus
|
||||
ports:
|
||||
- '3000:3000/tcp'
|
||||
volumes:
|
||||
- './.sessions:/app/.sessions'
|
||||
environment:
|
||||
# Environment variables from https://waha.devlike.pro/docs/how-to/config/
|
||||
# - WHATSAPP_RESTART_ALL_SESSIONS=True
|
||||
# - WHATSAPP_HOOK_URL=https://webhook.site/11111111-1111-1111-1111-11111111
|
||||
# - WHATSAPP_HOOK_EVENTS=message
|
||||
# - WHATSAPP_API_HOSTNAME=localhost
|
||||
- WHATSAPP_DEFAULT_ENGINE=WEBJS
|
||||
- WHATSAPP_API_KEY=321
|
||||
# Username and password for Swagger
|
||||
- WHATSAPP_SWAGGER_USERNAME=swagger
|
||||
- WHATSAPP_SWAGGER_PASSWORD=admin
|
||||
# Username and password for WAHA Dashboard
|
||||
# you can use the same username and password for both Swagger and Dashboard
|
||||
# Default - waha / waha
|
||||
- WAHA_DASHBOARD_USERNAME=waha
|
||||
- WAHA_DASHBOARD_PASSWORD=waha
|
||||
# Engine specific environment variables
|
||||
# - WAHA_WEBJS_WEB_VERSION=2.2412.54-videofix
|
||||
restart: always
|
||||
|
||||
waha-plus--mongodb:
|
||||
# Check available Docker images:
|
||||
# https://waha.devlike.pro/docs/how-to/engines/#docker-images
|
||||
image: devlikeapro/waha-plus:chrome
|
||||
container_name: waha-plus--mongodb
|
||||
ports:
|
||||
- '3000:3000/tcp'
|
||||
volumes:
|
||||
- './.sessions:/app/.sessions'
|
||||
environment:
|
||||
# Environment variables from https://waha.devlike.pro/docs/how-to/config/
|
||||
# - WHATSAPP_RESTART_ALL_SESSIONS=True
|
||||
# - WHATSAPP_HOOK_URL=https://webhook.site/11111111-1111-1111-1111-11111111
|
||||
# - WHATSAPP_HOOK_EVENTS=message
|
||||
# - WHATSAPP_API_KEY=321
|
||||
# - WHATSAPP_SWAGGER_USERNAME=admin
|
||||
# - WHATSAPP_SWAGGER_PASSWORD=123
|
||||
# - WAHA_DASHBOARD_USERNAME=admin
|
||||
# - WAHA_DASHBOARD_PASSWORD=123
|
||||
# - WHATSAPP_API_HOSTNAME=localhost
|
||||
- WHATSAPP_DEFAULT_ENGINE=WEBJS
|
||||
- WHATSAPP_SESSIONS_MONGO_URL=mongodb://mongodb:27017
|
||||
restart: always
|
||||
|
||||
# Let's Encrypt + Certbot
|
||||
# https://waha.devlike.pro/docs/how-to/security/#https
|
||||
waha-https--certbot:
|
||||
image: devlikeapro/waha-plus
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- '3000:3000'
|
||||
volumes:
|
||||
- './.sessions:/app/.sessions'
|
||||
- '/etc/letsencrypt:/etc/letsencrypt'
|
||||
environment:
|
||||
- DOMAIN=waha.example.pro
|
||||
- WHATSAPP_API_HOSTNAME=${DOMAIN}
|
||||
- WAHA_HTTPS_ENABLED=true
|
||||
- WAHA_HTTPS_PATH_KEY=/etc/letsencrypt/live/${DOMAIN}/privkey.pem
|
||||
- WAHA_HTTPS_PATH_CERT=/etc/letsencrypt/live/${DOMAIN}/cert.pem
|
||||
- WAHA_HTTPS_PATH_CA=/etc/letsencrypt/live/${DOMAIN}/chain.pem
|
||||
|
||||
# Self-signed certificates example
|
||||
# https://waha.devlike.pro/docs/how-to/security/#https
|
||||
waha-https--self-signed:
|
||||
image: devlikeapro/waha-plus
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- '3000:3000'
|
||||
volumes:
|
||||
- './.sessions:/app/.sessions'
|
||||
- './.secrets:/app/.secrets'
|
||||
environment:
|
||||
- WAHA_HTTPS_ENABLED=true
|
||||
- WAHA_HTTPS_PATH_KEY=.secrets/privkey.pem
|
||||
- WAHA_HTTPS_PATH_CERT=.secrets/cert.pem
|
||||
- WAHA_HTTPS_PATH_CA=.secrets/chain.pem
|
||||
|
||||
mongodb:
|
||||
image: mongo
|
||||
container_name: mongodb
|
||||
ports:
|
||||
- '27017:27017/tcp'
|
||||
volumes:
|
||||
- mongodb_data:/data/db
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
mongodb_data: {}
|
||||
+214
-86
@@ -1,107 +1,215 @@
|
||||
version: '3'
|
||||
#
|
||||
# https://waha.devlike.pro/docs/how-to/install/
|
||||
# Here's we provide a simple example of how to install WAHA using Docker Compose.
|
||||
#
|
||||
# We're assuming you have Docker and Docker Compose installed.
|
||||
# If you don't have Docker Compose installed, you can follow the official guide:
|
||||
# https://docs.docker.com/compose/install/
|
||||
#
|
||||
|
||||
services:
|
||||
waha:
|
||||
# Check available Docker images:
|
||||
# https://waha.devlike.pro/docs/how-to/engines/#docker-images
|
||||
image: devlikeapro/waha
|
||||
container_name: waha
|
||||
ports:
|
||||
- '3000:3000/tcp'
|
||||
environment:
|
||||
# Environment variables from https://waha.devlike.pro/docs/how-to/config/
|
||||
# https://docs.webhook.site/
|
||||
- WHATSAPP_HOOK_URL=https://webhook.site/11111111-1111-1111-1111-11111111
|
||||
- WHATSAPP_HOOK_EVENTS=message
|
||||
- WHATSAPP_DEFAULT_ENGINE=WEBJS
|
||||
# Always restart the container on failure
|
||||
restart: always
|
||||
|
||||
waha-plus:
|
||||
# Check available Docker images:
|
||||
#
|
||||
# Image
|
||||
#
|
||||
image: devlikeapro/waha-plus:latest # or devlikeapro/waha:latest if you're using WAHA Core
|
||||
#
|
||||
# We strongly recommend using the pinned version of WAHA
|
||||
# https://waha.devlike.pro/docs/how-to/engines/#versions
|
||||
# image: devlikeapro/waha-plus:latest-2024.7.6 # 'latest' is not mistaken here
|
||||
#
|
||||
# Multiple images are available
|
||||
# https://waha.devlike.pro/docs/how-to/engines/#docker-images
|
||||
image: devlikeapro/waha-plus:chrome
|
||||
container_name: waha-plus
|
||||
# image: devlikeapro/waha-plus:chrome
|
||||
#
|
||||
|
||||
# The first port can be any free port you want
|
||||
# The second port must be the same as WHATSAPP_API_PORT or 3000 by default
|
||||
# Consider using the same port for simplicity
|
||||
ports:
|
||||
- '3000:3000/tcp'
|
||||
# NOTE: if you're using HTTP, you can use the following port mapping
|
||||
#- '80:3000/tcp'
|
||||
# NOTE: if you're using HTTPS, you can use the following port mapping
|
||||
#- '443:3000/tcp'
|
||||
|
||||
volumes:
|
||||
# Store sessions in the .sessions folder (comment it if you're using MongoDB)
|
||||
# Doesn't work with WAHA Core
|
||||
- './.sessions:/app/.sessions'
|
||||
|
||||
# https://waha.devlike.pro/docs/how-to/storages/#save-media-files-between-the-container-restarts
|
||||
- './.media:/app/.media'
|
||||
|
||||
# If you're using certbot for HTTPS, you can use the following volume mapping
|
||||
# https://waha.devlike.pro/blog/setting-up-https-for-waha/#lets-encrypt-certbot--waha
|
||||
# - '/etc/letsencrypt:/etc/letsencrypt'
|
||||
|
||||
# WAHA Configuration
|
||||
# https://waha.devlike.pro/docs/how-to/config/
|
||||
environment:
|
||||
# Environment variables from https://waha.devlike.pro/docs/how-to/config/
|
||||
# - WHATSAPP_RESTART_ALL_SESSIONS=True
|
||||
# - WHATSAPP_HOOK_URL=https://webhook.site/11111111-1111-1111-1111-11111111
|
||||
# - WHATSAPP_HOOK_EVENTS=message
|
||||
# - WHATSAPP_API_HOSTNAME=localhost
|
||||
- WHATSAPP_DEFAULT_ENGINE=WEBJS
|
||||
#
|
||||
# Common
|
||||
#
|
||||
# If you know the right URL, you can use it here.
|
||||
# Use any port in WHATSAPP_API_PORT and domain in WHATSAPP_API_HOSTNAME
|
||||
# https://waha.devlike.pro/docs/how-to/config/#common
|
||||
#- WHATSAPP_API_SCHEMA=http
|
||||
#- WHATSAPP_API_PORT=3000
|
||||
#- WHATSAPP_API_HOSTNAME=localhost
|
||||
|
||||
#
|
||||
# Security
|
||||
#
|
||||
# https://waha.devlike.pro/docs/how-to/security/
|
||||
#
|
||||
- WHATSAPP_API_KEY=321
|
||||
# Username and password for Swagger
|
||||
- WHATSAPP_SWAGGER_USERNAME=swagger
|
||||
- WHATSAPP_SWAGGER_PASSWORD=admin
|
||||
# Username and password for WAHA Dashboard
|
||||
# you can use the same username and password for both Swagger and Dashboard
|
||||
# Default - waha / waha
|
||||
- WAHA_DASHBOARD_USERNAME=waha
|
||||
- WAHA_DASHBOARD_PASSWORD=waha
|
||||
# Engine specific environment variables
|
||||
# - WAHA_WEBJS_WEB_VERSION=2.2412.54-videofix
|
||||
restart: always
|
||||
#- WHATSAPP_SWAGGER_USERNAME=admin
|
||||
#- WHATSAPP_SWAGGER_PASSWORD=admin
|
||||
|
||||
waha-plus--mongodb:
|
||||
# Check available Docker images:
|
||||
# https://waha.devlike.pro/docs/how-to/engines/#docker-images
|
||||
image: devlikeapro/waha-plus:chrome
|
||||
container_name: waha-plus--mongodb
|
||||
ports:
|
||||
- '3000:3000/tcp'
|
||||
volumes:
|
||||
- './.sessions:/app/.sessions'
|
||||
environment:
|
||||
# Environment variables from https://waha.devlike.pro/docs/how-to/config/
|
||||
# - WHATSAPP_RESTART_ALL_SESSIONS=True
|
||||
# - WHATSAPP_HOOK_URL=https://webhook.site/11111111-1111-1111-1111-11111111
|
||||
# - WHATSAPP_HOOK_EVENTS=message
|
||||
# - WHATSAPP_API_KEY=321
|
||||
# - WHATSAPP_SWAGGER_USERNAME=admin
|
||||
# - WHATSAPP_SWAGGER_PASSWORD=123
|
||||
# - WAHA_DASHBOARD_USERNAME=admin
|
||||
# - WAHA_DASHBOARD_PASSWORD=123
|
||||
# - WHATSAPP_API_HOSTNAME=localhost
|
||||
#
|
||||
# Dashboard
|
||||
#
|
||||
# https://waha.devlike.pro/docs/how-to/waha-dashboard/#configuration
|
||||
# Enabled by default
|
||||
#- WAHA_DASHBOARD_ENABLED=true
|
||||
#- WAHA_DASHBOARD_USERNAME=waha
|
||||
#- WAHA_DASHBOARD_PASSWORD=waha
|
||||
|
||||
#
|
||||
# Logging
|
||||
# https://waha.devlike.pro/docs/how-to/observability/#logging
|
||||
#
|
||||
- WAHA_LOG_FORMAT=PRETTY
|
||||
# Set log format to JSON if you consume logs with log management systems
|
||||
#- WAHA_LOG_FORMAT=JSON
|
||||
- WAHA_LOG_LEVEL=info
|
||||
# If you want to see more logs, you can set the log level to debug
|
||||
#- WAHA_LOG_LEVEL=debug
|
||||
# DEBUG=1 # shortcut for setting log level to debug
|
||||
|
||||
#
|
||||
# Engine
|
||||
#
|
||||
# Choose the right engine for your needs (WEBJS by default)
|
||||
# https://waha.devlike.pro/docs/how-to/engines/
|
||||
- WHATSAPP_DEFAULT_ENGINE=WEBJS
|
||||
- WHATSAPP_SESSIONS_MONGO_URL=mongodb://mongodb:27017
|
||||
restart: always
|
||||
# Use NOWEB engine for the fastest performance
|
||||
#- WHATSAPP_DEFAULT_ENGINE=NOWEB
|
||||
|
||||
# Let's Encrypt + Certbot
|
||||
# https://waha.devlike.pro/docs/how-to/security/#https
|
||||
waha-https--certbot:
|
||||
image: devlikeapro/waha-plus
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- '3000:3000'
|
||||
volumes:
|
||||
- './.sessions:/app/.sessions'
|
||||
- '/etc/letsencrypt:/etc/letsencrypt'
|
||||
environment:
|
||||
- DOMAIN=waha.example.pro
|
||||
- WHATSAPP_API_HOSTNAME=${DOMAIN}
|
||||
- WAHA_HTTPS_ENABLED=true
|
||||
- WAHA_HTTPS_PATH_KEY=/etc/letsencrypt/live/${DOMAIN}/privkey.pem
|
||||
- WAHA_HTTPS_PATH_CERT=/etc/letsencrypt/live/${DOMAIN}/cert.pem
|
||||
- WAHA_HTTPS_PATH_CA=/etc/letsencrypt/live/${DOMAIN}/chain.pem
|
||||
#
|
||||
# Sessions
|
||||
#
|
||||
# https://waha.devlike.pro/docs/how-to/config/#sessions
|
||||
# Restart all sessions when container starts
|
||||
- WHATSAPP_RESTART_ALL_SESSIONS=True
|
||||
# Do not print QR codes in logs
|
||||
- WAHA_PRINT_QR=False
|
||||
#
|
||||
# OR you can specify sessions by name, if you have handful amount of sessions
|
||||
#- WHATSAPP_START_SESSION=session1,session2
|
||||
# Do not use both WHATSAPP_RESTART_ALL_SESSIONS and WHATSAPP_START_SESSION parameters
|
||||
#
|
||||
|
||||
# Self-signed certificates example
|
||||
# https://waha.devlike.pro/docs/how-to/security/#https
|
||||
waha-https--self-signed:
|
||||
image: devlikeapro/waha-plus
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- '3000:3000'
|
||||
volumes:
|
||||
- './.sessions:/app/.sessions'
|
||||
- './.secrets:/app/.secrets'
|
||||
environment:
|
||||
- WAHA_HTTPS_ENABLED=true
|
||||
- WAHA_HTTPS_PATH_KEY=.secrets/privkey.pem
|
||||
- WAHA_HTTPS_PATH_CERT=.secrets/cert.pem
|
||||
- WAHA_HTTPS_PATH_CA=.secrets/chain.pem
|
||||
#
|
||||
# Swagger
|
||||
#
|
||||
# https://waha.devlike.pro/docs/how-to/swagger/
|
||||
#- WHATSAPP_SWAGGER_USERNAME=admin
|
||||
#- WHATSAPP_SWAGGER_PASSWORD=admin
|
||||
# Disable Swagger
|
||||
#- WHATSAPP_SWAGGER_ENABLED=false
|
||||
# Enable advanced Swagger configuration
|
||||
#- WHATSAPP_SWAGGER_CONFIG_ADVANCED=true
|
||||
#
|
||||
# Swagger White Label customization
|
||||
# https://waha.devlike.pro/docs/how-to/swagger/#white-label
|
||||
#- WHATSAPP_SWAGGER_TITLE=WAHA API
|
||||
#
|
||||
|
||||
#
|
||||
# Global Proxy Settings
|
||||
# https://waha.devlike.pro/docs/how-to/config/#global-proxy-configuration
|
||||
# You can also set proxy settings for each session later when starting it
|
||||
# https://waha.devlike.pro/docs/how-to/sessions/#configure-proxy
|
||||
#- WHATSAPP_PROXY_SERVER=proxy.example.com:3128
|
||||
#-WHATSAPP_PROXY_SERVER_USERNAME=user
|
||||
#-WHATSAPP_PROXY_SERVER_PASSWORD=pass
|
||||
#
|
||||
|
||||
#
|
||||
# HTTPS Configuration
|
||||
#
|
||||
# https://waha.devlike.pro/docs/how-to/config/#https
|
||||
# Consider using certbot for HTTPS
|
||||
# https://waha.devlike.pro/blog/setting-up-https-for-waha/#lets-encrypt-certbot--waha
|
||||
#- WAHA_HTTPS_ENABLED=true
|
||||
#- WAHA_HTTPS_PATH_KEY=/etc/letsencrypt/live/waha.example.pro/privkey.pem
|
||||
#- WAHA_HTTPS_PATH_CERT=/etc/letsencrypt/live/waha.example.pro/cert.pem \
|
||||
#- WAHA_HTTPS_PATH_CA=/etc/letsencrypt/live/waha.example.pro/chain.pem
|
||||
#- WHATSAPP_API_SCHEMA=https
|
||||
#- WHATSAPP_API_PORT=3000
|
||||
#- WHATSAPP_API_HOSTNAME=waha.example.pro
|
||||
#
|
||||
|
||||
#
|
||||
# Media Configuration
|
||||
#
|
||||
# https://waha.devlike.pro/docs/how-to/config/#files
|
||||
#
|
||||
# Disable media (images, videos, files) download for incoming messages
|
||||
#- WHATSAPP_DOWNLOAD_MEDIA=false
|
||||
#
|
||||
# Download only specific media types
|
||||
#- WHATSAPP_FILES_MIMETYPES=image/jpeg,image/png
|
||||
#
|
||||
|
||||
# Media - Local Storage
|
||||
# https://waha.devlike.pro/docs/how-to/storages/#media---local
|
||||
#
|
||||
# Set to 0 to keep media files forever
|
||||
# https://waha.devlike.pro/docs/how-to/storages/#save-media-files-between-the-container-restarts
|
||||
- WAHA_MEDIA_STORAGE=LOCAL
|
||||
- WHATSAPP_FILES_LIFETIME=0
|
||||
- WHATSAPP_FILES_FOLDER=/app/.media
|
||||
# Keep media files for 180 seconds (3 minutes)
|
||||
#- WHATSAPP_FILES_LIFETIME=180
|
||||
#
|
||||
|
||||
# Media - S3 Storage
|
||||
# https://waha.devlike.pro/docs/how-to/storages/#media---s3
|
||||
#- WAHA_MEDIA_STORAGE=S3
|
||||
#- WAHA_S3_REGION=eu-west-2
|
||||
#- WAHA_S3_BUCKET=waha
|
||||
#- WAHA_S3_ACCESS_KEY_ID=minioadmin
|
||||
#- WAHA_S3_SECRET_ACCESS_KEY=minioadmin
|
||||
#- WAHA_S3_ENDPOINT=http://minio:9000 # Not required if you're using AWS S3
|
||||
#- WAHA_S3_FORCE_PATH_STYLE=True # Required for Minio
|
||||
#- WAHA_S3_PROXY_FILES=True # Required for docker-compose setup
|
||||
|
||||
#
|
||||
# Global Webhooks
|
||||
#
|
||||
# https://waha.devlike.pro/docs/how-to/config/#webhooks
|
||||
# https://waha.devlike.pro/docs/how-to/webhooks/
|
||||
#- WHATSAPP_HOOK_URL=https://webhook.site/11111111-1111-1111-1111-11111111
|
||||
#- WHATSAPP_HOOK_EVENTS=session.status,message,message.reaction
|
||||
#
|
||||
|
||||
#
|
||||
# MongoDB Configuration
|
||||
# https://waha.devlike.pro/docs/how-to/storages/#sessions---mongodb
|
||||
#- WHATSAPP_SESSIONS_MONGO_URL=mongodb://mongodb:27017
|
||||
#
|
||||
|
||||
# NOTE: Only if you're using MongoDB
|
||||
# https://waha.devlike.pro/docs/how-to/storages/#sessions---mongodb
|
||||
# Comment this block if you're using MongoDB
|
||||
mongodb:
|
||||
image: mongo
|
||||
container_name: mongodb
|
||||
@@ -111,5 +219,25 @@ services:
|
||||
- mongodb_data:/data/db
|
||||
restart: always
|
||||
|
||||
# NOTE: Only if you're using S3 to save media files
|
||||
# https://waha.devlike.pro/docs/how-to/storages/#media---s3
|
||||
# Comment this block if you're using AWS S3
|
||||
minio:
|
||||
image: quay.io/minio/minio
|
||||
container_name: minio
|
||||
restart: always
|
||||
ports:
|
||||
- '9000:9000'
|
||||
- '9001:9001'
|
||||
environment:
|
||||
MINIO_REGION: 'eu-west-2'
|
||||
MINIO_ROOT_USER: 'minioadmin'
|
||||
MINIO_ROOT_PASSWORD: 'minioadmin'
|
||||
volumes:
|
||||
- minio_data:/data
|
||||
command: server /data --console-address ":9001"
|
||||
|
||||
volumes:
|
||||
# NOTE: Only if you're using MongoDB
|
||||
mongodb_data: {}
|
||||
minio_data: {}
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Calculate UV_THREADPOOL_SIZE based on number of CPUs
|
||||
cpus=$(node -e "const os = require('os'); console.log(os.cpus().length);")
|
||||
uv_threadpool_size=$(($cpus * 2))
|
||||
|
||||
# Set UV_THREADPOOL_SIZE as an environment variable
|
||||
export UV_THREADPOOL_SIZE="${UV_THREADPOOL_SIZE:-$uv_threadpool_size}"
|
||||
|
||||
# Start your application using yarn
|
||||
yarn start:prod
|
||||
Binary file not shown.
@@ -50,8 +50,8 @@ docker run -it --rm --network=host -e WHATSAPP_HOOK_URL=http://localhost:5000/bo
|
||||
|
||||
2. Open Swagger API in the browser http://localhost:3000/
|
||||
3. Start session and scan QR code in swagger
|
||||
1. Find `POST /api/session/start` request press **Try it out** and
|
||||
**Execute** it with `default` session name
|
||||
1. Find `POST /api/sessions/` request press **Try it out** and **Execute** it
|
||||
with `default` session name
|
||||
2. Find `GET /api/screenshot` and execute it - it must show QR code
|
||||
3. Scan QR code on your mobile WhatsApp application (that installed on your
|
||||
phone)
|
||||
|
||||
+14
-3
@@ -15,6 +15,7 @@
|
||||
"start:prod": "node dist/main",
|
||||
"start:prod-exit": "node dist/main",
|
||||
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix --max-warnings=0",
|
||||
"lint-cache": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix --cache --max-warnings=0",
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watch",
|
||||
"test:cov": "jest --coverage",
|
||||
@@ -22,11 +23,13 @@
|
||||
"test:e2e": "jest --config ./test/jest-e2e.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@adiwajshing/baileys": "github:devlikeapro/Baileys#fork-master",
|
||||
"@adiwajshing/baileys": "github:devlikeapro/Baileys#fork-master-channels-2",
|
||||
"@adiwajshing/keyed-db": "^0.2.4",
|
||||
"@aws-sdk/client-s3": "^3.633.0",
|
||||
"@aws-sdk/s3-request-presigner": "^3.633.0",
|
||||
"@nestjs/axios": "^3.0.2",
|
||||
"@nestjs/common": "^9.0.9",
|
||||
"@nestjs/config": "^0.5.0",
|
||||
"@nestjs/config": "^3.2.3",
|
||||
"@nestjs/core": "^9.0.9",
|
||||
"@nestjs/passport": "^9.0.0",
|
||||
"@nestjs/platform-express": "^9.0.9",
|
||||
@@ -38,6 +41,7 @@
|
||||
"@types/better-sqlite3": "^7.6.10",
|
||||
"@types/lodash": "^4.14.194",
|
||||
"@types/ws": "^8.5.4",
|
||||
"adm-zip": "0.5.10",
|
||||
"async-lock": "^1.4.1",
|
||||
"better-sqlite3": "9.6.0",
|
||||
"check-disk-space": "^3.4.0",
|
||||
@@ -47,15 +51,22 @@
|
||||
"del": "^6.0.0",
|
||||
"express-basic-auth": "^1.2.1",
|
||||
"file-type": "16.5.4",
|
||||
"fs-extra": "^11.2.0",
|
||||
"https-proxy-agent": "^7.0.0",
|
||||
"joi": "^17.13.3",
|
||||
"knex": "^3.1.0",
|
||||
"libphonenumber-js": "^1.10.36",
|
||||
"link-preview-js": "^3.0.4",
|
||||
"lodash": "^4.17.21",
|
||||
"mime-types": "^2.1.27",
|
||||
"mongodb": "^6.3.0",
|
||||
"nestjs-pino": "^4.1.0",
|
||||
"passport": "^0.6.0",
|
||||
"passport-headerapikey": "^1.2.2",
|
||||
"pino-http": "^10.2.0",
|
||||
"pino-pretty": "^11.2.1",
|
||||
"pretty-bytes": "5.6.0",
|
||||
"promise-retry": "^2.0.1",
|
||||
"puppeteer": "^21.0.0",
|
||||
"qrcode": "^1.5.1",
|
||||
"qrcode-terminal": "^0.12.0",
|
||||
@@ -67,7 +78,7 @@
|
||||
"sharp": "^0.33.4",
|
||||
"swagger-ui-express": "^4.1.4",
|
||||
"venom-bot": "5.0.1",
|
||||
"whatsapp-web.js": "https://github.com/devlikeapro/whatsapp-web.js#main-fork-update"
|
||||
"whatsapp-web.js": "github:devlikeapro/whatsapp-web.js#fork-webpack-exodus-channels"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nestjs/cli": "^9.0.0",
|
||||
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
echo "Starting WAHA..."
|
||||
|
||||
docker run -d \
|
||||
--restart=always \
|
||||
--name waha \
|
||||
-p 3000:3000/tcp \
|
||||
-v ./.sessions:/app/.sessions \
|
||||
-v ./.media:/app/.media \
|
||||
--env WHATSAPP_API_KEY=321 \
|
||||
--env WAHA_DASHBOARD_USERNAME=waha \
|
||||
--env WAHA_DASHBOARD_PASSWORD=waha \
|
||||
--env WAHA_LOG_FORMAT=PRETTY \
|
||||
--env WAHA_LOG_LEVEL=info \
|
||||
--env WHATSAPP_DEFAULT_ENGINE=WEBJS \
|
||||
--env WHATSAPP_RESTART_ALL_SESSIONS=True \
|
||||
--env WAHA_PRINT_QR=False \
|
||||
--env WHATSAPP_FILES_LIFETIME=0 \
|
||||
--env WHATSAPP_FILES_FOLDER=/app/.media \
|
||||
devlikeapro/waha-plus:latest
|
||||
|
||||
echo "WAHA started."
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
set -e
|
||||
echo "Updating WAHA..."
|
||||
echo "Logging in to Docker..."
|
||||
docker login -u devlikeapro # -p {KEY} - you can hard code key here https://portal.devlike.pro/
|
||||
|
||||
echo "Pulling the latest image..."
|
||||
docker pull devlikeapro/waha-plus
|
||||
|
||||
echo "Logging out of Docker..."
|
||||
docker logout
|
||||
|
||||
# Just pull if you're using WAHA Core
|
||||
# docker pull devlikeapro/waha
|
||||
|
||||
echo "Stopping the current container..."
|
||||
docker stop waha || true
|
||||
echo "Removing the current container..."
|
||||
docker rm waha || true
|
||||
|
||||
echo "Running WAHA..."
|
||||
sh ./waha-run.sh
|
||||
@@ -8,9 +8,15 @@ import {
|
||||
} from '@nestjs/common';
|
||||
import { UnprocessableEntityException } from '@nestjs/common/exceptions/unprocessable-entity.exception';
|
||||
import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger';
|
||||
import { ApiFileAcceptHeader } from '@waha/nestjs/ApiFileAcceptHeader';
|
||||
import {
|
||||
SessionApiParam,
|
||||
SessionParam,
|
||||
} from '@waha/nestjs/params/SessionApiParam';
|
||||
|
||||
import { SessionManager } from '../core/abc/manager.abc';
|
||||
import { WhatsappSession } from '../core/abc/session.abc';
|
||||
import { BufferResponseInterceptor } from '../nestjs/BufferResponseInterceptor';
|
||||
import {
|
||||
CaptchaBody,
|
||||
OTPRequest,
|
||||
@@ -21,18 +27,16 @@ import {
|
||||
} from '../structures/auth.dto';
|
||||
import { WAHASessionStatus } from '../structures/enums.dto';
|
||||
import { Base64File } from '../structures/files.dto';
|
||||
import { BufferResponseInterceptor } from './BufferResponseInterceptor';
|
||||
import { ApiFileAcceptHeader, SessionApiParam, SessionParam } from './helpers';
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('api/:session/auth')
|
||||
@ApiTags('auth')
|
||||
@ApiTags('🔑 Auth')
|
||||
class AuthController {
|
||||
constructor(private manager: SessionManager) {}
|
||||
|
||||
@Get('qr')
|
||||
@ApiOperation({
|
||||
summary: 'Get QR code for pairing WhatsApp Web.',
|
||||
summary: 'Get QR code for pairing WhatsApp API.',
|
||||
})
|
||||
@SessionApiParam
|
||||
@ApiFileAcceptHeader(Base64File, QRCodeValue)
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
import {
|
||||
Body,
|
||||
Controller,
|
||||
Delete,
|
||||
Get,
|
||||
Param,
|
||||
Post,
|
||||
Query,
|
||||
} from '@nestjs/common';
|
||||
import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger';
|
||||
import {
|
||||
SessionApiParam,
|
||||
SessionParam,
|
||||
} from '@waha/nestjs/params/SessionApiParam';
|
||||
import {
|
||||
Channel,
|
||||
CreateChannelRequest,
|
||||
ListChannelsQuery,
|
||||
NewsletterIdApiParam,
|
||||
NewsletterIdOrInviteCodeApiParam,
|
||||
} from '@waha/structures/channels.dto';
|
||||
|
||||
import { SessionManager } from '../core/abc/manager.abc';
|
||||
import { isNewsletter, WhatsappSession } from '../core/abc/session.abc';
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('api/:session/channels')
|
||||
@ApiTags('📢 Channels')
|
||||
export class ChannelsController {
|
||||
constructor(private manager: SessionManager) {}
|
||||
|
||||
@Get('')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Get list of know channels' })
|
||||
async list(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Query() query: ListChannelsQuery,
|
||||
): Promise<Channel[]> {
|
||||
return session.channelsList(query);
|
||||
}
|
||||
|
||||
@Post('')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Create a new channel.' })
|
||||
create(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Body() request: CreateChannelRequest,
|
||||
): Promise<Channel> {
|
||||
return session.channelsCreateChannel(request);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
@SessionApiParam
|
||||
@NewsletterIdApiParam
|
||||
@ApiOperation({ summary: 'Delete the channel.' })
|
||||
delete(@SessionParam session: WhatsappSession, @Param('id') id: string) {
|
||||
return session.channelsDeleteChannel(id);
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
@SessionApiParam
|
||||
@NewsletterIdOrInviteCodeApiParam
|
||||
@ApiOperation({
|
||||
summary: 'Get the channel info',
|
||||
description:
|
||||
'You can use either id (123@newsletter) ' +
|
||||
'OR invite code (https://www.whatsapp.com/channel/123)',
|
||||
})
|
||||
get(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('id') id: string,
|
||||
): Promise<Channel> {
|
||||
if (isNewsletter(id)) {
|
||||
return session.channelsGetChannel(id);
|
||||
} else {
|
||||
// https://www.whatsapp.com/channel/123 => 123
|
||||
const inviteCode = id.split('/').pop();
|
||||
return session.channelsGetChannelByInviteCode(inviteCode);
|
||||
}
|
||||
}
|
||||
|
||||
@Post('follow')
|
||||
@SessionApiParam
|
||||
@NewsletterIdApiParam
|
||||
@ApiOperation({ summary: 'Follow the channel.' })
|
||||
follow(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('id') id: string,
|
||||
): Promise<void> {
|
||||
return session.channelsFollowChannel(id);
|
||||
}
|
||||
|
||||
@Post('unfollow')
|
||||
@SessionApiParam
|
||||
@NewsletterIdApiParam
|
||||
@ApiOperation({ summary: 'Unfollow the channel.' })
|
||||
unfollow(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('id') id: string,
|
||||
): Promise<void> {
|
||||
return session.channelsUnfollowChannel(id);
|
||||
}
|
||||
|
||||
@Post('mute')
|
||||
@SessionApiParam
|
||||
@NewsletterIdApiParam
|
||||
@ApiOperation({ summary: 'Mute the channel.' })
|
||||
mute(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('id') id: string,
|
||||
): Promise<void> {
|
||||
return session.channelsMuteChannel(id);
|
||||
}
|
||||
|
||||
@Post('unmute')
|
||||
@SessionApiParam
|
||||
@NewsletterIdApiParam
|
||||
@ApiOperation({ summary: 'Unmute the channel.' })
|
||||
unmute(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('id') id: string,
|
||||
): Promise<void> {
|
||||
return session.channelsUnmuteChannel(id);
|
||||
}
|
||||
}
|
||||
@@ -4,28 +4,29 @@ import {
|
||||
Delete,
|
||||
Get,
|
||||
Param,
|
||||
Post,
|
||||
Put,
|
||||
Query,
|
||||
UsePipes,
|
||||
ValidationPipe,
|
||||
} from '@nestjs/common';
|
||||
import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger';
|
||||
import { ChatIdApiParam } from '@waha/nestjs/params/ChatIdApiParam';
|
||||
import { MessageIdApiParam } from '@waha/nestjs/params/MessageIdApiParam';
|
||||
import {
|
||||
SessionApiParam,
|
||||
SessionParam,
|
||||
} from '@waha/nestjs/params/SessionApiParam';
|
||||
|
||||
import { SessionManager } from '../core/abc/manager.abc';
|
||||
import { WhatsappSession } from '../core/abc/session.abc';
|
||||
import { parseBool } from '../helpers';
|
||||
import { GetChatMessagesQuery, GetChatsQuery } from '../structures/chats.dto';
|
||||
import { EditMessageRequest } from '../structures/chatting.dto';
|
||||
import {
|
||||
ChatIdApiParam,
|
||||
MessageIdApiParam,
|
||||
SessionApiParam,
|
||||
SessionParam,
|
||||
} from './helpers';
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('api/:session/chats')
|
||||
@ApiTags('chats')
|
||||
@ApiTags('💬 Chats')
|
||||
@UsePipes(new ValidationPipe({ transform: true }))
|
||||
class ChatsController {
|
||||
constructor(private manager: SessionManager) {}
|
||||
@@ -43,6 +44,7 @@ class ChatsController {
|
||||
@Delete(':chatId')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Deletes the chat' })
|
||||
@ChatIdApiParam
|
||||
deleteChat(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('chatId') chatId: string,
|
||||
@@ -53,6 +55,7 @@ class ChatsController {
|
||||
@Get(':chatId/messages')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Gets messages in the chat' })
|
||||
@ChatIdApiParam
|
||||
getChatMessages(
|
||||
@Query() query: GetChatMessagesQuery,
|
||||
@SessionParam session: WhatsappSession,
|
||||
@@ -65,6 +68,7 @@ class ChatsController {
|
||||
@Delete(':chatId/messages')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Clears all messages from the chat' })
|
||||
@ChatIdApiParam
|
||||
clearMessages(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('chatId') chatId: string,
|
||||
@@ -98,6 +102,28 @@ class ChatsController {
|
||||
) {
|
||||
return session.editMessage(chatId, messageId, body);
|
||||
}
|
||||
|
||||
@Post(':chatId/archive')
|
||||
@SessionApiParam
|
||||
@ChatIdApiParam
|
||||
@ApiOperation({ summary: 'Archive the chat' })
|
||||
archiveChat(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('chatId') chatId: string,
|
||||
) {
|
||||
return session.chatsArchiveChat(chatId);
|
||||
}
|
||||
|
||||
@Post(':chatId/unarchive')
|
||||
@SessionApiParam
|
||||
@ChatIdApiParam
|
||||
@ApiOperation({ summary: 'Unarchive the chat' })
|
||||
unarchiveChat(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('chatId') chatId: string,
|
||||
) {
|
||||
return session.chatsUnarchiveChat(chatId);
|
||||
}
|
||||
}
|
||||
|
||||
export { ChatsController };
|
||||
@@ -26,35 +26,10 @@ import { WAMessage } from '../structures/responses.dto';
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('api')
|
||||
@ApiTags('chatting')
|
||||
@ApiTags('📤 Chatting')
|
||||
export class ChattingController {
|
||||
constructor(private manager: SessionManager) {}
|
||||
|
||||
@Get('/checkNumberStatus')
|
||||
@ApiOperation({ summary: 'Check number status' })
|
||||
async checkNumberStatus(
|
||||
@Query() request: CheckNumberStatusQuery,
|
||||
): Promise<WANumberExistResult> {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.checkNumberStatus(request);
|
||||
}
|
||||
|
||||
@Post('/sendContactVcard')
|
||||
sendContactVcard(@Body() request: MessageContactVcardRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.sendContactVCard(request);
|
||||
}
|
||||
|
||||
@Get('/sendText')
|
||||
@ApiOperation({ summary: 'Send a text message' })
|
||||
sendTextGet(@Query() query: MessageTextQuery) {
|
||||
const whatsapp = this.manager.getSession(query.session);
|
||||
const msg = new MessageTextRequest();
|
||||
msg.chatId = query.phone;
|
||||
msg.text = query.text;
|
||||
return whatsapp.sendText(msg);
|
||||
}
|
||||
|
||||
@Post('/sendText')
|
||||
@ApiOperation({ summary: 'Send a text message' })
|
||||
sendText(@Body() request: MessageTextRequest): Promise<WAMessage> {
|
||||
@@ -62,31 +37,11 @@ export class ChattingController {
|
||||
return whatsapp.sendText(request);
|
||||
}
|
||||
|
||||
@Post('/sendPoll')
|
||||
@ApiOperation({
|
||||
summary: 'Send a poll with options. You can use it as buttons replace',
|
||||
})
|
||||
sendPoll(@Body() request: MessagePollRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.sendPoll(request);
|
||||
}
|
||||
|
||||
@Post('/sendLocation')
|
||||
sendLocation(@Body() request: MessageLocationRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.sendLocation(request);
|
||||
}
|
||||
|
||||
@Post('/sendLinkPreview')
|
||||
sendLinkPreview(@Body() request: MessageLinkPreviewRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.sendLinkPreview(request);
|
||||
}
|
||||
|
||||
@Post('/sendImage')
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Send an image. Either from an URL or base64 data - look at the request schemas for details.',
|
||||
summary: 'Send an image',
|
||||
description:
|
||||
'Either from an URL or base64 data - look at the request schemas for details.',
|
||||
})
|
||||
sendImage(@Body() request: MessageImageRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
@@ -95,8 +50,9 @@ export class ChattingController {
|
||||
|
||||
@Post('/sendFile')
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Send a file. Either from an URL or base64 data - look at the request schemas for details.',
|
||||
summary: 'Send a file',
|
||||
description:
|
||||
'Either from an URL or base64 data - look at the request schemas for details.',
|
||||
})
|
||||
sendFile(@Body() request: MessageFileRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
@@ -105,8 +61,9 @@ export class ChattingController {
|
||||
|
||||
@Post('/sendVoice')
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Send an voice message. Either from an URL or base64 data - look at the request schemas for details.',
|
||||
summary: 'Send an voice message',
|
||||
description:
|
||||
'Either from an URL or base64 data - look at the request schemas for details.',
|
||||
})
|
||||
sendVoice(@Body() request: MessageVoiceRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
@@ -115,21 +72,15 @@ export class ChattingController {
|
||||
|
||||
@Post('/sendVideo')
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Send a video. Either from an URL or base64 data - look at the request schemas for details.',
|
||||
summary: 'Send a video',
|
||||
description:
|
||||
'Either from an URL or base64 data - look at the request schemas for details.',
|
||||
})
|
||||
sendVideo(@Body() request: MessageVideoRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.sendVideo(request);
|
||||
}
|
||||
|
||||
@Post('/reply')
|
||||
@ApiOperation({ summary: 'Reply to a text message' })
|
||||
reply(@Body() request: MessageReplyRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.reply(request);
|
||||
}
|
||||
|
||||
@Post('/sendSeen')
|
||||
sendSeen(@Body() chat: SendSeenRequest) {
|
||||
const whatsapp = this.manager.getSession(chat.session);
|
||||
@@ -166,10 +117,72 @@ export class ChattingController {
|
||||
return;
|
||||
}
|
||||
|
||||
@Post('/sendPoll')
|
||||
@ApiOperation({
|
||||
summary: 'Send a poll with options',
|
||||
description: 'You can use it as buttons or list replacement',
|
||||
})
|
||||
sendPoll(@Body() request: MessagePollRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.sendPoll(request);
|
||||
}
|
||||
|
||||
@Post('/sendLocation')
|
||||
sendLocation(@Body() request: MessageLocationRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.sendLocation(request);
|
||||
}
|
||||
|
||||
@Post('/sendLinkPreview')
|
||||
sendLinkPreview(@Body() request: MessageLinkPreviewRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.sendLinkPreview(request);
|
||||
}
|
||||
|
||||
@Get('/messages')
|
||||
@ApiOperation({ summary: 'Get messages in a chat' })
|
||||
getMessages(@Query() query: GetMessageQuery) {
|
||||
const whatsapp = this.manager.getSession(query.session);
|
||||
return whatsapp.getMessages(query);
|
||||
}
|
||||
|
||||
@Get('/sendText')
|
||||
@ApiOperation({ summary: 'Send a text message', deprecated: true })
|
||||
sendTextGet(@Query() query: MessageTextQuery) {
|
||||
const whatsapp = this.manager.getSession(query.session);
|
||||
const msg = new MessageTextRequest();
|
||||
msg.chatId = query.phone;
|
||||
msg.text = query.text;
|
||||
return whatsapp.sendText(msg);
|
||||
}
|
||||
|
||||
@Post('/sendContactVcard')
|
||||
sendContactVcard(@Body() request: MessageContactVcardRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.sendContactVCard(request);
|
||||
}
|
||||
|
||||
@Get('/checkNumberStatus')
|
||||
@ApiOperation({
|
||||
summary: 'Check number status',
|
||||
description: 'DEPRECATED. Use "POST /contacts/check-exists" instead',
|
||||
deprecated: true,
|
||||
})
|
||||
async DEPRECATED_checkNumberStatus(
|
||||
@Query() request: CheckNumberStatusQuery,
|
||||
): Promise<WANumberExistResult> {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.checkNumberStatus(request);
|
||||
}
|
||||
|
||||
@Post('/reply')
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'DEPRECATED - you can set "reply_to" field when sending text, image, etc',
|
||||
deprecated: true,
|
||||
})
|
||||
reply(@Body() request: MessageReplyRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.reply(request);
|
||||
}
|
||||
}
|
||||
@@ -11,14 +11,15 @@ import { ContactQuery, ContactRequest } from '../structures/contacts.dto';
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('api/contacts')
|
||||
@ApiTags('contacts')
|
||||
@ApiTags('👤 Contacts')
|
||||
export class ContactsController {
|
||||
constructor(private manager: SessionManager) {}
|
||||
|
||||
@Get('/')
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Get contact basic info. The method always return result, even if the phone number is not registered in WhatsApp. For that - use /check-exists endpoint below.',
|
||||
summary: 'Get contact basic info',
|
||||
description:
|
||||
'The method always return result, even if the phone number is not registered in WhatsApp. For that - use /contacts/check-exists endpoint below.',
|
||||
})
|
||||
get(@Query() query: ContactQuery) {
|
||||
const whatsapp = this.manager.getSession(query.session);
|
||||
@@ -43,8 +44,9 @@ export class ContactsController {
|
||||
|
||||
@Get('/about')
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Gets the Contact\'s current "about" info. Returns null if you don\'t have permission to read their status.',
|
||||
summary: 'Gets the Contact\'s "about" info',
|
||||
description:
|
||||
'Returns null if you do not have permission to read their status.',
|
||||
})
|
||||
getAbout(@Query() query: ContactQuery) {
|
||||
const whatsapp = this.manager.getSession(query.session);
|
||||
@@ -53,8 +55,9 @@ export class ContactsController {
|
||||
|
||||
@Get('/profile-picture')
|
||||
@ApiOperation({
|
||||
summary:
|
||||
"Returns the contact's profile picture URL, if privacy settings allow it.",
|
||||
summary: "Get contact's profile picture URL",
|
||||
description:
|
||||
'If privacy settings do not allow to get the picture, the method will return null.',
|
||||
})
|
||||
getProfilePicture(@Query() query: ContactQuery) {
|
||||
const whatsapp = this.manager.getSession(query.session);
|
||||
|
||||
@@ -8,6 +8,11 @@ import {
|
||||
Put,
|
||||
} from '@nestjs/common';
|
||||
import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger';
|
||||
import { GroupIdApiParam } from '@waha/nestjs/params/ChatIdApiParam';
|
||||
import {
|
||||
SessionApiParam,
|
||||
SessionParam,
|
||||
} from '@waha/nestjs/params/SessionApiParam';
|
||||
|
||||
import { SessionManager } from '../core/abc/manager.abc';
|
||||
import { WhatsappSession } from '../core/abc/session.abc';
|
||||
@@ -18,11 +23,10 @@ import {
|
||||
SettingsSecurityChangeInfo,
|
||||
SubjectRequest,
|
||||
} from '../structures/groups.dto';
|
||||
import { SessionApiParam, SessionParam } from './helpers';
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('api/:session/groups')
|
||||
@ApiTags('groups')
|
||||
@ApiTags('👥 Groups')
|
||||
export class GroupsController {
|
||||
constructor(private manager: SessionManager) {}
|
||||
|
||||
@@ -44,6 +48,7 @@ export class GroupsController {
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
@GroupIdApiParam
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Get the group.' })
|
||||
getGroup(@SessionParam session: WhatsappSession, @Param('id') id: string) {
|
||||
@@ -52,9 +57,11 @@ export class GroupsController {
|
||||
|
||||
@Put(':id/settings/security/info-admin-only')
|
||||
@SessionApiParam
|
||||
@GroupIdApiParam
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Updates the group settings to only allow admins to edit group info (title, description, photo).',
|
||||
summary: 'Updates the group "info admin only" settings.',
|
||||
description:
|
||||
'You can allow only admins to edit group info (title, description, photo).',
|
||||
})
|
||||
setInfoAdminOnly(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@@ -66,9 +73,11 @@ export class GroupsController {
|
||||
|
||||
@Get(':id/settings/security/info-admin-only')
|
||||
@SessionApiParam
|
||||
@GroupIdApiParam
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Gets the group settings to only allow admins to edit group info (title, description, photo).',
|
||||
summary: "Get the group's 'info admin only' settings.",
|
||||
description:
|
||||
'You can allow only admins to edit group info (title, description, photo).',
|
||||
})
|
||||
getInfoAdminOnly(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@@ -79,8 +88,10 @@ export class GroupsController {
|
||||
|
||||
@Put(':id/settings/security/messages-admin-only')
|
||||
@SessionApiParam
|
||||
@GroupIdApiParam
|
||||
@ApiOperation({
|
||||
summary:
|
||||
summary: 'Update settings - who can send messages',
|
||||
description:
|
||||
'Updates the group settings to only allow admins to send messages.',
|
||||
})
|
||||
setMessagesAdminOnly(
|
||||
@@ -93,8 +104,10 @@ export class GroupsController {
|
||||
|
||||
@Get(':id/settings/security/messages-admin-only')
|
||||
@SessionApiParam
|
||||
@GroupIdApiParam
|
||||
@ApiOperation({
|
||||
summary: 'Gets the group settings to only allow admins to send messages.',
|
||||
summary: 'Get settings - who can send messages',
|
||||
description: 'The group settings to only allow admins to send messages.',
|
||||
})
|
||||
getMessagesAdminOnly(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@@ -105,6 +118,7 @@ export class GroupsController {
|
||||
|
||||
@Delete(':id')
|
||||
@SessionApiParam
|
||||
@GroupIdApiParam
|
||||
@ApiOperation({ summary: 'Delete the group.' })
|
||||
deleteGroup(@SessionParam session: WhatsappSession, @Param('id') id: string) {
|
||||
return session.deleteGroup(id);
|
||||
@@ -112,6 +126,7 @@ export class GroupsController {
|
||||
|
||||
@Post(':id/leave')
|
||||
@SessionApiParam
|
||||
@GroupIdApiParam
|
||||
@ApiOperation({ summary: 'Leave the group.' })
|
||||
leaveGroup(@SessionParam session: WhatsappSession, @Param('id') id: string) {
|
||||
return session.leaveGroup(id);
|
||||
@@ -119,11 +134,12 @@ export class GroupsController {
|
||||
|
||||
@Put(':id/description')
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Updates the group description.\n' +
|
||||
'Returns true if the subject was properly updated. This can return false if the user does not have the necessary permissions.\n',
|
||||
summary: 'Updates the group description.',
|
||||
description:
|
||||
'Returns "true" if the subject was properly updated. This can return "false" if the user does not have the necessary permissions.',
|
||||
})
|
||||
@SessionApiParam
|
||||
@GroupIdApiParam
|
||||
setDescription(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('id') id: string,
|
||||
@@ -134,10 +150,11 @@ export class GroupsController {
|
||||
|
||||
@Put(':id/subject')
|
||||
@SessionApiParam
|
||||
@GroupIdApiParam
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Updates the group subject.\n' +
|
||||
'Returns true if the subject was properly updated. This can return false if the user does not have the necessary permissions.\n',
|
||||
summary: 'Updates the group subject',
|
||||
description:
|
||||
'Returns "true" if the subject was properly updated. This can return "false" if the user does not have the necessary permissions.',
|
||||
})
|
||||
setSubject(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@@ -149,7 +166,8 @@ export class GroupsController {
|
||||
|
||||
@Get(':id/invite-code')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Gets the invite code for a specific group.' })
|
||||
@GroupIdApiParam
|
||||
@ApiOperation({ summary: 'Gets the invite code for the group.' })
|
||||
getInviteCode(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('id') id: string,
|
||||
@@ -159,6 +177,7 @@ export class GroupsController {
|
||||
|
||||
@Post(':id/invite-code/revoke')
|
||||
@SessionApiParam
|
||||
@GroupIdApiParam
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Invalidates the current group invite code and generates a new one.',
|
||||
@@ -172,7 +191,8 @@ export class GroupsController {
|
||||
|
||||
@Get(':id/participants/')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Get a list of participants by in the group.' })
|
||||
@GroupIdApiParam
|
||||
@ApiOperation({ summary: 'Get participants' })
|
||||
getParticipants(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('id') id: string,
|
||||
@@ -182,7 +202,8 @@ export class GroupsController {
|
||||
|
||||
@Post(':id/participants/add')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Adds a list of participants by ID to the group.' })
|
||||
@GroupIdApiParam
|
||||
@ApiOperation({ summary: 'Add participants' })
|
||||
addParticipants(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('id') id: string,
|
||||
@@ -193,8 +214,9 @@ export class GroupsController {
|
||||
|
||||
@Post(':id/participants/remove')
|
||||
@SessionApiParam
|
||||
@GroupIdApiParam
|
||||
@ApiOperation({
|
||||
summary: 'Removes a list of participants by ID to the group.',
|
||||
summary: 'Remove participants',
|
||||
})
|
||||
removeParticipants(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@@ -206,6 +228,7 @@ export class GroupsController {
|
||||
|
||||
@Post(':id/admin/promote')
|
||||
@SessionApiParam
|
||||
@GroupIdApiParam
|
||||
@ApiOperation({ summary: 'Promote participants to admin users.' })
|
||||
promoteToAdmin(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@@ -217,7 +240,8 @@ export class GroupsController {
|
||||
|
||||
@Post(':id/admin/demote')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Demotes participants by to regular users.' })
|
||||
@GroupIdApiParam
|
||||
@ApiOperation({ summary: 'Demotes participants to regular users.' })
|
||||
demoteToAdmin(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('id') id: string,
|
||||
|
||||
@@ -1,16 +1,22 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger';
|
||||
import { HealthCheck } from '@nestjs/terminus';
|
||||
|
||||
import { WAHAHealthCheckService } from '../core/abc/WAHAHealthCheckService';
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('health')
|
||||
@ApiTags('other')
|
||||
@ApiTags('🔍 Observability')
|
||||
export class HealthController {
|
||||
constructor(private wahaHealth: WAHAHealthCheckService) {}
|
||||
|
||||
@Get()
|
||||
@HealthCheck()
|
||||
@ApiOperation({
|
||||
summary: 'Check the health of the server',
|
||||
description:
|
||||
"Perform all health checks and return the server's health status.",
|
||||
})
|
||||
async check() {
|
||||
return this.wahaHealth.check();
|
||||
}
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
import {
|
||||
applyDecorators,
|
||||
Injectable,
|
||||
Param,
|
||||
PipeTransform,
|
||||
} from '@nestjs/common';
|
||||
import {
|
||||
ApiExtraModels,
|
||||
ApiParam,
|
||||
ApiResponse,
|
||||
getSchemaPath,
|
||||
} from '@nestjs/swagger';
|
||||
|
||||
import { SessionManager } from '../core/abc/manager.abc';
|
||||
import { WhatsappSession } from '../core/abc/session.abc';
|
||||
import { Base64File } from '../structures/files.dto';
|
||||
|
||||
/**
|
||||
* Get session name and return Whatsapp session back (if exists)
|
||||
* use it as
|
||||
@Param('session', SessionPipe) session: WhatsappSession,
|
||||
*/
|
||||
@Injectable()
|
||||
export class SessionPipe implements PipeTransform<WhatsappSession> {
|
||||
constructor(private manager: SessionManager) {}
|
||||
|
||||
async transform(value: any) {
|
||||
return this.manager.getSession(value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Decorator for a method that uses SessionPipe above
|
||||
*/
|
||||
export const SessionApiParam = ApiParam({
|
||||
name: 'session',
|
||||
required: true,
|
||||
type: 'string',
|
||||
schema: {
|
||||
default: 'default',
|
||||
},
|
||||
description: 'WhatsApp session name',
|
||||
});
|
||||
|
||||
/**
|
||||
* Session param
|
||||
@SessionParam session: WhatsappSession,
|
||||
*/
|
||||
export const SessionParam = Param('session', SessionPipe);
|
||||
|
||||
export const ChatIdApiParam = ApiParam({
|
||||
name: 'chatId',
|
||||
required: true,
|
||||
type: 'string',
|
||||
description: 'Chat ID',
|
||||
example: '123456789@c.us',
|
||||
});
|
||||
|
||||
export const MessageIdApiParam = ApiParam({
|
||||
name: 'messageId',
|
||||
required: true,
|
||||
type: 'string',
|
||||
description: 'Message ID',
|
||||
example: 'true_123456789@c.us_BAE6A33293978B16',
|
||||
});
|
||||
|
||||
function getRefSchemaPaths(models) {
|
||||
return models.map((model) => {
|
||||
return { $ref: getSchemaPath(model) };
|
||||
});
|
||||
}
|
||||
|
||||
export function ApiFileAcceptHeader(...models) {
|
||||
models = models.length ? models : [Base64File];
|
||||
return applyDecorators(
|
||||
// Add extra models, otherwise it'll give a error
|
||||
// $ref not found
|
||||
ApiExtraModels(...models),
|
||||
ApiResponse({
|
||||
status: 200,
|
||||
content: {
|
||||
'image/png': {
|
||||
schema: {
|
||||
type: 'string',
|
||||
format: 'binary',
|
||||
},
|
||||
},
|
||||
'application/json': {
|
||||
schema: {
|
||||
oneOf: getRefSchemaPaths(models),
|
||||
},
|
||||
},
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
import { Body, Controller, Get, Param, Put } from '@nestjs/common';
|
||||
import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger';
|
||||
import { WhatsappSession } from '@waha/core/abc/session.abc';
|
||||
import { ChatIdApiParam } from '@waha/nestjs/params/ChatIdApiParam';
|
||||
import {
|
||||
SessionApiParam,
|
||||
SessionParam,
|
||||
} from '@waha/nestjs/params/SessionApiParam';
|
||||
import { Label, SetLabelsRequest } from '@waha/structures/labels.dto';
|
||||
|
||||
import { SessionManager } from '../core/abc/manager.abc';
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('api/:session/labels')
|
||||
@ApiTags('🏷️ Labels')
|
||||
export class LabelsController {
|
||||
constructor(private manager: SessionManager) {}
|
||||
|
||||
@Get('/')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Get all labels' })
|
||||
getAll(@SessionParam session: WhatsappSession): Promise<Label[]> {
|
||||
return session.getLabels();
|
||||
}
|
||||
|
||||
@Get('/chats/:chatId')
|
||||
@SessionApiParam
|
||||
@ChatIdApiParam
|
||||
@ApiOperation({ summary: 'Get labels for the chat' })
|
||||
getChatLabels(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('chatId') chatId: string,
|
||||
): Promise<Label[]> {
|
||||
return session.getChatLabels(chatId);
|
||||
}
|
||||
|
||||
@Put('/chats/:chatId')
|
||||
@SessionApiParam
|
||||
@ChatIdApiParam
|
||||
@ApiOperation({ summary: 'Save labels for the chat' })
|
||||
putChatLabels(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('chatId') chatId: string,
|
||||
@Body() request: SetLabelsRequest,
|
||||
) {
|
||||
return session.putLabelsToChat(chatId, request.labels);
|
||||
}
|
||||
|
||||
@Get('/:labelId/chats')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Get chats by label' })
|
||||
getChatsByLabel(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('labelId') labelId: string,
|
||||
) {
|
||||
return session.getChatsByLabelId(labelId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger';
|
||||
import { PingResponse } from '@waha/structures/ping.dto';
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('ping')
|
||||
@ApiTags('🔍 Observability')
|
||||
export class PingController {
|
||||
@Get()
|
||||
@ApiOperation({
|
||||
summary: 'Ping the server',
|
||||
description: 'Check if the server is alive and responding to requests.',
|
||||
})
|
||||
ping(): PingResponse {
|
||||
return { message: 'pong' };
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,11 @@ import {
|
||||
Post,
|
||||
} from '@nestjs/common';
|
||||
import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger';
|
||||
import { ChatIdApiParam } from '@waha/nestjs/params/ChatIdApiParam';
|
||||
import {
|
||||
SessionApiParam,
|
||||
SessionParam,
|
||||
} from '@waha/nestjs/params/SessionApiParam';
|
||||
|
||||
import { SessionManager } from '../core/abc/manager.abc';
|
||||
import { WhatsappSession } from '../core/abc/session.abc';
|
||||
@@ -15,11 +20,10 @@ import {
|
||||
WAHAChatPresences,
|
||||
WAHASessionPresence,
|
||||
} from '../structures/presence.dto';
|
||||
import { SessionApiParam, SessionParam } from './helpers';
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('api/:session/presence')
|
||||
@ApiTags('presence')
|
||||
@ApiTags('✅ Presence')
|
||||
export class PresenceController {
|
||||
constructor(private manager: SessionManager) {}
|
||||
|
||||
@@ -64,6 +68,7 @@ export class PresenceController {
|
||||
|
||||
@Get(':chatId')
|
||||
@SessionApiParam
|
||||
@ChatIdApiParam
|
||||
@ApiOperation({
|
||||
summary:
|
||||
"Get the presence for the chat id. If it hasn't been subscribed - it also subscribes to it.",
|
||||
@@ -77,6 +82,7 @@ export class PresenceController {
|
||||
|
||||
@Post(':chatId/subscribe')
|
||||
@SessionApiParam
|
||||
@ChatIdApiParam
|
||||
@ApiOperation({
|
||||
summary: 'Subscribe to presence events for the chat.',
|
||||
})
|
||||
|
||||
@@ -7,16 +7,16 @@ import {
|
||||
UseInterceptors,
|
||||
} from '@nestjs/common';
|
||||
import { ApiSecurity, ApiTags } from '@nestjs/swagger';
|
||||
import { ApiFileAcceptHeader } from '@waha/nestjs/ApiFileAcceptHeader';
|
||||
import { Response } from 'express';
|
||||
|
||||
import { SessionManager } from '../core/abc/manager.abc';
|
||||
import { BufferResponseInterceptor } from '../nestjs/BufferResponseInterceptor';
|
||||
import { SessionQuery } from '../structures/base.dto';
|
||||
import { BufferResponseInterceptor } from './BufferResponseInterceptor';
|
||||
import { ApiFileAcceptHeader } from './helpers';
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('api')
|
||||
@ApiTags('screenshot')
|
||||
@ApiTags('🖼️ Screenshot')
|
||||
export class ScreenshotController {
|
||||
constructor(private manager: SessionManager) {}
|
||||
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
import * as process from 'node:process';
|
||||
|
||||
import {
|
||||
Body,
|
||||
Controller,
|
||||
Get,
|
||||
Logger,
|
||||
Post,
|
||||
Query,
|
||||
UsePipes,
|
||||
} from '@nestjs/common';
|
||||
import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger';
|
||||
import { getApp } from '@waha/main';
|
||||
import { WAHAValidationPipe } from '@waha/nestjs/pipes/WAHAValidationPipe';
|
||||
import { WAHAEnvironment } from '@waha/structures/environment.dto';
|
||||
import {
|
||||
EnvironmentQuery,
|
||||
ServerStatusResponse,
|
||||
StopRequest,
|
||||
} from '@waha/structures/server.dto';
|
||||
import { VERSION } from '@waha/version';
|
||||
import * as lodash from 'lodash';
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('api/server')
|
||||
@ApiTags('🔍 Observability')
|
||||
export class ServerController {
|
||||
private logger: Logger;
|
||||
|
||||
constructor() {
|
||||
this.logger = new Logger('ServerController');
|
||||
}
|
||||
|
||||
@Get('version')
|
||||
@ApiOperation({ summary: 'Get the version of the server' })
|
||||
get(): WAHAEnvironment {
|
||||
return VERSION;
|
||||
}
|
||||
|
||||
@Get('environment')
|
||||
@ApiOperation({ summary: 'Get the server environment' })
|
||||
environment(
|
||||
@Query(new WAHAValidationPipe()) query: EnvironmentQuery,
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
): object {
|
||||
let result = process.env;
|
||||
if (!query.all) {
|
||||
result = lodash.pickBy(result, (value, key) => {
|
||||
return (
|
||||
key.startsWith('WAHA_') ||
|
||||
key.startsWith('WHATSAPP_') ||
|
||||
key === 'DEBUG'
|
||||
);
|
||||
});
|
||||
}
|
||||
const map = new Map<string, string>();
|
||||
// sort and set
|
||||
Object.keys(result)
|
||||
.sort()
|
||||
.forEach((key) => {
|
||||
map.set(key, result[key]);
|
||||
});
|
||||
return Object.fromEntries(map);
|
||||
}
|
||||
|
||||
@Get('status')
|
||||
@ApiOperation({ summary: 'Get the server status' })
|
||||
async status(): Promise<ServerStatusResponse> {
|
||||
const now = Date.now();
|
||||
const uptime = Math.floor(process.uptime() * 1000);
|
||||
const startTimestamp = now - uptime;
|
||||
return {
|
||||
startTimestamp: startTimestamp,
|
||||
uptime: uptime,
|
||||
};
|
||||
}
|
||||
|
||||
@Post('stop')
|
||||
@ApiOperation({
|
||||
summary: 'Stop (and restart) the server',
|
||||
description:
|
||||
"If you're using docker, after calling this endpoint Docker will start a new container, " +
|
||||
'so you can use this endpoint to restart the server',
|
||||
})
|
||||
@UsePipes(new WAHAValidationPipe())
|
||||
async stop(@Body() request: StopRequest) {
|
||||
const timeout = 1_000;
|
||||
if (request.force) {
|
||||
this.logger.log(`Force stopping the server in ${timeout}ms`);
|
||||
setTimeout(() => {
|
||||
this.logger.log('Force stopping the server');
|
||||
process.kill(process.pid, 'SIGKILL');
|
||||
}, timeout);
|
||||
} else {
|
||||
this.logger.log(`Gracefully stopping the server in ${timeout}ms`);
|
||||
setTimeout(async () => {
|
||||
this.logger.log('Gracefully closing the application...');
|
||||
const app = getApp();
|
||||
if (app) {
|
||||
await app.close();
|
||||
}
|
||||
this.logger.log('Application closed');
|
||||
process.exit(0);
|
||||
}, timeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
+255
-47
@@ -6,69 +6,66 @@ import {
|
||||
NotFoundException,
|
||||
Param,
|
||||
Post,
|
||||
Put,
|
||||
Query,
|
||||
UsePipes,
|
||||
} from '@nestjs/common';
|
||||
import { UnprocessableEntityException } from '@nestjs/common/exceptions/unprocessable-entity.exception';
|
||||
import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger';
|
||||
import {
|
||||
ApiExtraModels,
|
||||
ApiOperation,
|
||||
ApiSecurity,
|
||||
ApiTags,
|
||||
} from '@nestjs/swagger';
|
||||
SessionApiParam,
|
||||
SessionParam,
|
||||
} from '@waha/nestjs/params/SessionApiParam';
|
||||
import { WAHAValidationPipe } from '@waha/nestjs/pipes/WAHAValidationPipe';
|
||||
import { WAHASessionStatus } from '@waha/structures/enums.dto';
|
||||
import {
|
||||
SessionLogoutDeprecatedRequest,
|
||||
SessionStartDeprecatedRequest,
|
||||
SessionStopDeprecatedRequest,
|
||||
} from '@waha/structures/sessions.deprecated.dto';
|
||||
import { generatePrefixedId } from '@waha/utils/ids';
|
||||
import { sleep } from '@waha/utils/promiseTimeout';
|
||||
|
||||
import { SessionManager } from '../core/abc/manager.abc';
|
||||
import { WhatsappSession } from '../core/abc/session.abc';
|
||||
import { parseBool } from '../helpers';
|
||||
import {
|
||||
ListSessionsQuery,
|
||||
MeInfo,
|
||||
SessionCreateRequest,
|
||||
SessionDTO,
|
||||
SessionInfo,
|
||||
SessionLogoutRequest,
|
||||
SessionStartRequest,
|
||||
SessionStopRequest,
|
||||
SessionUpdateRequest,
|
||||
} from '../structures/sessions.dto';
|
||||
import { SessionApiParam, SessionParam } from './helpers';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const AsyncLock = require('async-lock');
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('api/sessions')
|
||||
@ApiTags('sessions')
|
||||
@ApiTags('🖥️ Sessions')
|
||||
class SessionsController {
|
||||
constructor(private manager: SessionManager) {}
|
||||
private lock: any;
|
||||
|
||||
@Post('/start/')
|
||||
async start(@Body() request: SessionStartRequest): Promise<SessionDTO> {
|
||||
const result = await this.manager.start(request);
|
||||
await this.manager.sessionConfigRepository.save(
|
||||
request.name,
|
||||
request.config || null,
|
||||
);
|
||||
return result;
|
||||
constructor(private manager: SessionManager) {
|
||||
this.lock = new AsyncLock({ maxPending: Infinity });
|
||||
}
|
||||
|
||||
@Post('/stop/')
|
||||
@ApiOperation({ summary: 'Stop session' })
|
||||
async stop(@Body() request: SessionStopRequest): Promise<void> {
|
||||
if (request.logout) {
|
||||
await this.manager.logout(request);
|
||||
} else {
|
||||
await this.manager.stop(request);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@Post('/logout/')
|
||||
@ApiOperation({ summary: 'Logout from session.' })
|
||||
clean(@Body() request: SessionLogoutRequest): Promise<void> {
|
||||
return this.manager.logout(request);
|
||||
private withLock(name: string, fn: () => any) {
|
||||
return this.lock.acquire(name, fn);
|
||||
}
|
||||
|
||||
@Get('/')
|
||||
list(@Query() query: ListSessionsQuery): Promise<SessionInfo[]> {
|
||||
const all = parseBool(query.all);
|
||||
return this.manager.getSessions(all);
|
||||
@ApiOperation({ summary: 'List all sessions' })
|
||||
list(
|
||||
@Query(new WAHAValidationPipe()) query: ListSessionsQuery,
|
||||
): Promise<SessionInfo[]> {
|
||||
return this.manager.getSessions(query.all);
|
||||
}
|
||||
|
||||
@Get('/:session')
|
||||
@ApiOperation({ summary: 'Get session information' })
|
||||
@SessionApiParam
|
||||
@UsePipes(new WAHAValidationPipe())
|
||||
async get(@Param('session') name: string): Promise<SessionInfo> {
|
||||
const session = this.manager.getSessionInfo(name);
|
||||
if (session === null) {
|
||||
@@ -76,20 +73,231 @@ class SessionsController {
|
||||
}
|
||||
return session;
|
||||
}
|
||||
}
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('api/sessions/:session')
|
||||
@ApiTags('sessions')
|
||||
class SessionController {
|
||||
constructor(private manager: SessionManager) {}
|
||||
|
||||
@Get('me')
|
||||
@Get(':session/me')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Get information about the authenticated account' })
|
||||
getMe(@SessionParam session: WhatsappSession): MeInfo | null {
|
||||
return session.getSessionMeInfo();
|
||||
}
|
||||
|
||||
@Post('')
|
||||
@ApiOperation({
|
||||
summary: 'Create a session',
|
||||
description:
|
||||
'Create session a new session (and start it at the same time if required).',
|
||||
})
|
||||
@UsePipes(new WAHAValidationPipe())
|
||||
async create(@Body() request: SessionCreateRequest): Promise<SessionDTO> {
|
||||
const name = request.name || generatePrefixedId('session');
|
||||
await this.withLock(name, async () => {
|
||||
if (await this.manager.exists(name)) {
|
||||
const msg = `Session '${name}' already exists. Use PUT to update it.`;
|
||||
throw new UnprocessableEntityException(msg);
|
||||
}
|
||||
|
||||
const config = request.config;
|
||||
const start = request.start || false;
|
||||
await this.manager.upsert(name, config);
|
||||
if (start) {
|
||||
await this.manager.start(name);
|
||||
}
|
||||
});
|
||||
return await this.manager.getSessionInfo(name);
|
||||
}
|
||||
|
||||
@Put(':session')
|
||||
@ApiOperation({
|
||||
summary: 'Update a session',
|
||||
description: '',
|
||||
})
|
||||
@SessionApiParam
|
||||
@UsePipes(new WAHAValidationPipe())
|
||||
async update(
|
||||
@Param('session') name: string,
|
||||
@Body() request: SessionUpdateRequest,
|
||||
): Promise<SessionDTO> {
|
||||
await this.withLock(name, async () => {
|
||||
if (!(await this.manager.exists(name))) {
|
||||
throw new NotFoundException('Session not found');
|
||||
}
|
||||
const config = request.config;
|
||||
const isRunning = this.manager.isRunning(name);
|
||||
await this.manager.stop(name, true);
|
||||
await this.manager.upsert(name, config);
|
||||
if (isRunning) {
|
||||
await this.manager.start(name);
|
||||
}
|
||||
});
|
||||
return await this.manager.getSessionInfo(name);
|
||||
}
|
||||
|
||||
@Delete(':session')
|
||||
@SessionApiParam
|
||||
@ApiOperation({
|
||||
summary: 'Delete the session',
|
||||
description:
|
||||
'Delete the session with the given name. Stop and logout as well. Idempotent operation.',
|
||||
})
|
||||
@UsePipes(new WAHAValidationPipe())
|
||||
async delete(@Param('session') name: string): Promise<void> {
|
||||
await this.withLock(name, async () => {
|
||||
await this.manager.stop(name, true);
|
||||
await this.manager.logout(name);
|
||||
await this.manager.delete(name);
|
||||
});
|
||||
}
|
||||
|
||||
@Post(':session/start')
|
||||
@SessionApiParam
|
||||
@ApiOperation({
|
||||
summary: 'Start the session',
|
||||
description:
|
||||
'Start the session with the given name. The session must exist. Identity operation.',
|
||||
})
|
||||
@UsePipes(new WAHAValidationPipe())
|
||||
async start(@Param('session') name: string): Promise<SessionDTO> {
|
||||
await this.withLock(name, async () => {
|
||||
const exists = await this.manager.exists(name);
|
||||
if (!exists) {
|
||||
throw new NotFoundException('Session not found');
|
||||
}
|
||||
const isRunning = this.manager.isRunning(name);
|
||||
if (!isRunning) {
|
||||
await this.manager.start(name);
|
||||
}
|
||||
});
|
||||
return await this.manager.getSessionInfo(name);
|
||||
}
|
||||
|
||||
@Post(':session/stop')
|
||||
@SessionApiParam
|
||||
@ApiOperation({
|
||||
summary: 'Stop the session',
|
||||
description: 'Stop the session with the given name. Idempotent operation.',
|
||||
})
|
||||
@UsePipes(new WAHAValidationPipe())
|
||||
async stop(@Param('session') name: string): Promise<SessionDTO> {
|
||||
await this.withLock(name, async () => {
|
||||
const exists = await this.manager.exists(name);
|
||||
if (!exists) {
|
||||
throw new NotFoundException('Session not found');
|
||||
}
|
||||
await this.manager.stop(name, false);
|
||||
});
|
||||
return await this.manager.getSessionInfo(name);
|
||||
}
|
||||
|
||||
@Post(':session/logout')
|
||||
@SessionApiParam
|
||||
@ApiOperation({
|
||||
summary: 'Logout from the session',
|
||||
description: 'Logout the session, restart a session if it was not STOPPED',
|
||||
})
|
||||
@UsePipes(new WAHAValidationPipe())
|
||||
async logout(@Param('session') name: string): Promise<SessionDTO> {
|
||||
await this.withLock(name, async () => {
|
||||
const exists = await this.manager.exists(name);
|
||||
if (!exists) {
|
||||
throw new NotFoundException('Session not found');
|
||||
}
|
||||
const isRunning = this.manager.isRunning(name);
|
||||
await this.manager.stop(name, true);
|
||||
await this.manager.logout(name);
|
||||
if (isRunning) {
|
||||
await this.manager.start(name);
|
||||
}
|
||||
});
|
||||
return await this.manager.getSessionInfo(name);
|
||||
}
|
||||
|
||||
@Post(':session/restart')
|
||||
@SessionApiParam
|
||||
@ApiOperation({
|
||||
summary: 'Restart the session',
|
||||
description: 'Restart the session with the given name.',
|
||||
})
|
||||
@UsePipes(new WAHAValidationPipe())
|
||||
async restart(@Param('session') name: string): Promise<SessionDTO> {
|
||||
await this.withLock(name, async () => {
|
||||
const exists = await this.manager.exists(name);
|
||||
if (!exists) {
|
||||
throw new NotFoundException('Session not found');
|
||||
}
|
||||
await this.manager.stop(name, true);
|
||||
await this.manager.start(name);
|
||||
});
|
||||
|
||||
return await this.manager.getSessionInfo(name);
|
||||
}
|
||||
|
||||
@Post('/start/')
|
||||
@ApiOperation({
|
||||
summary: 'Upsert and Start session',
|
||||
description:
|
||||
'Create session (if not exists) or update a config (if exists) and start it.',
|
||||
deprecated: true,
|
||||
})
|
||||
async DEPRACATED_start(
|
||||
@Body() request: SessionStartDeprecatedRequest,
|
||||
): Promise<SessionDTO> {
|
||||
const name = request.name;
|
||||
if (this.manager.isRunning(name)) {
|
||||
const msg = `Session '${name}' is already started.`;
|
||||
throw new UnprocessableEntityException(msg);
|
||||
}
|
||||
|
||||
return await this.withLock(name, async () => {
|
||||
const config = request.config;
|
||||
if (config) {
|
||||
await this.manager.upsert(name, config);
|
||||
}
|
||||
return await this.manager.start(name);
|
||||
});
|
||||
}
|
||||
|
||||
@Post('/stop/')
|
||||
@ApiOperation({
|
||||
summary: 'Stop (and Logout if asked) session',
|
||||
description: 'Stop session and Logout by default.',
|
||||
deprecated: true,
|
||||
})
|
||||
async DEPRECATED_stop(
|
||||
@Body() request: SessionStopDeprecatedRequest,
|
||||
): Promise<void> {
|
||||
const name = request.name;
|
||||
if (request.logout) {
|
||||
// Old API did remove the session complete
|
||||
await this.withLock(name, async () => {
|
||||
await this.manager.stop(name, true);
|
||||
await this.manager.logout(name);
|
||||
await this.manager.delete(name);
|
||||
});
|
||||
} else {
|
||||
await this.withLock(name, async () => {
|
||||
await this.manager.stop(name, false);
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@Post('/logout/')
|
||||
@ApiOperation({
|
||||
summary: 'Logout and Delete session.',
|
||||
description: 'Stop, Logout and Delete session.',
|
||||
deprecated: true,
|
||||
})
|
||||
async DEPRECATED_logout(
|
||||
@Body() request: SessionLogoutDeprecatedRequest,
|
||||
): Promise<void> {
|
||||
const name = request.name;
|
||||
await this.withLock(name, async () => {
|
||||
await this.manager.stop(name, true);
|
||||
await this.manager.logout(name);
|
||||
await this.manager.delete(name);
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
export { SessionController, SessionsController };
|
||||
export { SessionsController };
|
||||
@@ -1,13 +1,9 @@
|
||||
import {
|
||||
Body,
|
||||
Controller,
|
||||
Delete,
|
||||
Get,
|
||||
Param,
|
||||
Post,
|
||||
Query,
|
||||
} from '@nestjs/common';
|
||||
import { Body, Controller, Post } from '@nestjs/common';
|
||||
import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger';
|
||||
import {
|
||||
SessionApiParam,
|
||||
SessionParam,
|
||||
} from '@waha/nestjs/params/SessionApiParam';
|
||||
|
||||
import { SessionManager } from '../core/abc/manager.abc';
|
||||
import { WhatsappSession } from '../core/abc/session.abc';
|
||||
@@ -18,17 +14,16 @@ import {
|
||||
VideoStatus,
|
||||
VoiceStatus,
|
||||
} from '../structures/status.dto';
|
||||
import { SessionApiParam, SessionParam } from './helpers';
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('api/:session/status')
|
||||
@ApiTags('status')
|
||||
@ApiTags('🟢 Status')
|
||||
class StatusController {
|
||||
constructor(private manager: SessionManager) {}
|
||||
|
||||
@Post('text')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Send text status.' })
|
||||
@ApiOperation({ summary: 'Send text status' })
|
||||
sendTextStatus(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Body() status: TextStatus,
|
||||
@@ -38,7 +33,7 @@ class StatusController {
|
||||
|
||||
@Post('image')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Send image status.' })
|
||||
@ApiOperation({ summary: 'Send image status' })
|
||||
sendImageStatus(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Body() status: ImageStatus,
|
||||
@@ -48,7 +43,7 @@ class StatusController {
|
||||
|
||||
@Post('voice')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Send voice status.' })
|
||||
@ApiOperation({ summary: 'Send voice status' })
|
||||
sendVoiceStatus(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Body() status: VoiceStatus,
|
||||
@@ -58,7 +53,7 @@ class StatusController {
|
||||
|
||||
@Post('video')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Send video status.' })
|
||||
@ApiOperation({ summary: 'Send video status' })
|
||||
sendVideoStatus(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Body() status: VideoStatus,
|
||||
@@ -68,7 +63,7 @@ class StatusController {
|
||||
|
||||
@Post('delete')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'DELETE sent status.' })
|
||||
@ApiOperation({ summary: 'DELETE sent status' })
|
||||
deleteStatus(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Body() status: DeleteStatusRequest,
|
||||
|
||||
@@ -1,14 +1,24 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { ApiExtraModels, ApiSecurity, ApiTags } from '@nestjs/swagger';
|
||||
import {
|
||||
ApiExtraModels,
|
||||
ApiOperation,
|
||||
ApiSecurity,
|
||||
ApiTags,
|
||||
} from '@nestjs/swagger';
|
||||
|
||||
import { WAHAEnvironment } from '../structures/environment.dto';
|
||||
import { VERSION } from '../version';
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('api/version')
|
||||
@ApiTags('other')
|
||||
@ApiTags('🔍 Observability')
|
||||
export class VersionController {
|
||||
@Get('')
|
||||
@ApiOperation({
|
||||
summary: 'Get the server version ',
|
||||
deprecated: true,
|
||||
description: "Use 'GET /api/server/version' instead ",
|
||||
})
|
||||
get(): WAHAEnvironment {
|
||||
return VERSION;
|
||||
}
|
||||
|
||||
+17
-21
@@ -1,20 +1,16 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { WAHAEvents } from '@waha/structures/enums.dto';
|
||||
|
||||
import { parseBool } from './helpers';
|
||||
import { WAHAEngine } from './structures/enums.dto';
|
||||
import { WebhookConfig } from './structures/webhooks.config.dto';
|
||||
import { getEngineName } from './version';
|
||||
|
||||
@Injectable()
|
||||
export class WhatsappConfigService {
|
||||
public filesUri = '/api/files';
|
||||
public schema = 'http';
|
||||
|
||||
constructor(private configService: ConfigService) {}
|
||||
|
||||
get filesURL(): string {
|
||||
return `${this.schema}://${this.hostname}:${this.port}${this.filesUri}/`;
|
||||
get schema() {
|
||||
return this.configService.get('WHATSAPP_API_SCHEMA', 'http');
|
||||
}
|
||||
|
||||
get hostname(): string {
|
||||
@@ -25,17 +21,6 @@ export class WhatsappConfigService {
|
||||
return this.configService.get('WHATSAPP_API_PORT', '3000');
|
||||
}
|
||||
|
||||
get filesFolder(): string {
|
||||
return this.configService.get(
|
||||
'WHATSAPP_FILES_FOLDER',
|
||||
'/tmp/whatsapp-files',
|
||||
);
|
||||
}
|
||||
|
||||
get filesLifetime(): number {
|
||||
return this.configService.get<number>('WHATSAPP_FILES_LIFETIME', 180);
|
||||
}
|
||||
|
||||
get mimetypes(): string[] {
|
||||
if (!this.shouldDownloadMedia) {
|
||||
return ['mimetype/ignore-all-media'];
|
||||
@@ -66,8 +51,11 @@ export class WhatsappConfigService {
|
||||
}
|
||||
|
||||
get proxyServer(): string[] | string | undefined {
|
||||
const single = this.configService.get('WHATSAPP_PROXY_SERVER', undefined);
|
||||
const multipleValues = this.configService.get(
|
||||
const single = this.configService.get<string>(
|
||||
'WHATSAPP_PROXY_SERVER',
|
||||
undefined,
|
||||
);
|
||||
const multipleValues = this.configService.get<string>(
|
||||
'WHATSAPP_PROXY_SERVER_LIST',
|
||||
undefined,
|
||||
);
|
||||
@@ -103,7 +91,7 @@ export class WhatsappConfigService {
|
||||
return this.get('WHATSAPP_HOOK_URL');
|
||||
}
|
||||
|
||||
private getWebhookEvents(): string[] {
|
||||
private getWebhookEvents(): WAHAEvents[] {
|
||||
const value = this.get('WHATSAPP_HOOK_EVENTS', '');
|
||||
return value ? value.split(',') : [];
|
||||
}
|
||||
@@ -120,6 +108,14 @@ export class WhatsappConfigService {
|
||||
return this.configService.get('WHATSAPP_API_KEY', '');
|
||||
}
|
||||
|
||||
getExcludedPaths(): string[] {
|
||||
const value = this.configService.get('WHATSAPP_API_KEY_EXCLUDE_PATH', '');
|
||||
if (!value) {
|
||||
return [];
|
||||
}
|
||||
return value.split(',');
|
||||
}
|
||||
|
||||
getHealthMediaFilesThreshold(): number {
|
||||
return this.configService.get<number>(
|
||||
'WHATSAPP_HEALTH_MEDIA_FILES_THRESHOLD_MB',
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { DocumentBuilder, OpenAPIObject, SwaggerModule } from '@nestjs/swagger';
|
||||
import { DECORATORS } from '@nestjs/swagger/dist/constants';
|
||||
import { Logger } from 'nestjs-pino';
|
||||
|
||||
import { WhatsappConfigService } from '../config.service';
|
||||
import { VERSION } from '../version';
|
||||
import { SwaggerConfigServiceCore } from './config/SwaggerConfigServiceCore';
|
||||
|
||||
export class SwaggerConfiguratorCore {
|
||||
constructor(protected app: INestApplication) {}
|
||||
protected logger: any;
|
||||
|
||||
constructor(protected app: INestApplication) {
|
||||
this.logger = app.get(Logger);
|
||||
}
|
||||
|
||||
get title() {
|
||||
return 'WAHA - WhatsApp HTTP API';
|
||||
@@ -24,8 +29,8 @@ export class SwaggerConfiguratorCore {
|
||||
'<li><a href="https://github.com/devlikeapro/waha" target="_blank">GitHub - WAHA Core</a></li>' +
|
||||
'<li><a href="https://github.com/devlikeapro/waha-plu' + // Separate line to pass pre-commit check
|
||||
's" target="_blank">GitHub - WAHA Plus</a></li>' +
|
||||
'<li><b>NEW!</b> - <a href="/dashboard">WAHA Dashboard</a></li>' +
|
||||
'<li><b>NEW!</b> - <a href="https://waha.devlike.pro/docs/how-to/waha-dashboard">WAHA Dashboard Documentation</a></li>' +
|
||||
'<li><a href="/dashboard">WAHA Dashboard</a></li>' +
|
||||
'<li><a href="https://waha.devlike.pro/docs/how-to/waha-dashboard">WAHA Dashboard Documentation</a></li>' +
|
||||
'</ul>' +
|
||||
'<p>Support the project and get WAHA Plus version!</p>' +
|
||||
'<ul>' +
|
||||
@@ -51,24 +56,30 @@ export class SwaggerConfiguratorCore {
|
||||
.setDescription(this.description)
|
||||
.setExternalDoc(this.title, this.externalDocUrl)
|
||||
.setVersion(VERSION.version)
|
||||
.addTag('sessions', 'Control WhatsApp sessions')
|
||||
.addTag('auth', 'Authentication')
|
||||
.addTag('screenshot', 'Get screenshot of WhatsApp and show QR code')
|
||||
.addTag('chatting', 'Chatting methods')
|
||||
.addTag('🖥️ Sessions', 'Control WhatsApp sessions (accounts)')
|
||||
.addTag('🔑 Auth', 'Authentication')
|
||||
.addTag('🖼️ Screenshot', 'Get screenshot of WhatsApp and show QR code')
|
||||
.addTag('📤 Chatting', 'Chatting methods')
|
||||
.addTag('📢 Channels', 'Channels (newsletters) methods')
|
||||
.addTag(
|
||||
'status',
|
||||
'🟢 Status',
|
||||
'Status (aka stories) methods. <b>NOWEB</b> engine only!',
|
||||
)
|
||||
.addTag('chats', `Chats methods`)
|
||||
.addTag('💬 Chats', `Chats methods`)
|
||||
.addTag(
|
||||
'contacts',
|
||||
'👤 Contacts',
|
||||
`Contacts methods.<br>
|
||||
Use phone number (without +) or phone number and \`@c.us\` at the end as \`contactId\`.<br>
|
||||
'E.g: \`12312312310\` OR \`12312312310@c.us\`<br>`,
|
||||
)
|
||||
.addTag('groups', `Groups methods.<br>`)
|
||||
.addTag('presence', `Presence information`)
|
||||
.addTag('other', 'Other methods')
|
||||
.addTag('👥 Groups', `Groups methods.<br>`)
|
||||
.addTag('✅ Presence', `Presence information`)
|
||||
.addTag(
|
||||
'🏷️ Labels',
|
||||
'Labels - available only for WhatsApp Business accounts',
|
||||
)
|
||||
.addTag('🔍 Observability', 'Other methods')
|
||||
.addTag('🗄️ Storage', 'Storage methods')
|
||||
.addApiKey({
|
||||
type: 'apiKey',
|
||||
description: 'Your secret api key',
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
export abstract class DataStore {}
|
||||
export abstract class DataStore {
|
||||
abstract init(sessionName?: string): Promise<void>;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ConsoleLogger, Injectable } from '@nestjs/common';
|
||||
import { DiskHealthIndicator, HealthCheckService } from '@nestjs/terminus';
|
||||
import { Injectable, Logger, LoggerService } from '@nestjs/common';
|
||||
import { HealthCheckService } from '@nestjs/terminus';
|
||||
import type { HealthCheckResult } from '@nestjs/terminus/dist/health-check/health-check-result.interface';
|
||||
|
||||
import { WhatsappConfigService } from '../../config.service';
|
||||
@@ -7,12 +7,14 @@ import { SessionManager } from './manager.abc';
|
||||
|
||||
@Injectable()
|
||||
export abstract class WAHAHealthCheckService {
|
||||
protected logger: LoggerService;
|
||||
constructor(
|
||||
protected sessionManager: SessionManager,
|
||||
protected health: HealthCheckService,
|
||||
protected log: ConsoleLogger,
|
||||
protected config: WhatsappConfigService,
|
||||
) {}
|
||||
) {
|
||||
this.logger = new Logger('WAHAHealthCheckService');
|
||||
}
|
||||
|
||||
abstract check(): Promise<HealthCheckResult>;
|
||||
}
|
||||
+17
-11
@@ -1,19 +1,13 @@
|
||||
import {
|
||||
BeforeApplicationShutdown,
|
||||
OnApplicationShutdown,
|
||||
} from '@nestjs/common';
|
||||
import { BeforeApplicationShutdown } from '@nestjs/common';
|
||||
import { WAHAWebhook } from '@waha/structures/webhooks.dto';
|
||||
import { VERSION } from '@waha/version';
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
import { WAHAEngine, WAHAEvents } from '../../structures/enums.dto';
|
||||
import {
|
||||
MeInfo,
|
||||
SessionConfig,
|
||||
SessionDTO,
|
||||
SessionInfo,
|
||||
SessionLogoutRequest,
|
||||
SessionStartRequest,
|
||||
SessionStopRequest,
|
||||
} from '../../structures/sessions.dto';
|
||||
import { ISessionAuthRepository } from '../storage/ISessionAuthRepository';
|
||||
import { ISessionConfigRepository } from '../storage/ISessionConfigRepository';
|
||||
@@ -37,11 +31,22 @@ export abstract class SessionManager implements BeforeApplicationShutdown {
|
||||
//
|
||||
// API Methods
|
||||
//
|
||||
abstract start(request: SessionStartRequest): Promise<SessionDTO>;
|
||||
/**
|
||||
* Either create or update
|
||||
*/
|
||||
abstract exists(name: string): Promise<boolean>;
|
||||
|
||||
abstract stop(request: SessionStopRequest): Promise<void>;
|
||||
abstract isRunning(name: string): boolean;
|
||||
|
||||
abstract logout(request: SessionLogoutRequest): Promise<void>;
|
||||
abstract upsert(name: string, config?: SessionConfig): Promise<void>;
|
||||
|
||||
abstract delete(name: string): Promise<void>;
|
||||
|
||||
abstract start(name: string): Promise<SessionDTO>;
|
||||
|
||||
abstract stop(name: string, silent: boolean): Promise<void>;
|
||||
|
||||
abstract logout(name: string): Promise<void>;
|
||||
|
||||
abstract getSession(name: string): WhatsappSession;
|
||||
|
||||
@@ -55,6 +60,7 @@ export abstract class SessionManager implements BeforeApplicationShutdown {
|
||||
const data: WAHAWebhook = {
|
||||
event: event,
|
||||
session: session.name,
|
||||
metadata: session.sessionConfig?.metadata,
|
||||
me: me,
|
||||
payload: payload,
|
||||
engine: session.engine,
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
abstract class MediaStorage {
|
||||
abstract save(
|
||||
messageId: string,
|
||||
mimetype: string,
|
||||
buffer: Buffer,
|
||||
): Promise<string>;
|
||||
}
|
||||
|
||||
interface IEngineMediaProcessor<Message> {
|
||||
hasMedia(message: Message): boolean;
|
||||
|
||||
getFilename(message: Message): string | null;
|
||||
|
||||
getMimetype(message: Message): string;
|
||||
|
||||
getMessageId(message: Message): string;
|
||||
|
||||
getMediaBuffer(message: Message): Promise<Buffer | null>;
|
||||
}
|
||||
|
||||
interface MediaManager {
|
||||
processMedia<Message>(
|
||||
processor: IEngineMediaProcessor<Message>,
|
||||
message: Message,
|
||||
): Promise<Message>;
|
||||
}
|
||||
|
||||
export { IEngineMediaProcessor, MediaManager, MediaStorage };
|
||||
+127
-27
@@ -1,7 +1,14 @@
|
||||
import { ConsoleLogger } from '@nestjs/common';
|
||||
import {
|
||||
Channel,
|
||||
CreateChannelRequest,
|
||||
ListChannelsQuery,
|
||||
} from '@waha/structures/channels.dto';
|
||||
import { GetChatsQuery } from '@waha/structures/chats.dto';
|
||||
import { Label, LabelID } from '@waha/structures/labels.dto';
|
||||
import { LoggerBuilder } from '@waha/utils/logging';
|
||||
import { EventEmitter } from 'events';
|
||||
import * as fs from 'fs';
|
||||
import { Logger } from 'pino';
|
||||
import { MessageId } from 'whatsapp-web.js';
|
||||
|
||||
import {
|
||||
@@ -49,9 +56,9 @@ import {
|
||||
} from '../../structures/status.dto';
|
||||
import { WASessionStatusBody } from '../../structures/webhooks.dto';
|
||||
import { NotImplementedByEngineError } from '../exceptions';
|
||||
import { IMediaManager } from '../media/IMediaManager';
|
||||
import { QR } from '../QR';
|
||||
import { DataStore } from './DataStore';
|
||||
import { MediaManager } from './media.abc';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const qrcode = require('qrcode-terminal');
|
||||
@@ -81,8 +88,8 @@ export enum WAHAInternalEvent {
|
||||
export interface SessionParams {
|
||||
name: string;
|
||||
printQR: boolean;
|
||||
mediaManager: MediaManager;
|
||||
log: ConsoleLogger;
|
||||
mediaManager: IMediaManager;
|
||||
loggerBuilder: LoggerBuilder;
|
||||
sessionStore: DataStore;
|
||||
proxyConfig?: ProxyConfig;
|
||||
sessionConfig?: SessionConfig;
|
||||
@@ -94,8 +101,9 @@ export abstract class WhatsappSession {
|
||||
public engine: WAHAEngine;
|
||||
|
||||
public name: string;
|
||||
protected mediaManager: MediaManager;
|
||||
protected log: ConsoleLogger;
|
||||
protected mediaManager: IMediaManager;
|
||||
public loggerBuilder: LoggerBuilder;
|
||||
protected logger: Logger;
|
||||
protected sessionStore: DataStore;
|
||||
protected proxyConfig?: ProxyConfig;
|
||||
public sessionConfig?: SessionConfig;
|
||||
@@ -107,7 +115,7 @@ export abstract class WhatsappSession {
|
||||
public constructor({
|
||||
name,
|
||||
printQR,
|
||||
log,
|
||||
loggerBuilder,
|
||||
sessionStore,
|
||||
proxyConfig,
|
||||
mediaManager,
|
||||
@@ -117,7 +125,8 @@ export abstract class WhatsappSession {
|
||||
this.events = new EventEmitter();
|
||||
this.name = name;
|
||||
this.proxyConfig = proxyConfig;
|
||||
this.log = log;
|
||||
this.loggerBuilder = loggerBuilder;
|
||||
this.logger = loggerBuilder.child({ name: 'WhatsappSession' });
|
||||
this.sessionStore = sessionStore;
|
||||
this.mediaManager = mediaManager;
|
||||
this.sessionConfig = sessionConfig;
|
||||
@@ -143,34 +152,48 @@ export abstract class WhatsappSession {
|
||||
// Run optimized version of Chrome
|
||||
// References:
|
||||
// https://github.com/pedroslopez/whatsapp-web.js/issues/1420
|
||||
// https://github.com/wppconnect-team/wppconnect/issues/1326
|
||||
// https://www.bannerbear.com/blog/ways-to-speed-up-puppeteer-screenshots/
|
||||
return [
|
||||
'--no-sandbox',
|
||||
'--aggressive-cache-discard',
|
||||
'--disable-accelerated-2d-canvas',
|
||||
'--disable-application-cache',
|
||||
'--disable-background-networking',
|
||||
'--disable-cache',
|
||||
'--disable-client-side-phishing-detection',
|
||||
'--disable-setuid-sandbox',
|
||||
'--disable-component-update',
|
||||
'--disable-default-apps',
|
||||
'--disable-popup-blocking',
|
||||
'--disable-offer-store-unmasked-wallet-cards',
|
||||
'--disable-speech-api',
|
||||
'--hide-scrollbars',
|
||||
'--mute-audio',
|
||||
'--disable-extensions',
|
||||
'--disable-dev-shm-usage',
|
||||
'--disable-accelerated-2d-canvas',
|
||||
'--no-first-run',
|
||||
'--no-default-browser-check',
|
||||
'--no-pings',
|
||||
'--password-store=basic',
|
||||
'--use-mock-keychain',
|
||||
'--no-zygote',
|
||||
'--single-process',
|
||||
'--disable-extensions',
|
||||
'--disable-gpu',
|
||||
'--disable-offer-store-unmasked-wallet-cards',
|
||||
'--disable-offline-load-stale-cache',
|
||||
'--disable-popup-blocking',
|
||||
'--disable-setuid-sandbox',
|
||||
'--disable-speech-api',
|
||||
'--disable-sync',
|
||||
'--disable-translate',
|
||||
'--disable-web-security',
|
||||
'--disk-cache-size=0',
|
||||
'--hide-scrollbars',
|
||||
'--ignore-certificate-errors',
|
||||
'--ignore-ssl-errors',
|
||||
'--metrics-recording-only',
|
||||
'--mute-audio',
|
||||
'--no-default-browser-check',
|
||||
'--no-first-run',
|
||||
'--no-pings',
|
||||
'--no-sandbox',
|
||||
'--no-zygote',
|
||||
'--password-store=basic',
|
||||
'--safebrowsing-disable-auto-update',
|
||||
'--single-process',
|
||||
'--use-mock-keychain',
|
||||
];
|
||||
}
|
||||
|
||||
protected isDebugEnabled() {
|
||||
return this.log.isLevelEnabled('debug');
|
||||
return this.logger.isLevelEnabled('debug');
|
||||
}
|
||||
|
||||
/** Start the session */
|
||||
@@ -316,6 +339,34 @@ export abstract class WhatsappSession {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
public chatsArchiveChat(chatId: string): Promise<any> {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
public chatsUnarchiveChat(chatId: string): Promise<any> {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Labels methods
|
||||
*/
|
||||
|
||||
public getLabels(): Promise<Label[]> {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
public getChatsByLabelId(labelId: string) {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
public getChatLabels(chatId: string): Promise<Label[]> {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
public putLabelsToChat(chatId: string, labels: LabelID[]) {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Contacts methods
|
||||
*/
|
||||
@@ -434,6 +485,47 @@ export abstract class WhatsappSession {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Channels methods
|
||||
*/
|
||||
public channelsList(query: ListChannelsQuery): Promise<Channel[]> {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
public channelsCreateChannel(
|
||||
request: CreateChannelRequest,
|
||||
): Promise<Channel> {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
public channelsGetChannel(id: string): Promise<Channel> {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
public channelsGetChannelByInviteCode(inviteCode: string): Promise<Channel> {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
public channelsDeleteChannel(id: string): Promise<void> {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
public channelsFollowChannel(id: string): Promise<void> {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
public channelsUnfollowChannel(id: string): Promise<void> {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
public channelsMuteChannel(id: string): Promise<void> {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
public channelsUnmuteChannel(id: string): Promise<void> {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Status methods
|
||||
*/
|
||||
@@ -488,14 +580,22 @@ export abstract class WhatsappSession {
|
||||
return;
|
||||
}
|
||||
if (!qr.raw) {
|
||||
this.log.error(
|
||||
this.logger.error(
|
||||
'QR.raw is not available, can not print it in the console',
|
||||
);
|
||||
return;
|
||||
}
|
||||
this.log.log(
|
||||
this.logger.info(
|
||||
"You can disable QR in console by setting 'WAHA_PRINT_QR=false' in your environment variables.",
|
||||
);
|
||||
qrcode.generate(qr.raw, { small: true });
|
||||
}
|
||||
}
|
||||
|
||||
export function isNewsletter(jid: string) {
|
||||
return jid.endsWith('@newsletter');
|
||||
}
|
||||
|
||||
export function getChannelInviteLink(code: string) {
|
||||
return `https://whatsapp.com/channel/${code}`;
|
||||
}
|
||||
@@ -1,15 +1,19 @@
|
||||
import { ConsoleLogger } from '@nestjs/common';
|
||||
import { LoggerBuilder } from '@waha/utils/logging';
|
||||
import { Logger } from 'pino';
|
||||
|
||||
import { WebhookConfig } from '../../structures/webhooks.config.dto';
|
||||
import { WhatsappSession } from './session.abc';
|
||||
|
||||
export abstract class WebhookSender {
|
||||
protected url: string;
|
||||
protected logger: Logger;
|
||||
|
||||
constructor(
|
||||
protected log: ConsoleLogger,
|
||||
loggerBuilder: LoggerBuilder,
|
||||
protected webhookConfig: WebhookConfig,
|
||||
) {
|
||||
this.url = webhookConfig.url;
|
||||
this.logger = loggerBuilder.child({ name: WebhookSender.name });
|
||||
}
|
||||
|
||||
abstract send(json);
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { BeforeApplicationShutdown, ConsoleLogger } from '@nestjs/common';
|
||||
import {
|
||||
BeforeApplicationShutdown,
|
||||
Logger,
|
||||
LoggerService,
|
||||
} from '@nestjs/common';
|
||||
import { sleep } from '@nestjs/terminus/dist/utils';
|
||||
import {
|
||||
OnGatewayConnection,
|
||||
@@ -8,10 +12,10 @@ import {
|
||||
WebSocketServer,
|
||||
} from '@nestjs/websockets';
|
||||
import { SessionManager } from '@waha/core/abc/manager.abc';
|
||||
import { getLogLevels } from '@waha/helpers';
|
||||
import { WebsocketHeartbeatJob } from '@waha/nestjs/ws/WebsocketHeartbeatJob';
|
||||
import { WebSocket } from '@waha/nestjs/ws/ws';
|
||||
import { WAHAEvents } from '@waha/structures/enums.dto';
|
||||
import { HeartbeatJob } from '@waha/utils/HeartbeatJob';
|
||||
import { WebSocket } from '@waha/utils/ws';
|
||||
import { generatePrefixedId } from '@waha/utils/ids';
|
||||
import { IncomingMessage } from 'http';
|
||||
import * as lodash from 'lodash';
|
||||
import * as url from 'url';
|
||||
@@ -36,26 +40,28 @@ export class WebsocketGatewayCore
|
||||
private listeners: Map<WebSocket, { session: string; events: string[] }> =
|
||||
new Map();
|
||||
|
||||
private log: ConsoleLogger;
|
||||
private heartbeat: HeartbeatJob;
|
||||
private readonly logger: LoggerService;
|
||||
private heartbeat: WebsocketHeartbeatJob;
|
||||
|
||||
constructor(private manager: SessionManager) {
|
||||
const levels = getLogLevels(false);
|
||||
this.log = new ConsoleLogger('WebsocketGateway', { logLevels: levels });
|
||||
this.heartbeat = new HeartbeatJob(this.log, this.HEARTBEAT_INTERVAL);
|
||||
this.logger = new Logger('WebsocketGateway');
|
||||
this.heartbeat = new WebsocketHeartbeatJob(
|
||||
this.logger,
|
||||
this.HEARTBEAT_INTERVAL,
|
||||
);
|
||||
}
|
||||
|
||||
handleConnection(socket: WebSocket, request: IncomingMessage, ...args): any {
|
||||
const random = Math.random().toString(36).substring(7);
|
||||
const id = `wsc_${random}`;
|
||||
// wsc - websocket client
|
||||
const id = generatePrefixedId('wsc');
|
||||
socket.id = id;
|
||||
this.log.debug(`New client connected: ${request.url}`);
|
||||
this.logger.debug(`New client connected: ${request.url}`);
|
||||
const params = this.getParams(id, request, socket);
|
||||
if (!params) {
|
||||
return;
|
||||
}
|
||||
const { session, events } = params;
|
||||
this.log.debug(
|
||||
this.logger.debug(
|
||||
`Client connected to session: '${session}', events: ${events}, ${id}`,
|
||||
);
|
||||
this.listeners.set(socket, { session, events });
|
||||
@@ -65,7 +71,7 @@ export class WebsocketGatewayCore
|
||||
const query = url.parse(request.url, true).query;
|
||||
const session = (query.session as string) || '*';
|
||||
if (session !== '*') {
|
||||
this.log.warn(
|
||||
this.logger.warn(
|
||||
`Only connecting to all sessions is allowed for now, use session=*, ${id}`,
|
||||
);
|
||||
const error =
|
||||
@@ -79,7 +85,7 @@ export class WebsocketGatewayCore
|
||||
!lodash.isEqual(events, ['*']) &&
|
||||
!lodash.isEqual(events, [WAHAEvents.SESSION_STATUS])
|
||||
) {
|
||||
this.log.warn(
|
||||
this.logger.warn(
|
||||
`Only \'session.status\' event is allowed for now, use events=session.status or events=*, ${id}`,
|
||||
);
|
||||
const error =
|
||||
@@ -91,33 +97,35 @@ export class WebsocketGatewayCore
|
||||
}
|
||||
|
||||
handleDisconnect(socket: WebSocket): any {
|
||||
this.log.debug(`Client disconnected - ${socket.id}`);
|
||||
this.logger.debug(`Client disconnected - ${socket.id}`);
|
||||
this.listeners.delete(socket);
|
||||
}
|
||||
|
||||
async beforeApplicationShutdown(signal?: string) {
|
||||
this.log.log('Shutting down websocket server');
|
||||
this.logger.log('Shutting down websocket server');
|
||||
// Allow pending messages to be sent, it can be even 1ms, just to release the event loop
|
||||
await sleep(100);
|
||||
this.server.clients.forEach((options, client) => {
|
||||
this.server?.clients.forEach((options, client) => {
|
||||
// @ts-ignore
|
||||
this.logger.debug(`Closing client connection - ${client.id}...`);
|
||||
client.close(1001, 'Server is shutting down');
|
||||
});
|
||||
// Do not turn off heartbeat service here,
|
||||
// it's responsible for terminating the connection that is not alive
|
||||
this.log.log('Websocket server is down');
|
||||
this.logger.log('Websocket server is down');
|
||||
}
|
||||
|
||||
afterInit(server: Server) {
|
||||
this.log.debug('Websocket server initialized');
|
||||
this.logger.debug('Websocket server initialized');
|
||||
this.manager.events.on(
|
||||
WAHAEvents.SESSION_STATUS,
|
||||
this.sendToAll.bind(this),
|
||||
);
|
||||
this.log.debug('Subscribed to manager events');
|
||||
this.logger.debug('Subscribed to manager events');
|
||||
|
||||
this.log.debug('Starting heartbeat service...');
|
||||
this.logger.debug('Starting heartbeat service...');
|
||||
this.heartbeat.start(server);
|
||||
this.log.debug('Heartbeat service started');
|
||||
this.logger.debug('Heartbeat service started');
|
||||
}
|
||||
|
||||
sendToAll(data: any) {
|
||||
@@ -125,7 +133,7 @@ export class WebsocketGatewayCore
|
||||
if (options.events.length === 0) {
|
||||
return;
|
||||
}
|
||||
this.log.debug('Sending data to client', data);
|
||||
this.logger.debug('Sending data to client', data);
|
||||
client.send(JSON.stringify(data));
|
||||
});
|
||||
}
|
||||
|
||||
+71
-29
@@ -1,12 +1,23 @@
|
||||
import { ConsoleLogger, INestApplication, Module } from '@nestjs/common';
|
||||
import { INestApplication, Module } from '@nestjs/common';
|
||||
import { ConfigModule } from '@nestjs/config';
|
||||
import { APP_INTERCEPTOR } from '@nestjs/core';
|
||||
import { PassportModule } from '@nestjs/passport';
|
||||
import { ServeStaticModule } from '@nestjs/serve-static';
|
||||
import { TerminusModule } from '@nestjs/terminus';
|
||||
import { BufferJsonReplacerInterceptor } from '@waha/api/BufferJsonReplacerInterceptor';
|
||||
import { ChannelsController } from '@waha/api/channels.controller';
|
||||
import { ServerController } from '@waha/api/server.controller';
|
||||
import { WebsocketGatewayCore } from '@waha/core/api/websocket.gateway.core';
|
||||
import { MediaLocalStorageConfig } from '@waha/core/media/local/MediaLocalStorageConfig';
|
||||
import { BufferJsonReplacerInterceptor } from '@waha/nestjs/BufferJsonReplacerInterceptor';
|
||||
import {
|
||||
getPinoHttpUseLevel,
|
||||
getPinoLogLevel,
|
||||
getPinoTransport,
|
||||
} from '@waha/utils/logging';
|
||||
import * as Joi from 'joi';
|
||||
import { LoggerModule } from 'nestjs-pino';
|
||||
import { join } from 'path';
|
||||
import { Logger } from 'pino';
|
||||
|
||||
import { AuthController } from '../api/auth.controller';
|
||||
import { ChatsController } from '../api/chats.controller';
|
||||
@@ -14,12 +25,11 @@ import { ChattingController } from '../api/chatting.controller';
|
||||
import { ContactsController } from '../api/contacts.controller';
|
||||
import { GroupsController } from '../api/groups.controller';
|
||||
import { HealthController } from '../api/health.controller';
|
||||
import { LabelsController } from '../api/labels.controller';
|
||||
import { PingController } from '../api/ping.controller';
|
||||
import { PresenceController } from '../api/presence.controller';
|
||||
import { ScreenshotController } from '../api/screenshot.controller';
|
||||
import {
|
||||
SessionController,
|
||||
SessionsController,
|
||||
} from '../api/sessions.controller';
|
||||
import { SessionsController } from '../api/sessions.controller';
|
||||
import { StatusController } from '../api/status.controller';
|
||||
import { VersionController } from '../api/version.controller';
|
||||
import { WhatsappConfigService } from '../config.service';
|
||||
@@ -32,31 +42,56 @@ import { WAHAHealthCheckServiceCore } from './health/WAHAHealthCheckServiceCore'
|
||||
import { SessionManagerCore } from './manager.core';
|
||||
|
||||
export const IMPORTS = [
|
||||
LoggerModule.forRoot({
|
||||
renameContext: 'name',
|
||||
pinoHttp: {
|
||||
quietReqLogger: true,
|
||||
level: getPinoLogLevel(),
|
||||
useLevel: getPinoHttpUseLevel(),
|
||||
transport: getPinoTransport(),
|
||||
autoLogging: {
|
||||
ignore: (req) => {
|
||||
return (
|
||||
req.url.startsWith('/dashboard/') ||
|
||||
req.url.startsWith('/api/files/') ||
|
||||
req.url.startsWith('/api/s3/')
|
||||
);
|
||||
},
|
||||
},
|
||||
serializers: {
|
||||
req: (req) => ({
|
||||
id: req.id,
|
||||
method: req.method,
|
||||
url: req.url,
|
||||
query: req.query,
|
||||
params: req.params,
|
||||
}),
|
||||
res: (res) => ({
|
||||
statusCode: res.statusCode,
|
||||
}),
|
||||
},
|
||||
},
|
||||
}),
|
||||
ConfigModule.forRoot({
|
||||
isGlobal: true,
|
||||
validationSchema: Joi.object({
|
||||
WHATSAPP_API_SCHEMA: Joi.string().valid('http', 'https').default('http'),
|
||||
}),
|
||||
}),
|
||||
ServeStaticModule.forRootAsync({
|
||||
imports: [],
|
||||
extraProviders: [WhatsappConfigService, DashboardConfigServiceCore],
|
||||
inject: [WhatsappConfigService, DashboardConfigServiceCore],
|
||||
useFactory: (
|
||||
config: WhatsappConfigService,
|
||||
dashboardConfig: DashboardConfigServiceCore,
|
||||
) => {
|
||||
const options = [
|
||||
// Serve files (media)
|
||||
extraProviders: [DashboardConfigServiceCore],
|
||||
inject: [DashboardConfigServiceCore],
|
||||
useFactory: (dashboardConfig: DashboardConfigServiceCore) => {
|
||||
if (!dashboardConfig.enabled) {
|
||||
return [];
|
||||
}
|
||||
return [
|
||||
{
|
||||
rootPath: config.filesFolder,
|
||||
serveRoot: config.filesUri,
|
||||
},
|
||||
];
|
||||
if (dashboardConfig.enabled) {
|
||||
options.push({
|
||||
rootPath: join(__dirname, '..', 'dashboard'),
|
||||
serveRoot: dashboardConfig.dashboardUri,
|
||||
});
|
||||
}
|
||||
return options;
|
||||
},
|
||||
];
|
||||
},
|
||||
}),
|
||||
PassportModule,
|
||||
@@ -65,16 +100,19 @@ export const IMPORTS = [
|
||||
export const CONTROLLERS = [
|
||||
AuthController,
|
||||
SessionsController,
|
||||
SessionController,
|
||||
ChattingController,
|
||||
ChatsController,
|
||||
ChannelsController,
|
||||
StatusController,
|
||||
LabelsController,
|
||||
ContactsController,
|
||||
GroupsController,
|
||||
PresenceController,
|
||||
ScreenshotController,
|
||||
VersionController,
|
||||
PingController,
|
||||
HealthController,
|
||||
ServerController,
|
||||
VersionController,
|
||||
];
|
||||
const PROVIDERS = [
|
||||
{
|
||||
@@ -93,8 +131,8 @@ const PROVIDERS = [
|
||||
SwaggerConfigServiceCore,
|
||||
WhatsappConfigService,
|
||||
EngineConfigService,
|
||||
ConsoleLogger,
|
||||
WebsocketGatewayCore,
|
||||
MediaLocalStorageConfig,
|
||||
];
|
||||
|
||||
@Module({
|
||||
@@ -103,13 +141,17 @@ const PROVIDERS = [
|
||||
providers: PROVIDERS,
|
||||
})
|
||||
export class AppModuleCore {
|
||||
constructor(protected config: WhatsappConfigService) {}
|
||||
public startTimestamp: number;
|
||||
|
||||
static getHttpsOptions() {
|
||||
constructor(protected config: WhatsappConfigService) {
|
||||
this.startTimestamp = Date.now();
|
||||
}
|
||||
|
||||
static getHttpsOptions(logger: Logger) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
static appReady(app: INestApplication) {
|
||||
static appReady(app: INestApplication, logger: Logger) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, Logger } from '@nestjs/common';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { InjectPinoLogger, PinoLogger } from 'nestjs-pino';
|
||||
|
||||
import { parseBool } from '../../helpers';
|
||||
|
||||
@@ -7,7 +8,11 @@ import { parseBool } from '../../helpers';
|
||||
export class DashboardConfigServiceCore {
|
||||
public dashboardUri = '/dashboard';
|
||||
|
||||
constructor(protected configService: ConfigService) {}
|
||||
constructor(
|
||||
protected configService: ConfigService,
|
||||
@InjectPinoLogger('DashboardConfigService')
|
||||
protected logger: PinoLogger,
|
||||
) {}
|
||||
|
||||
get enabled(): boolean {
|
||||
const value = this.configService.get('WAHA_DASHBOARD_ENABLED', 'true');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, Logger } from '@nestjs/common';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
|
||||
import { parseBool } from '../../helpers';
|
||||
@@ -7,14 +7,18 @@ import { getEngineName } from '../../version';
|
||||
|
||||
@Injectable()
|
||||
export class EngineConfigService {
|
||||
constructor(protected configService: ConfigService) {}
|
||||
private logger: Logger;
|
||||
|
||||
constructor(protected configService: ConfigService) {
|
||||
this.logger = new Logger('EngineConfigService');
|
||||
}
|
||||
|
||||
getDefaultEngineName(): WAHAEngine {
|
||||
const value = getEngineName();
|
||||
if (value in WAHAEngine) {
|
||||
return WAHAEngine[value];
|
||||
}
|
||||
console.log(
|
||||
this.logger.warn(
|
||||
`Unknown WhatsApp default engine WHATSAPP_DEFAULT_ENGINE=${value}. Using WEBJS`,
|
||||
);
|
||||
return WAHAEngine.WEBJS;
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { InjectPinoLogger, PinoLogger } from 'nestjs-pino';
|
||||
|
||||
import { parseBool } from '../../helpers';
|
||||
|
||||
@Injectable()
|
||||
export class SwaggerConfigServiceCore {
|
||||
constructor(protected configService: ConfigService) {}
|
||||
constructor(
|
||||
protected configService: ConfigService,
|
||||
@InjectPinoLogger('SwaggerConfigService')
|
||||
protected logger: PinoLogger,
|
||||
) {}
|
||||
|
||||
get advancedConfigEnabled(): boolean {
|
||||
const value = this.configService.get(
|
||||
|
||||
@@ -4,37 +4,59 @@ import makeWASocket, {
|
||||
DisconnectReason,
|
||||
extractMessageContent,
|
||||
getAggregateVotesInPollMessage,
|
||||
getContentType,
|
||||
getKeyAuthor,
|
||||
getUrlFromDirectPath,
|
||||
isJidGroup,
|
||||
isJidStatusBroadcast,
|
||||
isRealMessage,
|
||||
jidNormalizedUser,
|
||||
makeCacheableSignalKeyStore,
|
||||
NewsletterMetadata,
|
||||
normalizeMessageContent,
|
||||
PresenceData,
|
||||
proto,
|
||||
WAMessageContent,
|
||||
WAMessageKey,
|
||||
} from '@adiwajshing/baileys';
|
||||
import { WACallEvent } from '@adiwajshing/baileys/lib/Types/Call';
|
||||
import { Label as NOWEBLabel } from '@adiwajshing/baileys/lib/Types/Label';
|
||||
import { LabelAssociationType } from '@adiwajshing/baileys/lib/Types/LabelAssociation';
|
||||
import { isLidUser } from '@adiwajshing/baileys/lib/WABinary/jid-utils';
|
||||
import { Logger as BaileysLogger } from '@adiwajshing/baileys/node_modules/pino';
|
||||
import { UnprocessableEntityException } from '@nestjs/common';
|
||||
import { NowebInMemoryStore } from '@waha/core/engines/noweb/store/NowebInMemoryStore';
|
||||
import { flipObject, getLogLevels, parseBool, splitAt } from '@waha/helpers';
|
||||
import { IMediaEngineProcessor } from '@waha/core/media/IMediaEngineProcessor';
|
||||
import { flipObject, parseBool, splitAt } from '@waha/helpers';
|
||||
import { PairingCodeResponse } from '@waha/structures/auth.dto';
|
||||
import { CallData } from '@waha/structures/calls.dto';
|
||||
import {
|
||||
Channel,
|
||||
ChannelRole,
|
||||
CreateChannelRequest,
|
||||
ListChannelsQuery,
|
||||
} from '@waha/structures/channels.dto';
|
||||
import { GetChatsQuery } from '@waha/structures/chats.dto';
|
||||
import { ContactQuery, ContactRequest } from '@waha/structures/contacts.dto';
|
||||
import {
|
||||
Label,
|
||||
LabelChatAssociation,
|
||||
LabelID,
|
||||
} from '@waha/structures/labels.dto';
|
||||
import { ReplyToMessage } from '@waha/structures/message.dto';
|
||||
import {
|
||||
PollVote,
|
||||
PollVotePayload,
|
||||
WAMessageAckBody,
|
||||
} from '@waha/structures/webhooks.dto';
|
||||
import { waitUntil } from '@waha/utils/promiseTimeout';
|
||||
import { SingleDelayedJobRunner } from '@waha/utils/SingleDelayedJobRunner';
|
||||
import { SinglePeriodicJobRunner } from '@waha/utils/SinglePeriodicJobRunner';
|
||||
import * as Buffer from 'buffer';
|
||||
import { request } from 'express';
|
||||
import { Agent } from 'https';
|
||||
import * as lodash from 'lodash';
|
||||
import { toNumber } from 'lodash';
|
||||
import * as NodeCache from 'node-cache';
|
||||
import type { Logger } from 'pino';
|
||||
|
||||
import {
|
||||
ChatRequest,
|
||||
@@ -83,9 +105,10 @@ import {
|
||||
DeleteStatusRequest,
|
||||
TextStatus,
|
||||
} from '../../../structures/status.dto';
|
||||
import { IEngineMediaProcessor } from '../../abc/media.abc';
|
||||
import {
|
||||
ensureSuffix,
|
||||
getChannelInviteLink,
|
||||
isNewsletter,
|
||||
WAHAInternalEvent,
|
||||
WhatsappSession,
|
||||
} from '../../abc/session.abc';
|
||||
@@ -95,7 +118,6 @@ import {
|
||||
} from '../../exceptions';
|
||||
import { toVcard } from '../../helpers';
|
||||
import { createAgentProxy } from '../../helpers.proxy';
|
||||
import { buildLogger } from '../../manager.core';
|
||||
import { QR } from '../../QR';
|
||||
import { NowebAuthFactoryCore } from './NowebAuthFactoryCore';
|
||||
import { INowebStore } from './store/INowebStore';
|
||||
@@ -105,8 +127,6 @@ import { extractMediaContent } from './utils';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const QRCode = require('qrcode');
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const pino = require('pino');
|
||||
|
||||
export const BaileysEvents = {
|
||||
CONNECTION_UPDATE: 'connection.update',
|
||||
@@ -129,15 +149,15 @@ const ToEnginePresenceStatus = flipObject(PresenceStatuses);
|
||||
|
||||
export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
private START_ATTEMPT_DELAY_SECONDS = 2;
|
||||
private AUTO_RESTART_AFTER_SECONDS = 30 * 60;
|
||||
private AUTO_RESTART_AFTER_SECONDS = 28 * 60;
|
||||
|
||||
engine = WAHAEngine.NOWEB;
|
||||
authFactory = new NowebAuthFactoryCore();
|
||||
storageFactory = new NowebStorageFactoryCore();
|
||||
private startTimeoutId: null | ReturnType<typeof setTimeout> = null;
|
||||
private autoRestartTimeoutId: null | ReturnType<typeof setTimeout> = null;
|
||||
public logger: Logger;
|
||||
private startDelayedJob: SingleDelayedJobRunner;
|
||||
private autoRestartJob: SinglePeriodicJobRunner;
|
||||
private msgRetryCounterCache: NodeCache;
|
||||
protected engineLogger: BaileysLogger;
|
||||
|
||||
get listenConnectionEventsFromTheStart() {
|
||||
return true;
|
||||
@@ -150,26 +170,40 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
public constructor(config) {
|
||||
super(config);
|
||||
this.qr = new QR();
|
||||
const levels = getLogLevels(this.sessionConfig?.debug);
|
||||
const debug = levels.includes('debug');
|
||||
const logger = pino({ level: debug ? 'debug' : 'info' });
|
||||
this.logger = logger.child({
|
||||
session: this.name,
|
||||
});
|
||||
// external map to store retry counts of messages when decryption/encryption fails
|
||||
// keep this out of the socket itself, to prevent a message decryption/encryption loop across socket restarts
|
||||
this.msgRetryCounterCache = new NodeCache({
|
||||
stdTTL: 60 * 60, // 1 hour
|
||||
useClones: false,
|
||||
});
|
||||
|
||||
this.engineLogger = this.loggerBuilder.child({
|
||||
name: 'NOWEBEngine',
|
||||
}) as unknown as BaileysLogger;
|
||||
|
||||
// Restart job if session failed
|
||||
this.startDelayedJob = new SingleDelayedJobRunner(
|
||||
'start-engine',
|
||||
this.START_ATTEMPT_DELAY_SECONDS * SECOND,
|
||||
this.logger,
|
||||
);
|
||||
|
||||
// Enable auto-restart
|
||||
const shiftSeconds = Math.floor(Math.random() * 30);
|
||||
const delay = this.AUTO_RESTART_AFTER_SECONDS + shiftSeconds;
|
||||
this.autoRestartJob = new SinglePeriodicJobRunner(
|
||||
'auto-restart',
|
||||
delay * SECOND,
|
||||
this.logger,
|
||||
);
|
||||
}
|
||||
|
||||
start() {
|
||||
async start() {
|
||||
this.status = WAHASessionStatus.STARTING;
|
||||
this.buildClient();
|
||||
await this.buildClient();
|
||||
}
|
||||
|
||||
getSocketConfig(agent, state) {
|
||||
getSocketConfig(agent, state): any {
|
||||
const fullSyncEnabled = this.sessionConfig?.noweb?.store?.fullSync || false;
|
||||
const browser = fullSyncEnabled
|
||||
? Browsers.ubuntu('Desktop')
|
||||
@@ -180,11 +214,11 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
auth: {
|
||||
creds: state.creds,
|
||||
/** caching makes the store faster to send/recv messages */
|
||||
keys: makeCacheableSignalKeyStore(state.keys, this.logger),
|
||||
keys: makeCacheableSignalKeyStore(state.keys, this.engineLogger),
|
||||
},
|
||||
printQRInTerminal: false,
|
||||
browser: browser,
|
||||
logger: this.logger,
|
||||
logger: this.engineLogger,
|
||||
mobile: false,
|
||||
defaultQueryTimeoutMs: 120_000,
|
||||
keepAliveIntervalMs: 30_000,
|
||||
@@ -194,7 +228,7 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
};
|
||||
}
|
||||
|
||||
async makeSocket() {
|
||||
async makeSocket(): Promise<any> {
|
||||
const { state, saveCreds } = await this.authFactory.buildAuth(
|
||||
this.sessionStore,
|
||||
this.name,
|
||||
@@ -214,31 +248,32 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
}
|
||||
|
||||
async connectStore() {
|
||||
this.log.debug(`Connecting store...`);
|
||||
this.logger.debug(`Connecting store...`);
|
||||
if (!this.store) {
|
||||
this.log.debug(`Making a new store...`);
|
||||
const levels = getLogLevels(this.sessionConfig?.debug);
|
||||
const log = buildLogger(`NowebStore - ${this.name}`, levels);
|
||||
this.logger.debug(`Making a new store...`);
|
||||
const storeEnabled = this.sessionConfig?.noweb?.store?.enabled || false;
|
||||
if (storeEnabled) {
|
||||
this.log.debug('Using NowebPersistentStore');
|
||||
this.logger.debug('Using NowebPersistentStore');
|
||||
const storage = this.storageFactory.createStorage(
|
||||
this.sessionStore,
|
||||
this.name,
|
||||
);
|
||||
this.store = new NowebPersistentStore(log, storage);
|
||||
this.store = new NowebPersistentStore(
|
||||
this.loggerBuilder.child({ name: NowebPersistentStore.name }),
|
||||
storage,
|
||||
);
|
||||
await this.store.init().catch((err) => {
|
||||
this.log.error(`Failed to initialize storage or store: ${err}`);
|
||||
this.logger.error(`Failed to initialize storage or store: ${err}`);
|
||||
this.status = WAHASessionStatus.FAILED;
|
||||
this.end();
|
||||
throw err;
|
||||
});
|
||||
} else {
|
||||
this.log.debug('Using NowebInMemoryStore');
|
||||
this.logger.debug('Using NowebInMemoryStore');
|
||||
this.store = new NowebInMemoryStore();
|
||||
}
|
||||
}
|
||||
this.log.debug(`Binding store to socket...`);
|
||||
this.logger.debug(`Binding store to socket...`);
|
||||
this.store.bind(this.sock.ev, this.sock);
|
||||
}
|
||||
|
||||
@@ -263,20 +298,15 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
this.enableAutoRestart();
|
||||
}
|
||||
|
||||
protected enableAutoRestart() {
|
||||
if (this.autoRestartTimeoutId) {
|
||||
return;
|
||||
}
|
||||
|
||||
// add random delay to avoid multiple restarts at the same time
|
||||
const shiftSeconds = Math.floor(Math.random() * 30);
|
||||
const delay = this.AUTO_RESTART_AFTER_SECONDS + shiftSeconds;
|
||||
this.log.debug(`Auto-restart is enabled, after ${delay} seconds`);
|
||||
this.autoRestartTimeoutId = setTimeout(() => {
|
||||
this.autoRestartTimeoutId = null;
|
||||
this.log.log('Auto-restarting the client connection...');
|
||||
this.sock?.end(new Error('auto-restart'));
|
||||
}, delay * SECOND);
|
||||
private enableAutoRestart() {
|
||||
this.autoRestartJob.start(async () => {
|
||||
this.logger.info('Auto-restarting the client connection...');
|
||||
if (this.sock?.ws?.isConnecting) {
|
||||
this.logger.warn('Auto-restart skipped, the client is connecting...');
|
||||
return;
|
||||
}
|
||||
this.sock?.end(undefined);
|
||||
});
|
||||
}
|
||||
|
||||
protected async getMessage(
|
||||
@@ -291,28 +321,18 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
|
||||
protected listenEngineEventsInDebugMode() {
|
||||
this.sock.ev.process((events) => {
|
||||
this.log.debug(`NOWEB events: ${JSON.stringify(events)}`);
|
||||
this.logger.debug({ events: events }, `NOWEB events`);
|
||||
});
|
||||
}
|
||||
|
||||
private restartClient() {
|
||||
if (this.startTimeoutId) {
|
||||
this.log.log(
|
||||
'Request to restart is already in progress, ignoring this request',
|
||||
);
|
||||
return;
|
||||
}
|
||||
this.log.log(
|
||||
`Setting up client start in ${this.START_ATTEMPT_DELAY_SECONDS} seconds...`,
|
||||
);
|
||||
this.startTimeoutId = setTimeout(() => {
|
||||
this.startTimeoutId = undefined;
|
||||
this.buildClient();
|
||||
}, this.START_ATTEMPT_DELAY_SECONDS * SECOND);
|
||||
this.startDelayedJob.schedule(async () => {
|
||||
await this.buildClient();
|
||||
});
|
||||
}
|
||||
|
||||
protected listenConnectionEvents() {
|
||||
this.log.debug(`Start listening ${BaileysEvents.CONNECTION_UPDATE}...`);
|
||||
this.logger.debug(`Start listening ${BaileysEvents.CONNECTION_UPDATE}...`);
|
||||
this.sock.ev.on('connection.update', async (update) => {
|
||||
const { connection, lastDisconnect, qr, isNewLogin } = update;
|
||||
if (isNewLogin) {
|
||||
@@ -330,12 +350,14 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
this.qr.save('');
|
||||
// reconnect if not logged out
|
||||
if (shouldReconnect) {
|
||||
this.log.log(
|
||||
`Connection closed due to '${lastDisconnect.error}', reconnecting...`,
|
||||
);
|
||||
if (lastDisconnect.error) {
|
||||
this.logger.info(
|
||||
`Connection closed due to '${lastDisconnect.error}', reconnecting...`,
|
||||
);
|
||||
}
|
||||
this.restartClient();
|
||||
} else {
|
||||
this.log.error(
|
||||
this.logger.error(
|
||||
`Connection closed due to '${lastDisconnect.error}', do not reconnect the session.`,
|
||||
);
|
||||
await this.end();
|
||||
@@ -405,7 +427,7 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
const jidPresences = this.store?.presences?.[jid];
|
||||
const participantPresence = jidPresences?.[participant];
|
||||
if (participantPresence?.lastKnownPresence === 'composing') {
|
||||
this.log.debug(
|
||||
this.logger.debug(
|
||||
`Fixing presence for '${participant}' in '${jid} since it's typing`,
|
||||
);
|
||||
const presence: PresenceData = { lastKnownPresence: 'available' };
|
||||
@@ -419,13 +441,16 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
}
|
||||
|
||||
private async end() {
|
||||
clearTimeout(this.autoRestartTimeoutId);
|
||||
clearTimeout(this.startTimeoutId);
|
||||
this.autoRestartJob.stop();
|
||||
this.startDelayedJob.cancel();
|
||||
// @ts-ignore
|
||||
this.sock?.ev?.removeAllListeners();
|
||||
this.sock?.ws?.removeAllListeners();
|
||||
await this.store?.close();
|
||||
// wait until connection is not connecting to avoid error:
|
||||
// "WebSocket was closed before the connection was established"
|
||||
await waitUntil(async () => !this.sock?.ws?.isConnecting, 1_000, 10_000);
|
||||
this.sock?.end(undefined);
|
||||
this.store?.close();
|
||||
}
|
||||
|
||||
getSessionMeInfo(): MeInfo | null {
|
||||
@@ -462,7 +487,7 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
}
|
||||
|
||||
if (this.status == WAHASessionStatus.STARTING) {
|
||||
this.log.debug('Waiting for connection update...');
|
||||
this.logger.debug('Waiting for connection update...');
|
||||
await this.sock.waitForConnectionUpdate((update) => !!update.qr);
|
||||
}
|
||||
|
||||
@@ -471,12 +496,12 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
throw new UnprocessableEntityException(err);
|
||||
}
|
||||
|
||||
this.log.log(`Requesting pairing code for '${phoneNumber}'...`);
|
||||
this.logger.info(`Requesting pairing code for '${phoneNumber}'...`);
|
||||
const code: string = await this.sock.requestPairingCode(phoneNumber);
|
||||
// show it as ABCD-ABCD
|
||||
const parts = splitAt(code, 4);
|
||||
const codeRepr = parts.join('-');
|
||||
this.log.log(`Your code: ${codeRepr}`);
|
||||
this.logger.info(`Your code: ${codeRepr}`);
|
||||
return { code: codeRepr };
|
||||
}
|
||||
|
||||
@@ -513,26 +538,20 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
};
|
||||
}
|
||||
|
||||
sendText(request: MessageTextRequest) {
|
||||
async sendText(request: MessageTextRequest) {
|
||||
const chatId = toJID(this.ensureSuffix(request.chatId));
|
||||
const message = {
|
||||
text: request.text,
|
||||
mentions: request.mentions?.map(toJID),
|
||||
};
|
||||
return this.sock.sendMessage(chatId, message);
|
||||
const options = await this.getMessageOptions(request);
|
||||
return this.sock.sendMessage(chatId, message, options);
|
||||
}
|
||||
|
||||
public deleteMessage(chatId: string, messageId: string) {
|
||||
const jid = toJID(this.ensureSuffix(chatId));
|
||||
const key = parseMessageId(messageId);
|
||||
const options = {
|
||||
statusJidList: [
|
||||
'79521562380@s.whatsapp.net',
|
||||
'79069571990@s.whatsapp.net',
|
||||
'79069471990@s.whatsapp.net',
|
||||
],
|
||||
};
|
||||
return this.sock.sendMessage(jid, { delete: key }, options);
|
||||
const key = parseMessageIdSerialized(messageId);
|
||||
return this.sock.sendMessage(jid, { delete: key });
|
||||
}
|
||||
|
||||
public editMessage(
|
||||
@@ -541,7 +560,7 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
request: EditMessageRequest,
|
||||
) {
|
||||
const jid = toJID(this.ensureSuffix(chatId));
|
||||
const key = parseMessageId(messageId);
|
||||
const key = parseMessageIdSerialized(messageId);
|
||||
const message = {
|
||||
text: request.text,
|
||||
mentions: request.mentions?.map(toJID),
|
||||
@@ -571,23 +590,18 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
};
|
||||
const message = { poll: poll };
|
||||
const remoteJid = toJID(request.chatId);
|
||||
const result = await this.sock.sendMessage(remoteJid, message);
|
||||
const options = await this.getMessageOptions(request);
|
||||
const result = await this.sock.sendMessage(remoteJid, message, options);
|
||||
return this.toWAMessage(result);
|
||||
}
|
||||
|
||||
async reply(request: MessageReplyRequest) {
|
||||
const { id } = parseMessageId(request.reply_to);
|
||||
const quotedMessage = await this.store.loadMessage(
|
||||
toJID(request.chatId),
|
||||
id,
|
||||
);
|
||||
const options = await this.getMessageOptions(request);
|
||||
const message = {
|
||||
text: request.text,
|
||||
mentions: request.mentions?.map(toJID),
|
||||
};
|
||||
return await this.sock.sendMessage(request.chatId, message, {
|
||||
quoted: quotedMessage,
|
||||
});
|
||||
return await this.sock.sendMessage(request.chatId, message, options);
|
||||
}
|
||||
|
||||
sendImage(request: MessageImageRequest) {
|
||||
@@ -618,11 +632,14 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
}
|
||||
|
||||
async sendSeen(request: SendSeenRequest) {
|
||||
const key = parseMessageId(request.messageId);
|
||||
const key = parseMessageIdSerialized(request.messageId);
|
||||
const participant = request.participant
|
||||
? toJID(this.ensureSuffix(request.participant))
|
||||
: undefined;
|
||||
const data = {
|
||||
remoteJid: key.remoteJid,
|
||||
id: key.id,
|
||||
participant: request.participant,
|
||||
participant: participant,
|
||||
};
|
||||
return this.sock.readMessages([data]);
|
||||
}
|
||||
@@ -649,19 +666,18 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
toJID(chatId),
|
||||
toNumber(limit),
|
||||
);
|
||||
const result = [];
|
||||
|
||||
const promises = [];
|
||||
for (const msg of messages) {
|
||||
const wamsg = await this.processIncomingMessage(msg, downloadMedia);
|
||||
if (!wamsg) {
|
||||
continue;
|
||||
}
|
||||
result.push(wamsg);
|
||||
promises.push(this.processIncomingMessage(msg, downloadMedia));
|
||||
}
|
||||
let result = await Promise.all(promises);
|
||||
result = result.filter(Boolean);
|
||||
return result;
|
||||
}
|
||||
|
||||
async setReaction(request: MessageReactionRequest) {
|
||||
const key = parseMessageId(request.messageId);
|
||||
const key = parseMessageIdSerialized(request.messageId);
|
||||
const reactionMessage = {
|
||||
react: {
|
||||
text: request.reaction,
|
||||
@@ -672,7 +688,7 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
}
|
||||
|
||||
async setStar(request: MessageStarRequest) {
|
||||
const key = parseMessageId(request.messageId);
|
||||
const key = parseMessageIdSerialized(request.messageId);
|
||||
await this.sock.chatModify(
|
||||
{
|
||||
star: {
|
||||
@@ -695,6 +711,73 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
return chats;
|
||||
}
|
||||
|
||||
protected async chatsPutArchive(
|
||||
chatId: string,
|
||||
archive: boolean,
|
||||
): Promise<any> {
|
||||
const jid = toJID(chatId);
|
||||
const messages = await this.store.getMessagesByJid(jid, 1);
|
||||
return await this.sock.chatModify(
|
||||
{ archive: archive, lastMessages: messages },
|
||||
jid,
|
||||
);
|
||||
}
|
||||
|
||||
public chatsArchiveChat(chatId: string): Promise<any> {
|
||||
return this.chatsPutArchive(chatId, true);
|
||||
}
|
||||
|
||||
public chatsUnarchiveChat(chatId: string): Promise<any> {
|
||||
return this.chatsPutArchive(chatId, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Labels methods
|
||||
*/
|
||||
|
||||
public async getLabels(): Promise<Label[]> {
|
||||
const labels = await this.store.getLabels();
|
||||
return labels.map(this.toLabel);
|
||||
}
|
||||
|
||||
public async getChatsByLabelId(labelId: string) {
|
||||
const chats = await this.store.getChatsByLabelId(labelId);
|
||||
// Remove unreadCount, it's not ready yet
|
||||
chats.forEach((chat) => delete chat.unreadCount);
|
||||
return chats;
|
||||
}
|
||||
|
||||
public async getChatLabels(chatId: string): Promise<Label[]> {
|
||||
const jid = toJID(chatId);
|
||||
const labels = await this.store.getChatLabels(jid);
|
||||
return labels.map(this.toLabel);
|
||||
}
|
||||
|
||||
public async putLabelsToChat(chatId: string, labels: LabelID[]) {
|
||||
const jid = toJID(chatId);
|
||||
const labelsIds = labels.map((label) => label.id);
|
||||
const currentLabels = await this.store.getChatLabels(jid);
|
||||
const currentLabelsIds = currentLabels.map((label) => label.id);
|
||||
const addLabelsIds = lodash.difference(labelsIds, currentLabelsIds);
|
||||
const removeLabelsIds = lodash.difference(currentLabelsIds, labelsIds);
|
||||
for (const labelId of addLabelsIds) {
|
||||
await this.sock.addChatLabel(jid, labelId);
|
||||
}
|
||||
for (const labelId of removeLabelsIds) {
|
||||
await this.sock.removeChatLabel(jid, labelId);
|
||||
}
|
||||
}
|
||||
|
||||
protected toLabel(label: NOWEBLabel): Label {
|
||||
const color = label.color;
|
||||
return {
|
||||
id: label.id,
|
||||
name: label.name,
|
||||
color: color,
|
||||
colorHex: Label.toHex(color),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Contacts methods
|
||||
*/
|
||||
@@ -844,13 +927,7 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
|
||||
public deleteStatus(request: DeleteStatusRequest) {
|
||||
const messageId = request.id;
|
||||
let key: any;
|
||||
if (messageId.includes('_')) {
|
||||
key = parseMessageId(messageId);
|
||||
} else {
|
||||
key = { id: messageId };
|
||||
}
|
||||
|
||||
const key = parseMessageIdSerialized(messageId, true);
|
||||
key.fromMe = true;
|
||||
key.remoteJid = BROADCAST_ID;
|
||||
const JIDs = request.contacts.map(toJID);
|
||||
@@ -870,6 +947,81 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Channels methods
|
||||
*/
|
||||
protected toChannel(newsletter: NewsletterMetadata): Channel {
|
||||
const role =
|
||||
// @ts-ignore
|
||||
newsletter.viewer_metadata?.role ||
|
||||
(newsletter.viewer_metadata?.view_role as ChannelRole) ||
|
||||
ChannelRole.GUEST;
|
||||
const preview = newsletter.preview
|
||||
? getUrlFromDirectPath(newsletter.preview)
|
||||
: null;
|
||||
const picture = newsletter.picture
|
||||
? getUrlFromDirectPath(newsletter.picture)
|
||||
: null;
|
||||
return {
|
||||
id: newsletter.id,
|
||||
name: newsletter.name,
|
||||
description: newsletter.description,
|
||||
invite: getChannelInviteLink(newsletter.invite),
|
||||
preview: preview,
|
||||
picture: picture,
|
||||
verified: newsletter.verification === 'VERIFIED',
|
||||
role: role,
|
||||
};
|
||||
}
|
||||
|
||||
public async channelsList(query: ListChannelsQuery): Promise<Channel[]> {
|
||||
const newsletters = await this.sock.newsletterSubscribed();
|
||||
let channels = newsletters.map(this.toChannel);
|
||||
if (query.role) {
|
||||
// @ts-ignore
|
||||
channels = channels.filter((channel) => channel.role === query.role);
|
||||
}
|
||||
return channels;
|
||||
}
|
||||
|
||||
public async channelsCreateChannel(request: CreateChannelRequest) {
|
||||
const newsletter = await this.sock.newsletterCreate(
|
||||
request.name,
|
||||
request.description,
|
||||
);
|
||||
return this.toChannel(newsletter);
|
||||
}
|
||||
|
||||
public async channelsGetChannel(id: string) {
|
||||
const newsletter = await this.sock.newsletterMetadata('jid', id);
|
||||
return this.toChannel(newsletter);
|
||||
}
|
||||
|
||||
public async channelsGetChannelByInviteCode(inviteCode: string) {
|
||||
const newsletter = await this.sock.newsletterMetadata('invite', inviteCode);
|
||||
return this.toChannel(newsletter);
|
||||
}
|
||||
|
||||
public async channelsDeleteChannel(id: string) {
|
||||
return await this.sock.newsletterDelete(id);
|
||||
}
|
||||
|
||||
public async channelsFollowChannel(id: string): Promise<void> {
|
||||
return await this.sock.newsletterAction(id, 'follow');
|
||||
}
|
||||
|
||||
public async channelsUnfollowChannel(id: string): Promise<void> {
|
||||
return await this.sock.newsletterAction(id, 'unfollow');
|
||||
}
|
||||
|
||||
public async channelsMuteChannel(id: string): Promise<void> {
|
||||
return await this.sock.newsletterAction(id, 'mute');
|
||||
}
|
||||
|
||||
public async channelsUnmuteChannel(id: string): Promise<void> {
|
||||
return await this.sock.newsletterAction(id, 'unmute');
|
||||
}
|
||||
|
||||
/**
|
||||
* END - Methods for API
|
||||
*/
|
||||
@@ -933,6 +1085,99 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
);
|
||||
});
|
||||
return true;
|
||||
case WAHAEvents.CALL_RECEIVED:
|
||||
this.sock.ev.on('call', (calls: WACallEvent[]) => {
|
||||
calls = lodash.filter(calls, { status: 'offer' });
|
||||
for (const call of calls) {
|
||||
const body = this.toCallData(call);
|
||||
handler(body);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
case WAHAEvents.CALL_ACCEPTED:
|
||||
this.sock.ev.on('call', (calls: WACallEvent[]) => {
|
||||
calls = lodash.filter(calls, { status: 'accept' });
|
||||
for (const call of calls) {
|
||||
const body = this.toCallData(call);
|
||||
handler(body);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
case WAHAEvents.CALL_REJECTED:
|
||||
this.sock.ev.on('call', (calls: WACallEvent[]) => {
|
||||
const acceptCalls = lodash.filter(calls, { status: 'accept' });
|
||||
if (acceptCalls.length > 0) {
|
||||
// We got two events when accepting calls - reject and accept
|
||||
// Like for each device
|
||||
// So if we see accepted call - ignore rejected
|
||||
return;
|
||||
}
|
||||
|
||||
calls = lodash.filter(calls, { status: 'reject' });
|
||||
for (const call of calls) {
|
||||
const body = this.toCallData(call);
|
||||
if (body.isGroup == null) {
|
||||
// We get two "reject" events, one with null property, ignore it
|
||||
return;
|
||||
}
|
||||
handler(body);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
case WAHAEvents.LABEL_UPSERT:
|
||||
this.sock.ev.on('labels.edit', (data: NOWEBLabel) => {
|
||||
if (data.deleted) {
|
||||
return;
|
||||
}
|
||||
const body = this.toLabel(data);
|
||||
handler(body);
|
||||
});
|
||||
return true;
|
||||
case WAHAEvents.LABEL_DELETED:
|
||||
this.sock.ev.on('labels.edit', (data: NOWEBLabel) => {
|
||||
if (!data.deleted) {
|
||||
return;
|
||||
}
|
||||
const body = this.toLabel(data);
|
||||
handler(body);
|
||||
});
|
||||
return true;
|
||||
case WAHAEvents.LABEL_CHAT_ADDED:
|
||||
this.sock.ev.on('labels.association', async ({ association, type }) => {
|
||||
if (type !== 'add') {
|
||||
return;
|
||||
}
|
||||
if (association.type !== LabelAssociationType.Chat) {
|
||||
return;
|
||||
}
|
||||
const labelData = await this.store.getLabelById(association.labelId);
|
||||
const label = labelData ? this.toLabel(labelData) : null;
|
||||
const body: LabelChatAssociation = {
|
||||
labelId: association.labelId,
|
||||
chatId: toCusFormat(association.chatId),
|
||||
label: label,
|
||||
};
|
||||
handler(body);
|
||||
});
|
||||
return true;
|
||||
case WAHAEvents.LABEL_CHAT_DELETED:
|
||||
this.sock.ev.on('labels.association', async ({ association, type }) => {
|
||||
if (type !== 'remove') {
|
||||
return;
|
||||
}
|
||||
if (association.type !== LabelAssociationType.Chat) {
|
||||
return;
|
||||
}
|
||||
const labelData = await this.store.getLabelById(association.labelId);
|
||||
const label = labelData ? this.toLabel(labelData) : null;
|
||||
const body: LabelChatAssociation = {
|
||||
labelId: association.labelId,
|
||||
chatId: toCusFormat(association.chatId),
|
||||
label: label,
|
||||
};
|
||||
handler(body);
|
||||
});
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -994,16 +1239,16 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
try {
|
||||
message = await this.downloadMedia(message);
|
||||
} catch (e) {
|
||||
this.log.error('Failed when tried to download media for a message');
|
||||
this.log.error(e, e.stack);
|
||||
this.logger.error('Failed when tried to download media for a message');
|
||||
this.logger.error(e, e.stack);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
return await this.toWAMessage(message);
|
||||
} catch (error) {
|
||||
this.log.error('Failed to process incoming message');
|
||||
this.log.error(error);
|
||||
this.logger.error('Failed to process incoming message');
|
||||
this.logger.error(error);
|
||||
console.trace(error);
|
||||
return null;
|
||||
}
|
||||
@@ -1012,18 +1257,8 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
protected toWAMessage(message): Promise<WAMessage> {
|
||||
const fromToParticipant = getFromToParticipant(message);
|
||||
const id = buildMessageId(message.key);
|
||||
let body = message.message.conversation;
|
||||
if (!body) {
|
||||
// Some of the messages have no conversation, but instead have text in extendedTextMessage
|
||||
// https://github.com/devlikeapro/waha/issues/90
|
||||
body = message.message.extendedTextMessage?.text;
|
||||
}
|
||||
if (!body) {
|
||||
// Populate from caption
|
||||
const mediaContent = extractMediaContent(message.message);
|
||||
// @ts-ignore - AudioMessage doesn't have caption field
|
||||
body = mediaContent?.caption;
|
||||
}
|
||||
const body = this.extractBody(message.message);
|
||||
const replyTo = this.extractReplyTo(message.message);
|
||||
const ack = message.ack || message.status - 1;
|
||||
return Promise.resolve({
|
||||
id: id,
|
||||
@@ -1043,10 +1278,45 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
ackName: WAMessageAck[ack] || ACK_UNKNOWN,
|
||||
location: message.location,
|
||||
vCards: message.vCards,
|
||||
replyTo: replyTo,
|
||||
_data: message,
|
||||
});
|
||||
}
|
||||
|
||||
protected extractBody(message): string | null {
|
||||
if (!message) {
|
||||
return null;
|
||||
}
|
||||
let body = message.conversation;
|
||||
if (!body) {
|
||||
// Some of the messages have no conversation, but instead have text in extendedTextMessage
|
||||
// https://github.com/devlikeapro/waha/issues/90
|
||||
body = message.extendedTextMessage?.text;
|
||||
}
|
||||
if (!body) {
|
||||
// Populate from caption
|
||||
const mediaContent = extractMediaContent(message);
|
||||
// @ts-ignore - AudioMessage doesn't have caption field
|
||||
body = mediaContent?.caption;
|
||||
}
|
||||
return body;
|
||||
}
|
||||
|
||||
protected extractReplyTo(message): ReplyToMessage | null {
|
||||
const msgType = getContentType(message);
|
||||
const contextInfo = message[msgType]?.contextInfo;
|
||||
if (!contextInfo) {
|
||||
return null;
|
||||
}
|
||||
const quotedMessage = contextInfo.quotedMessage;
|
||||
const body = this.extractBody(quotedMessage);
|
||||
return {
|
||||
id: contextInfo.stanzaId,
|
||||
participant: toCusFormat(contextInfo.participant),
|
||||
body: body,
|
||||
};
|
||||
}
|
||||
|
||||
protected toWAContact(contact: Contact) {
|
||||
contact.id = toCusFormat(contact.id);
|
||||
// @ts-ignore
|
||||
@@ -1170,6 +1440,20 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
handler(payload);
|
||||
}
|
||||
|
||||
private toCallData(call: WACallEvent): CallData {
|
||||
// call.date can be either string 2024-07-18T09:45:55.000Z or Date
|
||||
const date = new Date(call.date);
|
||||
// convert to timestamp in seconds
|
||||
const timestamp: number = date.getTime() / 1000;
|
||||
return {
|
||||
id: call.id,
|
||||
from: toCusFormat(call.from),
|
||||
timestamp: timestamp,
|
||||
isVideo: call.isVideo,
|
||||
isGroup: call.isGroup,
|
||||
};
|
||||
}
|
||||
|
||||
private toWahaPresences(
|
||||
remoteJid: string,
|
||||
storedPresences: { [participant: string]: PresenceData },
|
||||
@@ -1196,11 +1480,23 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
|
||||
protected downloadMedia(message) {
|
||||
const processor = new EngineMediaProcessor(this);
|
||||
return this.mediaManager.processMedia(processor, message);
|
||||
return this.mediaManager.processMedia(processor, message, this.name);
|
||||
}
|
||||
|
||||
protected async getMessageOptions(request: any): Promise<any> {
|
||||
let quoted;
|
||||
if (request.reply_to) {
|
||||
const key = parseMessageIdSerialized(request.reply_to, true);
|
||||
quoted = await this.store.loadMessage(toJID(request.chatId), key.id);
|
||||
}
|
||||
|
||||
return {
|
||||
quoted: quoted,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export class EngineMediaProcessor implements IEngineMediaProcessor<any> {
|
||||
export class EngineMediaProcessor implements IMediaEngineProcessor<any> {
|
||||
constructor(public session: WhatsappSessionNoWebCore) {}
|
||||
|
||||
hasMedia(message: any): boolean {
|
||||
@@ -1229,6 +1525,9 @@ export class EngineMediaProcessor implements IEngineMediaProcessor<any> {
|
||||
* Convert from 11111111111@s.whatsapp.net to 11111111111@c.us
|
||||
*/
|
||||
function toCusFormat(remoteJid) {
|
||||
if (!remoteJid) {
|
||||
return remoteJid;
|
||||
}
|
||||
if (isJidGroup(remoteJid)) {
|
||||
return remoteJid;
|
||||
}
|
||||
@@ -1238,6 +1537,9 @@ function toCusFormat(remoteJid) {
|
||||
if (isLidUser(remoteJid)) {
|
||||
return remoteJid;
|
||||
}
|
||||
if (isNewsletter(remoteJid)) {
|
||||
return remoteJid;
|
||||
}
|
||||
if (!remoteJid) {
|
||||
return;
|
||||
}
|
||||
@@ -1259,6 +1561,9 @@ export function toJID(chatId) {
|
||||
if (isJidStatusBroadcast(chatId)) {
|
||||
return chatId;
|
||||
}
|
||||
if (isNewsletter(chatId)) {
|
||||
return chatId;
|
||||
}
|
||||
const number = chatId.split('@')[0];
|
||||
return number + '@s.whatsapp.net';
|
||||
}
|
||||
@@ -1278,7 +1583,11 @@ function buildMessageId({ id, remoteJid, fromMe }) {
|
||||
* false_11111111111@c.us_AAA
|
||||
* {id: "AAA", remoteJid: "11111111111@s.whatsapp.net", "fromMe": false}
|
||||
*/
|
||||
function parseMessageId(messageId) {
|
||||
function parseMessageIdSerialized(messageId: string, soft: boolean = false) {
|
||||
if (!messageId.includes('_') && soft) {
|
||||
return { id: messageId };
|
||||
}
|
||||
|
||||
const parts = messageId.split('_');
|
||||
if (parts.length != 3) {
|
||||
throw new Error(
|
||||
|
||||
@@ -3,6 +3,8 @@ import { Chat } from '@adiwajshing/baileys';
|
||||
export interface IChatRepository {
|
||||
getAll(): Promise<Chat[]>;
|
||||
|
||||
getAllByIds(ids: string[]): Promise<Chat[]>;
|
||||
|
||||
getAllWithMessages(limit?: number, offset?: number): Promise<Chat[]>;
|
||||
|
||||
getById(id: string): Promise<Chat | null>;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import {
|
||||
LabelAssociation,
|
||||
LabelAssociationType,
|
||||
} from '@adiwajshing/baileys/lib/Types/LabelAssociation';
|
||||
|
||||
export interface ILabelAssociationRepository {
|
||||
deleteOne(association: LabelAssociation): Promise<void>;
|
||||
|
||||
save(association: LabelAssociation): Promise<void>;
|
||||
|
||||
deleteByLabelId(labelId: string): Promise<void>;
|
||||
|
||||
getAssociationsByLabelId(
|
||||
labelId: string,
|
||||
type: LabelAssociationType,
|
||||
): Promise<LabelAssociation[]>;
|
||||
|
||||
getAssociationsByChatId(chatId: string): Promise<LabelAssociation[]>;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Contact } from '@adiwajshing/baileys';
|
||||
import { Label } from '@adiwajshing/baileys/lib/Types/Label';
|
||||
|
||||
export interface ILabelsRepository {
|
||||
getById(id: string): Promise<Label | null>;
|
||||
|
||||
getAll(): Promise<Label[]>;
|
||||
|
||||
getAllByIds(ids: string[]): Promise<Label[]>;
|
||||
|
||||
deleteById(id: string): Promise<void>;
|
||||
|
||||
save(label: Label): Promise<void>;
|
||||
}
|
||||
@@ -1,15 +1,40 @@
|
||||
import { WAMessage } from '@adiwajshing/baileys';
|
||||
import { LabelAssociation } from '@adiwajshing/baileys/lib/Types/LabelAssociation';
|
||||
import { ILabelAssociationRepository } from '@waha/core/engines/noweb/store/ILabelAssociationsRepository';
|
||||
import { ILabelsRepository } from '@waha/core/engines/noweb/store/ILabelsRepository';
|
||||
|
||||
import { IChatRepository } from './IChatRepository';
|
||||
import { IContactRepository } from './IContactRepository';
|
||||
import { IMessagesRepository } from './IMessagesRepository';
|
||||
|
||||
export interface INowebStorage {
|
||||
init(): Promise<void>;
|
||||
export abstract class INowebStorage {
|
||||
abstract init(): Promise<void>;
|
||||
|
||||
close(): Promise<void>;
|
||||
abstract close(): Promise<void>;
|
||||
|
||||
getContactsRepository(): IContactRepository;
|
||||
abstract getContactsRepository(): IContactRepository;
|
||||
|
||||
getChatRepository(): IChatRepository;
|
||||
abstract getChatRepository(): IChatRepository;
|
||||
|
||||
getMessagesRepository(): IMessagesRepository;
|
||||
abstract getMessagesRepository(): IMessagesRepository;
|
||||
|
||||
abstract getLabelsRepository(): ILabelsRepository;
|
||||
|
||||
abstract getLabelAssociationRepository(): ILabelAssociationRepository;
|
||||
|
||||
protected getMessagesMetadata(): Map<string, any> {
|
||||
return new Map()
|
||||
.set('jid', (msg: WAMessage) => msg.key.remoteJid)
|
||||
.set('id', (msg: WAMessage) => msg.key.id)
|
||||
.set('messageTimestamp', (msg: WAMessage) => msg.messageTimestamp);
|
||||
}
|
||||
|
||||
protected getLabelAssociationMetadata() {
|
||||
return new Map().set(
|
||||
'id',
|
||||
(a: LabelAssociation) =>
|
||||
// @ts-ignore
|
||||
`${a.type}_${a.labelId}_${a.chatId}_${a.messageId}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
Contact,
|
||||
proto,
|
||||
} from '@adiwajshing/baileys';
|
||||
import { Label } from '@adiwajshing/baileys/lib/Types/Label';
|
||||
|
||||
export interface INowebStore {
|
||||
presences: any;
|
||||
@@ -23,4 +24,12 @@ export interface INowebStore {
|
||||
getContacts(): Promise<Contact[]>;
|
||||
|
||||
getContactById(jid: string): Promise<Contact>;
|
||||
|
||||
getLabels(): Promise<Label[]>;
|
||||
|
||||
getLabelById(labelId: string): Promise<Label | null>;
|
||||
|
||||
getChatsByLabelId(labelId: string): Promise<Chat[]>;
|
||||
|
||||
getChatLabels(chatId: string): Promise<Label[]>;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Chat, Contact, makeInMemoryStore, proto } from '@adiwajshing/baileys';
|
||||
import { BadRequestException, ConsoleLogger } from '@nestjs/common';
|
||||
import { Label } from '@adiwajshing/baileys/lib/Types/Label';
|
||||
import { BadRequestException } from '@nestjs/common';
|
||||
|
||||
import { INowebStore } from './INowebStore';
|
||||
|
||||
@@ -51,4 +52,20 @@ export class NowebInMemoryStore implements INowebStore {
|
||||
getContactById(jid: string): Promise<Contact> {
|
||||
throw new BadRequestException(this.errorMessage);
|
||||
}
|
||||
|
||||
getLabels(): Promise<Label[]> {
|
||||
throw new BadRequestException(this.errorMessage);
|
||||
}
|
||||
|
||||
getLabelById(labelId: string): Promise<Label | null> {
|
||||
throw new BadRequestException(this.errorMessage);
|
||||
}
|
||||
|
||||
getChatsByLabelId(labelId: string): Promise<Chat[]> {
|
||||
throw new BadRequestException(this.errorMessage);
|
||||
}
|
||||
|
||||
getChatLabels(chatId: string): Promise<Label[]> {
|
||||
throw new BadRequestException(this.errorMessage);
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,15 @@ import {
|
||||
updateMessageWithReaction,
|
||||
updateMessageWithReceipt,
|
||||
} from '@adiwajshing/baileys';
|
||||
import { ConsoleLogger } from '@nestjs/common';
|
||||
import { Label } from '@adiwajshing/baileys/lib/Types/Label';
|
||||
import {
|
||||
LabelAssociation,
|
||||
LabelAssociationType,
|
||||
} from '@adiwajshing/baileys/lib/Types/LabelAssociation';
|
||||
import { ILabelAssociationRepository } from '@waha/core/engines/noweb/store/ILabelAssociationsRepository';
|
||||
import { ILabelsRepository } from '@waha/core/engines/noweb/store/ILabelsRepository';
|
||||
import { toNumber } from 'lodash';
|
||||
import { Logger } from 'pino';
|
||||
|
||||
import { toJID } from '../session.noweb.core';
|
||||
import { IChatRepository } from './IChatRepository';
|
||||
@@ -27,17 +34,21 @@ export class NowebPersistentStore implements INowebStore {
|
||||
private chatRepo: IChatRepository;
|
||||
private contactRepo: IContactRepository;
|
||||
private messagesRepo: IMessagesRepository;
|
||||
private labelsRepo: ILabelsRepository;
|
||||
private labelAssociationsRepo: ILabelAssociationRepository;
|
||||
public presences: any;
|
||||
private lock: any;
|
||||
|
||||
constructor(
|
||||
private log: ConsoleLogger,
|
||||
private logger: Logger,
|
||||
public storage: INowebStorage,
|
||||
) {
|
||||
this.socket = null;
|
||||
this.chatRepo = storage.getChatRepository();
|
||||
this.contactRepo = storage.getContactsRepository();
|
||||
this.messagesRepo = storage.getMessagesRepository();
|
||||
this.labelsRepo = storage.getLabelsRepository();
|
||||
this.labelAssociationsRepo = storage.getLabelAssociationRepository();
|
||||
this.presences = {};
|
||||
this.lock = new AsyncLock({ maxPending: Infinity });
|
||||
}
|
||||
@@ -82,6 +93,10 @@ export class NowebPersistentStore implements INowebStore {
|
||||
ev.on('contacts.update', (data) =>
|
||||
this.withLock('contacts', () => this.onContactUpdate(data)),
|
||||
);
|
||||
ev.on('labels.edit', (data) => this.onLabelsEdit(data));
|
||||
ev.on('labels.association', ({ association, type }) =>
|
||||
this.onLabelsAssociation(association, type),
|
||||
);
|
||||
// Presence
|
||||
ev.on('presence.update', (data) => this.onPresenceUpdate(data));
|
||||
this.socket = socket;
|
||||
@@ -89,7 +104,7 @@ export class NowebPersistentStore implements INowebStore {
|
||||
|
||||
async close(): Promise<void> {
|
||||
await this.storage?.close().catch((error) => {
|
||||
this.log.warn(`Failed to close storage: ${error}`);
|
||||
this.logger.warn(`Failed to close storage: ${error}`);
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -97,7 +112,7 @@ export class NowebPersistentStore implements INowebStore {
|
||||
private async onMessagingHistorySet(history) {
|
||||
const { contacts, chats, messages, isLatest } = history;
|
||||
if (isLatest) {
|
||||
this.log.debug(
|
||||
this.logger.debug(
|
||||
'history sync - clearing all entities, got latest history',
|
||||
);
|
||||
await Promise.all([
|
||||
@@ -110,7 +125,7 @@ export class NowebPersistentStore implements INowebStore {
|
||||
await Promise.all([
|
||||
this.withLock('contacts', async () => {
|
||||
await this.onContactsUpsert(contacts);
|
||||
this.log.log(`history sync - '${contacts.length}' synced contacts`);
|
||||
this.logger.info(`history sync - '${contacts.length}' synced contacts`);
|
||||
}),
|
||||
this.withLock('chats', () => this.onChatUpsert(chats)),
|
||||
this.withLock('messages', () => this.syncMessagesHistory(messages)),
|
||||
@@ -120,7 +135,7 @@ export class NowebPersistentStore implements INowebStore {
|
||||
private async syncMessagesHistory(messages) {
|
||||
const realMessages = messages.filter(isRealMessage);
|
||||
await this.messagesRepo.upsert(realMessages);
|
||||
this.log.log(
|
||||
this.logger.info(
|
||||
`history sync - '${messages.length}' got messages, '${realMessages.length}' real messages`,
|
||||
);
|
||||
}
|
||||
@@ -128,12 +143,12 @@ export class NowebPersistentStore implements INowebStore {
|
||||
private async onMessagesUpsert(update) {
|
||||
const { messages, type } = update;
|
||||
if (type !== 'notify' && type !== 'append') {
|
||||
this.log.debug(`unexpected type for messages.upsert: '${type}'`);
|
||||
this.logger.debug(`unexpected type for messages.upsert: '${type}'`);
|
||||
return;
|
||||
}
|
||||
const realMessages = messages.filter(isRealMessage);
|
||||
await this.messagesRepo.upsert(realMessages);
|
||||
this.log.debug(
|
||||
this.logger.debug(
|
||||
`messages.upsert - ${messages.length} got messages, ${realMessages.length} real messages`,
|
||||
);
|
||||
}
|
||||
@@ -178,7 +193,7 @@ export class NowebPersistentStore implements INowebStore {
|
||||
chat.conversationTimestamp = toNumber(chat.conversationTimestamp);
|
||||
await this.chatRepo.save(chat);
|
||||
}
|
||||
this.log.log(`history sync - '${chats.length}' synced chats`);
|
||||
this.logger.info(`history sync - '${chats.length}' synced chats`);
|
||||
}
|
||||
|
||||
private async onChatUpdate(updates: ChatUpdate[]) {
|
||||
@@ -219,7 +234,7 @@ export class NowebPersistentStore implements INowebStore {
|
||||
const contact = await this.contactRepo.getById(update.id);
|
||||
|
||||
if (!contact) {
|
||||
this.log.warn(
|
||||
this.logger.warn(
|
||||
`got update for non-existent contact. update: '${JSON.stringify(
|
||||
update,
|
||||
)}'`,
|
||||
@@ -246,7 +261,7 @@ export class NowebPersistentStore implements INowebStore {
|
||||
for (const { key, reaction } of reactions) {
|
||||
const msg = await this.messagesRepo.getByJidById(key.remoteJid, key.id);
|
||||
if (!msg) {
|
||||
this.log.warn(
|
||||
this.logger.warn(
|
||||
`got reaction update for non-existent message. key: '${JSON.stringify(
|
||||
key,
|
||||
)}'`,
|
||||
@@ -262,7 +277,7 @@ export class NowebPersistentStore implements INowebStore {
|
||||
for (const { key, receipt } of updates) {
|
||||
const msg = await this.messagesRepo.getByJidById(key.remoteJid, key.id);
|
||||
if (!msg) {
|
||||
this.log.warn(
|
||||
this.logger.warn(
|
||||
`got receipt update for non-existent message. key: '${JSON.stringify(
|
||||
key,
|
||||
)}'`,
|
||||
@@ -274,6 +289,26 @@ export class NowebPersistentStore implements INowebStore {
|
||||
}
|
||||
}
|
||||
|
||||
private async onLabelsEdit(label: Label) {
|
||||
if (label.deleted) {
|
||||
await this.labelsRepo.deleteById(label.id);
|
||||
await this.labelAssociationsRepo.deleteByLabelId(label.id);
|
||||
} else {
|
||||
await this.labelsRepo.save(label);
|
||||
}
|
||||
}
|
||||
|
||||
private async onLabelsAssociation(
|
||||
association: LabelAssociation,
|
||||
type: 'add' | 'remove',
|
||||
) {
|
||||
if (type === 'remove') {
|
||||
await this.labelAssociationsRepo.deleteOne(association);
|
||||
} else {
|
||||
await this.labelAssociationsRepo.save(association);
|
||||
}
|
||||
}
|
||||
|
||||
private async onPresenceUpdate({ id, presences: update }) {
|
||||
this.presences[id] = this.presences[id] || {};
|
||||
Object.assign(this.presences[id], update);
|
||||
@@ -302,4 +337,29 @@ export class NowebPersistentStore implements INowebStore {
|
||||
getContacts() {
|
||||
return this.contactRepo.getAll();
|
||||
}
|
||||
|
||||
getLabels(): Promise<Label[]> {
|
||||
return this.labelsRepo.getAll();
|
||||
}
|
||||
|
||||
getLabelById(labelId: string): Promise<Label | null> {
|
||||
return this.labelsRepo.getById(labelId);
|
||||
}
|
||||
|
||||
async getChatsByLabelId(labelId: string): Promise<Chat[]> {
|
||||
const associations =
|
||||
await this.labelAssociationsRepo.getAssociationsByLabelId(
|
||||
labelId,
|
||||
LabelAssociationType.Chat,
|
||||
);
|
||||
const ids = associations.map((association) => association.chatId);
|
||||
return await this.chatRepo.getAllByIds(ids);
|
||||
}
|
||||
|
||||
async getChatLabels(chatId: string): Promise<Label[]> {
|
||||
const associations =
|
||||
await this.labelAssociationsRepo.getAssociationsByChatId(chatId);
|
||||
const ids = associations.map((association) => association.labelId);
|
||||
return await this.labelsRepo.getAllByIds(ids);
|
||||
}
|
||||
}
|
||||
@@ -53,4 +53,26 @@ export const NOWEB_STORE_SCHEMA = [
|
||||
new Index('timestamp_index', ['messageTimestamp']),
|
||||
],
|
||||
),
|
||||
new Schema(
|
||||
'labels',
|
||||
[new Field('id', 'TEXT'), new Field('data', 'TEXT')],
|
||||
[new Index('labels_id_index', ['id'])],
|
||||
),
|
||||
new Schema(
|
||||
'labelAssociations',
|
||||
[
|
||||
new Field('id', 'TEXT'),
|
||||
new Field('type', 'TEXT'),
|
||||
new Field('labelId', 'TEXT'),
|
||||
new Field('chatId', 'TEXT'),
|
||||
new Field('messageId', 'TEXT'),
|
||||
new Field('data', 'TEXT'),
|
||||
],
|
||||
[
|
||||
new Index('label_assoc_id_index', ['id']),
|
||||
new Index('label_assoc_type_label_index', ['type', 'labelId']),
|
||||
new Index('label_assoc_type_chat_index', ['type', 'chatId']),
|
||||
new Index('label_assoc_type_message_index', ['type', 'messageId']),
|
||||
],
|
||||
),
|
||||
];
|
||||
@@ -38,6 +38,15 @@ export class Sqlite3KVRepository<Entity> {
|
||||
return this.all(this.select());
|
||||
}
|
||||
|
||||
getAllByIds(ids: string[]) {
|
||||
return this.all(this.select().whereIn('id', ids));
|
||||
}
|
||||
|
||||
protected getAllBy(filters: any) {
|
||||
const query = this.select().where(filters);
|
||||
return this.all(query);
|
||||
}
|
||||
|
||||
protected async getBy(filters: any) {
|
||||
const query = this.select().where(filters).limit(1);
|
||||
return this.get(query);
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import {
|
||||
LabelAssociation,
|
||||
LabelAssociationType,
|
||||
} from '@adiwajshing/baileys/lib/Types/LabelAssociation';
|
||||
import { ILabelAssociationRepository } from '@waha/core/engines/noweb/store/ILabelAssociationsRepository';
|
||||
|
||||
import { Sqlite3KVRepository } from './Sqlite3KVRepository';
|
||||
|
||||
export class Sqlite3LabelAssociationsRepository
|
||||
extends Sqlite3KVRepository<LabelAssociation>
|
||||
implements ILabelAssociationRepository
|
||||
{
|
||||
async deleteOne(association: LabelAssociation): Promise<void> {
|
||||
await this.deleteBy({
|
||||
type: association.type,
|
||||
chatId: association.chatId,
|
||||
labelId: association.labelId,
|
||||
// @ts-ignore: messageId doesn't existing in ChatLabelAssociation
|
||||
messageId: association.messageId || null,
|
||||
});
|
||||
}
|
||||
|
||||
async deleteByLabelId(labelId: string): Promise<void> {
|
||||
await this.deleteBy({ labelId: labelId });
|
||||
}
|
||||
|
||||
getAssociationsByLabelId(
|
||||
labelId: string,
|
||||
type: LabelAssociationType,
|
||||
): Promise<LabelAssociation[]> {
|
||||
return this.getAllBy({
|
||||
type: type,
|
||||
labelId: labelId,
|
||||
});
|
||||
}
|
||||
|
||||
getAssociationsByChatId(chatId: string): Promise<LabelAssociation[]> {
|
||||
return this.getAllBy({ chatId: chatId, type: LabelAssociationType.Chat });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import { Label } from '@adiwajshing/baileys/lib/Types/Label';
|
||||
import { ILabelsRepository } from '@waha/core/engines/noweb/store/ILabelsRepository';
|
||||
|
||||
import { Sqlite3KVRepository } from './Sqlite3KVRepository';
|
||||
|
||||
export class Sqlite3LabelsRepository
|
||||
extends Sqlite3KVRepository<Label>
|
||||
implements ILabelsRepository {}
|
||||
@@ -1,4 +1,9 @@
|
||||
import { WAMessage } from '@adiwajshing/baileys';
|
||||
import { LabelAssociation } from '@adiwajshing/baileys/lib/Types/LabelAssociation';
|
||||
import { ILabelAssociationRepository } from '@waha/core/engines/noweb/store/ILabelAssociationsRepository';
|
||||
import { ILabelsRepository } from '@waha/core/engines/noweb/store/ILabelsRepository';
|
||||
import { Sqlite3LabelAssociationsRepository } from '@waha/core/engines/noweb/store/sqlite3/Sqlite3LabelAssociationsRepository';
|
||||
import { Sqlite3LabelsRepository } from '@waha/core/engines/noweb/store/sqlite3/Sqlite3LabelsRepository';
|
||||
|
||||
import { INowebStorage } from '../INowebStorage';
|
||||
import { Field, Index, NOWEB_STORE_SCHEMA, Schema } from '../Schema';
|
||||
@@ -10,11 +15,12 @@ import { Sqlite3SchemaValidation } from './Sqlite3SchemaValidation';
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const Database = require('better-sqlite3');
|
||||
|
||||
export class Sqlite3Storage implements INowebStorage {
|
||||
export class Sqlite3Storage extends INowebStorage {
|
||||
private readonly db: any;
|
||||
private readonly tables: Schema[];
|
||||
|
||||
constructor(filePath: string) {
|
||||
super();
|
||||
this.db = new Database(filePath);
|
||||
this.tables = NOWEB_STORE_SCHEMA;
|
||||
}
|
||||
@@ -71,6 +77,33 @@ export class Sqlite3Storage implements INowebStorage {
|
||||
this.db.exec(
|
||||
'CREATE INDEX IF NOT EXISTS timestamp_index ON messages (messageTimestamp)',
|
||||
);
|
||||
|
||||
//
|
||||
// Labels
|
||||
//
|
||||
this.db.exec(
|
||||
'CREATE TABLE IF NOT EXISTS labels (id TEXT PRIMARY KEY, data TEXT)',
|
||||
);
|
||||
this.db.exec(
|
||||
'CREATE UNIQUE INDEX IF NOT EXISTS labels_id_index ON labels (id)',
|
||||
);
|
||||
|
||||
// Label associations
|
||||
this.db.exec(
|
||||
'CREATE TABLE IF NOT EXISTS labelAssociations (id TEXT PRIMARY KEY, type TEXT, labelId TEXT, chatId TEXT, messageId TEXT, data TEXT)',
|
||||
);
|
||||
this.db.exec(
|
||||
'CREATE UNIQUE INDEX IF NOT EXISTS label_assoc_id_index ON labelAssociations (id)',
|
||||
);
|
||||
this.db.exec(
|
||||
'CREATE INDEX IF NOT EXISTS label_assoc_type_label_index ON labelAssociations (type, labelId)',
|
||||
);
|
||||
this.db.exec(
|
||||
'CREATE INDEX IF NOT EXISTS label_assoc_type_chat_index ON labelAssociations (type, chatId)',
|
||||
);
|
||||
this.db.exec(
|
||||
'CREATE INDEX IF NOT EXISTS label_assoc_type_message_index ON labelAssociations (type, messageId)',
|
||||
);
|
||||
}
|
||||
|
||||
async close() {
|
||||
@@ -85,11 +118,21 @@ export class Sqlite3Storage implements INowebStorage {
|
||||
return new Sqlite3ChatRepository(this.db, this.getSchema('chats'));
|
||||
}
|
||||
|
||||
getLabelsRepository(): ILabelsRepository {
|
||||
return new Sqlite3LabelsRepository(this.db, this.getSchema('labels'));
|
||||
}
|
||||
|
||||
getLabelAssociationRepository(): ILabelAssociationRepository {
|
||||
const metadata = this.getLabelAssociationMetadata();
|
||||
return new Sqlite3LabelAssociationsRepository(
|
||||
this.db,
|
||||
this.getSchema('labelAssociations'),
|
||||
metadata,
|
||||
);
|
||||
}
|
||||
|
||||
getMessagesRepository() {
|
||||
const metadata = new Map()
|
||||
.set('jid', (msg: WAMessage) => msg.key.remoteJid)
|
||||
.set('id', (msg: WAMessage) => msg.key.id)
|
||||
.set('messageTimestamp', (msg: WAMessage) => msg.messageTimestamp);
|
||||
const metadata = this.getMessagesMetadata();
|
||||
return new Sqlite3MessagesRepository(
|
||||
this.db,
|
||||
this.getSchema('messages'),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { UnprocessableEntityException } from '@nestjs/common/exceptions/unprocessable-entity.exception';
|
||||
import { IMediaEngineProcessor } from '@waha/core/media/IMediaEngineProcessor';
|
||||
import * as Buffer from 'buffer';
|
||||
import { create, CreateConfig, Message, Whatsapp } from 'venom-bot';
|
||||
|
||||
@@ -21,7 +22,6 @@ import {
|
||||
WAHASessionStatus,
|
||||
} from '../../../structures/enums.dto';
|
||||
import { WAMessage } from '../../../structures/responses.dto';
|
||||
import { IEngineMediaProcessor } from '../../abc/media.abc';
|
||||
import { WAHAInternalEvent, WhatsappSession } from '../../abc/session.abc';
|
||||
import { NotImplementedByEngineError } from '../../exceptions';
|
||||
import { QR } from '../../QR';
|
||||
@@ -69,7 +69,7 @@ export class WhatsappSessionVenomCore extends WhatsappSession {
|
||||
this.qr.save(base64Qrimg, urlCode);
|
||||
this.printQR(this.qr);
|
||||
this.status = WAHASessionStatus.SCAN_QR_CODE;
|
||||
this.log.debug('Number of attempts to read the qrcode: ', attempts);
|
||||
this.logger.debug('Number of attempts to read the qrcode: ', attempts);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ export class WhatsappSessionVenomCore extends WhatsappSession {
|
||||
this.whatsapp = await this.buildClient();
|
||||
} catch (error) {
|
||||
this.status = WAHASessionStatus.FAILED;
|
||||
this.log.error(error);
|
||||
this.logger.error(error);
|
||||
this.qr.save('');
|
||||
return;
|
||||
}
|
||||
@@ -248,7 +248,7 @@ export class WhatsappSessionVenomCore extends WhatsappSession {
|
||||
|
||||
protected downloadMedia(message: Message) {
|
||||
const processor = new EngineMediaProcessor(this);
|
||||
return this.mediaManager.processMedia(processor, message);
|
||||
return this.mediaManager.processMedia(processor, message, this.name);
|
||||
}
|
||||
|
||||
private processIncomingMessage(message: Message) {
|
||||
@@ -280,7 +280,7 @@ export class WhatsappSessionVenomCore extends WhatsappSession {
|
||||
}
|
||||
}
|
||||
|
||||
export class EngineMediaProcessor implements IEngineMediaProcessor<Message> {
|
||||
export class EngineMediaProcessor implements IMediaEngineProcessor<Message> {
|
||||
constructor(public session: WhatsappSessionVenomCore) {}
|
||||
|
||||
hasMedia(message: any): boolean {
|
||||
|
||||
@@ -1,535 +0,0 @@
|
||||
<!doctype html>
|
||||
<html class="no-js" dir="ltr" loc="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<title>WhatsApp Web</title>
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<meta name="google" content="notranslate" />
|
||||
<meta name="format-detection" content="telephone=no" />
|
||||
<meta
|
||||
name="description"
|
||||
content="Quickly send and receive WhatsApp messages right from your computer."
|
||||
/>
|
||||
<meta
|
||||
name="og:description"
|
||||
content="Quickly send and receive WhatsApp messages right from your computer."
|
||||
/>
|
||||
<meta name="og:url" content="https://web.whatsapp.com/" />
|
||||
<meta name="og:title" content="WhatsApp Web" />
|
||||
<meta
|
||||
name="og:image"
|
||||
content="https://static.facebook.com/images/whatsapp/www/whatsapp-promo.png"
|
||||
/>
|
||||
<link
|
||||
id="favicon"
|
||||
rel="shortcut icon"
|
||||
href="/img/favicon/1x/favicon.png"
|
||||
type="image/png"
|
||||
/>
|
||||
<link
|
||||
rel="apple-touch-icon"
|
||||
sizes="192x192"
|
||||
href="/apple-touch-icon.png"
|
||||
type="image/png"
|
||||
/>
|
||||
<meta
|
||||
name="theme-color"
|
||||
content="#111b21"
|
||||
media="(prefers-color-scheme: dark)"
|
||||
/>
|
||||
<meta name="theme-color" content="#f0f2f5" />
|
||||
<link
|
||||
id="whatsapp-pwa-manifest-link"
|
||||
rel="manifest"
|
||||
href="/manifest.json"
|
||||
crossorigin="use-credentials"
|
||||
/>
|
||||
<style>
|
||||
#initial_startup {
|
||||
--startup-background: #f0f2f5;
|
||||
--startup-background-rgb: 240, 242, 245;
|
||||
--startup-icon: #bbc5cb;
|
||||
--secondary-lighter: #8696a0;
|
||||
--primary-title: #41525d;
|
||||
--progress-primary: #00c298;
|
||||
--progress-background: #e9edef;
|
||||
}
|
||||
.dark #initial_startup {
|
||||
--startup-background: #111b21;
|
||||
--startup-background-rgb: 17, 27, 33;
|
||||
--startup-icon: #676f73;
|
||||
--primary-title: rgba(233, 237, 239, 0.88);
|
||||
--secondary-lighter: #667781;
|
||||
--progress-primary: #0b846d;
|
||||
--progress-background: #233138;
|
||||
}
|
||||
#app,
|
||||
body,
|
||||
html {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
#app {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
#initial_startup {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
user-select: none;
|
||||
background-color: var(--startup-background);
|
||||
}
|
||||
#initial_startup .graphic {
|
||||
margin-top: -40px;
|
||||
color: var(--startup-icon);
|
||||
}
|
||||
#initial_startup .graphic .resume-logo {
|
||||
transform: translateX(calc(50% - 52px / 2));
|
||||
}
|
||||
#initial_startup .graphic::after {
|
||||
position: relative;
|
||||
top: -100%;
|
||||
left: calc(50% - 72px * 2 - 72px / 2);
|
||||
display: block;
|
||||
width: calc(72px * 3);
|
||||
height: 100%;
|
||||
content: '';
|
||||
background: linear-gradient(
|
||||
to right,
|
||||
rgba(var(--startup-background-rgb), 0.5) 0,
|
||||
rgba(var(--startup-background-rgb), 0.5) 33.33%,
|
||||
rgba(var(--startup-background-rgb), 0) 44.1%,
|
||||
rgba(var(--startup-background-rgb), 0) 55.8%,
|
||||
rgba(var(--startup-background-rgb), 0.5) 66.66%,
|
||||
rgba(var(--startup-background-rgb), 0.5) 100%
|
||||
);
|
||||
opacity: 1;
|
||||
animation: shimmer 1.5s linear 0.6s infinite;
|
||||
}
|
||||
html[dir='rtl'] #initial_startup .graphic::after {
|
||||
animation-direction: reverse;
|
||||
}
|
||||
@keyframes shimmer {
|
||||
from {
|
||||
left: calc(50% - 72px * 2 - 72px / 2);
|
||||
}
|
||||
to {
|
||||
left: calc(50% - 72px / 2);
|
||||
}
|
||||
}
|
||||
#initial_startup .progress {
|
||||
position: relative;
|
||||
width: 420px;
|
||||
height: 3px;
|
||||
margin-top: 40px;
|
||||
}
|
||||
#initial_startup .progress progress {
|
||||
vertical-align: top;
|
||||
}
|
||||
#initial_startup .main {
|
||||
margin-top: 40px;
|
||||
font-size: 17px;
|
||||
color: var(--primary-title);
|
||||
}
|
||||
#initial_startup .secondary {
|
||||
margin-top: 12px;
|
||||
font-size: 14px;
|
||||
color: var(--secondary-lighter);
|
||||
}
|
||||
#initial_startup .secondary span {
|
||||
display: inline-block;
|
||||
margin-bottom: 2px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
progress {
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
width: 100%;
|
||||
height: 3px;
|
||||
margin: 0;
|
||||
color: var(--progress-primary);
|
||||
background-color: var(--progress-background);
|
||||
border: none;
|
||||
}
|
||||
progress[value]::-webkit-progress-bar {
|
||||
background-color: var(--progress-background);
|
||||
}
|
||||
progress[value]::-moz-progress-bar,
|
||||
progress[value]::-webkit-progress-value {
|
||||
background-color: var(--progress-primary);
|
||||
transition: width 0.45s ease;
|
||||
}
|
||||
</style>
|
||||
<link
|
||||
href="/stylex-f0601c57714fe972a8c4d2c2562f8082.css"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<link href="/app-6113f1562d101247269b.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body class="web">
|
||||
<script
|
||||
data-binary-transparency-hash-key="inline-js-d11c72a06542fc3b43af600028cf0f996e4b9b178dfa047e18730efaf74aab0b"
|
||||
>
|
||||
try {
|
||||
var systemThemeDark,
|
||||
theme = window.localStorage.getItem('theme'),
|
||||
systemThemeMode = window.localStorage.getItem('system-theme-mode');
|
||||
if (('true' === systemThemeMode || !theme) && window.matchMedia) {
|
||||
var systemTheme = window.matchMedia('(prefers-color-scheme: dark)');
|
||||
systemThemeDark = systemTheme && systemTheme.matches;
|
||||
}
|
||||
var darkTheme = '"dark"' === theme || Boolean(systemThemeDark);
|
||||
darkTheme && document.body.classList.add('dark');
|
||||
} catch (e) {}
|
||||
</script>
|
||||
<div id="app"></div>
|
||||
<div id="hard_expire_time" data-time="1719543128.405"></div>
|
||||
<div id="initial_startup">
|
||||
<div class="graphic">
|
||||
<span
|
||||
><svg width="250" height="52" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
class="resume-logo"
|
||||
d="M37.7 31.2c-.6-.4-3.8-2-4.4-2.1-.6-.2-1-.4-1.4.3l-2 2.5c-.4.4-.8.5-1.5.2-.6-.3-2.7-1-5.1-3.2-2-1.7-3.2-3.8-3.6-4.5-.4-.6 0-1 .3-1.3l1-1.1.6-1.1c.2-.4 0-.8 0-1.1l-2-4.8c-.6-1.3-1.1-1-1.5-1.1h-1.2c-.5 0-1.2.1-1.8.8-.5.6-2.2 2.2-2.2 5.3 0 3.2 2.3 6.3 2.6 6.7.3.4 4.6 7 11 9.7l3.7 1.4c1.5.5 3 .4 4 .2 1.3-.1 3.9-1.5 4.4-3 .5-1.5.5-2.8.4-3-.2-.4-.6-.5-1.3-.8M26 47.2c-3.9 0-7.6-1-11-3l-.7-.4-8.1 2L8.4 38l-.6-.8A21.4 21.4 0 0126 4.4a21.3 21.3 0 0121.4 21.4c0 11.8-9.6 21.4-21.4 21.4M44.2 7.6a25.8 25.8 0 00-40.6 31L0 52l13.7-3.6A25.8 25.8 0 0044.3 7.5"
|
||||
fill="currentColor"
|
||||
></path></svg
|
||||
></span>
|
||||
</div>
|
||||
<div class="progress">
|
||||
<progress value="0" max="100" dir="ltr"></progress>
|
||||
</div>
|
||||
<div class="main">WhatsApp</div>
|
||||
<div class="secondary">
|
||||
<span
|
||||
><svg width="10" height="12" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M5 1.6c1.4 0 2.5 1 2.6 2.4v1.5h.2c.5 0 1 .4 1 1V10c0 .6-.5 1-1 1H2.3a1 1 0 01-1.1-1V6.5c0-.6.5-1 1-1h.2V4.2c0-1.4 1-2.5 2.4-2.6H5zm0 1.2c-.7 0-1.3.6-1.3 1.3v1.4h2.6V4.2c0-.7-.4-1.2-1-1.3H5z"
|
||||
fill="currentColor"
|
||||
></path>
|
||||
</svg> </span
|
||||
> End-to-end encrypted
|
||||
</div>
|
||||
</div>
|
||||
<link
|
||||
rel="preload"
|
||||
crossorigin="anonymous"
|
||||
as="fetch"
|
||||
href="/binary-transparency-manifest-2.2412.54.json"
|
||||
id="binary-transparency-manifest-preload"
|
||||
/>
|
||||
<script src="/libsignal-protocol-ee5b8ba.min.js"></script>
|
||||
<script defer="defer" src="/runtime.295f0230b6dbd8983513.js"></script>
|
||||
<script
|
||||
data-binary-transparency-hash-key="inline-js-cdf06293c99d00ee0c1bc0fcfdbd76a7ae9aef6290926dbff0cba3a7994b7fca"
|
||||
>
|
||||
/*! Copyright (c) 2024 WhatsApp Inc. All Rights Reserved. */
|
||||
(self.webpackChunkwhatsapp_web_client =
|
||||
self.webpackChunkwhatsapp_web_client || []).push([
|
||||
[5617],
|
||||
{
|
||||
307914: (e) => {
|
||||
e.exports = function (e) {
|
||||
return e && e.__esModule ? e : { default: e };
|
||||
};
|
||||
},
|
||||
595318: (e) => {
|
||||
(e.exports = function (e) {
|
||||
return e && e.__esModule ? e : { default: e };
|
||||
}),
|
||||
(e.exports.default = e.exports),
|
||||
(e.exports.__esModule = !0);
|
||||
},
|
||||
415227: (e, t) => {
|
||||
'use strict';
|
||||
Object.defineProperty(t, '__esModule', { value: !0 }),
|
||||
(t.default = function (e) {
|
||||
const t = new Error(e);
|
||||
if (void 0 === t.stack)
|
||||
try {
|
||||
throw t;
|
||||
} catch (e) {}
|
||||
return t;
|
||||
});
|
||||
},
|
||||
670983: (e, t, r) => {
|
||||
'use strict';
|
||||
var n = r(307914);
|
||||
Object.defineProperty(t, '__esModule', { value: !0 }),
|
||||
(t.default = function (e) {
|
||||
let t =
|
||||
arguments.length > 1 && void 0 !== arguments[1]
|
||||
? arguments[1]
|
||||
: '?';
|
||||
if (null == e)
|
||||
throw (0, o.default)('Unexpected null or undefined: ' + t);
|
||||
return e;
|
||||
});
|
||||
var o = n(r(415227));
|
||||
},
|
||||
250473: (e, t, r) => {
|
||||
'use strict';
|
||||
Object.defineProperty(t, '__esModule', { value: !0 }),
|
||||
(t.UNIQUE_UPLOADS_ALLOWED_BEFORE_THROTTLE =
|
||||
t.TICKET_URL =
|
||||
t.CLB_URL =
|
||||
t.CLB_TOKEN =
|
||||
t.CLB_CHECK_URL =
|
||||
void 0);
|
||||
var n = r(508247);
|
||||
(t.CLB_CHECK_URL =
|
||||
'https://crashlogs.whatsapp.net/wa_fls_upload_check'),
|
||||
(t.CLB_TOKEN =
|
||||
'1063127757113399|745146ffa34413f9dbb5469f5370b7af'),
|
||||
(t.CLB_URL = 'https://crashlogs.whatsapp.net/wa_clb_data');
|
||||
const o = n.DYN_ORIGIN + 'web-contact-us';
|
||||
(t.TICKET_URL = o), (t.UNIQUE_UPLOADS_ALLOWED_BEFORE_THROTTLE = 0);
|
||||
},
|
||||
207024: (e, t, r) => {
|
||||
'use strict';
|
||||
var n = r(595318);
|
||||
Object.defineProperty(t, '__esModule', { value: !0 }),
|
||||
(t.getDistribution = function () {
|
||||
let e = 'unknown';
|
||||
return (e = 'prod'), 'web_prod';
|
||||
}),
|
||||
(t.getLogUserAgent = function (e) {
|
||||
let t,
|
||||
{ appVersion: r, browser: n, device: o } = e;
|
||||
return (t = 'Web/' + n), `WhatsApp/${r} ${t} Device/${o}`;
|
||||
}),
|
||||
n(r(472514)),
|
||||
n(r(556869));
|
||||
},
|
||||
794858: (e, t, r) => {
|
||||
'use strict';
|
||||
var n = r(595318),
|
||||
o = n(r(670983)),
|
||||
a = r(508247),
|
||||
s = r(250473),
|
||||
c = r(207024),
|
||||
_ = n(r(174285)),
|
||||
u = r(425017);
|
||||
function i(e) {
|
||||
!(function (e, t) {
|
||||
const r = window.navigator.userAgent;
|
||||
if (r === p && e.includes('getElementsByTagName')) return;
|
||||
const n = new FormData(),
|
||||
i = new Blob([e], { type: 'text/plain' });
|
||||
n.append(
|
||||
'from_jid',
|
||||
(function () {
|
||||
if (f) return f;
|
||||
try {
|
||||
(f = JSON.parse(
|
||||
(0, o.default)(_.default, 'localStorage').getItem(
|
||||
d.UNKNOWN_ID,
|
||||
),
|
||||
)),
|
||||
f && (f = f.replace('-', ''));
|
||||
} catch (e) {}
|
||||
if (!f) {
|
||||
f = 'unknown' + Math.floor(1e10 * Math.random());
|
||||
const e = f;
|
||||
try {
|
||||
(0, o.default)(_.default, 'localStorage').setItem(
|
||||
d.UNKNOWN_ID,
|
||||
JSON.stringify(e),
|
||||
);
|
||||
} catch (e) {}
|
||||
}
|
||||
return (0, o.default)(f, 'id');
|
||||
})(),
|
||||
),
|
||||
n.append(
|
||||
'agent',
|
||||
(0, c.getLogUserAgent)(
|
||||
(0, u.parseUASimple)(r, a.VERSION_BASE),
|
||||
),
|
||||
),
|
||||
n.append('file', i, 'logs.txt'),
|
||||
n.append('tags', 'load');
|
||||
const l = new XMLHttpRequest(),
|
||||
I =
|
||||
s.CLB_URL +
|
||||
'?access_token=' +
|
||||
encodeURIComponent(s.CLB_TOKEN);
|
||||
l.open('POST', I, !0), l.send(n);
|
||||
})(e);
|
||||
}
|
||||
function l(e) {
|
||||
let { error: t, reason: r, stack: n } = e;
|
||||
const o = new Date().toISOString();
|
||||
return `${o}: error: ${t}\n${o}: reason for logs: ${r}\n${o}: userAgent: ${window.navigator.userAgent}\n${n}`;
|
||||
}
|
||||
null == window.onerror &&
|
||||
(window.onerror = function (e, t, r) {
|
||||
const n = t.split('?')[0];
|
||||
return "Uncaught SyntaxError: Unexpected token '<'" === e
|
||||
? ((function (e) {
|
||||
i(
|
||||
l({
|
||||
error: 'failed to load a js or css bundle',
|
||||
reason: `failed to load [${e
|
||||
.split('/')[3]
|
||||
.replace(/^\//, '')}]`,
|
||||
stack: '',
|
||||
}),
|
||||
);
|
||||
})(n),
|
||||
!0)
|
||||
: (i(
|
||||
l({
|
||||
error: e,
|
||||
reason: `Error at [${n}:${r}]`,
|
||||
stack: '',
|
||||
}),
|
||||
),
|
||||
!1);
|
||||
});
|
||||
const d = { UNKNOWN_ID: a.UNKNOWN_ID },
|
||||
p =
|
||||
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36';
|
||||
let f;
|
||||
},
|
||||
425017: (e, t) => {
|
||||
'use strict';
|
||||
function r(e) {
|
||||
return e.includes('windows')
|
||||
? 'Windows'
|
||||
: e.includes('mac')
|
||||
? 'Mac OS'
|
||||
: e.includes('linux')
|
||||
? 'Linux'
|
||||
: 'Unparsed';
|
||||
}
|
||||
Object.defineProperty(t, '__esModule', { value: !0 }),
|
||||
(t.parseUASimple = function (e, t) {
|
||||
const n = e.toLowerCase();
|
||||
return { browser: s(n), device: r(n), appVersion: t };
|
||||
});
|
||||
const n = /(chrome|firefox)\/([\w\.]+)/i,
|
||||
o = /(edge|opr)\/([\w\.]+)/i,
|
||||
a = {
|
||||
chrome: 'Chrome',
|
||||
edge: 'Edge',
|
||||
opr: 'Opera',
|
||||
firefox: 'Firefox',
|
||||
};
|
||||
function s(e) {
|
||||
const t = e.match(o) || e.match(n);
|
||||
return null == t ? 'Unparsed' : `${a[t[1]]} ${t[2]}`;
|
||||
}
|
||||
},
|
||||
174285: (e, t) => {
|
||||
'use strict';
|
||||
let r;
|
||||
Object.defineProperty(t, '__esModule', { value: !0 }),
|
||||
(t.default = void 0);
|
||||
try {
|
||||
r = window.localStorage;
|
||||
} catch (e) {}
|
||||
var n = r;
|
||||
t.default = n;
|
||||
},
|
||||
508247: (e, t) => {
|
||||
'use strict';
|
||||
Object.defineProperty(t, '__esModule', { value: !0 }),
|
||||
(t.WS_ORIGIN =
|
||||
t.WEB_PUBLIC_PATH =
|
||||
t.VERSION_TERTIARY =
|
||||
t.VERSION_STR =
|
||||
t.VERSION_SECONDARY =
|
||||
t.VERSION_PRIMARY =
|
||||
t.VERSION_BASE =
|
||||
t.USER_TIMINGS =
|
||||
t.UNKNOWN_ID =
|
||||
t.LOCALHOST_ENV_CONFIG =
|
||||
t.HASH_PLACEHOLDER =
|
||||
t.FLB_PLATFORM =
|
||||
t.FB_APP_ID =
|
||||
t.DYN_ORIGIN =
|
||||
t.DIFF_VERSION =
|
||||
t.DIFF_ID =
|
||||
t.BUILD_URL =
|
||||
t.BUILD_TIMESTAMP =
|
||||
t.BUILD_ID =
|
||||
void 0);
|
||||
t.DIFF_ID = '';
|
||||
(t.DIFF_VERSION = ''),
|
||||
(t.LOCALHOST_ENV_CONFIG = !1),
|
||||
(t.HASH_PLACEHOLDER = '507042ed75b89fb00e8ef35da3541122cbc261e6'),
|
||||
(t.VERSION_PRIMARY = '2'),
|
||||
(t.VERSION_SECONDARY = '2412'),
|
||||
(t.VERSION_TERTIARY = '54'),
|
||||
(t.VERSION_BASE = '2.2412.54'),
|
||||
(t.VERSION_STR = '2.2412.54'),
|
||||
(t.DYN_ORIGIN = 'https://web.whatsapp.com/'),
|
||||
(t.WS_ORIGIN = ''),
|
||||
(t.FLB_PLATFORM = 'web'),
|
||||
(t.FB_APP_ID = ''),
|
||||
(t.UNKNOWN_ID = 'WAUnknownID'),
|
||||
(t.BUILD_ID = '583059957'),
|
||||
(t.BUILD_TIMESTAMP = 'March 29, 2024'),
|
||||
(t.WEB_PUBLIC_PATH = '/'),
|
||||
(t.BUILD_URL = 'https://web.whatsapp.com/'),
|
||||
(t.USER_TIMINGS = !1);
|
||||
},
|
||||
472514: (e, t) => {
|
||||
'use strict';
|
||||
Object.defineProperty(t, '__esModule', { value: !0 }),
|
||||
(t.default = function (e) {
|
||||
return e.default;
|
||||
});
|
||||
},
|
||||
556869: (e, t) => {
|
||||
'use strict';
|
||||
Object.defineProperty(t, '__esModule', { value: !0 }),
|
||||
(t.default = function e(t) {
|
||||
const r = new Error(t);
|
||||
if (void 0 === r.stack)
|
||||
try {
|
||||
throw e;
|
||||
} catch (e) {}
|
||||
return r;
|
||||
});
|
||||
},
|
||||
},
|
||||
(e) => {
|
||||
'use strict';
|
||||
e((e.s = 794858));
|
||||
},
|
||||
]);
|
||||
</script>
|
||||
<script defer="defer" src="/vendor1~app.264a01b6133c4a120327.js"></script>
|
||||
<script defer="defer" src="/app.2c7f8dd150ae88037cde.js"></script>
|
||||
<script
|
||||
data-binary-transparency-hash-key="inline-js-9c8cd3d0f4d5af8c7f5cd1c45208edd308bfe472e353a50e4cbacbf6cb58627c"
|
||||
>
|
||||
((i) => {
|
||||
const l = document.getElementById(i);
|
||||
l &&
|
||||
fetch(l.href)
|
||||
.then((b) => b.text())
|
||||
.then((code) => {
|
||||
const script = document.createElement('script');
|
||||
script.id = 'binary-transparency-manifest';
|
||||
script.type = 'application/json';
|
||||
script.innerHTML = code;
|
||||
document.body.append(script);
|
||||
});
|
||||
})('binary-transparency-manifest-preload');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -7,8 +7,11 @@ const { LoadUtils } = require('./WahaInjected');
|
||||
const ChatFactory = require('whatsapp-web.js/src/factories/ChatFactory');
|
||||
|
||||
export class WebjsClient extends Client {
|
||||
async initialize() {
|
||||
await super.initialize();
|
||||
async inject() {
|
||||
// Even tho this.inject is not defined as interface in Client.ts
|
||||
// We can still call and override it
|
||||
// @ts-ignore
|
||||
await super.inject();
|
||||
//Load util functions (serializers, helper functions)
|
||||
await this.pupPage.evaluate(LoadUtils);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,25 @@
|
||||
import { UnprocessableEntityException } from '@nestjs/common/exceptions/unprocessable-entity.exception';
|
||||
import { IEngineMediaProcessor } from '@waha/core/abc/media.abc';
|
||||
import { WAHAInternalEvent, WhatsappSession } from '@waha/core/abc/session.abc';
|
||||
import {
|
||||
getChannelInviteLink,
|
||||
WAHAInternalEvent,
|
||||
WhatsappSession,
|
||||
} from '@waha/core/abc/session.abc';
|
||||
import { WebjsClient } from '@waha/core/engines/webjs/WebjsClient';
|
||||
import {
|
||||
AvailableInPlusVersion,
|
||||
NotImplementedByEngineError,
|
||||
} from '@waha/core/exceptions';
|
||||
import { IMediaEngineProcessor } from '@waha/core/media/IMediaEngineProcessor';
|
||||
import { QR } from '@waha/core/QR';
|
||||
import { parseBool } from '@waha/helpers';
|
||||
import { GetChatsQuery } from '@waha/structures/chats.dto';
|
||||
import { CallData } from '@waha/structures/calls.dto';
|
||||
import {
|
||||
Channel,
|
||||
ChannelRole,
|
||||
CreateChannelRequest,
|
||||
ListChannelsQuery,
|
||||
} from '@waha/structures/channels.dto';
|
||||
import { ChatArchiveEvent, GetChatsQuery } from '@waha/structures/chats.dto';
|
||||
import {
|
||||
ChatRequest,
|
||||
CheckNumberStatusQuery,
|
||||
@@ -40,15 +51,22 @@ import {
|
||||
ParticipantsRequest,
|
||||
SettingsSecurityChangeInfo,
|
||||
} from '@waha/structures/groups.dto';
|
||||
import { Label, LabelID } from '@waha/structures/labels.dto';
|
||||
import { ReplyToMessage } from '@waha/structures/message.dto';
|
||||
import { WAMessage, WAMessageReaction } from '@waha/structures/responses.dto';
|
||||
import { MeInfo } from '@waha/structures/sessions.dto';
|
||||
import { WAMessageRevokedBody } from '@waha/structures/webhooks.dto';
|
||||
import { waitUntil } from '@waha/utils/promiseTimeout';
|
||||
import { SingleDelayedJobRunner } from '@waha/utils/SingleDelayedJobRunner';
|
||||
import {
|
||||
Call,
|
||||
Channel as WEBJSChannel,
|
||||
Chat,
|
||||
ClientOptions,
|
||||
Contact,
|
||||
Events,
|
||||
GroupChat,
|
||||
Label as WEBJSLabel,
|
||||
Location,
|
||||
Message,
|
||||
Reaction,
|
||||
@@ -68,7 +86,7 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
engine = WAHAEngine.WEBJS;
|
||||
protected engineConfig?: WebJSConfig;
|
||||
|
||||
private startTimeoutId: null | ReturnType<typeof setTimeout> = null;
|
||||
private startDelayedJob: SingleDelayedJobRunner;
|
||||
private shouldRestart: boolean;
|
||||
|
||||
whatsapp: WebjsClient;
|
||||
@@ -78,6 +96,13 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
super(config);
|
||||
this.qr = new QR();
|
||||
this.shouldRestart = true;
|
||||
|
||||
// Restart job if session failed
|
||||
this.startDelayedJob = new SingleDelayedJobRunner(
|
||||
'start-engine',
|
||||
this.START_ATTEMPT_DELAY_SECONDS * SECOND,
|
||||
this.logger,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,8 +114,9 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
|
||||
protected getClientOptions(): ClientOptions {
|
||||
const path = this.getClassDirName();
|
||||
const webVersion = this.engineConfig?.webVersion || '2.2412.54';
|
||||
this.log.debug(`Using web version: '${webVersion}'`);
|
||||
const webVersion =
|
||||
this.engineConfig?.webVersion || '2.3000.1014522270-alpha';
|
||||
// this.log.debug(`Using web version: '${webVersion}'`);
|
||||
return {
|
||||
puppeteer: {
|
||||
headless: true,
|
||||
@@ -100,9 +126,9 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
},
|
||||
webVersion: webVersion,
|
||||
webVersionCache: {
|
||||
type: 'local',
|
||||
path: path,
|
||||
strict: true,
|
||||
type: 'none',
|
||||
// path: path,
|
||||
// strict: true,
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -115,23 +141,22 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
|
||||
private restartClient() {
|
||||
if (!this.shouldRestart) {
|
||||
this.log.debug("Shouldn't restart the client, ignoring restart request");
|
||||
this.logger.debug(
|
||||
'Should not restart the client, ignoring restart request',
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.startTimeoutId) {
|
||||
const msg =
|
||||
'Request to restart is already in progress, ignoring restart request';
|
||||
this.log.warn(msg);
|
||||
return;
|
||||
}
|
||||
this.log.log(
|
||||
`Setting up client start in ${this.START_ATTEMPT_DELAY_SECONDS} seconds...`,
|
||||
);
|
||||
this.startTimeoutId = setTimeout(() => {
|
||||
this.startTimeoutId = undefined;
|
||||
this.start();
|
||||
}, this.START_ATTEMPT_DELAY_SECONDS * SECOND);
|
||||
this.startDelayedJob.schedule(async () => {
|
||||
if (!this.shouldRestart) {
|
||||
this.logger.warn(
|
||||
'Should not restart the client, ignoring restart request',
|
||||
);
|
||||
return;
|
||||
}
|
||||
await this.end();
|
||||
await this.start();
|
||||
});
|
||||
}
|
||||
|
||||
protected addProxyConfig(clientOptions: ClientOptions) {
|
||||
@@ -152,7 +177,6 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
}
|
||||
|
||||
protected async init() {
|
||||
await this.end();
|
||||
this.shouldRestart = true;
|
||||
this.whatsapp = await this.buildClient();
|
||||
this.whatsapp
|
||||
@@ -161,21 +185,21 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
// Listen for browser disconnected event
|
||||
this.whatsapp.pupBrowser.on('disconnected', () => {
|
||||
this.status = WAHASessionStatus.FAILED;
|
||||
this.log.error('The browser has been disconnected');
|
||||
this.logger.error('The browser has been disconnected');
|
||||
this.restartClient();
|
||||
});
|
||||
// Listen for page close event
|
||||
this.whatsapp.pupPage.on('close', () => {
|
||||
this.status = WAHASessionStatus.FAILED;
|
||||
this.log.error('The WhatsApp Web page has been closed');
|
||||
this.logger.error('The WhatsApp Web page has been closed');
|
||||
this.restartClient();
|
||||
});
|
||||
|
||||
// Listen for page error event
|
||||
if (this.isDebugEnabled()) {
|
||||
this.log.debug("Logging 'console' event for web page");
|
||||
this.logger.debug("Logging 'console' event for web page");
|
||||
this.whatsapp.pupPage.on('console', (msg) =>
|
||||
this.log.debug(`WEBJS page log: ${msg.text()}`),
|
||||
this.logger.debug(`WEBJS page log: ${msg.text()}`),
|
||||
);
|
||||
this.whatsapp.pupPage.evaluate(() =>
|
||||
console.log(`url is ${location.href}`),
|
||||
@@ -184,7 +208,7 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
})
|
||||
.catch((error) => {
|
||||
this.status = WAHASessionStatus.FAILED;
|
||||
this.log.error(error);
|
||||
this.logger.error(error);
|
||||
this.restartClient();
|
||||
return;
|
||||
});
|
||||
@@ -211,12 +235,22 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
private async end() {
|
||||
try {
|
||||
this.whatsapp?.removeAllListeners();
|
||||
clearInterval(this.startTimeoutId);
|
||||
this.startDelayedJob.cancel();
|
||||
// It's possible that browser yet starting
|
||||
await waitUntil(
|
||||
async () => {
|
||||
const result = !!this.whatsapp.pupBrowser;
|
||||
this.logger.debug(`Browser is ready to be closed: ${result}`);
|
||||
return result;
|
||||
},
|
||||
1_000,
|
||||
10_000,
|
||||
);
|
||||
this.whatsapp?.destroy().catch((error) => {
|
||||
this.log.debug('Failed to destroy the client', error);
|
||||
this.logger.warn(error, 'Failed to destroy the client');
|
||||
});
|
||||
} catch (error) {
|
||||
this.log.error(error);
|
||||
this.logger.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,14 +273,14 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
const event = Events[key];
|
||||
this.whatsapp.on(event, (...data: any[]) => {
|
||||
const log = { event: event, data: data };
|
||||
this.log.debug(`WEBJS event: ${JSON.stringify(log)}`);
|
||||
this.logger.debug({ event: log }, `WEBJS event`);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected listenConnectionEvents() {
|
||||
this.whatsapp.on(Events.QR_RECEIVED, async (qr) => {
|
||||
this.log.debug('QR received');
|
||||
this.logger.debug('QR received');
|
||||
// Convert to image and save
|
||||
const url = await QRCode.toDataURL(qr);
|
||||
this.qr.save(url, qr);
|
||||
@@ -257,13 +291,25 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
this.whatsapp.on(Events.READY, () => {
|
||||
this.status = WAHASessionStatus.WORKING;
|
||||
this.qr.save('');
|
||||
this.log.log(`Session '${this.name}' has been authenticated!`);
|
||||
this.logger.info(`Session '${this.name}' is ready!`);
|
||||
});
|
||||
|
||||
this.whatsapp.on(Events.AUTHENTICATED, () => {
|
||||
this.status = WAHASessionStatus.WORKING;
|
||||
this.qr.save('');
|
||||
this.logger.info(`Session '${this.name}' has been authenticated!`);
|
||||
});
|
||||
|
||||
this.whatsapp.on(Events.AUTHENTICATION_FAILURE, () => {
|
||||
this.status = WAHASessionStatus.FAILED;
|
||||
this.qr.save('');
|
||||
this.logger.info(`Session '${this.name}' has been disconnected!`);
|
||||
});
|
||||
|
||||
this.whatsapp.on(Events.DISCONNECTED, () => {
|
||||
this.status = WAHASessionStatus.FAILED;
|
||||
this.qr.save('');
|
||||
this.log.log(`Session '${this.name}' has been disconnected!`);
|
||||
this.logger.info(`Session '${this.name}' has been disconnected!`);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -307,10 +353,7 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
}
|
||||
|
||||
sendText(request: MessageTextRequest) {
|
||||
const options = {
|
||||
// It's fine to sent just ids instead of Contact object
|
||||
mentions: request.mentions as unknown as string[],
|
||||
};
|
||||
const options = this.getMessageOptions(request);
|
||||
return this.whatsapp.sendMessage(
|
||||
this.ensureSuffix(request.chatId),
|
||||
request.text,
|
||||
@@ -337,11 +380,7 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
}
|
||||
|
||||
reply(request: MessageReplyRequest) {
|
||||
const options = {
|
||||
quotedMessageId: request.reply_to,
|
||||
// It's fine to sent just ids instead of Contact object
|
||||
mentions: request.mentions as unknown as string[],
|
||||
};
|
||||
const options = this.getMessageOptions(request);
|
||||
return this.whatsapp.sendMessage(request.chatId, request.text, options);
|
||||
}
|
||||
|
||||
@@ -361,7 +400,8 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
const location = new Location(request.latitude, request.longitude, {
|
||||
name: request.title,
|
||||
});
|
||||
return this.whatsapp.sendMessage(request.chatId, location);
|
||||
const options = this.getMessageOptions(request);
|
||||
return this.whatsapp.sendMessage(request.chatId, location, options);
|
||||
}
|
||||
|
||||
async sendSeen(request: SendSeenRequest) {
|
||||
@@ -423,12 +463,12 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
const messages = await chat.fetchMessages({
|
||||
limit: limit,
|
||||
});
|
||||
// Go over messages, download media, and convert to right format.
|
||||
const result = [];
|
||||
for (const message of messages) {
|
||||
const msg = await this.processIncomingMessage(message, downloadMedia);
|
||||
result.push(msg);
|
||||
const promises = [];
|
||||
for (const msg of messages) {
|
||||
promises.push(this.processIncomingMessage(msg, downloadMedia));
|
||||
}
|
||||
let result = await Promise.all(promises);
|
||||
result = result.filter(Boolean);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -442,6 +482,52 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
return chat.clearMessages();
|
||||
}
|
||||
|
||||
public chatsArchiveChat(chatId: string): Promise<any> {
|
||||
const id = this.ensureSuffix(chatId);
|
||||
return this.whatsapp.archiveChat(id);
|
||||
}
|
||||
|
||||
public chatsUnarchiveChat(chatId: string): Promise<any> {
|
||||
const id = this.ensureSuffix(chatId);
|
||||
return this.whatsapp.unarchiveChat(id);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Label methods
|
||||
*/
|
||||
|
||||
public async getLabels(): Promise<Label[]> {
|
||||
const labels = await this.whatsapp.getLabels();
|
||||
return labels.map(this.toLabel);
|
||||
}
|
||||
|
||||
public getChatsByLabelId(labelId: string) {
|
||||
return this.whatsapp.getChatsByLabelId(labelId);
|
||||
}
|
||||
|
||||
public async getChatLabels(chatId: string): Promise<Label[]> {
|
||||
const id = this.ensureSuffix(chatId);
|
||||
const labels = await this.whatsapp.getChatLabels(id);
|
||||
return labels.map(this.toLabel);
|
||||
}
|
||||
|
||||
public async putLabelsToChat(chatId: string, labels: LabelID[]) {
|
||||
const labelIds = labels.map((label) => label.id);
|
||||
const chatIds = [this.ensureSuffix(chatId)];
|
||||
await this.whatsapp.addOrRemoveLabels(labelIds, chatIds);
|
||||
}
|
||||
|
||||
protected toLabel(label: WEBJSLabel): Label {
|
||||
const color = label.colorIndex;
|
||||
return {
|
||||
id: label.id,
|
||||
name: label.name,
|
||||
color: color,
|
||||
colorHex: Label.toHex(color),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Contacts methods
|
||||
*/
|
||||
@@ -602,6 +688,109 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
return groupChat.demoteParticipants(participantIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* Channels methods
|
||||
*/
|
||||
protected ChatToChannel(chat: WEBJSChannel): Channel {
|
||||
// @ts-ignore
|
||||
const metadata = chat.channelMetadata;
|
||||
let role = metadata.membershipType.toUpperCase();
|
||||
if (role === 'VIEWER') {
|
||||
role = ChannelRole.GUEST;
|
||||
}
|
||||
return {
|
||||
id: chat.id._serialized,
|
||||
name: chat.name,
|
||||
description: chat.description,
|
||||
invite: getChannelInviteLink(metadata.inviteCode),
|
||||
preview: null,
|
||||
picture: null,
|
||||
verified: metadata.verified,
|
||||
role: role,
|
||||
};
|
||||
}
|
||||
|
||||
protected ChannelMetadataToChannel(metadata: any): Channel {
|
||||
let role = metadata.membershipType.toUpperCase();
|
||||
if (role === 'VIEWER') {
|
||||
role = ChannelRole.GUEST;
|
||||
}
|
||||
return {
|
||||
id: metadata.id,
|
||||
name: metadata.titleMetadata.title,
|
||||
description: metadata.descriptionMetadata.description,
|
||||
invite: metadata.inviteLink,
|
||||
preview: metadata.pictureUrl,
|
||||
picture: metadata.pictureUrl,
|
||||
verified: metadata.isVerified,
|
||||
role: role,
|
||||
};
|
||||
}
|
||||
|
||||
public async channelsList(query: ListChannelsQuery): Promise<Channel[]> {
|
||||
const data = await this.whatsapp.getChannels();
|
||||
let channels = data.map(this.ChatToChannel);
|
||||
if (query.role) {
|
||||
// @ts-ignore
|
||||
channels = channels.filter((channel) => channel.role === query.role);
|
||||
}
|
||||
|
||||
const promises = channels.map(async (channel) =>
|
||||
this.whatsapp.getProfilePicUrl(channel.id),
|
||||
);
|
||||
const pictures = await Promise.all(promises);
|
||||
channels = channels.map((channel, index) => {
|
||||
channel.picture = pictures[index] || null;
|
||||
channel.preview = channel.picture;
|
||||
return channel;
|
||||
});
|
||||
return channels;
|
||||
}
|
||||
|
||||
public channelsCreateChannel(
|
||||
request: CreateChannelRequest,
|
||||
): Promise<Channel> {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
public async channelsGetChannel(id: string): Promise<Channel> {
|
||||
return await this.channelsGetChannelByInviteCode(id);
|
||||
}
|
||||
|
||||
public async channelsGetChannelByInviteCode(
|
||||
inviteCode: string,
|
||||
): Promise<Channel> {
|
||||
const metadata = await this.whatsapp.getChannelByInviteCode(inviteCode);
|
||||
const channel = this.ChannelMetadataToChannel(metadata);
|
||||
channel.preview =
|
||||
(await this.whatsapp.getProfilePicUrl(channel.id)) || null;
|
||||
channel.picture = channel.preview;
|
||||
return channel;
|
||||
}
|
||||
|
||||
public channelsDeleteChannel(id: string): Promise<void> {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
public channelsFollowChannel(id: string): Promise<void> {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
public channelsUnfollowChannel(id: string): Promise<void> {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
public channelsMuteChannel(id: string): Promise<void> {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
public channelsUnmuteChannel(id: string): Promise<void> {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Presences methods
|
||||
*/
|
||||
public async setPresence(presence: WAHAPresenceStatus, chatId?: string) {
|
||||
let chat: Chat;
|
||||
switch (presence) {
|
||||
@@ -682,6 +871,28 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
case WAHAEvents.GROUP_LEAVE:
|
||||
this.whatsapp.on(Events.GROUP_LEAVE, handler);
|
||||
return true;
|
||||
case WAHAEvents.CHAT_ARCHIVE:
|
||||
this.whatsapp.on('chat_archived', (chat, archived, _) => {
|
||||
const body: ChatArchiveEvent = {
|
||||
id: chat.id._serialized,
|
||||
archived: archived,
|
||||
timestamp: chat.timestamp,
|
||||
};
|
||||
handler(body);
|
||||
});
|
||||
return true;
|
||||
case WAHAEvents.CALL_RECEIVED:
|
||||
this.whatsapp.on('call', (call: Call) => {
|
||||
const body: CallData = {
|
||||
id: call.id,
|
||||
from: call.from,
|
||||
timestamp: call.timestamp,
|
||||
isVideo: call.isVideo,
|
||||
isGroup: call.isGroup,
|
||||
};
|
||||
handler(body);
|
||||
});
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -692,8 +903,8 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
try {
|
||||
message = await this.downloadMedia(message);
|
||||
} catch (e) {
|
||||
this.log.error('Failed when tried to download media for a message');
|
||||
this.log.error(e, e.stack);
|
||||
this.logger.error('Failed when tried to download media for a message');
|
||||
this.logger.error(e, e.stack);
|
||||
}
|
||||
}
|
||||
return await this.toWAMessage(message);
|
||||
@@ -715,6 +926,7 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
}
|
||||
|
||||
protected toWAMessage(message: Message): Promise<WAMessage> {
|
||||
const replyTo = this.extractReplyTo(message);
|
||||
// @ts-ignore
|
||||
return Promise.resolve({
|
||||
id: message.id._serialized,
|
||||
@@ -735,10 +947,24 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
ackName: WAMessageAck[message.ack] || ACK_UNKNOWN,
|
||||
location: message.location,
|
||||
vCards: message.vCards,
|
||||
replyTo: replyTo,
|
||||
_data: message.rawData,
|
||||
});
|
||||
}
|
||||
|
||||
protected extractReplyTo(message: Message): ReplyToMessage | null {
|
||||
// @ts-ignore
|
||||
const quotedMsg = message.rawData.quotedMsg;
|
||||
if (!quotedMsg) {
|
||||
return;
|
||||
}
|
||||
return {
|
||||
id: quotedMsg.id?.id,
|
||||
participant: quotedMsg.author || quotedMsg.from,
|
||||
body: quotedMsg.caption || quotedMsg.body,
|
||||
};
|
||||
}
|
||||
|
||||
public async getEngineInfo() {
|
||||
// Add 1 seconds timeout
|
||||
return {
|
||||
@@ -755,11 +981,23 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
|
||||
protected downloadMedia(message: Message) {
|
||||
const processor = new EngineMediaProcessor();
|
||||
return this.mediaManager.processMedia(processor, message);
|
||||
return this.mediaManager.processMedia(processor, message, this.name);
|
||||
}
|
||||
|
||||
protected getMessageOptions(request: any): any {
|
||||
let mentions = request.mentions;
|
||||
mentions = mentions ? mentions.map(this.ensureSuffix) : undefined;
|
||||
|
||||
const quotedMessageId = request.reply_to;
|
||||
|
||||
return {
|
||||
mentions: mentions,
|
||||
quotedMessageId: quotedMessageId,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export class EngineMediaProcessor implements IEngineMediaProcessor<Message> {
|
||||
export class EngineMediaProcessor implements IMediaEngineProcessor<Message> {
|
||||
hasMedia(message: Message): boolean {
|
||||
if (!message.hasMedia) {
|
||||
return false;
|
||||
|
||||
+106
-79
@@ -1,15 +1,16 @@
|
||||
import {
|
||||
ConsoleLogger,
|
||||
Injectable,
|
||||
LogLevel,
|
||||
NotFoundException,
|
||||
UnprocessableEntityException,
|
||||
} from '@nestjs/common';
|
||||
import { promiseTimeout } from '@waha/utils/promiseTimeout';
|
||||
import { MediaNoopStorage } from '@waha/core/media/MediaNoopStorage';
|
||||
import { getPinoLogLevel, LoggerBuilder } from '@waha/utils/logging';
|
||||
import { promiseTimeout, sleep } from '@waha/utils/promiseTimeout';
|
||||
import { EventEmitter } from 'events';
|
||||
import { PinoLogger } from 'nestjs-pino';
|
||||
|
||||
import { WhatsappConfigService } from '../config.service';
|
||||
import { getLogLevels } from '../helpers';
|
||||
import {
|
||||
WAHAEngine,
|
||||
WAHAEvents,
|
||||
@@ -17,11 +18,9 @@ import {
|
||||
} from '../structures/enums.dto';
|
||||
import {
|
||||
ProxyConfig,
|
||||
SessionConfig,
|
||||
SessionDTO,
|
||||
SessionInfo,
|
||||
SessionLogoutRequest,
|
||||
SessionStartRequest,
|
||||
SessionStopRequest,
|
||||
} from '../structures/sessions.dto';
|
||||
import { WebhookConfig } from '../structures/webhooks.config.dto';
|
||||
import { SessionManager } from './abc/manager.abc';
|
||||
@@ -32,9 +31,8 @@ import { WhatsappSessionVenomCore } from './engines/venom/session.venom.core';
|
||||
import { WhatsappSessionWebJSCore } from './engines/webjs/session.webjs.core';
|
||||
import { DOCS_URL } from './exceptions';
|
||||
import { getProxyConfig } from './helpers.proxy';
|
||||
import { CoreMediaManager, MediaStorageCore } from './media.core';
|
||||
import { MediaManagerCore } from './media/MediaManagerCore';
|
||||
import { LocalSessionAuthRepository } from './storage/LocalSessionAuthRepository';
|
||||
import { LocalSessionConfigRepository } from './storage/LocalSessionConfigRepository';
|
||||
import { LocalStoreCore } from './storage/LocalStoreCore';
|
||||
import { WebhookConductorCore } from './webhooks.core';
|
||||
|
||||
@@ -46,13 +44,15 @@ export class OnlyDefaultSessionIsAllowed extends UnprocessableEntityException {
|
||||
}
|
||||
}
|
||||
|
||||
export function buildLogger(name: string, levels: LogLevel[]) {
|
||||
return new ConsoleLogger(name, { logLevels: levels });
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class SessionManagerCore extends SessionManager {
|
||||
private session?: WhatsappSession;
|
||||
SESSION_STOP_TIMEOUT = 3000;
|
||||
|
||||
// session - exists and running (or failed or smth)
|
||||
// null - stopped
|
||||
// undefined - removed
|
||||
private session: WhatsappSession | undefined | null;
|
||||
private sessionConfig?: SessionConfig;
|
||||
DEFAULT = 'default';
|
||||
|
||||
// @ts-ignore
|
||||
@@ -61,25 +61,25 @@ export class SessionManagerCore extends SessionManager {
|
||||
|
||||
constructor(
|
||||
private config: WhatsappConfigService,
|
||||
private log: ConsoleLogger,
|
||||
private engineConfigService: EngineConfigService,
|
||||
private log: PinoLogger,
|
||||
) {
|
||||
super();
|
||||
this.events = new EventEmitter();
|
||||
this.log.setContext('SessionManager');
|
||||
this.session = undefined;
|
||||
this.session = null;
|
||||
this.sessionConfig = null;
|
||||
this.log.setContext(SessionManagerCore.name);
|
||||
const engineName = this.engineConfigService.getDefaultEngineName();
|
||||
this.EngineClass = this.getEngine(engineName);
|
||||
this.store = new LocalStoreCore(engineName.toLowerCase());
|
||||
this.sessionAuthRepository = new LocalSessionAuthRepository(this.store);
|
||||
this.sessionConfigRepository = new LocalSessionConfigRepository(this.store);
|
||||
this.startPredefinedSessions();
|
||||
}
|
||||
|
||||
protected startPredefinedSessions() {
|
||||
const startSessions = this.config.startSessions;
|
||||
startSessions.forEach((sessionName) => {
|
||||
this.start({ name: sessionName });
|
||||
this.start(sessionName);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -105,39 +105,56 @@ export class SessionManagerCore extends SessionManager {
|
||||
if (!this.session) {
|
||||
return;
|
||||
}
|
||||
await this.stop({ name: this.DEFAULT, logout: false });
|
||||
await this.stop(this.DEFAULT, true);
|
||||
}
|
||||
|
||||
//
|
||||
// API Methods
|
||||
//
|
||||
async start(request: SessionStartRequest): Promise<SessionDTO> {
|
||||
this.onlyDefault(request.name);
|
||||
async exists(name: string): Promise<boolean> {
|
||||
this.onlyDefault(name);
|
||||
return this.session !== undefined;
|
||||
}
|
||||
|
||||
isRunning(name: string): boolean {
|
||||
this.onlyDefault(name);
|
||||
return !!this.session;
|
||||
}
|
||||
|
||||
async upsert(name: string, config?: SessionConfig): Promise<void> {
|
||||
this.onlyDefault(name);
|
||||
this.sessionConfig = config;
|
||||
}
|
||||
|
||||
async start(name: string): Promise<SessionDTO> {
|
||||
this.onlyDefault(name);
|
||||
if (this.session) {
|
||||
throw new UnprocessableEntityException(
|
||||
`Session '${this.DEFAULT}' is already started.`,
|
||||
);
|
||||
}
|
||||
|
||||
const name = request.name;
|
||||
this.log.log(`'${name}' - starting session...`);
|
||||
const levels = getLogLevels(request.config?.debug);
|
||||
const log = buildLogger(`WhatsappSession - ${name}`, levels);
|
||||
const mediaManager = new CoreMediaManager(
|
||||
new MediaStorageCore(),
|
||||
this.log.info(`'${name}' - starting session...`);
|
||||
const mediaManager = new MediaManagerCore(
|
||||
new MediaNoopStorage(),
|
||||
this.config.mimetypes,
|
||||
);
|
||||
const webhookLog = buildLogger(`Webhook - ${name}`, levels);
|
||||
const webhook = new this.WebhookConductorClass(webhookLog);
|
||||
const proxyConfig = this.getProxyConfig(request);
|
||||
const logger = this.log.logger.child({
|
||||
session: name,
|
||||
sessionRunTimestamp: Date.now(),
|
||||
});
|
||||
logger.level = getPinoLogLevel(this.sessionConfig?.debug);
|
||||
const loggerBuilder: LoggerBuilder = logger;
|
||||
|
||||
const webhook = new this.WebhookConductorClass(loggerBuilder);
|
||||
const proxyConfig = this.getProxyConfig();
|
||||
const sessionConfig: SessionParams = {
|
||||
name,
|
||||
mediaManager,
|
||||
log,
|
||||
loggerBuilder,
|
||||
printQR: this.engineConfigService.shouldPrintQR,
|
||||
sessionStore: this.store,
|
||||
proxyConfig: proxyConfig,
|
||||
sessionConfig: request.config,
|
||||
sessionConfig: this.sessionConfig,
|
||||
};
|
||||
await this.sessionAuthRepository.init(name);
|
||||
// @ts-ignore
|
||||
@@ -145,7 +162,7 @@ export class SessionManagerCore extends SessionManager {
|
||||
this.session = session;
|
||||
|
||||
// configure webhooks
|
||||
const webhooks = this.getWebhooks(request);
|
||||
const webhooks = this.getWebhooks();
|
||||
webhook.configure(session, webhooks);
|
||||
|
||||
// configure events
|
||||
@@ -156,6 +173,7 @@ export class SessionManagerCore extends SessionManager {
|
||||
|
||||
// start session
|
||||
await session.start();
|
||||
logger.info('Session has been started.');
|
||||
return {
|
||||
name: session.name,
|
||||
status: session.status,
|
||||
@@ -163,13 +181,46 @@ export class SessionManagerCore extends SessionManager {
|
||||
};
|
||||
}
|
||||
|
||||
async stop(name: string, silent: boolean): Promise<void> {
|
||||
this.onlyDefault(name);
|
||||
if (!this.isRunning(name)) {
|
||||
this.log.debug(`Session is not running.`, { session: name });
|
||||
return;
|
||||
}
|
||||
|
||||
this.log.info(`Stopping session...`, { session: name });
|
||||
try {
|
||||
const session = this.getSession(name);
|
||||
await session.stop();
|
||||
} catch (err) {
|
||||
this.log.warn(`Error while stopping session '${name}'`);
|
||||
if (!silent) {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
this.log.info(`Session has been stopped.`, { session: name });
|
||||
this.session = null;
|
||||
await sleep(this.SESSION_STOP_TIMEOUT);
|
||||
}
|
||||
|
||||
async logout(name: string): Promise<void> {
|
||||
this.onlyDefault(name);
|
||||
await this.sessionAuthRepository.clean(name);
|
||||
}
|
||||
|
||||
async delete(name: string): Promise<void> {
|
||||
this.onlyDefault(name);
|
||||
this.session = undefined;
|
||||
this.sessionConfig = undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Combine per session and global webhooks
|
||||
*/
|
||||
private getWebhooks(request: SessionStartRequest) {
|
||||
private getWebhooks() {
|
||||
let webhooks: WebhookConfig[] = [];
|
||||
if (request.config?.webhooks) {
|
||||
webhooks = webhooks.concat(request.config.webhooks);
|
||||
if (this.sessionConfig?.webhooks) {
|
||||
webhooks = webhooks.concat(this.sessionConfig.webhooks);
|
||||
}
|
||||
const globalWebhookConfig = this.config.getWebhookConfig();
|
||||
if (globalWebhookConfig) {
|
||||
@@ -181,71 +232,44 @@ export class SessionManagerCore extends SessionManager {
|
||||
/**
|
||||
* Get either session's or global proxy if defined
|
||||
*/
|
||||
protected getProxyConfig(
|
||||
request: SessionStartRequest,
|
||||
): ProxyConfig | undefined {
|
||||
if (request.config?.proxy) {
|
||||
return request.config.proxy;
|
||||
protected getProxyConfig(): ProxyConfig | undefined {
|
||||
if (this.sessionConfig?.proxy) {
|
||||
return this.sessionConfig.proxy;
|
||||
}
|
||||
if (!this.session) {
|
||||
return undefined;
|
||||
}
|
||||
const sessions = { [request.name]: this.session };
|
||||
return getProxyConfig(this.config, sessions, request.name);
|
||||
}
|
||||
|
||||
async stop(request: SessionStopRequest): Promise<void> {
|
||||
this.onlyDefault(request.name);
|
||||
|
||||
const name = request.name;
|
||||
this.log.log(`Stopping ${name} session...`);
|
||||
const session = this.getSession(name);
|
||||
await session.stop();
|
||||
this.log.log(`"${name}" has been stopped.`);
|
||||
this.session = undefined;
|
||||
}
|
||||
|
||||
async logout(request: SessionLogoutRequest) {
|
||||
const name = request.name;
|
||||
this.onlyDefault(request.name);
|
||||
this.stop({ name: name, logout: false })
|
||||
.then(() => {
|
||||
this.log.log(`Session '${name}' has been stopped.`);
|
||||
})
|
||||
.catch((err) => {
|
||||
this.log.error(
|
||||
`Error while stopping session '${name}' while logging out`,
|
||||
err,
|
||||
);
|
||||
});
|
||||
await this.sessionAuthRepository.clean(request.name);
|
||||
const sessions = { [this.DEFAULT]: this.session };
|
||||
return getProxyConfig(this.config, sessions, this.DEFAULT);
|
||||
}
|
||||
|
||||
getSession(name: string): WhatsappSession {
|
||||
this.onlyDefault(name);
|
||||
const session = this.session;
|
||||
if (!session) {
|
||||
if (session === undefined) {
|
||||
throw new NotFoundException(
|
||||
`We didn't find a session with name '${name}'. Please start it first by using POST /sessions/start request`,
|
||||
`We didn't find a session with name '${name}'.
|
||||
Please start it first by using POST /sessions/${name}/start request`,
|
||||
);
|
||||
}
|
||||
return session;
|
||||
}
|
||||
|
||||
async getSessions(all: boolean): Promise<SessionInfo[]> {
|
||||
if (!this.session) {
|
||||
if (!all) {
|
||||
return [];
|
||||
}
|
||||
if (this.session === null && all) {
|
||||
return [
|
||||
{
|
||||
name: this.DEFAULT,
|
||||
status: WAHASessionStatus.STOPPED,
|
||||
config: undefined,
|
||||
config: this.sessionConfig,
|
||||
me: null,
|
||||
},
|
||||
];
|
||||
}
|
||||
if (this.session === undefined && all) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const me = this.session.getSessionMeInfo();
|
||||
// Get engine info
|
||||
let engineInfo = {};
|
||||
@@ -253,7 +277,10 @@ export class SessionManagerCore extends SessionManager {
|
||||
try {
|
||||
engineInfo = await promiseTimeout(10, this.session.getEngineInfo());
|
||||
} catch (e) {
|
||||
this.log.warn('Error while getting engine info', e);
|
||||
this.log.warn(
|
||||
{ session: this.session },
|
||||
'Error while getting engine info',
|
||||
);
|
||||
}
|
||||
}
|
||||
const engine = {
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
import { WAMedia } from '../structures/responses.dto';
|
||||
import {
|
||||
IEngineMediaProcessor,
|
||||
MediaManager,
|
||||
MediaStorage,
|
||||
} from './abc/media.abc';
|
||||
import { DOCS_URL } from './exceptions';
|
||||
|
||||
export class MediaStorageCore implements MediaStorage {
|
||||
async save(
|
||||
messageId: string,
|
||||
mimetype: string,
|
||||
buffer: Buffer,
|
||||
): Promise<string> {
|
||||
return Promise.resolve(
|
||||
`Media attachment's available only in WAHA Plus version. ${DOCS_URL}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export class CoreMediaManager implements MediaManager {
|
||||
constructor(
|
||||
private storage: MediaStorage,
|
||||
private mimetypes: string[],
|
||||
) {}
|
||||
|
||||
async processMedia<Message>(
|
||||
processor: IEngineMediaProcessor<Message>,
|
||||
message: Message,
|
||||
): Promise<Message> {
|
||||
if (!processor.hasMedia(message)) {
|
||||
return message;
|
||||
}
|
||||
const mimetype = '';
|
||||
const filename = processor.getFilename(message);
|
||||
const url = await this.storage.save('', mimetype, Buffer.from(''));
|
||||
const media: WAMedia = {
|
||||
mimetype: mimetype,
|
||||
filename: filename,
|
||||
url: url,
|
||||
};
|
||||
|
||||
// @ts-ignore
|
||||
message.media = media;
|
||||
return message;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Engine specific media processor
|
||||
* Knows how to extract necessary attributes and fetch the data from Message
|
||||
*/
|
||||
interface IMediaEngineProcessor<Message> {
|
||||
hasMedia(message: Message): boolean;
|
||||
|
||||
getFilename(message: Message): string | null;
|
||||
|
||||
getMimetype(message: Message): string;
|
||||
|
||||
getMessageId(message: Message): string;
|
||||
|
||||
getMediaBuffer(message: Message): Promise<Buffer | null>;
|
||||
}
|
||||
|
||||
export { IMediaEngineProcessor };
|
||||
@@ -0,0 +1,15 @@
|
||||
import { IMediaEngineProcessor } from '@waha/core/media/IMediaEngineProcessor';
|
||||
|
||||
/**
|
||||
* General interface for MediaManager - one that handles the logic
|
||||
* and manipulates MediaStorage and MediaEngineProcessor
|
||||
*/
|
||||
interface IMediaManager {
|
||||
processMedia<Message>(
|
||||
processor: IMediaEngineProcessor<Message>,
|
||||
message: Message,
|
||||
session: string,
|
||||
): Promise<Message>;
|
||||
}
|
||||
|
||||
export { IMediaManager };
|
||||
@@ -0,0 +1,42 @@
|
||||
import { S3MediaData } from '@waha/structures/media.s3.dto';
|
||||
|
||||
/**
|
||||
* Handles saving data to the physical storage
|
||||
*/
|
||||
interface Message {
|
||||
// false_111111111@c.us_AAAAAAAAAAAAAA
|
||||
id: string;
|
||||
}
|
||||
|
||||
interface File {
|
||||
extension: string;
|
||||
filename?: string;
|
||||
}
|
||||
|
||||
export interface MediaData {
|
||||
session: string;
|
||||
message: Message;
|
||||
file: File;
|
||||
}
|
||||
|
||||
/**
|
||||
* For stored media data
|
||||
*/
|
||||
export interface MediaStorageData {
|
||||
url: string;
|
||||
s3?: S3MediaData;
|
||||
}
|
||||
|
||||
abstract class IMediaStorage {
|
||||
abstract init(): Promise<void>;
|
||||
|
||||
abstract save(buffer: Buffer, data: MediaData): Promise<boolean>;
|
||||
|
||||
abstract exists(data: MediaData): Promise<boolean>;
|
||||
|
||||
abstract getStorageData(data: MediaData): Promise<MediaStorageData>;
|
||||
|
||||
abstract purge(): Promise<void>;
|
||||
}
|
||||
|
||||
export { IMediaStorage };
|
||||
@@ -0,0 +1,44 @@
|
||||
import { IMediaEngineProcessor } from '@waha/core/media/IMediaEngineProcessor';
|
||||
import { IMediaStorage, MediaData } from '@waha/core/media/IMediaStorage';
|
||||
import { WAMedia } from '@waha/structures/media.dto';
|
||||
|
||||
import { IMediaManager } from './IMediaManager';
|
||||
|
||||
export class MediaManagerCore implements IMediaManager {
|
||||
constructor(
|
||||
private storage: IMediaStorage,
|
||||
private mimetypes: string[],
|
||||
) {}
|
||||
|
||||
async processMedia<Message>(
|
||||
processor: IMediaEngineProcessor<Message>,
|
||||
message: Message,
|
||||
session: string,
|
||||
): Promise<Message> {
|
||||
if (!processor.hasMedia(message)) {
|
||||
return message;
|
||||
}
|
||||
const mimetype = '';
|
||||
const mediaData: MediaData = {
|
||||
session: session,
|
||||
message: {
|
||||
id: '',
|
||||
},
|
||||
file: {
|
||||
extension: '',
|
||||
},
|
||||
};
|
||||
const { url } = await this.storage.getStorageData(mediaData);
|
||||
|
||||
const filename = processor.getFilename(message);
|
||||
const media: WAMedia = {
|
||||
mimetype: mimetype,
|
||||
filename: filename,
|
||||
url: url,
|
||||
};
|
||||
|
||||
// @ts-ignore
|
||||
message.media = media;
|
||||
return message;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { DOCS_URL } from '@waha/core/exceptions';
|
||||
import { IMediaStorage, MediaData } from '@waha/core/media/IMediaStorage';
|
||||
|
||||
export class MediaNoopStorage implements IMediaStorage {
|
||||
async init() {
|
||||
return;
|
||||
}
|
||||
|
||||
async save(buffer: Buffer, data: MediaData): Promise<boolean> {
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
|
||||
async exists(data: MediaData): Promise<boolean> {
|
||||
return false;
|
||||
}
|
||||
|
||||
async getStorageData(data: MediaData) {
|
||||
const url = `Media attachment's available only in WAHA Plus version. ${DOCS_URL}`;
|
||||
return { url };
|
||||
}
|
||||
|
||||
async purge() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { WhatsappConfigService } from '@waha/config.service';
|
||||
|
||||
@Injectable()
|
||||
export class MediaLocalStorageConfig {
|
||||
public filesUri = '/api/files';
|
||||
|
||||
constructor(private config: WhatsappConfigService) {}
|
||||
|
||||
get filesURL(): string {
|
||||
return `${this.config.schema}://${this.config.hostname}:${this.config.port}${this.filesUri}/`;
|
||||
}
|
||||
|
||||
get filesFolder(): string {
|
||||
return this.config.get('WHATSAPP_FILES_FOLDER', '/tmp/whatsapp-files');
|
||||
}
|
||||
|
||||
get filesLifetime(): number {
|
||||
return parseInt(this.config.get('WHATSAPP_FILES_LIFETIME', '180'));
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,4 @@ export abstract class ISessionAuthRepository {
|
||||
abstract init(sessionName?: string): Promise<void>;
|
||||
|
||||
abstract clean(sessionName: string): Promise<void>;
|
||||
|
||||
abstract getAll(): Promise<string[]>;
|
||||
}
|
||||
@@ -8,5 +8,9 @@ export abstract class ISessionConfigRepository {
|
||||
|
||||
abstract get(sessionName: string): Promise<SessionConfig | null>;
|
||||
|
||||
abstract exists(sessionName: string): Promise<boolean>;
|
||||
|
||||
abstract delete(sessionName: string): Promise<void>;
|
||||
|
||||
abstract getAll(): Promise<string[]>;
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
import * as fs from 'fs/promises';
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const fs = require('fs-extra');
|
||||
|
||||
import { ISessionAuthRepository } from './ISessionAuthRepository';
|
||||
import { LocalStore } from './LocalStore';
|
||||
// Keep all waha related files, ".waha.session.*"
|
||||
const KEEP_FILES = /^\.waha\.session\..*$/;
|
||||
|
||||
export class LocalSessionAuthRepository extends ISessionAuthRepository {
|
||||
private store: LocalStore;
|
||||
@@ -16,17 +19,17 @@ export class LocalSessionAuthRepository extends ISessionAuthRepository {
|
||||
}
|
||||
|
||||
async clean(sessionName: string) {
|
||||
const folder = this.store.getSessionDirectory(sessionName);
|
||||
await fs.rm(folder, { recursive: true });
|
||||
}
|
||||
|
||||
async getAll(): Promise<string[]> {
|
||||
await this.init();
|
||||
const content = await fs.readdir(this.store.getEngineDirectory(), {
|
||||
withFileTypes: true,
|
||||
});
|
||||
return content
|
||||
.filter((dirent) => dirent.isDirectory())
|
||||
.map((dirent) => dirent.name);
|
||||
// Remove all files and directories recursively, but keep waha files
|
||||
const sessionDirectory = this.store.getSessionDirectory(sessionName);
|
||||
// Check it exists and it's directory
|
||||
const exists = await fs.pathExists(sessionDirectory);
|
||||
if (!exists) {
|
||||
return;
|
||||
}
|
||||
const files = await fs.readdir(sessionDirectory);
|
||||
const filesToRemove = files.filter((file) => !file.match(KEEP_FILES));
|
||||
for (const file of filesToRemove) {
|
||||
await fs.remove(`${sessionDirectory}/${file}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
import * as fs from 'fs/promises';
|
||||
import * as path from 'path';
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const fs = require('fs-extra');
|
||||
|
||||
import { fileExists } from '@waha/utils/files';
|
||||
|
||||
import { SessionConfig } from '../../structures/sessions.dto';
|
||||
import { ISessionConfigRepository } from './ISessionConfigRepository';
|
||||
@@ -14,19 +16,15 @@ export class LocalSessionConfigRepository extends ISessionConfigRepository {
|
||||
this.store = store;
|
||||
}
|
||||
|
||||
private async fileExists(filepath: string) {
|
||||
try {
|
||||
await fs.access(filepath, fs.constants.F_OK);
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
async exists(sessionName: string): Promise<boolean> {
|
||||
const filepath = this.getFilePath(sessionName);
|
||||
return await fileExists(filepath);
|
||||
}
|
||||
|
||||
async get(sessionName: string): Promise<SessionConfig | null> {
|
||||
const filepath = this.getFilePath(sessionName);
|
||||
// Check file exists
|
||||
if (!(await this.fileExists(filepath))) {
|
||||
if (!(await fileExists(filepath))) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -56,10 +54,17 @@ export class LocalSessionConfigRepository extends ISessionConfigRepository {
|
||||
}
|
||||
|
||||
async delete(sessionName: string): Promise<void> {
|
||||
const filepath = this.getFilePath(sessionName);
|
||||
if (!(await this.fileExists(filepath))) {
|
||||
return;
|
||||
}
|
||||
await fs.unlink(filepath);
|
||||
const sessionDirectory = this.store.getSessionDirectory(sessionName);
|
||||
await fs.remove(sessionDirectory);
|
||||
}
|
||||
|
||||
async getAll(): Promise<string[]> {
|
||||
await this.store.init();
|
||||
const content = await fs.readdir(this.store.getEngineDirectory(), {
|
||||
withFileTypes: true,
|
||||
});
|
||||
return content
|
||||
.filter((dirent) => dirent.isDirectory())
|
||||
.map((dirent) => dirent.name);
|
||||
}
|
||||
}
|
||||
+20
-15
@@ -1,5 +1,3 @@
|
||||
import { ConsoleLogger } from '@nestjs/common';
|
||||
|
||||
import { WAHAEvents } from '../structures/enums.dto';
|
||||
import { WebhookConfig } from '../structures/webhooks.config.dto';
|
||||
import { WAHAWebhook } from '../structures/webhooks.dto';
|
||||
@@ -7,30 +5,36 @@ import { VERSION } from '../version';
|
||||
import { WAHAInternalEvent, WhatsappSession } from './abc/session.abc';
|
||||
import { WebhookConductor, WebhookSender } from './abc/webhooks.abc';
|
||||
import request = require('request');
|
||||
import { LoggerBuilder } from '@waha/utils/logging';
|
||||
import { Logger } from 'pino';
|
||||
|
||||
export class WebhookSenderCore extends WebhookSender {
|
||||
send(json) {
|
||||
this.log.log(`Sending POST to ${this.url}...`);
|
||||
this.log.verbose(`POST DATA: ${JSON.stringify(json)}`);
|
||||
this.logger.info({ url: this.url }, `Sending POST ...`);
|
||||
this.logger.debug({ data: json }, `POST DATA`);
|
||||
|
||||
request.post(this.url, { json: json }, (error, res, body) => {
|
||||
if (error) {
|
||||
this.log.error(error);
|
||||
this.logger.error(error);
|
||||
return;
|
||||
}
|
||||
this.log.log(`POST request was sent with status code: ${res.statusCode}`);
|
||||
this.log.debug(`Response: ${body}`);
|
||||
this.logger.info(
|
||||
`POST request was sent with status code: ${res.statusCode}`,
|
||||
);
|
||||
this.logger.debug({ body: body }, `Response`);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class WebhookConductorCore implements WebhookConductor {
|
||||
constructor(protected log: ConsoleLogger) {
|
||||
this.log = log;
|
||||
private logger: Logger;
|
||||
|
||||
constructor(protected loggerBuilder: LoggerBuilder) {
|
||||
this.logger = loggerBuilder.child({ name: WebhookConductor.name });
|
||||
}
|
||||
|
||||
protected buildSender(webhookConfig: WebhookConfig): WebhookSender {
|
||||
return new WebhookSenderCore(this.log, webhookConfig);
|
||||
return new WebhookSenderCore(this.loggerBuilder, webhookConfig);
|
||||
}
|
||||
|
||||
private getSuitableEvents(events: WAHAEvents[] | string[]): WAHAEvents[] {
|
||||
@@ -47,7 +51,7 @@ export class WebhookConductorCore implements WebhookConductor {
|
||||
for (const event of events) {
|
||||
// @ts-ignore
|
||||
if (!allEvents.includes(event)) {
|
||||
this.log.error(`Unknown event for webhook: '${event}'`);
|
||||
this.logger.error(`Unknown event for webhook: '${event}'`);
|
||||
continue;
|
||||
}
|
||||
rightEvents.push(event);
|
||||
@@ -70,7 +74,7 @@ export class WebhookConductorCore implements WebhookConductor {
|
||||
}
|
||||
|
||||
const url = webhook.url;
|
||||
this.log.log(`Configuring webhooks for ${url}...`);
|
||||
this.logger.info(`Configuring webhooks for ${url}...`);
|
||||
const events = this.getSuitableEvents(webhook.events);
|
||||
const sender = this.buildSender(webhook);
|
||||
for (const event of events) {
|
||||
@@ -93,14 +97,14 @@ export class WebhookConductorCore implements WebhookConductor {
|
||||
url,
|
||||
);
|
||||
if (!found) {
|
||||
this.log.error(
|
||||
this.logger.error(
|
||||
`Engine does not support webhook event: '${event}' for url '${url}'`,
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
this.log.log(`Webhooks were configured for ${url}.`);
|
||||
this.logger.info(`Webhooks were configured for ${url}.`);
|
||||
}
|
||||
|
||||
private configureSingleEvent(
|
||||
@@ -117,7 +121,7 @@ export class WebhookConductorCore implements WebhookConductor {
|
||||
if (!found) {
|
||||
return false;
|
||||
}
|
||||
this.log.log(`Event '${event}' is enabled for url: ${url}`);
|
||||
this.logger.info(`Event '${event}' is enabled for url: ${url}`);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -131,6 +135,7 @@ export class WebhookConductorCore implements WebhookConductor {
|
||||
const json: WAHAWebhook = {
|
||||
event: event,
|
||||
session: session.name,
|
||||
metadata: session.sessionConfig?.metadata,
|
||||
me: me,
|
||||
payload: data,
|
||||
engine: session.engine,
|
||||
|
||||
Whitespace-only changes.
@@ -1,234 +0,0 @@
|
||||
<!DOCTYPE html><html><head><style type="text/css" data-primevue-style-id="layer-order" >@layer tailwind-base, primevue, tailwind-utilities</style><meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Dashboard | WAHA</title>
|
||||
<link id="theme-css" rel="stylesheet" type="text/css" href="/dashboard/themes/lara-dark-green/theme.css">
|
||||
<link rel="icon" type="image/x-icon" href="/dashboard/favicon.ico">
|
||||
<link rel="stylesheet" href="/dashboard/_nuxt/entry.CdRyF6M1.css">
|
||||
<link rel="modulepreload" as="script" crossorigin href="/dashboard/_nuxt/DRtWvKfJ.js">
|
||||
<link rel="prefetch" as="image" type="image/svg+xml" href="/dashboard/_nuxt/primeicons.BubJZjaf.svg">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CmNMiwz3.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cm7Dkme4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CwRw2352.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Bl_ZW1Xh.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B5fdn047.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BMCLKWyE.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DpeyYdwe.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BPIn4_kN.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CELf783E.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CFcFeTBy.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BnGLU8uI.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CSbfZNF6.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DLCKhL4y.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CTyYxNkn.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/r743PZK3.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/G8FENBP4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/GnhOacnB.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Gj9DruUc.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BKuF8g-Y.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D6mOJ75X.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/33ou32AX.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B14_1DDx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D2eV2xTx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B7nXBdam.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D_qICk5i.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/dbkXk2FM.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/gHxUMB3b.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Dvzs3FMW.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cls9geQy.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DSMppbuD.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BMYrlhrg.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Hku5IA12.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/zU1BOWrX.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/ChcErU2V.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CkTkVLD1.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/RfUbfTV3.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CzY8CgE7.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/37NENiMc.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DOsY_IVn.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cw-7pq-7.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/mwds7uJx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DtAtnC1U.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Dgmq9a1E.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CGlsgAZL.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CfFFY47l.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Ca3-bi3b.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CJA3DD2a.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/LqjL8cgW.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BJSv0A8B.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/HF1fbsar.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/POGdjepN.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DF_jK3OP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CLLMBAGk.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/b2TVTf9x.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B8gNdiY1.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CpFoAXuV.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CP0-jfu8.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/7JVgPXr5.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B7DyUdc_.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/1T5oFhIQ.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Bkz4NsfY.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CVFSkoIM.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CS5BvUDo.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BL7cLbn_.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CLYZtMaI.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DVu_lr_n.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cvjjzn6F.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/e47XCw9e.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/fseMLFIf.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DAA892mm.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BQr05V_N.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/C1t5Tk14.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D2IhmS2j.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Ce0F-GHP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/uQ-y24Vd.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B-OEjvS-.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Dh-jSmv_.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BHHly3AA.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BEGul3PF.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/gkxWwNn4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B3LkAbCI.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CVNB3I9A.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cys77vfo.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DQ31lhkw.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D8bzSal1.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B1c-crdP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/rlYL6_u-.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/jC3uBuQA.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DMsZhJAp.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BjAXeOBb.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Dg_46Ljg.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/ZYKRgrtt.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Db4mELQW.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Djls7KqP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/eMP3SzX4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CDQwIvYz.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/qKtqUDpn.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/p4OZ13Rt.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/0XIOL7f-.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/nMqNs1WI.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/WUTkRygV.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D-MZziVS.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/16cy-3pL.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CmQzOt0X.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BzR4Bpo5.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cbk6LDlc.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DMpQ2VjP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/KMkrkpbk.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CTNwIyJm.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Ccp8DHy1.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D2OvdbTk.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BUWX4M_G.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/lgpgYudh.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BYI5e787.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CyrprVen.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/_99QGe7X.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/3aQOlzix.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/C6c3wBd4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CHvp0DM_.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BfPKB-F8.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/e2o5KJyy.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CZfe2Sfn.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BVlqpfGd.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CaXCK0Oi.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/yXaOlmbx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CVYvFl41.js">
|
||||
<link rel="prefetch" as="style" href="/dashboard/_nuxt/useServerStore.DWEvhDiM.css">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BidU6Jgh.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/VJFiI_rq.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/lXe9j5XU.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B_5QcCB8.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B-WZqzsx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/XrWOLLJc.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BbcatXLp.js">
|
||||
<link rel="prefetch" as="style" href="/dashboard/_nuxt/error-404.JekaaCis.css">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/cRLLwgqB.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D0FGFGTv.js">
|
||||
<link rel="prefetch" as="style" href="/dashboard/_nuxt/error-500.CNP9nqm1.css">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/C4Twg9_6.js">
|
||||
<script type="module" src="/dashboard/_nuxt/DRtWvKfJ.js" crossorigin></script>
|
||||
<script id="unhead:payload" type="application/json">{"title":"Dashboard | WAHA"}</script><style type="text/css" data-primevue-style-id="base" >
|
||||
.p-hidden-accessible {
|
||||
border: 0;
|
||||
clip: rect(0 0 0 0);
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
}
|
||||
|
||||
.p-hidden-accessible input,
|
||||
.p-hidden-accessible select {
|
||||
transform: scale(0);
|
||||
}
|
||||
|
||||
.p-overflow-hidden {
|
||||
overflow: hidden;
|
||||
padding-right: var(--scrollbar-width);
|
||||
}
|
||||
</style><style type="text/css" data-primevue-style-id="virtualscroller" >
|
||||
@layer primevue {
|
||||
.p-virtualscroller {
|
||||
position: relative;
|
||||
overflow: auto;
|
||||
contain: strict;
|
||||
transform: translateZ(0);
|
||||
will-change: scroll-position;
|
||||
outline: 0 none;
|
||||
}
|
||||
|
||||
.p-virtualscroller-content {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
/* contain: content; */
|
||||
min-height: 100%;
|
||||
min-width: 100%;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
.p-virtualscroller-spacer {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 1px;
|
||||
width: 1px;
|
||||
transform-origin: 0 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.p-virtualscroller .p-virtualscroller-loader {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.p-virtualscroller-loader.p-component-overlay {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.p-virtualscroller-loading-icon {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.p-virtualscroller-loading-icon.p-icon {
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
}
|
||||
|
||||
.p-virtualscroller-horizontal > .p-virtualscroller-content {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* Inline */
|
||||
.p-virtualscroller-inline .p-virtualscroller-content {
|
||||
position: static;
|
||||
}
|
||||
}
|
||||
</style></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4,"once":5},{},false,{},{},["Set"]]</script>
|
||||
<script>window.__NUXT__={};window.__NUXT__.config={public:{primevue:{usePrimeVue:true,resolvePath:"",cssLayerOrder:"tailwind-base, primevue, tailwind-utilities",importPT:"",options:{ripple:true},components:[{name:"AutoComplete",as:"AutoComplete",from:"primevue/autocomplete",export:"default",filePath:"primevue/autocomplete",global:true},{name:"Calendar",as:"Calendar",from:"primevue/calendar",export:"default",filePath:"primevue/calendar",global:true},{name:"CascadeSelect",as:"CascadeSelect",from:"primevue/cascadeselect",export:"default",filePath:"primevue/cascadeselect",global:true},{name:"Checkbox",as:"Checkbox",from:"primevue/checkbox",export:"default",filePath:"primevue/checkbox",global:true},{name:"Chips",as:"Chips",from:"primevue/chips",export:"default",filePath:"primevue/chips",global:true},{name:"ColorPicker",as:"ColorPicker",from:"primevue/colorpicker",export:"default",filePath:"primevue/colorpicker",global:true},{name:"Dropdown",as:"Dropdown",from:"primevue/dropdown",export:"default",filePath:"primevue/dropdown",global:true},{name:"FloatLabel",as:"FloatLabel",from:"primevue/floatlabel",export:"default",filePath:"primevue/floatlabel",global:true},{name:"IconField",as:"IconField",from:"primevue/iconfield",export:"default",filePath:"primevue/iconfield",global:true},{name:"InputGroup",as:"InputGroup",from:"primevue/inputgroup",export:"default",filePath:"primevue/inputgroup",global:true},{name:"InputGroupAddon",as:"InputGroupAddon",from:"primevue/inputgroupaddon",export:"default",filePath:"primevue/inputgroupaddon",global:true},{name:"InputIcon",as:"InputIcon",from:"primevue/inputicon",export:"default",filePath:"primevue/inputicon",global:true},{name:"InputMask",as:"InputMask",from:"primevue/inputmask",export:"default",filePath:"primevue/inputmask",global:true},{name:"InputNumber",as:"InputNumber",from:"primevue/inputnumber",export:"default",filePath:"primevue/inputnumber",global:true},{name:"InputOtp",as:"InputOtp",from:"primevue/inputotp",export:"default",filePath:"primevue/inputotp",global:true},{name:"InputSwitch",as:"InputSwitch",from:"primevue/inputswitch",export:"default",filePath:"primevue/inputswitch",global:true},{name:"InputText",as:"InputText",from:"primevue/inputtext",export:"default",filePath:"primevue/inputtext",global:true},{name:"Knob",as:"Knob",from:"primevue/knob",export:"default",filePath:"primevue/knob",global:true},{name:"Listbox",as:"Listbox",from:"primevue/listbox",export:"default",filePath:"primevue/listbox",global:true},{name:"MultiSelect",as:"MultiSelect",from:"primevue/multiselect",export:"default",filePath:"primevue/multiselect",global:true},{name:"Password",as:"Password",from:"primevue/password",export:"default",filePath:"primevue/password",global:true},{name:"RadioButton",as:"RadioButton",from:"primevue/radiobutton",export:"default",filePath:"primevue/radiobutton",global:true},{name:"Rating",as:"Rating",from:"primevue/rating",export:"default",filePath:"primevue/rating",global:true},{name:"SelectButton",as:"SelectButton",from:"primevue/selectbutton",export:"default",filePath:"primevue/selectbutton",global:true},{name:"Slider",as:"Slider",from:"primevue/slider",export:"default",filePath:"primevue/slider",global:true},{name:"Textarea",as:"Textarea",from:"primevue/textarea",export:"default",filePath:"primevue/textarea",global:true},{name:"ToggleButton",as:"ToggleButton",from:"primevue/togglebutton",export:"default",filePath:"primevue/togglebutton",global:true},{name:"TreeSelect",as:"TreeSelect",from:"primevue/treeselect",export:"default",filePath:"primevue/treeselect",global:true},{name:"TriStateCheckbox",as:"TriStateCheckbox",from:"primevue/tristatecheckbox",export:"default",filePath:"primevue/tristatecheckbox",global:true},{name:"Button",as:"Button",from:"primevue/button",export:"default",filePath:"primevue/button",global:true},{name:"ButtonGroup",as:"ButtonGroup",from:"primevue/buttongroup",export:"default",filePath:"primevue/buttongroup",global:true},{name:"SpeedDial",as:"SpeedDial",from:"primevue/speeddial",export:"default",filePath:"primevue/speeddial",global:true},{name:"SplitButton",as:"SplitButton",from:"primevue/splitbutton",export:"default",filePath:"primevue/splitbutton",global:true},{name:"Column",as:"Column",from:"primevue/column",export:"default",filePath:"primevue/column",global:true},{name:"Row",as:"Row",from:"primevue/row",export:"default",filePath:"primevue/row",global:true},{name:"ColumnGroup",as:"ColumnGroup",from:"primevue/columngroup",export:"default",filePath:"primevue/columngroup",global:true},{name:"DataTable",as:"DataTable",from:"primevue/datatable",export:"default",filePath:"primevue/datatable",global:true},{name:"DataView",as:"DataView",from:"primevue/dataview",export:"default",filePath:"primevue/dataview",global:true},{name:"DataViewLayoutOptions",as:"DataViewLayoutOptions",from:"primevue/dataviewlayoutoptions",export:"default",filePath:"primevue/dataviewlayoutoptions",global:true},{name:"OrderList",as:"OrderList",from:"primevue/orderlist",export:"Line truncated
|
||||
@@ -1,234 +0,0 @@
|
||||
<!DOCTYPE html><html><head><style type="text/css" data-primevue-style-id="layer-order" >@layer tailwind-base, primevue, tailwind-utilities</style><meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Dashboard | WAHA</title>
|
||||
<link id="theme-css" rel="stylesheet" type="text/css" href="/dashboard/themes/lara-dark-green/theme.css">
|
||||
<link rel="icon" type="image/x-icon" href="/dashboard/favicon.ico">
|
||||
<link rel="stylesheet" href="/dashboard/_nuxt/entry.CdRyF6M1.css">
|
||||
<link rel="modulepreload" as="script" crossorigin href="/dashboard/_nuxt/DRtWvKfJ.js">
|
||||
<link rel="prefetch" as="image" type="image/svg+xml" href="/dashboard/_nuxt/primeicons.BubJZjaf.svg">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CmNMiwz3.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cm7Dkme4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CwRw2352.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Bl_ZW1Xh.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B5fdn047.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BMCLKWyE.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DpeyYdwe.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BPIn4_kN.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CELf783E.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CFcFeTBy.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BnGLU8uI.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CSbfZNF6.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DLCKhL4y.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CTyYxNkn.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/r743PZK3.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/G8FENBP4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/GnhOacnB.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Gj9DruUc.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BKuF8g-Y.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D6mOJ75X.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/33ou32AX.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B14_1DDx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D2eV2xTx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B7nXBdam.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D_qICk5i.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/dbkXk2FM.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/gHxUMB3b.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Dvzs3FMW.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cls9geQy.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DSMppbuD.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BMYrlhrg.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Hku5IA12.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/zU1BOWrX.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/ChcErU2V.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CkTkVLD1.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/RfUbfTV3.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CzY8CgE7.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/37NENiMc.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DOsY_IVn.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cw-7pq-7.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/mwds7uJx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DtAtnC1U.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Dgmq9a1E.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CGlsgAZL.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CfFFY47l.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Ca3-bi3b.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CJA3DD2a.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/LqjL8cgW.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BJSv0A8B.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/HF1fbsar.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/POGdjepN.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DF_jK3OP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CLLMBAGk.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/b2TVTf9x.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B8gNdiY1.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CpFoAXuV.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CP0-jfu8.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/7JVgPXr5.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B7DyUdc_.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/1T5oFhIQ.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Bkz4NsfY.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CVFSkoIM.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CS5BvUDo.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BL7cLbn_.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CLYZtMaI.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DVu_lr_n.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cvjjzn6F.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/e47XCw9e.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/fseMLFIf.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DAA892mm.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BQr05V_N.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/C1t5Tk14.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D2IhmS2j.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Ce0F-GHP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/uQ-y24Vd.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B-OEjvS-.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Dh-jSmv_.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BHHly3AA.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BEGul3PF.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/gkxWwNn4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B3LkAbCI.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CVNB3I9A.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cys77vfo.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DQ31lhkw.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D8bzSal1.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B1c-crdP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/rlYL6_u-.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/jC3uBuQA.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DMsZhJAp.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BjAXeOBb.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Dg_46Ljg.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/ZYKRgrtt.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Db4mELQW.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Djls7KqP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/eMP3SzX4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CDQwIvYz.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/qKtqUDpn.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/p4OZ13Rt.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/0XIOL7f-.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/nMqNs1WI.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/WUTkRygV.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D-MZziVS.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/16cy-3pL.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CmQzOt0X.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BzR4Bpo5.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cbk6LDlc.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DMpQ2VjP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/KMkrkpbk.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CTNwIyJm.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Ccp8DHy1.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D2OvdbTk.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BUWX4M_G.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/lgpgYudh.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BYI5e787.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CyrprVen.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/_99QGe7X.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/3aQOlzix.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/C6c3wBd4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CHvp0DM_.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BfPKB-F8.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/e2o5KJyy.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CZfe2Sfn.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BVlqpfGd.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CaXCK0Oi.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/yXaOlmbx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CVYvFl41.js">
|
||||
<link rel="prefetch" as="style" href="/dashboard/_nuxt/useServerStore.DWEvhDiM.css">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BidU6Jgh.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/VJFiI_rq.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/lXe9j5XU.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B_5QcCB8.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B-WZqzsx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/XrWOLLJc.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BbcatXLp.js">
|
||||
<link rel="prefetch" as="style" href="/dashboard/_nuxt/error-404.JekaaCis.css">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/cRLLwgqB.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D0FGFGTv.js">
|
||||
<link rel="prefetch" as="style" href="/dashboard/_nuxt/error-500.CNP9nqm1.css">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/C4Twg9_6.js">
|
||||
<script type="module" src="/dashboard/_nuxt/DRtWvKfJ.js" crossorigin></script>
|
||||
<script id="unhead:payload" type="application/json">{"title":"Dashboard | WAHA"}</script><style type="text/css" data-primevue-style-id="base" >
|
||||
.p-hidden-accessible {
|
||||
border: 0;
|
||||
clip: rect(0 0 0 0);
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
}
|
||||
|
||||
.p-hidden-accessible input,
|
||||
.p-hidden-accessible select {
|
||||
transform: scale(0);
|
||||
}
|
||||
|
||||
.p-overflow-hidden {
|
||||
overflow: hidden;
|
||||
padding-right: var(--scrollbar-width);
|
||||
}
|
||||
</style><style type="text/css" data-primevue-style-id="virtualscroller" >
|
||||
@layer primevue {
|
||||
.p-virtualscroller {
|
||||
position: relative;
|
||||
overflow: auto;
|
||||
contain: strict;
|
||||
transform: translateZ(0);
|
||||
will-change: scroll-position;
|
||||
outline: 0 none;
|
||||
}
|
||||
|
||||
.p-virtualscroller-content {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
/* contain: content; */
|
||||
min-height: 100%;
|
||||
min-width: 100%;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
.p-virtualscroller-spacer {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 1px;
|
||||
width: 1px;
|
||||
transform-origin: 0 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.p-virtualscroller .p-virtualscroller-loader {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.p-virtualscroller-loader.p-component-overlay {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.p-virtualscroller-loading-icon {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.p-virtualscroller-loading-icon.p-icon {
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
}
|
||||
|
||||
.p-virtualscroller-horizontal > .p-virtualscroller-content {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* Inline */
|
||||
.p-virtualscroller-inline .p-virtualscroller-content {
|
||||
position: static;
|
||||
}
|
||||
}
|
||||
</style></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4,"once":5},{},false,{},{},["Set"]]</script>
|
||||
<script>window.__NUXT__={};window.__NUXT__.config={public:{primevue:{usePrimeVue:true,resolvePath:"",cssLayerOrder:"tailwind-base, primevue, tailwind-utilities",importPT:"",options:{ripple:true},components:[{name:"AutoComplete",as:"AutoComplete",from:"primevue/autocomplete",export:"default",filePath:"primevue/autocomplete",global:true},{name:"Calendar",as:"Calendar",from:"primevue/calendar",export:"default",filePath:"primevue/calendar",global:true},{name:"CascadeSelect",as:"CascadeSelect",from:"primevue/cascadeselect",export:"default",filePath:"primevue/cascadeselect",global:true},{name:"Checkbox",as:"Checkbox",from:"primevue/checkbox",export:"default",filePath:"primevue/checkbox",global:true},{name:"Chips",as:"Chips",from:"primevue/chips",export:"default",filePath:"primevue/chips",global:true},{name:"ColorPicker",as:"ColorPicker",from:"primevue/colorpicker",export:"default",filePath:"primevue/colorpicker",global:true},{name:"Dropdown",as:"Dropdown",from:"primevue/dropdown",export:"default",filePath:"primevue/dropdown",global:true},{name:"FloatLabel",as:"FloatLabel",from:"primevue/floatlabel",export:"default",filePath:"primevue/floatlabel",global:true},{name:"IconField",as:"IconField",from:"primevue/iconfield",export:"default",filePath:"primevue/iconfield",global:true},{name:"InputGroup",as:"InputGroup",from:"primevue/inputgroup",export:"default",filePath:"primevue/inputgroup",global:true},{name:"InputGroupAddon",as:"InputGroupAddon",from:"primevue/inputgroupaddon",export:"default",filePath:"primevue/inputgroupaddon",global:true},{name:"InputIcon",as:"InputIcon",from:"primevue/inputicon",export:"default",filePath:"primevue/inputicon",global:true},{name:"InputMask",as:"InputMask",from:"primevue/inputmask",export:"default",filePath:"primevue/inputmask",global:true},{name:"InputNumber",as:"InputNumber",from:"primevue/inputnumber",export:"default",filePath:"primevue/inputnumber",global:true},{name:"InputOtp",as:"InputOtp",from:"primevue/inputotp",export:"default",filePath:"primevue/inputotp",global:true},{name:"InputSwitch",as:"InputSwitch",from:"primevue/inputswitch",export:"default",filePath:"primevue/inputswitch",global:true},{name:"InputText",as:"InputText",from:"primevue/inputtext",export:"default",filePath:"primevue/inputtext",global:true},{name:"Knob",as:"Knob",from:"primevue/knob",export:"default",filePath:"primevue/knob",global:true},{name:"Listbox",as:"Listbox",from:"primevue/listbox",export:"default",filePath:"primevue/listbox",global:true},{name:"MultiSelect",as:"MultiSelect",from:"primevue/multiselect",export:"default",filePath:"primevue/multiselect",global:true},{name:"Password",as:"Password",from:"primevue/password",export:"default",filePath:"primevue/password",global:true},{name:"RadioButton",as:"RadioButton",from:"primevue/radiobutton",export:"default",filePath:"primevue/radiobutton",global:true},{name:"Rating",as:"Rating",from:"primevue/rating",export:"default",filePath:"primevue/rating",global:true},{name:"SelectButton",as:"SelectButton",from:"primevue/selectbutton",export:"default",filePath:"primevue/selectbutton",global:true},{name:"Slider",as:"Slider",from:"primevue/slider",export:"default",filePath:"primevue/slider",global:true},{name:"Textarea",as:"Textarea",from:"primevue/textarea",export:"default",filePath:"primevue/textarea",global:true},{name:"ToggleButton",as:"ToggleButton",from:"primevue/togglebutton",export:"default",filePath:"primevue/togglebutton",global:true},{name:"TreeSelect",as:"TreeSelect",from:"primevue/treeselect",export:"default",filePath:"primevue/treeselect",global:true},{name:"TriStateCheckbox",as:"TriStateCheckbox",from:"primevue/tristatecheckbox",export:"default",filePath:"primevue/tristatecheckbox",global:true},{name:"Button",as:"Button",from:"primevue/button",export:"default",filePath:"primevue/button",global:true},{name:"ButtonGroup",as:"ButtonGroup",from:"primevue/buttongroup",export:"default",filePath:"primevue/buttongroup",global:true},{name:"SpeedDial",as:"SpeedDial",from:"primevue/speeddial",export:"default",filePath:"primevue/speeddial",global:true},{name:"SplitButton",as:"SplitButton",from:"primevue/splitbutton",export:"default",filePath:"primevue/splitbutton",global:true},{name:"Column",as:"Column",from:"primevue/column",export:"default",filePath:"primevue/column",global:true},{name:"Row",as:"Row",from:"primevue/row",export:"default",filePath:"primevue/row",global:true},{name:"ColumnGroup",as:"ColumnGroup",from:"primevue/columngroup",export:"default",filePath:"primevue/columngroup",global:true},{name:"DataTable",as:"DataTable",from:"primevue/datatable",export:"default",filePath:"primevue/datatable",global:true},{name:"DataView",as:"DataView",from:"primevue/dataview",export:"default",filePath:"primevue/dataview",global:true},{name:"DataViewLayoutOptions",as:"DataViewLayoutOptions",from:"primevue/dataviewlayoutoptions",export:"default",filePath:"primevue/dataviewlayoutoptions",global:true},{name:"OrderList",as:"OrderList",from:"primevue/orderlist",export:"Line truncated
|
||||
@@ -1,234 +0,0 @@
|
||||
<!DOCTYPE html><html><head><style type="text/css" data-primevue-style-id="layer-order" >@layer tailwind-base, primevue, tailwind-utilities</style><meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Dashboard | WAHA</title>
|
||||
<link id="theme-css" rel="stylesheet" type="text/css" href="/dashboard/themes/lara-dark-green/theme.css">
|
||||
<link rel="icon" type="image/x-icon" href="/dashboard/favicon.ico">
|
||||
<link rel="stylesheet" href="/dashboard/_nuxt/entry.CdRyF6M1.css">
|
||||
<link rel="modulepreload" as="script" crossorigin href="/dashboard/_nuxt/DRtWvKfJ.js">
|
||||
<link rel="prefetch" as="image" type="image/svg+xml" href="/dashboard/_nuxt/primeicons.BubJZjaf.svg">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CmNMiwz3.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cm7Dkme4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CwRw2352.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Bl_ZW1Xh.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B5fdn047.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BMCLKWyE.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DpeyYdwe.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BPIn4_kN.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CELf783E.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CFcFeTBy.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BnGLU8uI.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CSbfZNF6.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DLCKhL4y.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CTyYxNkn.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/r743PZK3.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/G8FENBP4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/GnhOacnB.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Gj9DruUc.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BKuF8g-Y.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D6mOJ75X.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/33ou32AX.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B14_1DDx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D2eV2xTx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B7nXBdam.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D_qICk5i.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/dbkXk2FM.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/gHxUMB3b.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Dvzs3FMW.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cls9geQy.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DSMppbuD.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BMYrlhrg.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Hku5IA12.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/zU1BOWrX.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/ChcErU2V.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CkTkVLD1.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/RfUbfTV3.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CzY8CgE7.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/37NENiMc.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DOsY_IVn.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cw-7pq-7.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/mwds7uJx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DtAtnC1U.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Dgmq9a1E.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CGlsgAZL.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CfFFY47l.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Ca3-bi3b.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CJA3DD2a.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/LqjL8cgW.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BJSv0A8B.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/HF1fbsar.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/POGdjepN.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DF_jK3OP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CLLMBAGk.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/b2TVTf9x.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B8gNdiY1.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CpFoAXuV.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CP0-jfu8.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/7JVgPXr5.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B7DyUdc_.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/1T5oFhIQ.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Bkz4NsfY.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CVFSkoIM.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CS5BvUDo.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BL7cLbn_.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CLYZtMaI.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DVu_lr_n.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cvjjzn6F.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/e47XCw9e.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/fseMLFIf.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DAA892mm.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BQr05V_N.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/C1t5Tk14.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D2IhmS2j.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Ce0F-GHP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/uQ-y24Vd.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B-OEjvS-.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Dh-jSmv_.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BHHly3AA.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BEGul3PF.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/gkxWwNn4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B3LkAbCI.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CVNB3I9A.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cys77vfo.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DQ31lhkw.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D8bzSal1.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B1c-crdP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/rlYL6_u-.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/jC3uBuQA.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DMsZhJAp.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BjAXeOBb.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Dg_46Ljg.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/ZYKRgrtt.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Db4mELQW.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Djls7KqP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/eMP3SzX4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CDQwIvYz.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/qKtqUDpn.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/p4OZ13Rt.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/0XIOL7f-.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/nMqNs1WI.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/WUTkRygV.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D-MZziVS.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/16cy-3pL.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CmQzOt0X.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BzR4Bpo5.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cbk6LDlc.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DMpQ2VjP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/KMkrkpbk.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CTNwIyJm.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Ccp8DHy1.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D2OvdbTk.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BUWX4M_G.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/lgpgYudh.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BYI5e787.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CyrprVen.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/_99QGe7X.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/3aQOlzix.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/C6c3wBd4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CHvp0DM_.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BfPKB-F8.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/e2o5KJyy.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CZfe2Sfn.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BVlqpfGd.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CaXCK0Oi.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/yXaOlmbx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CVYvFl41.js">
|
||||
<link rel="prefetch" as="style" href="/dashboard/_nuxt/useServerStore.DWEvhDiM.css">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BidU6Jgh.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/VJFiI_rq.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/lXe9j5XU.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B_5QcCB8.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B-WZqzsx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/XrWOLLJc.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BbcatXLp.js">
|
||||
<link rel="prefetch" as="style" href="/dashboard/_nuxt/error-404.JekaaCis.css">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/cRLLwgqB.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D0FGFGTv.js">
|
||||
<link rel="prefetch" as="style" href="/dashboard/_nuxt/error-500.CNP9nqm1.css">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/C4Twg9_6.js">
|
||||
<script type="module" src="/dashboard/_nuxt/DRtWvKfJ.js" crossorigin></script>
|
||||
<script id="unhead:payload" type="application/json">{"title":"Dashboard | WAHA"}</script><style type="text/css" data-primevue-style-id="base" >
|
||||
.p-hidden-accessible {
|
||||
border: 0;
|
||||
clip: rect(0 0 0 0);
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
}
|
||||
|
||||
.p-hidden-accessible input,
|
||||
.p-hidden-accessible select {
|
||||
transform: scale(0);
|
||||
}
|
||||
|
||||
.p-overflow-hidden {
|
||||
overflow: hidden;
|
||||
padding-right: var(--scrollbar-width);
|
||||
}
|
||||
</style><style type="text/css" data-primevue-style-id="virtualscroller" >
|
||||
@layer primevue {
|
||||
.p-virtualscroller {
|
||||
position: relative;
|
||||
overflow: auto;
|
||||
contain: strict;
|
||||
transform: translateZ(0);
|
||||
will-change: scroll-position;
|
||||
outline: 0 none;
|
||||
}
|
||||
|
||||
.p-virtualscroller-content {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
/* contain: content; */
|
||||
min-height: 100%;
|
||||
min-width: 100%;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
.p-virtualscroller-spacer {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 1px;
|
||||
width: 1px;
|
||||
transform-origin: 0 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.p-virtualscroller .p-virtualscroller-loader {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.p-virtualscroller-loader.p-component-overlay {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.p-virtualscroller-loading-icon {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.p-virtualscroller-loading-icon.p-icon {
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
}
|
||||
|
||||
.p-virtualscroller-horizontal > .p-virtualscroller-content {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* Inline */
|
||||
.p-virtualscroller-inline .p-virtualscroller-content {
|
||||
position: static;
|
||||
}
|
||||
}
|
||||
</style></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4,"once":5},{},false,{},{},["Set"]]</script>
|
||||
<script>window.__NUXT__={};window.__NUXT__.config={public:{primevue:{usePrimeVue:true,resolvePath:"",cssLayerOrder:"tailwind-base, primevue, tailwind-utilities",importPT:"",options:{ripple:true},components:[{name:"AutoComplete",as:"AutoComplete",from:"primevue/autocomplete",export:"default",filePath:"primevue/autocomplete",global:true},{name:"Calendar",as:"Calendar",from:"primevue/calendar",export:"default",filePath:"primevue/calendar",global:true},{name:"CascadeSelect",as:"CascadeSelect",from:"primevue/cascadeselect",export:"default",filePath:"primevue/cascadeselect",global:true},{name:"Checkbox",as:"Checkbox",from:"primevue/checkbox",export:"default",filePath:"primevue/checkbox",global:true},{name:"Chips",as:"Chips",from:"primevue/chips",export:"default",filePath:"primevue/chips",global:true},{name:"ColorPicker",as:"ColorPicker",from:"primevue/colorpicker",export:"default",filePath:"primevue/colorpicker",global:true},{name:"Dropdown",as:"Dropdown",from:"primevue/dropdown",export:"default",filePath:"primevue/dropdown",global:true},{name:"FloatLabel",as:"FloatLabel",from:"primevue/floatlabel",export:"default",filePath:"primevue/floatlabel",global:true},{name:"IconField",as:"IconField",from:"primevue/iconfield",export:"default",filePath:"primevue/iconfield",global:true},{name:"InputGroup",as:"InputGroup",from:"primevue/inputgroup",export:"default",filePath:"primevue/inputgroup",global:true},{name:"InputGroupAddon",as:"InputGroupAddon",from:"primevue/inputgroupaddon",export:"default",filePath:"primevue/inputgroupaddon",global:true},{name:"InputIcon",as:"InputIcon",from:"primevue/inputicon",export:"default",filePath:"primevue/inputicon",global:true},{name:"InputMask",as:"InputMask",from:"primevue/inputmask",export:"default",filePath:"primevue/inputmask",global:true},{name:"InputNumber",as:"InputNumber",from:"primevue/inputnumber",export:"default",filePath:"primevue/inputnumber",global:true},{name:"InputOtp",as:"InputOtp",from:"primevue/inputotp",export:"default",filePath:"primevue/inputotp",global:true},{name:"InputSwitch",as:"InputSwitch",from:"primevue/inputswitch",export:"default",filePath:"primevue/inputswitch",global:true},{name:"InputText",as:"InputText",from:"primevue/inputtext",export:"default",filePath:"primevue/inputtext",global:true},{name:"Knob",as:"Knob",from:"primevue/knob",export:"default",filePath:"primevue/knob",global:true},{name:"Listbox",as:"Listbox",from:"primevue/listbox",export:"default",filePath:"primevue/listbox",global:true},{name:"MultiSelect",as:"MultiSelect",from:"primevue/multiselect",export:"default",filePath:"primevue/multiselect",global:true},{name:"Password",as:"Password",from:"primevue/password",export:"default",filePath:"primevue/password",global:true},{name:"RadioButton",as:"RadioButton",from:"primevue/radiobutton",export:"default",filePath:"primevue/radiobutton",global:true},{name:"Rating",as:"Rating",from:"primevue/rating",export:"default",filePath:"primevue/rating",global:true},{name:"SelectButton",as:"SelectButton",from:"primevue/selectbutton",export:"default",filePath:"primevue/selectbutton",global:true},{name:"Slider",as:"Slider",from:"primevue/slider",export:"default",filePath:"primevue/slider",global:true},{name:"Textarea",as:"Textarea",from:"primevue/textarea",export:"default",filePath:"primevue/textarea",global:true},{name:"ToggleButton",as:"ToggleButton",from:"primevue/togglebutton",export:"default",filePath:"primevue/togglebutton",global:true},{name:"TreeSelect",as:"TreeSelect",from:"primevue/treeselect",export:"default",filePath:"primevue/treeselect",global:true},{name:"TriStateCheckbox",as:"TriStateCheckbox",from:"primevue/tristatecheckbox",export:"default",filePath:"primevue/tristatecheckbox",global:true},{name:"Button",as:"Button",from:"primevue/button",export:"default",filePath:"primevue/button",global:true},{name:"ButtonGroup",as:"ButtonGroup",from:"primevue/buttongroup",export:"default",filePath:"primevue/buttongroup",global:true},{name:"SpeedDial",as:"SpeedDial",from:"primevue/speeddial",export:"default",filePath:"primevue/speeddial",global:true},{name:"SplitButton",as:"SplitButton",from:"primevue/splitbutton",export:"default",filePath:"primevue/splitbutton",global:true},{name:"Column",as:"Column",from:"primevue/column",export:"default",filePath:"primevue/column",global:true},{name:"Row",as:"Row",from:"primevue/row",export:"default",filePath:"primevue/row",global:true},{name:"ColumnGroup",as:"ColumnGroup",from:"primevue/columngroup",export:"default",filePath:"primevue/columngroup",global:true},{name:"DataTable",as:"DataTable",from:"primevue/datatable",export:"default",filePath:"primevue/datatable",global:true},{name:"DataView",as:"DataView",from:"primevue/dataview",export:"default",filePath:"primevue/dataview",global:true},{name:"DataViewLayoutOptions",as:"DataViewLayoutOptions",from:"primevue/dataviewlayoutoptions",export:"default",filePath:"primevue/dataviewlayoutoptions",global:true},{name:"OrderList",as:"OrderList",from:"primevue/orderlist",export:"Line truncated
|
||||
@@ -1,234 +0,0 @@
|
||||
<!DOCTYPE html><html><head><style type="text/css" data-primevue-style-id="layer-order" >@layer tailwind-base, primevue, tailwind-utilities</style><meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Dashboard | WAHA</title>
|
||||
<link id="theme-css" rel="stylesheet" type="text/css" href="/dashboard/themes/lara-dark-green/theme.css">
|
||||
<link rel="icon" type="image/x-icon" href="/dashboard/favicon.ico">
|
||||
<link rel="stylesheet" href="/dashboard/_nuxt/entry.CdRyF6M1.css">
|
||||
<link rel="modulepreload" as="script" crossorigin href="/dashboard/_nuxt/DRtWvKfJ.js">
|
||||
<link rel="prefetch" as="image" type="image/svg+xml" href="/dashboard/_nuxt/primeicons.BubJZjaf.svg">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CmNMiwz3.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cm7Dkme4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CwRw2352.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Bl_ZW1Xh.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B5fdn047.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BMCLKWyE.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DpeyYdwe.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BPIn4_kN.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CELf783E.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CFcFeTBy.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BnGLU8uI.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CSbfZNF6.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DLCKhL4y.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CTyYxNkn.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/r743PZK3.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/G8FENBP4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/GnhOacnB.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Gj9DruUc.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BKuF8g-Y.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D6mOJ75X.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/33ou32AX.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B14_1DDx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D2eV2xTx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B7nXBdam.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D_qICk5i.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/dbkXk2FM.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/gHxUMB3b.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Dvzs3FMW.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cls9geQy.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DSMppbuD.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BMYrlhrg.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Hku5IA12.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/zU1BOWrX.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/ChcErU2V.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CkTkVLD1.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/RfUbfTV3.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CzY8CgE7.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/37NENiMc.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DOsY_IVn.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cw-7pq-7.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/mwds7uJx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DtAtnC1U.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Dgmq9a1E.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CGlsgAZL.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CfFFY47l.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Ca3-bi3b.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CJA3DD2a.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/LqjL8cgW.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BJSv0A8B.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/HF1fbsar.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/POGdjepN.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DF_jK3OP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CLLMBAGk.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/b2TVTf9x.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B8gNdiY1.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CpFoAXuV.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CP0-jfu8.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/7JVgPXr5.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B7DyUdc_.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/1T5oFhIQ.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Bkz4NsfY.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CVFSkoIM.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CS5BvUDo.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BL7cLbn_.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CLYZtMaI.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DVu_lr_n.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cvjjzn6F.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/e47XCw9e.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/fseMLFIf.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DAA892mm.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BQr05V_N.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/C1t5Tk14.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D2IhmS2j.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Ce0F-GHP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/uQ-y24Vd.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B-OEjvS-.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Dh-jSmv_.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BHHly3AA.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BEGul3PF.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/gkxWwNn4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B3LkAbCI.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CVNB3I9A.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cys77vfo.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DQ31lhkw.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D8bzSal1.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B1c-crdP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/rlYL6_u-.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/jC3uBuQA.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DMsZhJAp.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BjAXeOBb.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Dg_46Ljg.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/ZYKRgrtt.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Db4mELQW.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Djls7KqP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/eMP3SzX4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CDQwIvYz.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/qKtqUDpn.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/p4OZ13Rt.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/0XIOL7f-.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/nMqNs1WI.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/WUTkRygV.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D-MZziVS.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/16cy-3pL.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CmQzOt0X.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BzR4Bpo5.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cbk6LDlc.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DMpQ2VjP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/KMkrkpbk.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CTNwIyJm.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Ccp8DHy1.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D2OvdbTk.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BUWX4M_G.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/lgpgYudh.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BYI5e787.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CyrprVen.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/_99QGe7X.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/3aQOlzix.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/C6c3wBd4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CHvp0DM_.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BfPKB-F8.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/e2o5KJyy.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CZfe2Sfn.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BVlqpfGd.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CaXCK0Oi.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/yXaOlmbx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CVYvFl41.js">
|
||||
<link rel="prefetch" as="style" href="/dashboard/_nuxt/useServerStore.DWEvhDiM.css">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BidU6Jgh.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/VJFiI_rq.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/lXe9j5XU.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B_5QcCB8.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B-WZqzsx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/XrWOLLJc.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BbcatXLp.js">
|
||||
<link rel="prefetch" as="style" href="/dashboard/_nuxt/error-404.JekaaCis.css">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/cRLLwgqB.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D0FGFGTv.js">
|
||||
<link rel="prefetch" as="style" href="/dashboard/_nuxt/error-500.CNP9nqm1.css">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/C4Twg9_6.js">
|
||||
<script type="module" src="/dashboard/_nuxt/DRtWvKfJ.js" crossorigin></script>
|
||||
<script id="unhead:payload" type="application/json">{"title":"Dashboard | WAHA"}</script><style type="text/css" data-primevue-style-id="base" >
|
||||
.p-hidden-accessible {
|
||||
border: 0;
|
||||
clip: rect(0 0 0 0);
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
}
|
||||
|
||||
.p-hidden-accessible input,
|
||||
.p-hidden-accessible select {
|
||||
transform: scale(0);
|
||||
}
|
||||
|
||||
.p-overflow-hidden {
|
||||
overflow: hidden;
|
||||
padding-right: var(--scrollbar-width);
|
||||
}
|
||||
</style><style type="text/css" data-primevue-style-id="virtualscroller" >
|
||||
@layer primevue {
|
||||
.p-virtualscroller {
|
||||
position: relative;
|
||||
overflow: auto;
|
||||
contain: strict;
|
||||
transform: translateZ(0);
|
||||
will-change: scroll-position;
|
||||
outline: 0 none;
|
||||
}
|
||||
|
||||
.p-virtualscroller-content {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
/* contain: content; */
|
||||
min-height: 100%;
|
||||
min-width: 100%;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
.p-virtualscroller-spacer {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 1px;
|
||||
width: 1px;
|
||||
transform-origin: 0 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.p-virtualscroller .p-virtualscroller-loader {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.p-virtualscroller-loader.p-component-overlay {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.p-virtualscroller-loading-icon {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.p-virtualscroller-loading-icon.p-icon {
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
}
|
||||
|
||||
.p-virtualscroller-horizontal > .p-virtualscroller-content {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* Inline */
|
||||
.p-virtualscroller-inline .p-virtualscroller-content {
|
||||
position: static;
|
||||
}
|
||||
}
|
||||
</style></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4,"once":5},{},false,{},{},["Set"]]</script>
|
||||
<script>window.__NUXT__={};window.__NUXT__.config={public:{primevue:{usePrimeVue:true,resolvePath:"",cssLayerOrder:"tailwind-base, primevue, tailwind-utilities",importPT:"",options:{ripple:true},components:[{name:"AutoComplete",as:"AutoComplete",from:"primevue/autocomplete",export:"default",filePath:"primevue/autocomplete",global:true},{name:"Calendar",as:"Calendar",from:"primevue/calendar",export:"default",filePath:"primevue/calendar",global:true},{name:"CascadeSelect",as:"CascadeSelect",from:"primevue/cascadeselect",export:"default",filePath:"primevue/cascadeselect",global:true},{name:"Checkbox",as:"Checkbox",from:"primevue/checkbox",export:"default",filePath:"primevue/checkbox",global:true},{name:"Chips",as:"Chips",from:"primevue/chips",export:"default",filePath:"primevue/chips",global:true},{name:"ColorPicker",as:"ColorPicker",from:"primevue/colorpicker",export:"default",filePath:"primevue/colorpicker",global:true},{name:"Dropdown",as:"Dropdown",from:"primevue/dropdown",export:"default",filePath:"primevue/dropdown",global:true},{name:"FloatLabel",as:"FloatLabel",from:"primevue/floatlabel",export:"default",filePath:"primevue/floatlabel",global:true},{name:"IconField",as:"IconField",from:"primevue/iconfield",export:"default",filePath:"primevue/iconfield",global:true},{name:"InputGroup",as:"InputGroup",from:"primevue/inputgroup",export:"default",filePath:"primevue/inputgroup",global:true},{name:"InputGroupAddon",as:"InputGroupAddon",from:"primevue/inputgroupaddon",export:"default",filePath:"primevue/inputgroupaddon",global:true},{name:"InputIcon",as:"InputIcon",from:"primevue/inputicon",export:"default",filePath:"primevue/inputicon",global:true},{name:"InputMask",as:"InputMask",from:"primevue/inputmask",export:"default",filePath:"primevue/inputmask",global:true},{name:"InputNumber",as:"InputNumber",from:"primevue/inputnumber",export:"default",filePath:"primevue/inputnumber",global:true},{name:"InputOtp",as:"InputOtp",from:"primevue/inputotp",export:"default",filePath:"primevue/inputotp",global:true},{name:"InputSwitch",as:"InputSwitch",from:"primevue/inputswitch",export:"default",filePath:"primevue/inputswitch",global:true},{name:"InputText",as:"InputText",from:"primevue/inputtext",export:"default",filePath:"primevue/inputtext",global:true},{name:"Knob",as:"Knob",from:"primevue/knob",export:"default",filePath:"primevue/knob",global:true},{name:"Listbox",as:"Listbox",from:"primevue/listbox",export:"default",filePath:"primevue/listbox",global:true},{name:"MultiSelect",as:"MultiSelect",from:"primevue/multiselect",export:"default",filePath:"primevue/multiselect",global:true},{name:"Password",as:"Password",from:"primevue/password",export:"default",filePath:"primevue/password",global:true},{name:"RadioButton",as:"RadioButton",from:"primevue/radiobutton",export:"default",filePath:"primevue/radiobutton",global:true},{name:"Rating",as:"Rating",from:"primevue/rating",export:"default",filePath:"primevue/rating",global:true},{name:"SelectButton",as:"SelectButton",from:"primevue/selectbutton",export:"default",filePath:"primevue/selectbutton",global:true},{name:"Slider",as:"Slider",from:"primevue/slider",export:"default",filePath:"primevue/slider",global:true},{name:"Textarea",as:"Textarea",from:"primevue/textarea",export:"default",filePath:"primevue/textarea",global:true},{name:"ToggleButton",as:"ToggleButton",from:"primevue/togglebutton",export:"default",filePath:"primevue/togglebutton",global:true},{name:"TreeSelect",as:"TreeSelect",from:"primevue/treeselect",export:"default",filePath:"primevue/treeselect",global:true},{name:"TriStateCheckbox",as:"TriStateCheckbox",from:"primevue/tristatecheckbox",export:"default",filePath:"primevue/tristatecheckbox",global:true},{name:"Button",as:"Button",from:"primevue/button",export:"default",filePath:"primevue/button",global:true},{name:"ButtonGroup",as:"ButtonGroup",from:"primevue/buttongroup",export:"default",filePath:"primevue/buttongroup",global:true},{name:"SpeedDial",as:"SpeedDial",from:"primevue/speeddial",export:"default",filePath:"primevue/speeddial",global:true},{name:"SplitButton",as:"SplitButton",from:"primevue/splitbutton",export:"default",filePath:"primevue/splitbutton",global:true},{name:"Column",as:"Column",from:"primevue/column",export:"default",filePath:"primevue/column",global:true},{name:"Row",as:"Row",from:"primevue/row",export:"default",filePath:"primevue/row",global:true},{name:"ColumnGroup",as:"ColumnGroup",from:"primevue/columngroup",export:"default",filePath:"primevue/columngroup",global:true},{name:"DataTable",as:"DataTable",from:"primevue/datatable",export:"default",filePath:"primevue/datatable",global:true},{name:"DataView",as:"DataView",from:"primevue/dataview",export:"default",filePath:"primevue/dataview",global:true},{name:"DataViewLayoutOptions",as:"DataViewLayoutOptions",from:"primevue/dataviewlayoutoptions",export:"default",filePath:"primevue/dataviewlayoutoptions",global:true},{name:"OrderList",as:"OrderList",from:"primevue/orderlist",export:"Line truncated
|
||||
@@ -1,234 +0,0 @@
|
||||
<!DOCTYPE html><html><head><style type="text/css" data-primevue-style-id="layer-order" >@layer tailwind-base, primevue, tailwind-utilities</style><meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Dashboard | WAHA</title>
|
||||
<link id="theme-css" rel="stylesheet" type="text/css" href="/dashboard/themes/lara-dark-green/theme.css">
|
||||
<link rel="icon" type="image/x-icon" href="/dashboard/favicon.ico">
|
||||
<link rel="stylesheet" href="/dashboard/_nuxt/entry.CdRyF6M1.css">
|
||||
<link rel="modulepreload" as="script" crossorigin href="/dashboard/_nuxt/DRtWvKfJ.js">
|
||||
<link rel="prefetch" as="image" type="image/svg+xml" href="/dashboard/_nuxt/primeicons.BubJZjaf.svg">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CmNMiwz3.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cm7Dkme4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CwRw2352.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Bl_ZW1Xh.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B5fdn047.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BMCLKWyE.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DpeyYdwe.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BPIn4_kN.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CELf783E.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CFcFeTBy.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BnGLU8uI.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CSbfZNF6.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DLCKhL4y.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CTyYxNkn.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/r743PZK3.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/G8FENBP4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/GnhOacnB.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Gj9DruUc.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BKuF8g-Y.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D6mOJ75X.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/33ou32AX.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B14_1DDx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D2eV2xTx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B7nXBdam.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D_qICk5i.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/dbkXk2FM.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/gHxUMB3b.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Dvzs3FMW.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cls9geQy.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DSMppbuD.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BMYrlhrg.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Hku5IA12.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/zU1BOWrX.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/ChcErU2V.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CkTkVLD1.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/RfUbfTV3.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CzY8CgE7.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/37NENiMc.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DOsY_IVn.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cw-7pq-7.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/mwds7uJx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DtAtnC1U.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Dgmq9a1E.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CGlsgAZL.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CfFFY47l.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Ca3-bi3b.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CJA3DD2a.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/LqjL8cgW.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BJSv0A8B.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/HF1fbsar.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/POGdjepN.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DF_jK3OP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CLLMBAGk.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/b2TVTf9x.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B8gNdiY1.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CpFoAXuV.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CP0-jfu8.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/7JVgPXr5.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B7DyUdc_.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/1T5oFhIQ.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Bkz4NsfY.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CVFSkoIM.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CS5BvUDo.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BL7cLbn_.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CLYZtMaI.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DVu_lr_n.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cvjjzn6F.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/e47XCw9e.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/fseMLFIf.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DAA892mm.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BQr05V_N.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/C1t5Tk14.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D2IhmS2j.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Ce0F-GHP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/uQ-y24Vd.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B-OEjvS-.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Dh-jSmv_.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BHHly3AA.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BEGul3PF.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/gkxWwNn4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B3LkAbCI.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CVNB3I9A.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cys77vfo.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DQ31lhkw.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D8bzSal1.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B1c-crdP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/rlYL6_u-.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/jC3uBuQA.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DMsZhJAp.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BjAXeOBb.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Dg_46Ljg.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/ZYKRgrtt.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Db4mELQW.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Djls7KqP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/eMP3SzX4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CDQwIvYz.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/qKtqUDpn.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/p4OZ13Rt.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/0XIOL7f-.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/nMqNs1WI.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/WUTkRygV.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D-MZziVS.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/16cy-3pL.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CmQzOt0X.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BzR4Bpo5.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Cbk6LDlc.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/DMpQ2VjP.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/KMkrkpbk.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CTNwIyJm.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/Ccp8DHy1.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D2OvdbTk.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BUWX4M_G.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/lgpgYudh.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BYI5e787.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CyrprVen.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/_99QGe7X.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/3aQOlzix.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/C6c3wBd4.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CHvp0DM_.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BfPKB-F8.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/e2o5KJyy.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CZfe2Sfn.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BVlqpfGd.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CaXCK0Oi.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/yXaOlmbx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/CVYvFl41.js">
|
||||
<link rel="prefetch" as="style" href="/dashboard/_nuxt/useServerStore.DWEvhDiM.css">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BidU6Jgh.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/VJFiI_rq.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/lXe9j5XU.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B_5QcCB8.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/B-WZqzsx.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/XrWOLLJc.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/BbcatXLp.js">
|
||||
<link rel="prefetch" as="style" href="/dashboard/_nuxt/error-404.JekaaCis.css">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/cRLLwgqB.js">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/D0FGFGTv.js">
|
||||
<link rel="prefetch" as="style" href="/dashboard/_nuxt/error-500.CNP9nqm1.css">
|
||||
<link rel="prefetch" as="script" crossorigin href="/dashboard/_nuxt/C4Twg9_6.js">
|
||||
<script type="module" src="/dashboard/_nuxt/DRtWvKfJ.js" crossorigin></script>
|
||||
<script id="unhead:payload" type="application/json">{"title":"Dashboard | WAHA"}</script><style type="text/css" data-primevue-style-id="base" >
|
||||
.p-hidden-accessible {
|
||||
border: 0;
|
||||
clip: rect(0 0 0 0);
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
}
|
||||
|
||||
.p-hidden-accessible input,
|
||||
.p-hidden-accessible select {
|
||||
transform: scale(0);
|
||||
}
|
||||
|
||||
.p-overflow-hidden {
|
||||
overflow: hidden;
|
||||
padding-right: var(--scrollbar-width);
|
||||
}
|
||||
</style><style type="text/css" data-primevue-style-id="virtualscroller" >
|
||||
@layer primevue {
|
||||
.p-virtualscroller {
|
||||
position: relative;
|
||||
overflow: auto;
|
||||
contain: strict;
|
||||
transform: translateZ(0);
|
||||
will-change: scroll-position;
|
||||
outline: 0 none;
|
||||
}
|
||||
|
||||
.p-virtualscroller-content {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
/* contain: content; */
|
||||
min-height: 100%;
|
||||
min-width: 100%;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
.p-virtualscroller-spacer {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 1px;
|
||||
width: 1px;
|
||||
transform-origin: 0 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.p-virtualscroller .p-virtualscroller-loader {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.p-virtualscroller-loader.p-component-overlay {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.p-virtualscroller-loading-icon {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.p-virtualscroller-loading-icon.p-icon {
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
}
|
||||
|
||||
.p-virtualscroller-horizontal > .p-virtualscroller-content {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* Inline */
|
||||
.p-virtualscroller-inline .p-virtualscroller-content {
|
||||
position: static;
|
||||
}
|
||||
}
|
||||
</style></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4,"once":5},{},false,{},{},["Set"]]</script>
|
||||
<script>window.__NUXT__={};window.__NUXT__.config={public:{primevue:{usePrimeVue:true,resolvePath:"",cssLayerOrder:"tailwind-base, primevue, tailwind-utilities",importPT:"",options:{ripple:true},components:[{name:"AutoComplete",as:"AutoComplete",from:"primevue/autocomplete",export:"default",filePath:"primevue/autocomplete",global:true},{name:"Calendar",as:"Calendar",from:"primevue/calendar",export:"default",filePath:"primevue/calendar",global:true},{name:"CascadeSelect",as:"CascadeSelect",from:"primevue/cascadeselect",export:"default",filePath:"primevue/cascadeselect",global:true},{name:"Checkbox",as:"Checkbox",from:"primevue/checkbox",export:"default",filePath:"primevue/checkbox",global:true},{name:"Chips",as:"Chips",from:"primevue/chips",export:"default",filePath:"primevue/chips",global:true},{name:"ColorPicker",as:"ColorPicker",from:"primevue/colorpicker",export:"default",filePath:"primevue/colorpicker",global:true},{name:"Dropdown",as:"Dropdown",from:"primevue/dropdown",export:"default",filePath:"primevue/dropdown",global:true},{name:"FloatLabel",as:"FloatLabel",from:"primevue/floatlabel",export:"default",filePath:"primevue/floatlabel",global:true},{name:"IconField",as:"IconField",from:"primevue/iconfield",export:"default",filePath:"primevue/iconfield",global:true},{name:"InputGroup",as:"InputGroup",from:"primevue/inputgroup",export:"default",filePath:"primevue/inputgroup",global:true},{name:"InputGroupAddon",as:"InputGroupAddon",from:"primevue/inputgroupaddon",export:"default",filePath:"primevue/inputgroupaddon",global:true},{name:"InputIcon",as:"InputIcon",from:"primevue/inputicon",export:"default",filePath:"primevue/inputicon",global:true},{name:"InputMask",as:"InputMask",from:"primevue/inputmask",export:"default",filePath:"primevue/inputmask",global:true},{name:"InputNumber",as:"InputNumber",from:"primevue/inputnumber",export:"default",filePath:"primevue/inputnumber",global:true},{name:"InputOtp",as:"InputOtp",from:"primevue/inputotp",export:"default",filePath:"primevue/inputotp",global:true},{name:"InputSwitch",as:"InputSwitch",from:"primevue/inputswitch",export:"default",filePath:"primevue/inputswitch",global:true},{name:"InputText",as:"InputText",from:"primevue/inputtext",export:"default",filePath:"primevue/inputtext",global:true},{name:"Knob",as:"Knob",from:"primevue/knob",export:"default",filePath:"primevue/knob",global:true},{name:"Listbox",as:"Listbox",from:"primevue/listbox",export:"default",filePath:"primevue/listbox",global:true},{name:"MultiSelect",as:"MultiSelect",from:"primevue/multiselect",export:"default",filePath:"primevue/multiselect",global:true},{name:"Password",as:"Password",from:"primevue/password",export:"default",filePath:"primevue/password",global:true},{name:"RadioButton",as:"RadioButton",from:"primevue/radiobutton",export:"default",filePath:"primevue/radiobutton",global:true},{name:"Rating",as:"Rating",from:"primevue/rating",export:"default",filePath:"primevue/rating",global:true},{name:"SelectButton",as:"SelectButton",from:"primevue/selectbutton",export:"default",filePath:"primevue/selectbutton",global:true},{name:"Slider",as:"Slider",from:"primevue/slider",export:"default",filePath:"primevue/slider",global:true},{name:"Textarea",as:"Textarea",from:"primevue/textarea",export:"default",filePath:"primevue/textarea",global:true},{name:"ToggleButton",as:"ToggleButton",from:"primevue/togglebutton",export:"default",filePath:"primevue/togglebutton",global:true},{name:"TreeSelect",as:"TreeSelect",from:"primevue/treeselect",export:"default",filePath:"primevue/treeselect",global:true},{name:"TriStateCheckbox",as:"TriStateCheckbox",from:"primevue/tristatecheckbox",export:"default",filePath:"primevue/tristatecheckbox",global:true},{name:"Button",as:"Button",from:"primevue/button",export:"default",filePath:"primevue/button",global:true},{name:"ButtonGroup",as:"ButtonGroup",from:"primevue/buttongroup",export:"default",filePath:"primevue/buttongroup",global:true},{name:"SpeedDial",as:"SpeedDial",from:"primevue/speeddial",export:"default",filePath:"primevue/speeddial",global:true},{name:"SplitButton",as:"SplitButton",from:"primevue/splitbutton",export:"default",filePath:"primevue/splitbutton",global:true},{name:"Column",as:"Column",from:"primevue/column",export:"default",filePath:"primevue/column",global:true},{name:"Row",as:"Row",from:"primevue/row",export:"default",filePath:"primevue/row",global:true},{name:"ColumnGroup",as:"ColumnGroup",from:"primevue/columngroup",export:"default",filePath:"primevue/columngroup",global:true},{name:"DataTable",as:"DataTable",from:"primevue/datatable",export:"default",filePath:"primevue/datatable",global:true},{name:"DataView",as:"DataView",from:"primevue/dataview",export:"default",filePath:"primevue/dataview",global:true},{name:"DataViewLayoutOptions",as:"DataViewLayoutOptions",from:"primevue/dataviewlayoutoptions",export:"default",filePath:"primevue/dataviewlayoutoptions",global:true},{name:"OrderList",as:"OrderList",from:"primevue/orderlist",export:"Line truncated
|
||||
@@ -1 +0,0 @@
|
||||
import{s as S}from"./CFcFeTBy.js";import{a3 as F,a5 as V,a4 as d,a6 as x,a7 as m,aa as l,a9 as D,i as y,Z as T,t as u,P as v,A as k,v as I,N as L,Q as O,x as K,$ as z,ab as P,W as C,O as g,y as R,ac as E,z as M}from"./DRtWvKfJ.js";import{s as w}from"./Bl_ZW1Xh.js";import{s as N}from"./GnhOacnB.js";import"./BMCLKWyE.js";var B={root:function(e){var t=e.instance;return["p-contextmenu p-component",{"p-ripple-disabled":t.$primevue.config.ripple===!1}]},menu:"p-contextmenu-root-list",menuitem:function(e){var t=e.instance,a=e.processedItem;return["p-menuitem",{"p-menuitem-active p-highlight":t.isItemActive(a),"p-focus":t.isItemFocused(a),"p-disabled":t.isItemDisabled(a)}]},content:"p-menuitem-content",action:"p-menuitem-link",icon:"p-menuitem-icon",label:"p-menuitem-text",submenuIcon:"p-submenu-icon",submenu:"p-submenu-list",separator:"p-menuitem-separator"},_=F.extend({name:"contextmenu",classes:B}),G={name:"BaseContextMenu",extends:w,props:{model:{type:Array,default:null},appendTo:{type:[String,Object],default:"body"},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},global:{type:Boolean,default:!1},tabindex:{type:Number,default:0},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:_,provide:function(){return{$parentInstance:this}}},A={name:"ContextMenuSub",hostName:"ContextMenu",extends:w,emits:["item-click","item-mouseenter","item-mousemove"],props:{items:{type:Array,default:null},menuId:{type:String,default:null},focusedItemId:{type:String,default:null},root:{type:Boolean,default:!1},visible:{type:Boolean,default:!1},level:{type:Number,default:0},templates:{type:Object,default:null},activeItemPath:{type:Object,default:null},tabindex:{type:Number,default:0}},methods:{getItemId:function(e){return"".concat(this.menuId,"_").concat(e.key)},getItemKey:function(e){return this.getItemId(e)},getItemProp:function(e,t,a){return e&&e.item?d.getItemValue(e.item[t],a):void 0},getItemLabel:function(e){return this.getItemProp(e,"label")},getItemLabelId:function(e){return"".concat(this.menuId,"_").concat(e.key,"_label")},getPTOptions:function(e,t,a){return this.ptm(e,{context:{item:t,active:this.isItemActive(t),focused:this.isItemFocused(t),disabled:this.isItemDisabled(t),index:a}})},isItemActive:function(e){return this.activeItemPath.some(function(t){return t.key===e.key})},isItemVisible:function(e){return this.getItemProp(e,"visible")!==!1},isItemDisabled:function(e){return this.getItemProp(e,"disabled")},isItemFocused:function(e){return this.focusedItemId===this.getItemId(e)},isItemGroup:function(e){return d.isNotEmpty(e.items)},onItemClick:function(e,t){this.getItemProp(t,"command",{originalEvent:e,item:t.item}),this.$emit("item-click",{originalEvent:e,processedItem:t,isFocus:!0})},onItemMouseEnter:function(e,t){this.$emit("item-mouseenter",{originalEvent:e,processedItem:t})},onItemMouseMove:function(e,t){this.$emit("item-mousemove",{originalEvent:e,processedItem:t,isFocus:!0})},getAriaSetSize:function(){var e=this;return this.items.filter(function(t){return e.isItemVisible(t)&&!e.getItemProp(t,"separator")}).length},getAriaPosInset:function(e){var t=this;return e-this.items.slice(0,e).filter(function(a){return t.isItemVisible(a)&&t.getItemProp(a,"separator")}).length+1},onEnter:function(){m.nestedPosition(this.$refs.container,this.level)},getMenuItemProps:function(e,t){return{action:l({class:this.cx("action"),tabindex:-1,"aria-hidden":!0},this.getPTOptions("action",e,t)),icon:l({class:[this.cx("icon"),this.getItemProp(e,"icon")]},this.getPTOptions("icon",e,t)),label:l({class:this.cx("label")},this.getPTOptions("label",e,t)),submenuicon:l({class:this.cx("submenuIcon")},this.getPTOptions("submenuicon",e,t))}}},components:{AngleRightIcon:N},directives:{ripple:D}},U=["tabindex"],H=["id","aria-label","aria-disabled","aria-expanded","aria-haspopup","aria-level","aria-setsize","aria-posinset","data-p-highlight","data-p-focused","data-p-disabled"],Z=["onClick","onMouseenter","onMousemove"],W=["href","target"],j=["id"],X=["id"];function Y(i,e,t,a,r,n){var o=y("AngleRightIcon"),h=y("ContextMenuSub",!0),b=T("ripple");return u(),v(E,l({name:"p-contextmenusub",onEnter:n.onEnter},i.ptm("menu.transition")),{default:k(function(){return[t.root||t.visible?(u(),I("ul",l({key:0,ref:"container",tabindex:t.tabindex},i.ptm("menu")),[(u(!0),I(L,null,O(t.items,function(s,c){return u(),I(L,{key:n.getItemKey(s)},[n.isItemVisible(s)&&!n.getItemProp(s,"separator")?(u(),I("li",l({key:0,id:n.getItemId(s),style:n.getItemProp(s,"style"),class:[i.cx("menuitem",{processedItem:s}),n.getItemProp(s,"class")],role:"menuitem","aria-label":n.getItemLabel(s),"aria-disabled":n.isItemDisabled(s)||void 0,"aria-expanded":n.isItemGroup(s)?n.isItemActive(s):void 0,"aria-haspopup":n.isItemGroup(s)&&!n.getItemProp(s,"to")?"menu":void 0,"aria-level":t.level+1,"aria-setsize":n.getAriaSetSize(),"aria-posinset":n.getAriaPosInset(c)},n.getPTOptions("menuitem",s,c),{"data-p-highlight":n.isItemActive(s),"data-p-focused"Line truncated
|
||||
@@ -1 +0,0 @@
|
||||
import{s as V}from"./CS5BvUDo.js";import{a3 as z,a5 as D,a4 as m,a6 as M,a7 as b,aa as c,a9 as N,i as K,Z as O,t as l,v as d,y as A,O as g,N as y,Q as x,x as P,$ as T,P as p,W as E,ab as k,aD as B,Y as L,z as S,ae as R,af as G}from"./DRtWvKfJ.js";import{s as F}from"./Bl_ZW1Xh.js";import{s as U}from"./Hku5IA12.js";import{s as H}from"./GnhOacnB.js";import"./BMCLKWyE.js";var q={submenu:function(e){var i=e.instance,s=e.processedItem;return{display:i.isItemActive(s)?"block":"none"}}},j={root:function(e){var i=e.instance;return["p-megamenu p-component",{"p-megamenu-mobile":i.queryMatches,"p-megamenu-mobile-active":i.mobileActive,"p-megamenu-horizontal":i.horizontal,"p-megamenu-vertical":i.vertical}]},start:"p-megamenu-start",menubutton:"p-megamenu-button",menu:"p-megamenu-root-list",submenuHeader:function(e){var i=e.instance,s=e.processedItem;return["p-megamenu-submenu-header p-submenu-header",{"p-disabled":i.isItemDisabled(s)}]},menuitem:function(e){var i=e.instance,s=e.processedItem;return["p-menuitem",{"p-menuitem-active p-highlight":i.isItemActive(s),"p-focus":i.isItemFocused(s),"p-disabled":i.isItemDisabled(s)}]},content:"p-menuitem-content",action:"p-menuitem-link",icon:"p-menuitem-icon",label:"p-menuitem-text",submenuIcon:"p-submenu-icon",panel:"p-megamenu-panel",grid:"p-megamenu-grid",column:function(e){var i=e.instance,s=e.processedItem,r=i.isItemGroup(s)?s.items.length:0,n;if(i.$parentInstance.queryMatches)n="p-megamenu-col-12";else switch(r){case 2:n="p-megamenu-col-6";break;case 3:n="p-megamenu-col-4";break;case 4:n="p-megamenu-col-3";break;case 6:n="p-megamenu-col-2";break;default:n="p-megamenu-col-12";break}return n},submenu:"p-submenu-list p-megamenu-submenu",submenuLabel:"p-menuitem-text",separator:"p-menuitem-separator",end:"p-megamenu-end"},W=z.extend({name:"megamenu",classes:j,inlineStyles:q}),Z={name:"BaseMegaMenu",extends:F,props:{model:{type:Array,default:null},orientation:{type:String,default:"horizontal"},breakpoint:{type:String,default:"960px"},disabled:{type:Boolean,default:!1},tabindex:{type:Number,default:0},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:W,provide:function(){return{$parentInstance:this}}},w={name:"MegaMenuSub",hostName:"MegaMenu",extends:F,emits:["item-click","item-mouseenter"],props:{menuId:{type:String,default:null},focusedItemId:{type:String,default:null},horizontal:{type:Boolean,default:!1},submenu:{type:Object,default:null},mobileActive:{type:Boolean,default:!1},items:{type:Array,default:null},level:{type:Number,default:0},templates:{type:Object,default:null},activeItem:{type:Object,default:null},tabindex:{type:Number,default:0}},methods:{getSubListId:function(e){return"".concat(this.getItemId(e),"_list")},getSubListKey:function(e){return this.getSubListId(e)},getItemId:function(e){return"".concat(this.menuId,"_").concat(e.key)},getItemKey:function(e){return this.getItemId(e)},getItemProp:function(e,i,s){return e&&e.item?m.getItemValue(e.item[i],s):void 0},getItemLabel:function(e){return this.getItemProp(e,"label")},getPTOptions:function(e,i,s){return this.ptm(s,{context:{item:e,index:i,active:this.isItemActive(e),focused:this.isItemFocused(e),disabled:this.isItemDisabled(e)}})},isItemActive:function(e){return m.isNotEmpty(this.activeItem)?this.activeItem.key===e.key:!1},isItemVisible:function(e){return this.getItemProp(e,"visible")!==!1},isItemDisabled:function(e){return this.getItemProp(e,"disabled")},isItemFocused:function(e){return this.focusedItemId===this.getItemId(e)},isItemGroup:function(e){return m.isNotEmpty(e.items)},onItemClick:function(e,i){this.getItemProp(i,"command",{originalEvent:e,item:i.item}),this.$emit("item-click",{originalEvent:e,processedItem:i,isFocus:!0})},onItemMouseEnter:function(e,i){this.$emit("item-mouseenter",{originalEvent:e,processedItem:i})},getAriaSetSize:function(){var e=this;return this.items.filter(function(i){return e.isItemVisible(i)&&!e.getItemProp(i,"separator")}).length},getAriaPosInset:function(e){var i=this;return e-this.items.slice(0,e).filter(function(s){return i.isItemVisible(s)&&i.getItemProp(s,"separator")}).length+1},getMenuItemProps:function(e,i){return{action:c({class:this.cx("action"),tabindex:-1,"aria-hidden":!0},this.getPTOptions(e,i,"action")),icon:c({class:[this.cx("icon"),this.getItemProp(e,"icon")]},this.getPTOptions(e,i,"icon")),label:c({class:this.cx("label")},this.getPTOptions(e,i,"label")),submenuicon:c({class:this.cx("submenuIcon")},this.getPTOptions(e,i,"submenuIcon"))}}},components:{AngleRightIcon:H,AngleDownIcon:U},directives:{ripple:N}},Q=["tabindex"],Y=["id","aria-label","aria-disabled","aria-expanded","aria-haspopup","aria-level","aria-setsize","aria-posinset","data-p-highlight","data-p-focused","data-p-disabled"],J=["onClick","onMouseenter"],X=["href","target"],_=["id"];function $(t,e,i,s,r,n){var o=K("MegaMenuSub",!0),h=O("ripple");return l(),d("ul",c({class:i.level===0?t.cx("menu"):t.cx("submenu"),tabindex:i.tabindex},i.level===0?t.ptm("menu"):t.ptm("Line truncated
|
||||
@@ -1,48 +0,0 @@
|
||||
import{t as s,v as m,aa as f,x as O,a3 as ft,aw as W,a4 as b,a7 as p,a2 as ue,ah as be,V as Ce,a5 as de,i as R,P as w,A as E,ab as C,W as S,O as v,a9 as pt,Z as Ue,y as H,N as P,$ as Z,B as qe,aj as Ze,Q as L,a6 as fe,a8 as mt,av as ht,ae as se,af as pe,z as A,ac as gt,ag as me,Y as k,a1 as Re}from"./DRtWvKfJ.js";import{s as U}from"./BMCLKWyE.js";import{s as yt}from"./B5fdn047.js";import wt from"./Bkz4NsfY.js";import vt from"./BnGLU8uI.js";import{s as F}from"./Bl_ZW1Xh.js";import{s as Xe}from"./DpeyYdwe.js";import{s as Je}from"./CTyYxNkn.js";import{s as bt}from"./CS5BvUDo.js";import{s as ge}from"./BKuF8g-Y.js";import{s as Ct}from"./B7nXBdam.js";import{O as K}from"./CELf783E.js";import Ye from"./Gj9DruUc.js";import Rt from"./DtAtnC1U.js";import St from"./Cm7Dkme4.js";import Pt from"./B14_1DDx.js";import{s as Mt}from"./b2TVTf9x.js";import{s as Et}from"./CFcFeTBy.js";import{s as Se,a as Pe,b as Me}from"./BL7cLbn_.js";import"./CVFSkoIM.js";import"./BMYrlhrg.js";import"./Hku5IA12.js";import"./zU1BOWrX.js";import"./ChcErU2V.js";import"./GnhOacnB.js";import"./CwRw2352.js";import"./D2eV2xTx.js";var Qe={name:"ArrowDownIcon",extends:U},kt=O("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.99994 14C6.91097 14.0004 6.82281 13.983 6.74064 13.9489C6.65843 13.9148 6.58387 13.8646 6.52133 13.8013L1.10198 8.38193C0.982318 8.25351 0.917175 8.08367 0.920272 7.90817C0.923368 7.73267 0.994462 7.56523 1.11858 7.44111C1.24269 7.317 1.41014 7.2459 1.58563 7.2428C1.76113 7.23971 1.93098 7.30485 2.0594 7.42451L6.32263 11.6877V0.677419C6.32263 0.497756 6.394 0.325452 6.52104 0.198411C6.64808 0.0713706 6.82039 0 7.00005 0C7.17971 0 7.35202 0.0713706 7.47906 0.198411C7.6061 0.325452 7.67747 0.497756 7.67747 0.677419V11.6877L11.9407 7.42451C12.0691 7.30485 12.2389 7.23971 12.4144 7.2428C12.5899 7.2459 12.7574 7.317 12.8815 7.44111C13.0056 7.56523 13.0767 7.73267 13.0798 7.90817C13.0829 8.08367 13.0178 8.25351 12.8981 8.38193L7.47875 13.8013C7.41621 13.8646 7.34164 13.9148 7.25944 13.9489C7.17727 13.983 7.08912 14.0004 7.00015 14C7.00012 14 7.00009 14 7.00005 14C7.00001 14 6.99998 14 6.99994 14Z",fill:"currentColor"},null,-1),Ot=[kt];function Dt(n,e,t,o,i,r){return s(),m("svg",f({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.pti()),Ot,16)}Qe.render=Dt;var $e={name:"ArrowUpIcon",extends:U},It=O("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.51551 13.799C6.64205 13.9255 6.813 13.9977 6.99193 14C7.17087 13.9977 7.34182 13.9255 7.46835 13.799C7.59489 13.6725 7.66701 13.5015 7.66935 13.3226V2.31233L11.9326 6.57554C11.9951 6.63887 12.0697 6.68907 12.1519 6.72319C12.2341 6.75731 12.3223 6.77467 12.4113 6.77425C12.5003 6.77467 12.5885 6.75731 12.6707 6.72319C12.7529 6.68907 12.8274 6.63887 12.89 6.57554C13.0168 6.44853 13.0881 6.27635 13.0881 6.09683C13.0881 5.91732 13.0168 5.74514 12.89 5.61812L7.48846 0.216594C7.48274 0.210436 7.4769 0.204374 7.47094 0.198411C7.3439 0.0713707 7.1716 0 6.99193 0C6.81227 0 6.63997 0.0713707 6.51293 0.198411C6.50704 0.204296 6.50128 0.210278 6.49563 0.216354L1.09386 5.61812C0.974201 5.74654 0.909057 5.91639 0.912154 6.09189C0.91525 6.26738 0.986345 6.43483 1.11046 6.55894C1.23457 6.68306 1.40202 6.75415 1.57752 6.75725C1.75302 6.76035 1.92286 6.6952 2.05128 6.57554L6.31451 2.31231V13.3226C6.31685 13.5015 6.38898 13.6725 6.51551 13.799Z",fill:"currentColor"},null,-1),Tt=[It];function xt(n,e,t,o,i,r){return s(),m("svg",f({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.pti()),Tt,16)}$e.render=xt;var Ft={root:function(e){var t=e.instance,o=e.props;return["p-datatable p-component",{"p-datatable-hoverable-rows":o.rowHover||o.selectionMode,"p-datatable-resizable":o.resizableColumns,"p-datatable-resizable-fit":o.resizableColumns&&o.columnResizeMode==="fit","p-datatable-scrollable":o.scrollable,"p-datatable-flex-scrollable":o.scrollable&&o.scrollHeight==="flex","p-datatable-responsive-stack":o.responsiveLayout==="stack","p-datatable-responsive-scroll":o.responsiveLayout==="scroll","p-datatable-striped":o.stripedRows,"p-datatable-gridlines":o.showGridlines,"p-datatable-grouped-header":t.headerColumnGroup!=null,"p-datatable-grouped-footer":t.footerColumnGroup!=null,"p-datatable-sm":o.size==="small","p-datatable-lg":o.size==="large"}]},loadingOverlay:"p-datatable-loading-overlay p-component-overlay",loadingIcon:"p-datatable-loading-icon",header:"p-datatable-header",paginator:function(e){var t=e.instance;return t.paginatorTop?"p-paginator-top":t.paginatorBottom?"p-paginator-bottom":""},wrapper:"p-datatable-wrapper",table:function(e){var t=e.props;return["p-datatable-table",{"p-datatable-scrollable-table":t.scrollable,"p-datatable-resizable-table":t.resizableColumns,"p-datatable-resizable-table-fit":t.resizableColumns&&t.columnResizeMode==="fit"}]},thead:"p-datatable-thead",headerCell:function(e){var t=e.instance,o=e.props,i=e.column;return i&&!t.columnProp(i,"hidden")&&(o.rowGroupMode!=="subheader"||o.groupRowsBy!Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var r=!0,a=!1,u;return{s:function(){t=t.call(n)},n:function(){var l=t.next();return r=l.done,l},e:function(l){a=!0,u=l},f:function(){try{!r&&t.return!=null&&t.return()}finally{if(a)throw u}}}}function sn(n,e){if(n){if(typeof n=="string")return ke(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ke(n,e)}}function ke(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,o=new Array(e);t<e;t++)o[t]=n[t];return o}function Oe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,o)}return t}function De(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Oe(Object(t),!0).forEach(function(o){un(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Oe(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function un(n,e,t){return e=dn(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function dn(n){var e=cn(n,"string");return J(e)=="symbol"?e:String(e)}function cn(n,e){if(J(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e||"default");if(J(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var lt={name:"BodyRow",hostName:"DataTable",extends:F,emits:["rowgroup-toggle","row-click","row-dblclick","row-rightclick","row-touchend","row-keydown","row-mousedown","row-dragstart","row-dragover","row-dragleave","row-dragend","row-drop","row-toggle","radio-change","checkbox-change","cell-edit-init","cell-edit-complete","cell-edit-cancel","row-edit-init","row-edit-save","row-edit-cancel","editing-meta-change"],props:{rowData:{type:Object,default:null},index:{type:Number,default:0},value:{type:Array,default:null},columns:{type:null,default:null},frozenRow:{type:Boolean,default:!1},empty:{type:Boolean,default:!1},rowGroupMode:{type:String,default:null},groupRowsBy:{type:[Array,String,Function],default:null},expandableRowGroups:{type:Boolean,default:!1},expandedRowGroups:{type:Array,default:null},first:{type:Number,default:0},dataKey:{type:[String,Function],default:null},expandedRowIcon:{type:String,default:null},collapsedRowIcon:{type:String,default:null},expandedRows:{type:[Array,Object],default:null},selection:{type:[Array,Object],default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},contextMenu:{type:Boolean,default:!1},contextMenuSelection:{type:Object,default:null},rowClass:{type:null,default:null},rowStyle:{type:null,default:null},rowGroupHeaderStyle:{type:null,default:null},editMode:{type:String,default:null},compareSelectionBy:{type:String,default:"deepEquals"},editingRows:{type:Array,default:null},editingRowKeys:{type:null,default:null},editingMeta:{type:Object,default:null},templates:{type:null,default:null},scrollable:{type:Boolean,default:!1},responsiveLayout:{type:String,default:"stack"},virtualScrollerContentProps:{type:Object,default:null},isVirtualScrollerDisabled:{type:Boolean,default:!1},expandedRowId:{type:String,default:null},nameAttributeSelector:{type:String,default:null}},data:function(){return{d_rowExpanded:!1}},watch:{expandedRows:{immediate:!0,handler:function(e){var t=this;this.d_rowExpanded=this.dataKey?(e==null?void 0:e[b.resolveFieldData(this.rowData,this.dataKey)])!==void 0:e==null?void 0:e.some(function(o){return t.equals(t.rowData,o)})}}},methods:{columnProp:function(e,t){return b.getVNodeProp(e,t)},getColumnPT:function(e){var t={parent:{instance:this,props:this.$props,state:this.$data}};return f(this.ptm("column.".concat(e),{column:t}),this.ptm("column.".concat(e),t),this.ptmo(this.columnProp({},"pt"),e,t))},getBodyRowPTOptions:function(e){var t,o=(t=this.$parentInstance)===null||t===void 0?void 0:t.$parentInstance;return this.ptm(e,{context:{index:this.rowIndex,selectable:(o==null?void 0:o.rowHover)||(o==null?void 0:o.selectionMode),selected:this.isSelected,stripedRows:(o==null?void 0:o.stripedRows)||!1}})},shouldRenderBodyCell:function(e){var t=this.columnProp(e,"hidden");if(this.rowGroupMode&&!t){var o=this.columnProp(e,"field");if(this.rowGroupMode==="subheader")return this.groupRowsBy!==o;if(this.rowGroupMode==="rowspan")if(this.isGrouped(e)){var i=this.value[this.rowIndex-1];if(i){var r=b.resolveFieldData(this.value[this.rowIndex],o),a=b.resolveFieldData(i,o);return r!==a}else return!0}else return!0}else return!t},calculateRowGroupSize:function(e){if(this.isGrouped(e)){for(var t=this.rowIndex,o=this.columnProp(e,"field"),i=b.resolveFieldData(this.value[t]
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var r=!0,a=!1,u;return{s:function(){t=t.call(n)},n:function(){var l=t.next();return r=l.done,l},e:function(l){a=!0,u=l},f:function(){try{!r&&t.return!=null&&t.return()}finally{if(a)throw u}}}}function Dn(n,e){if(n){if(typeof n=="string")return Fe(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Fe(n,e)}}function Fe(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,o=new Array(e);t<e;t++)o[t]=n[t];return o}var ut={name:"TableFooter",hostName:"DataTable",extends:F,props:{columnGroup:{type:null,default:null},columns:{type:Object,default:null}},provide:function(){return{$rows:this.d_footerRows,$columns:this.d_footerColumns}},data:function(){return{d_footerRows:new W({type:"Row"}),d_footerColumns:new W({type:"Column"})}},beforeUnmount:function(){this.d_footerRows.clear(),this.d_footerColumns.clear()},methods:{columnProp:function(e,t){return b.getVNodeProp(e,t)},getColumnGroupPT:function(e){var t={props:this.getColumnGroupProps(),parent:{instance:this,props:this.$props,state:this.$data},context:{type:"footer",scrollable:this.ptmTFootOptions.context.scrollable}};return f(this.ptm("columnGroup.".concat(e),{columnGroup:t}),this.ptm("columnGroup.".concat(e),t),this.ptmo(this.getColumnGroupProps(),e,t))},getColumnGroupProps:function(){return this.columnGroup&&this.columnGroup.props&&this.columnGroup.props.pt?this.columnGroup.props.pt:void 0},getRowPT:function(e,t,o){var i={props:e.props,parent:{instance:this,props:this.$props,state:this.$data},context:{index:o}};return f(this.ptm("row.".concat(t),{row:i}),this.ptm("row.".concat(t),i),this.ptmo(this.getRowProp(e),t,i))},getRowProp:function(e){return e.props&&e.props.pt?e.props.pt:void 0},getFooterRows:function(){var e;return(e=this.d_footerRows)===null||e===void 0?void 0:e.get(this.columnGroup,this.columnGroup.children)},getFooterColumns:function(e){var t;return(t=this.d_footerColumns)===null||t===void 0?void 0:t.get(e,e.children)}},computed:{hasFooter:function(){var e=!1;if(this.columnGroup)e=!0;else if(this.columns){var t=On(this.columns),o;try{for(t.s();!(o=t.n()).done;){var i=o.value;if(this.columnProp(i,"footer")||i.children&&i.children.footer){e=!0;break}}}catch(r){t.e(r)}finally{t.f()}}return e},ptmTFootOptions:function(){var e;return{context:{scrollable:(e=this.$parentInstance)===null||e===void 0||(e=e.$parentInstance)===null||e===void 0?void 0:e.scrollable}}}},components:{DTFooterCell:st}};function $(n){"@babel/helpers - typeof";return $=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$(n)}function Be(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,o)}return t}function ae(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Be(Object(t),!0).forEach(function(o){In(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Be(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function In(n,e,t){return e=Tn(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Tn(n){var e=xn(n,"string");return $(e)=="symbol"?e:String(e)}function xn(n,e){if($(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e||"default");if($(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Fn(n,e,t,o,i,r){var a=R("DTFooterCell");return r.hasFooter?(s(),m("tfoot",f({key:0,class:n.cx("tfoot"),style:n.sx("tfoot"),role:"rowgroup"},t.columnGroup?ae(ae({},n.ptm("tfoot",r.ptmTFootOptions)),r.getColumnGroupPT("root")):n.ptm("tfoot",r.ptmTFootOptions),{"data-pc-section":"tfoot"}),[t.columnGroup?(s(!0),m(P,{key:1},L(r.getFooterRows(),function(u,d){return s(),m("tr",f({key:d,role:"row"},ae(ae({},n.ptm("footerRow")),r.getRowPT(u,"root",d))),[(s(!0),m(P,null,L(r.getFooterColumns(u),function(l,g){return s(),m(P,{key:r.columnProp(l,"columnKey")||r.columnProp(l,"field")||g},[r.columnProp(l,"hidden")?v("",!0):(s(),w(a,{key:0,column:l,index:d,pt:n.pt},null,8,["column","index","pt"]))],64)}),128))],16)}),128)):(s(),m("tr",f({key:0,role:"row"},n.ptm("footerRow")),[(s(!0),m(P,null,L(t.columns,function(u,d){return s(),m(P,{key:r.columnProp(u,"columnKey")||r.columnProp(u,"field")||d},[r.columnProp(u,"hidden")?v("",!0):(s(),w(a,{key:0,column:u,pt:n.pt},null,8,["column","pt"]))],64)}),128))],16))],16)):v("",!0)}ut.render=Fn;function _(n){"@babel/helper
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ar(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var o,i,r,a,u=[],d=!0,l=!1;try{if(r=(t=t.call(n)).next,e===0){if(Object(t)!==t)return;d=!1}else for(;!(d=(o=r.call(t)).done)&&(u.push(o.value),u.length!==e);d=!0);}catch(g){l=!0,i=g}finally{try{if(!d&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(l)throw i}}return u}}function sr(n){if(Array.isArray(n))return n}function q(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=ve(n))||e&&n&&typeof n.length=="number"){t&&(n=t);var o=0,i=function(){};return{s:i,n:function(){return o>=n.length?{done:!0}:{done:!1,value:n[o++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var r=!0,a=!1,u;return{s:function(){t=t.call(n)},n:function(){var l=t.next();return r=l.done,l},e:function(l){a=!0,u=l},f:function(){try{!r&&t.return!=null&&t.return()}finally{if(a)throw u}}}}function M(n){return cr(n)||dr(n)||ve(n)||ur()}function ur(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ve(n,e){if(n){if(typeof n=="string")return he(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return he(n,e)}}function dr(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function cr(n){if(Array.isArray(n))return he(n)}function he(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,o=new Array(e);t<e;t++)o[t]=n[t];return o}var fr={name:"DataTable",extends:Xt,inheritAttrs:!1,emits:["value-change","update:first","update:rows","page","update:sortField","update:sortOrder","update:multiSortMeta","sort","filter","row-click","row-dblclick","update:selection","row-select","row-unselect","update:contextMenuSelection","row-contextmenu","row-unselect-all","row-select-all","select-all-change","column-resize-end","column-reorder","row-reorder","update:expandedRows","row-collapse","row-expand","update:expandedRowGroups","rowgroup-collapse","rowgroup-expand","update:filters","state-restore","state-save","cell-edit-init","cell-edit-complete","cell-edit-cancel","update:editingRows","row-edit-init","row-edit-save","row-edit-cancel"],provide:function(){return{$columns:this.d_columns,$columnGroups:this.d_columnGroups}},data:function(){return{d_first:this.first,d_rows:this.rows,d_sortField:this.sortField,d_sortOrder:this.sortOrder,d_nullSortOrder:this.nullSortOrder,d_multiSortMeta:this.multiSortMeta?M(this.multiSortMeta):[],d_groupRowsSortMeta:null,d_selectionKeys:null,d_columnOrder:null,d_editingRowKeys:null,d_editingMeta:{},d_filters:this.cloneFilters(this.filters),d_columns:new W({type:"Column"}),d_columnGroups:new W({type:"ColumnGroup"})}},rowTouched:!1,anchorRowIndex:null,rangeRowIndex:null,documentColumnResizeListener:null,documentColumnResizeEndListener:null,lastResizeHelperX:null,resizeColumnElement:null,columnResizing:!1,colReorderIconWidth:null,colReorderIconHeight:null,draggedColumn:null,draggedColumnElement:null,draggedRowIndex:null,droppedRowIndex:null,rowDragging:null,columnWidthsState:null,tableWidthState:null,columnWidthsRestored:!1,watch:{first:function(e){this.d_first=e},rows:function(e){this.d_rows=e},sortField:function(e){this.d_sortField=e},sortOrder:function(e){this.d_sortOrder=e},nullSortOrder:function(e){this.d_nullSortOrder=e},multiSortMeta:function(e){this.d_multiSortMeta=e},selection:{immediate:!0,handler:function(e){this.dataKey&&this.updateSelectionKeys(e)}},editingRows:{immediate:!0,handler:function(e){this.dataKey&&this.updateEditingRowKeys(e)}},filters:{deep:!0,handler:function(e){this.d_filters=this.cloneFilters(e)}}},mounted:function(){this.$el.setAttribute(this.attributeSelector,""),this.responsiveLayout==="stack"&&!this.scrollable&&!this.unstyled&&this.createResponsiveStyle(),this.isStateful()&&(this.restoreState(),this.resizableColumns&&this.restoreColumnWidths()),this.editMode==="row"&&this.dataKey&&!this.d_editingRowKeys&&this.updateEditingRowKeys(this.editingRows)},beforeUnmount:function(){this.unbindColumnResizeEvents(),this.destroyStyleElement(),this.destroyResponsiveStyle(),this.d_columns.clear(),this.d_columnGroups.clear()},updated:function(){this.isStateful()&&this.saveState(),this.editMode==="row"&&this.dataKey&&!this.d_editingRowKeys&&this.updateEditingRowKeys(this.editingRows)},methods:{columnProp:function(e,t){return b.getVNodeProp(e,t)},onPage:function(e){var t=this;this.clearEditingMetaData(),this.d_first=e.first,this.d_rows=e.rows;var o=this.createLazyLoadEvent(e);o.pageCount=e.pageCount,o.page=e.page,this.$emit("update:first",this.d_first),this.$emit("update:rows",this.d_rows),this.$emit("page",o),this.$nextTick(function(){t.$emit("value-change",t.processedData)})},onColumnHeaderClick:function(e){var t=this,o=e.originalEvent,i=e.column;if(this.columnProp(i,"sortable")){var r=o.target,a=this.columnProp(i,"sortField")||this.columnProp(i,"field");if(p.getAttribute(r,"data-p-sortable-column")===!0||p.getAttribute(r,"data-pc-section")==="headertitle"||p.getAttribute(r,"data-pc-section")==="headercontent"||p.getAttribute(r,"data-pc-section")==="sorticon"||p.getAttribute(r.parentElement,"data-pc-section")==="sorticon"||p.getAttribute(r.parentElement.parentElement,"data-pc-section")==="sorticon"||r.closest('[data-p-sortable-column="true"]')&&!r.closest('[data-pc-section="filtermenubutton"]')&&!p.isClickable(o.target)){if(p.clearSelection(),this.sortMode==="single")this.d_sortField===a?this.removableSort&&this.d_sortOrder*-1===this.defaultSortOrder?(this.d_sortOrder=null,this.d_sortField=null):this.d_sortOrder=this.d_sortOrder*-1:(this.d_sortOrder=this.defaultSortOrder,this.d_sortField=a),this.$emit("update:sortField",this.d_sortField),this.$emit("update:sortOrder",this.d_sortOrder),this.resetPage();else if(this.sortMode==="multiple"){var u=o.metaKey||o.ctrlKey;u||(this.d_
Line truncated
|
||||
`;for(var y=!1,c=0;c<o.columns.length;c++){var T=o.columns[c];if(o.columnProp(T,"exportable")!==!1&&o.columnProp(T,"field")){y?i+=o.csvSeparator:y=!0;var x=b.resolveFieldData(h,o.columnProp(T,"field"));x!=null?o.exportFunction?x=o.exportFunction({data:x,field:o.columnProp(T,"field")}):x=String(x).replace(/"/g,'""'):x="",i+='"'+x+'"'}}});for(var d=!1,l=0;l<this.columns.length;l++){var g=this.columns[l];l===0&&(i+=`
|
||||
`),this.columnProp(g,"exportable")!==!1&&this.columnProp(g,"exportFooter")&&(d?i+=this.csvSeparator:d=!0,i+='"'+(this.columnProp(g,"exportFooter")||this.columnProp(g,"footer")||this.columnProp(g,"field"))+'"')}p.exportCSV(i,this.exportFilename)},resetPage:function(){this.d_first=0,this.$emit("update:first",this.d_first)},onColumnResizeStart:function(e){var t=p.getOffset(this.$el).left;this.resizeColumnElement=e.target.parentElement,this.columnResizing=!0,this.lastResizeHelperX=e.pageX-t+this.$el.scrollLeft,this.bindColumnResizeEvents()},onColumnResize:function(e){var t=p.getOffset(this.$el).left;this.$el.setAttribute("data-p-unselectable-text","true"),!this.isUnstyled&&p.addClass(this.$el,"p-unselectable-text"),this.$refs.resizeHelper.style.height=this.$el.offsetHeight+"px",this.$refs.resizeHelper.style.top="0px",this.$refs.resizeHelper.style.left=e.pageX-t+this.$el.scrollLeft+"px",this.$refs.resizeHelper.style.display="block"},onColumnResizeEnd:function(){var e=this.$refs.resizeHelper.offsetLeft-this.lastResizeHelperX,t=this.resizeColumnElement.offsetWidth,o=t+e,i=this.resizeColumnElement.style.minWidth||15;if(t+e>parseInt(i,10)){if(this.columnResizeMode==="fit"){var r=this.resizeColumnElement.nextElementSibling,a=r.offsetWidth-e;o>15&&a>15&&this.resizeTableCells(o,a)}else if(this.columnResizeMode==="expand"){var u=this.$refs.table.offsetWidth+e+"px",d=function(y){y&&(y.style.width=y.style.minWidth=u)};if(this.resizeTableCells(o),d(this.$refs.table),!this.virtualScrollerDisabled){var l=this.$refs.bodyRef&&this.$refs.bodyRef.$el,g=this.$refs.frozenBodyRef&&this.$refs.frozenBodyRef.$el;d(l),d(g)}}this.$emit("column-resize-end",{element:this.resizeColumnElement,delta:e})}this.$refs.resizeHelper.style.display="none",this.resizeColumn=null,this.$el.removeAttribute("data-p-unselectable-text"),!this.isUnstyled&&p.removeClass(this.$el,"p-unselectable-text"),this.unbindColumnResizeEvents(),this.isStateful()&&this.saveState()},resizeTableCells:function(e,t){var o=p.index(this.resizeColumnElement),i=[],r=p.find(this.$refs.table,'thead[data-pc-section="thead"] > tr > th');r.forEach(function(d){return i.push(p.getOuterWidth(d))}),this.destroyStyleElement(),this.createStyleElement();var a="",u='[data-pc-name="datatable"]['.concat(this.attributeSelector,'] > [data-pc-section="wrapper"] ').concat(this.virtualScrollerDisabled?"":'> [data-pc-name="virtualscroller"]',' > table[data-pc-section="table"]');i.forEach(function(d,l){var g=l===o?e:t&&l===o+1?t:d,h="width: ".concat(g,"px !important; max-width: ").concat(g,"px !important");a+=`
|
||||
`.concat(u,' > thead[data-pc-section="thead"] > tr > th:nth-child(').concat(l+1,`),
|
||||
`).concat(u,' > tbody[data-pc-section="tbody"] > tr > td:nth-child(').concat(l+1,`),
|
||||
`).concat(u,' > tfoot[data-pc-section="tfoot"] > tr > td:nth-child(').concat(l+1,`) {
|
||||
`).concat(h,`
|
||||
}
|
||||
`)}),this.styleElement.innerHTML=a},bindColumnResizeEvents:function(){var e=this;this.documentColumnResizeListener||(this.documentColumnResizeListener=document.addEventListener("mousemove",function(){e.columnResizing&&e.onColumnResize(event)})),this.documentColumnResizeEndListener||(this.documentColumnResizeEndListener=document.addEventListener("mouseup",function(){e.columnResizing&&(e.columnResizing=!1,e.onColumnResizeEnd())}))},unbindColumnResizeEvents:function(){this.documentColumnResizeListener&&(document.removeEventListener("document",this.documentColumnResizeListener),this.documentColumnResizeListener=null),this.documentColumnResizeEndListener&&(document.removeEventListener("document",this.documentColumnResizeEndListener),this.documentColumnResizeEndListener=null)},onColumnHeaderMouseDown:function(e){var t=e.originalEvent,o=e.column;this.reorderableColumns&&this.columnProp(o,"reorderableColumn")!==!1&&(t.target.nodeName==="INPUT"||t.target.nodeName==="TEXTAREA"||p.getAttribute(t.target,'[data-pc-section="columnresizer"]')?t.currentTarget.draggable=!1:t.currentTarget.draggable=!0)},onColumnHeaderDragStart:function(e){var t=e.originalEvent,o=e.column;if(this.columnResizing){t.preventDefault();return}this.colReorderIconWidth=p.getHiddenElementOuterWidth(this.$refs.reorderIndicatorUp),this.colReorderIconHeight=p.getHiddenElementOuterHeight(this.$refs.reorderIndicatorUp),this.draggedColumn=o,this.draggedColumnElement=this.findParentHeader(t.target),t.dataTransfer.setData("text","b")},onColumnHeaderDragOver:function(e){var t=e.originalEvent,o=e.column,i=this.findParentHeader(t.target);if(this.reorderableColumns&&this.draggedColumnElement&&i&&!this.columnProp(o,"frozen")){t.preventDefault();var r=p.getOffset(this.$el),a=p.getOffset(i);if(this.draggedColumnElement!==i){var u=a.left-r.left,d=a.left+i.offsetWidth/2;this.$refs.reorderIndicatorUp.style.top=a.top-r.top-(this.colReorderIconHeight-1)+"px",this.$refs.reorderIndicatorDown.style.top=a.top-r.top+i.offsetHeight+"px",t.pageX>d?(this.$refs.reorderIndicatorUp.style.left=u+i.offsetWidth-Math.ceil(this.colReorderIconWidth/2)+"px",this.$refs.reorderIndicatorDown.style.left=u+i.offsetWidth-Math.ceil(this.colReorderIconWidth/2)+"px",this.dropPosition=1):(this.$refs.reorderIndicatorUp.style.left=u-Math.ceil(this.colReorderIconWidth/2)+"px",this.$refs.reorderIndicatorDown.style.left=u-Math.ceil(this.colReorderIconWidth/2)+"px",this.dropPosition=-1),this.$refs.reorderIndicatorUp.style.display="block",this.$refs.reorderIndicatorDown.style.display="block"}}},onColumnHeaderDragLeave:function(e){var t=e.originalEvent;this.reorderableColumns&&this.draggedColumnElement&&(t.preventDefault(),this.$refs.reorderIndicatorUp.style.display="none",this.$refs.reorderIndicatorDown.style.display="none")},onColumnHeaderDrop:function(e){var t=this,o=e.originalEvent,i=e.column;if(o.preventDefault(),this.draggedColumnElement){var r=p.index(this.draggedColumnElement),a=p.index(this.findParentHeader(o.target)),u=r!==a;if(u&&(a-r===1&&this.dropPosition===-1||a-r===-1&&this.dropPosition===1)&&(u=!1),u){var d=function(I,B){return t.columnProp(I,"columnKey")||t.columnProp(B,"columnKey")?t.columnProp(I,"columnKey")===t.columnProp(B,"columnKey"):t.columnProp(I,"field")===t.columnProp(B,"field")},l=this.columns.findIndex(function(D){return d(D,t.draggedColumn)}),g=this.columns.findIndex(function(D){return d(D,i)}),h=[],y=p.find(this.$el,'thead[data-pc-section="thead"] > tr > th');y.forEach(function(D){return h.push(p.getOuterWidth(D))});var c=h.find(function(D,I){return I===l}),T=h.filter(function(D,I){return I!==l}),x=[].concat(M(T.slice(0,g)),[c],M(T.slice(g)));this.addColumnWidthStyles(x),g<l&&this.dropPosition===1&&g++,g>l&&this.dropPosition===-1&&g--,b.reorderArray(this.columns,l,g),this.updateReorderableColumns(),this.$emit("column-reorder",{originalEvent:o,dragIndex:l,dropIndex:g})}this.$refs.reorderIndicatorUp.style.display="none",this.$refs.reorderIndicatorDown.style.display="none",this.draggedColumnElement.draggable=!1,this.draggedColumnElement=null,this.draggedColumn=null,this.dropPosition=null}},findParentHeader:function(e){if(e.nodeName==="TH")return e;for(var t=e.parentElement;t.nodeName!=="TH"&&(t=t.parentElement,!!t););return t},findColumnByKey:function(e,t){if(e&&e.length)for(var o=0;o<e.length;o++){var i=e[o];if(this.columnProp(i,"columnKey")===t||this.columnProp(i,"field")===t)return i}return null},onRowMouseDown:function(e){p.getAttribute(e.target,"data-pc-section")==="rowreordericon"||p.getAttribute(e.target.parentElement,"data-pc-section")==="rowreordericon"?e.currentTarget.draggable=!0:e.currentTarget.draggable=!1},onRowDragStart:function(e){var t=e.originalEvent,o=e.index;this.rowDragging=!0,this.draggedRowIndex=o,t.dataTransfer.setData("text","b")},onRowDragOver:function(e){var t=e.originalEvent,o=e.index;if(this.rowDragging&&this.draggedRowIndex!==o){var i=t.currentTarget,r=p.getOffset(i).top+p.getWindowScrollTop(),a=t.pageY,u=r+p.getOuterHeight(i)/2,d
Line truncated
|
||||
`.concat(o,' > thead[data-pc-section="thead"] > tr > th:nth-child(').concat(r+1,`),
|
||||
`).concat(o,' > tbody[data-pc-section="tbody"] > tr > td:nth-child(').concat(r+1,`),
|
||||
`).concat(o,' > tfoot[data-pc-section="tfoot"] > tr > td:nth-child(').concat(r+1,`) {
|
||||
`).concat(a,`
|
||||
}
|
||||
`)}),this.styleElement.innerHTML=t},restoreColumnWidths:function(){if(this.columnWidthsState){var e=this.columnWidthsState.split(",");this.columnResizeMode==="expand"&&this.tableWidthState&&(this.$refs.table.style.width=this.tableWidthState,this.$refs.table.style.minWidth=this.tableWidthState),b.isNotEmpty(e)&&this.addColumnWidthStyles(e)}},onCellEditInit:function(e){this.$emit("cell-edit-init",e)},onCellEditComplete:function(e){this.$emit("cell-edit-complete",e)},onCellEditCancel:function(e){this.$emit("cell-edit-cancel",e)},onRowEditInit:function(e){var t=this.editingRows?M(this.editingRows):[];t.push(e.data),this.$emit("update:editingRows",t),this.$emit("row-edit-init",e)},onRowEditSave:function(e){var t=M(this.editingRows);t.splice(this.findIndex(e.data,t),1),this.$emit("update:editingRows",t),this.$emit("row-edit-save",e)},onRowEditCancel:function(e){var t=M(this.editingRows);t.splice(this.findIndex(e.data,t),1),this.$emit("update:editingRows",t),this.$emit("row-edit-cancel",e)},onEditingMetaChange:function(e){var t=e.data,o=e.field,i=e.index,r=e.editing,a=G({},this.d_editingMeta),u=a[i];if(r)!u&&(u=a[i]={data:G({},t),fields:[]}),u.fields.push(o);else if(u){var d=u.fields.filter(function(l){return l!==o});d.length?u.fields=d:delete a[i]}this.d_editingMeta=a},clearEditingMetaData:function(){this.editMode&&(this.d_editingMeta={})},createLazyLoadEvent:function(e){return{originalEvent:e,first:this.d_first,rows:this.d_rows,sortField:this.d_sortField,sortOrder:this.d_sortOrder,multiSortMeta:this.d_multiSortMeta,filters:this.d_filters}},hasGlobalFilter:function(){return this.filters&&Object.prototype.hasOwnProperty.call(this.filters,"global")},onFilterChange:function(e){this.d_filters=e},onFilterApply:function(){this.d_first=0,this.$emit("update:first",this.d_first),this.$emit("update:filters",this.d_filters),this.lazy&&this.$emit("filter",this.createLazyLoadEvent())},cloneFilters:function(){var e={};return this.filters&&Object.entries(this.filters).forEach(function(t){var o=Ve(t,2),i=o[0],r=o[1];e[i]=r.operator?{operator:r.operator,constraints:r.constraints.map(function(a){return G({},a)})}:G({},r)}),e},updateReorderableColumns:function(){var e=this,t=[];this.columns.forEach(function(o){return t.push(e.columnProp(o,"columnKey")||e.columnProp(o,"field"))}),this.d_columnOrder=t},createStyleElement:function(){var e;this.styleElement=document.createElement("style"),this.styleElement.type="text/css",p.setAttribute(this.styleElement,"nonce",(e=this.$primevue)===null||e===void 0||(e=e.config)===null||e===void 0||(e=e.csp)===null||e===void 0?void 0:e.nonce),document.head.appendChild(this.styleElement)},createResponsiveStyle:function(){if(!this.responsiveStyleElement){var e;this.responsiveStyleElement=document.createElement("style"),this.responsiveStyleElement.type="text/css",p.setAttribute(this.responsiveStyleElement,"nonce",(e=this.$primevue)===null||e===void 0||(e=e.config)===null||e===void 0||(e=e.csp)===null||e===void 0?void 0:e.nonce),document.head.appendChild(this.responsiveStyleElement);var t=".p-datatable-wrapper ".concat(this.virtualScrollerDisabled?"":"> .p-virtualscroller"," > .p-datatable-table"),o=".p-datatable[".concat(this.attributeSelector,"] > ").concat(t),i=".p-datatable[".concat(this.attributeSelector,"].p-datatable-gridlines > ").concat(t),r=`
|
||||
@media screen and (max-width: `.concat(this.breakpoint,`) {
|
||||
`).concat(o,` > .p-datatable-thead > tr > th,
|
||||
`).concat(o,` > .p-datatable-tfoot > tr > td {
|
||||
display: none;
|
||||
}
|
||||
|
||||
`).concat(o,` > .p-datatable-tbody > tr > td {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
`).concat(o,` > .p-datatable-tbody > tr > td:not(:last-child) {
|
||||
border: 0 none;
|
||||
}
|
||||
|
||||
`).concat(i,` > .p-datatable-tbody > tr > td:last-child {
|
||||
border-top: 0;
|
||||
border-right: 0;
|
||||
border-left: 0;
|
||||
}
|
||||
|
||||
`).concat(o,` > .p-datatable-tbody > tr > td > .p-column-title {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
`);this.responsiveStyleElement.innerHTML=r}},destroyResponsiveStyle:function(){this.responsiveStyleElement&&(document.head.removeChild(this.responsiveStyleElement),this.responsiveStyleElement=null)},destroyStyleElement:function(){this.styleElement&&(document.head.removeChild(this.styleElement),this.styleElement=null)},dataToRender:function(e){var t=e||this.processedData;if(t&&this.paginator){var o=this.lazy?0:this.d_first;return t.slice(o,o+this.d_rows)}return t},getVirtualScrollerRef:function(){return this.$refs.virtualScroller},hasSpacerStyle:function(e){return b.isNotEmpty(e)}},computed:{columns:function(){var e=this.d_columns.get(this);if(this.reorderableColumns&&this.d_columnOrder){var t=[],o=q(this.d_columnOrder),i;try{for(o.s();!(i=o.n()).done;){var r=i.value,a=this.findColumnByKey(e,r);a&&!this.columnProp(a,"hidden")&&t.push(a)}}catch(u){o.e(u)}finally{o.f()}return[].concat(t,M(e.filter(function(u){return t.indexOf(u)<0})))}return e},columnGroups:function(){return this.d_columnGroups.get(this)},headerColumnGroup:function(){var e,t=this;return(e=this.columnGroups)===null||e===void 0?void 0:e.find(function(o){return t.columnProp(o,"type")==="header"})},footerColumnGroup:function(){var e,t=this;return(e=this.columnGroups)===null||e===void 0?void 0:e.find(function(o){return t.columnProp(o,"type")==="footer"})},hasFilters:function(){return this.filters&&Object.keys(this.filters).length>0&&this.filters.constructor===Object},processedData:function(){var e,t=this.value||[];return!this.lazy&&!((e=this.virtualScrollerOptions)!==null&&e!==void 0&&e.lazy)&&t&&t.length&&(this.hasFilters&&(t=this.filter(t)),this.sorted&&(this.sortMode==="single"?t=this.sortSingle(t):this.sortMode==="multiple"&&(t=this.sortMultiple(t)))),t},totalRecordsLength:function(){if(this.lazy)return this.totalRecords;var e=this.processedData;return e?e.length:0},empty:function(){var e=this.processedData;return!e||e.length===0},paginatorTop:function(){return this.paginator&&(this.paginatorPosition!=="bottom"||this.paginatorPosition==="both")},paginatorBottom:function(){return this.paginator&&(this.paginatorPosition!=="top"||this.paginatorPosition==="both")},sorted:function(){return this.d_sortField||this.d_multiSortMeta&&this.d_multiSortMeta.length>0},allRowsSelected:function(){var e=this;if(this.selectAll!==null)return this.selectAll;var t=this.frozenValue?[].concat(M(this.frozenValue),M(this.processedData)):this.processedData;return b.isNotEmpty(t)&&this.selection&&Array.isArray(this.selection)&&t.every(function(o){return e.selection.some(function(i){return e.equals(i,o)})})},attributeSelector:function(){return de()},groupRowSortField:function(){return this.sortMode==="single"?this.sortField:this.d_groupRowsSortMeta?this.d_groupRowsSortMeta.field:null},virtualScrollerDisabled:function(){return b.isEmpty(this.virtualScrollerOptions)||!this.scrollable}},components:{DTPaginator:wt,DTTableHeader:ct,DTTableBody:at,DTTableFooter:ut,DTVirtualScroller:vt,ArrowDownIcon:Qe,ArrowUpIcon:$e,SpinnerIcon:yt}};function oe(n){"@babel/helpers - typeof";return oe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oe(n)}function Ne(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,o)}return t}function We(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ne(Object(t),!0).forEach(function(o){pr(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ne(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function pr(n,e,t){return e=mr(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mr(n){var e=hr(n,"string");return oe(e)=="symbol"?e:String(e)}function hr(n,e){if(oe(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e||"default");if(oe(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function gr(n,e,t,o,i,r){var a=R("SpinnerIcon"),u=R("DTPaginator"),d=R("DTTableHeader"),l=R("DTTableBody"),g=R("DTTableFooter"),h=R("DTVirtualScroller");return s(),m("div",f({class:n.cx("root"),"data-scrollselectors":".p-datatable-wrapper"},n.ptmi("root")),[k(n.$slots,"default"),n.loading?(s(),m("div",f({key:0,class:n.cx("loadingOverlay")},n.ptm("loadingOverlay")),[n.$slots.loading?k(n.$slots,"loading",{key:0}):(s(),m(P,{key:1},[n.$slots.loadingicon?(s(),w(C(n.$slots.loadingicon),{key:0,class:S(n.cx("loadingIcon"))},null,8,["class"])):n.loadingIcon?(s(),m("i",f({key:1,class:[n.cx("loadingIcon"),"pi-spin",n.loadingIcon]},n.ptm("loadingIcon")),null,16)):(s(),w(a,f({key:2,spin:"",class:n.
Line truncated
|
||||
@@ -1,72 +0,0 @@
|
||||
import{O as g}from"./CELf783E.js";import{s as k}from"./CFcFeTBy.js";import{a3 as H,a6 as p,a7 as d,a8 as y,i as L,t as h,v as f,aa as a,O as v,z as m,A as b,ac as M,x as c}from"./DRtWvKfJ.js";import{s as C}from"./Bl_ZW1Xh.js";var S={root:function(e){var t=e.props;return["p-colorpicker p-component",{"p-colorpicker-overlay":!t.inline}]},input:function(e){var t=e.props;return["p-colorpicker-preview p-inputtext",{"p-disabled":t.disabled}]},panel:function(e){var t=e.instance,o=e.props;return["p-colorpicker-panel",{"p-colorpicker-overlay-panel":!o.inline,"p-disabled":o.disabled,"p-ripple-disabled":t.$primevue.config.ripple===!1}]},content:"p-colorpicker-content",selector:"p-colorpicker-color-selector",color:"p-colorpicker-color",colorHandle:"p-colorpicker-color-handle",hue:"p-colorpicker-hue",hueHandle:"p-colorpicker-hue-handle"},B=H.extend({name:"colorpicker",classes:S}),D={name:"BaseColorPicker",extends:C,props:{modelValue:{type:null,default:null},defaultColor:{type:null,default:"ff0000"},inline:{type:Boolean,default:!1},format:{type:String,default:"hex"},disabled:{type:Boolean,default:!1},tabindex:{type:String,default:null},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},appendTo:{type:[String,Object],default:"body"},panelClass:null},style:B,provide:function(){return{$parentInstance:this}}},x={name:"ColorPicker",extends:D,inheritAttrs:!1,emits:["update:modelValue","change","show","hide"],data:function(){return{overlayVisible:!1}},hsbValue:null,outsideClickListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,scrollHandler:null,resizeListener:null,hueDragging:null,colorDragging:null,selfUpdate:null,picker:null,colorSelector:null,colorHandle:null,hueView:null,hueHandle:null,watch:{modelValue:{immediate:!0,handler:function(e){this.hsbValue=this.toHSB(e),this.selfUpdate?this.selfUpdate=!1:this.updateUI()}}},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindDragListeners(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.picker&&this.autoZIndex&&p.clear(this.picker),this.clearRefs()},mounted:function(){this.updateUI()},methods:{pickColor:function(e){var t=this.colorSelector.getBoundingClientRect(),o=t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),r=t.left+document.body.scrollLeft,i=Math.floor(100*Math.max(0,Math.min(150,(e.pageX||e.changedTouches[0].pageX)-r))/150),l=Math.floor(100*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-o)))/150);this.hsbValue=this.validateHSB({h:this.hsbValue.h,s:i,b:l}),this.selfUpdate=!0,this.updateColorHandle(),this.updateInput(),this.updateModel(e)},pickHue:function(e){var t=this.hueView.getBoundingClientRect().top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0);this.hsbValue=this.validateHSB({h:Math.floor(360*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-t)))/150),s:100,b:100}),this.selfUpdate=!0,this.updateColorSelector(),this.updateHue(),this.updateModel(e),this.updateInput()},updateModel:function(e){var t=this.modelValue;switch(this.format){case"hex":t=this.HSBtoHEX(this.hsbValue);break;case"rgb":t=this.HSBtoRGB(this.hsbValue);break;case"hsb":t=this.hsbValue;break}this.$emit("update:modelValue",t),this.$emit("change",{event:e,value:t})},updateColorSelector:function(){if(this.colorSelector){var e=this.validateHSB({h:this.hsbValue.h,s:100,b:100});this.colorSelector.style.backgroundColor="#"+this.HSBtoHEX(e)}},updateColorHandle:function(){this.colorHandle&&(this.colorHandle.style.left=Math.floor(150*this.hsbValue.s/100)+"px",this.colorHandle.style.top=Math.floor(150*(100-this.hsbValue.b)/100)+"px")},updateHue:function(){this.hueHandle&&(this.hueHandle.style.top=Math.floor(150-150*this.hsbValue.h/360)+"px")},updateInput:function(){this.$refs.input&&(this.$refs.input.style.backgroundColor="#"+this.HSBtoHEX(this.hsbValue))},updateUI:function(){this.updateHue(),this.updateColorHandle(),this.updateInput(),this.updateColorSelector()},validateHSB:function(e){return{h:Math.min(360,Math.max(0,e.h)),s:Math.min(100,Math.max(0,e.s)),b:Math.min(100,Math.max(0,e.b))}},validateRGB:function(e){return{r:Math.min(255,Math.max(0,e.r)),g:Math.min(255,Math.max(0,e.g)),b:Math.min(255,Math.max(0,e.b))}},validateHEX:function(e){var t=6-e.length;if(t>0){for(var o=[],r=0;r<t;r++)o.push("0");o.push(e),e=o.join("")}return e},HEXtoRGB:function(e){var t=parseInt(e.indexOf("#")>-1?e.substring(1):e,16);return{r:t>>16,g:(t&65280)>>8,b:t&255}},HEXtoHSB:function(e){return this.RGBtoHSB(this.HEXtoRGB(e))},RGBtoHSB:function(e){var t={h:0,s:0,b:0},o=Math.min(e.r,e.g,e.b),r=Math.max(e.r,e.g,e.b),i=r-o;return t.b=r,t.s=r!==0?255*i/r:0,t.s!==0?e.r===r?t.h=(e.g-e.b)/i:e.g===r?t.h=2+(e.b-e.r)/i:t.h=4+(e.r-e.g)/i:t.h=-1,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t},HSBtoRGB:function(e){var t={r:null,g:null,b:null},o=Math.round(e.h),r=Math.round(e.s*255/100),i=Math.round(e.b*255/10Line truncated
|
||||
.p-colorpicker {
|
||||
display: inline-block;
|
||||
}
|
||||
.p-colorpicker-dragging {
|
||||
cursor: pointer;
|
||||
}
|
||||
.p-colorpicker-overlay {
|
||||
position: relative;
|
||||
}
|
||||
.p-colorpicker-panel {
|
||||
position: relative;
|
||||
width: 193px;
|
||||
height: 166px;
|
||||
}
|
||||
.p-colorpicker-overlay-panel {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
.p-colorpicker-preview {
|
||||
cursor: pointer;
|
||||
}
|
||||
.p-colorpicker-panel .p-colorpicker-content {
|
||||
position: relative;
|
||||
}
|
||||
.p-colorpicker-panel .p-colorpicker-color-selector {
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
top: 8px;
|
||||
left: 8px;
|
||||
position: absolute;
|
||||
}
|
||||
.p-colorpicker-panel .p-colorpicker-color {
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
}
|
||||
.p-colorpicker-panel .p-colorpicker-color-handle {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 150px;
|
||||
border-radius: 100%;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
margin: -5px 0 0 -5px;
|
||||
cursor: pointer;
|
||||
opacity: 0.85;
|
||||
}
|
||||
.p-colorpicker-panel .p-colorpicker-hue {
|
||||
width: 17px;
|
||||
height: 150px;
|
||||
top: 8px;
|
||||
left: 167px;
|
||||
position: absolute;
|
||||
opacity: 0.85;
|
||||
}
|
||||
.p-colorpicker-panel .p-colorpicker-hue-handle {
|
||||
position: absolute;
|
||||
top: 150px;
|
||||
left: 0px;
|
||||
width: 21px;
|
||||
margin-left: -2px;
|
||||
margin-top: -5px;
|
||||
height: 10px;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
opacity: 0.85;
|
||||
cursor: pointer;
|
||||
}
|
||||
`;E(V);x.render=R;export{x as default};
|
||||
@@ -1,2 +0,0 @@
|
||||
import{a3 as C,a5 as H,a4 as l,a7 as b,ah as G,a9 as B,i as N,Z as U,t as h,v as O,x as m,aa as a,Y as g,$ as L,ai as j,P as q,ab as z,W,y,O as V,z as Q,a1 as Y,A as D,N as T,Q as Z,B as F}from"./DRtWvKfJ.js";import{s as J}from"./D2eV2xTx.js";import X from"./BnGLU8uI.js";import{s as $}from"./Bl_ZW1Xh.js";import"./BMCLKWyE.js";import"./B5fdn047.js";var _={root:function(e){e.instance;var i=e.props;return["p-listbox p-component",{"p-disabled":i.disabled,"p-invalid":i.invalid}]},header:"p-listbox-header",filterContainer:"p-listbox-filter-container",filterInput:"p-listbox-filter p-inputtext p-component",filterIcon:"p-listbox-filter-icon",wrapper:"p-listbox-list-wrapper",list:"p-listbox-list",itemGroup:"p-listbox-item-group",item:function(e){var i=e.instance,s=e.option,o=e.index,n=e.getItemOptions;return["p-listbox-item",{"p-highlight":i.isSelected(s),"p-focus":i.focusedOptionIndex===i.getOptionIndex(o,n),"p-disabled":i.isOptionDisabled(s)}]},emptyMessage:"p-listbox-empty-message"},ee=C.extend({name:"listbox",classes:_}),te={name:"BaseListbox",extends:$,props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,listStyle:null,invalid:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dataKey:null,multiple:{type:Boolean,default:!1},metaKeySelection:{type:Boolean,default:!1},filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},filterInputProps:null,virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},focusOnHover:{type:Boolean,default:!0},filterMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},filterIcon:{type:String,default:void 0},tabindex:{type:Number,default:0},ariaLabel:{type:String,default:null},ariaLabelledby:{type:String,default:null}},style:ee,provide:function(){return{$parentInstance:this}}};function E(t){return oe(t)||se(t)||ne(t)||ie()}function ie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ne(t,e){if(t){if(typeof t=="string")return w(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor&&(i=t.constructor.name),i==="Map"||i==="Set")return Array.from(t);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return w(t,e)}}function se(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function oe(t){if(Array.isArray(t))return w(t)}function w(t,e){(e==null||e>t.length)&&(e=t.length);for(var i=0,s=new Array(e);i<e;i++)s[i]=t[i];return s}var re={name:"Listbox",extends:te,inheritAttrs:!1,emits:["update:modelValue","change","focus","blur","filter"],list:null,virtualScroller:null,optionTouched:!1,startRangeIndex:-1,searchTimeout:null,searchValue:"",data:function(){return{id:this.$attrs.id,filterValue:null,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":{immediate:!0,handler:function(e){this.id=e||H()}},options:function(){this.autoUpdateModel()}},mounted:function(){this.autoUpdateModel()},methods:{getOptionIndex:function(e,i){return this.virtualScrollerDisabled?e:i&&i(e).index},getOptionLabel:function(e){return this.optionLabel?l.resolveFieldData(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?l.resolveFieldData(e,this.optionValue):e},getOptionRenderKey:function(e,i){return(this.dataKey?l.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+i},getPTOptions:function(e,i,s,o){return this.ptm(o,{context:{selected:this.isSelected(e),focused:this.focusedOptionIndex===this.getOptionIndex(s,i),disabled:this.isOptionDisabled(e)}})},isOptionDisabled:function(e){return this.optionDisabled?l.resolveFieldData(e,this.optionDisabled):!1},isOptionGroup:function(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel:function(e){return l.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren:function(e){return l.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset:function(e){var i=this;return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter(function(s){return i.isOptionGroup(s)}).length:e)+1},onFirstHiddenFocus:function(){b.focus(this.list);var e=b.getFirstFocusableElement(this.$el,':not([data-p-hidden-focusable="true"])');this.$refs.lastHiddenFocusableElement.tabIndex=b.isElement(e)?void 0:-1,this.$refs.firstHiddenFocusableElement.tabIndex=-1},onLastHiddenFocus:function(e){var i=e.relatedTarget;if(i===this.list){var s=b.getFirstFocusableElement(this.$el,':not([data-p-hidden-focusable="true"])');b.focus(s),this.$refs.firstHiddenFocusableElement.tabIndex=void 0}else b.focus(this.$refs.firstHiddenFocusableElement);this.$refs.lastHiddenFocusableElement.tabIndex=-1},onFocusout:function(e){!this.$el.contains(e.relatedTarget)&&this.$refs.lastHiddenFocusableElement&&this.$refs.firstHiddenFocusableElement&&(this.$refs.lastHiddenFocusableElement.tabIndex=this.$refs.firstHiddenFocusableElement.tabIndex=void 0)},onListFocus:function(e){this.focused=!0,this.focusedOptionIndex=this.focusedOptionIndex!==-1?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():this.findSelectedOptionIndex(),this.autoUpdateModel(),this.$emit("focus",e)},onListBlur:function(e){this.focused=!1,this.focusedOptionIndex=this.startRangeIndex=-1,this.searchValue="",this.$emit("blur",e)},onListKeyDown:function(e){var i=this,s=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":case"NumpadEnter":case"Space":this.onSpaceKey(e);break;case"Tab":break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e);break;default:if(this.multiple&&e.code==="KeyA"&&s){var o=this.visibleOptions.filter(function(n){return i.isValidOption(n)}).map(function(n){return i.getOptionValue(n)});this.updateModel(e,o),e.preventDefault();break}!s&&l.isPrintableCharacter(e.key)&&(this.searchOptions(e,e.key),e.preventDefault());break}},onOptionSelect:function(e,i){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1;this.disabled||this.isOptionDisabled(i)||(this.multiple?this.onOptionSelectMultiple(e,i):this.onOptionSelectSingle(e,i),this.optionTouched=!1,s!==-1&&(this.focusedOptionIndex=s))},onOptionMouseDown:function(e,i){this.changeFocusedOptionIndex(e,i)},onOptionMouseMove:function(e,i){this.focusOnHover&&this.focused&&this.changeFocusedOptionIndex(e,i)},onOptionTouchEnd:function(){this.disabled||(this.optionTouched=!0)},onOptionSelectSingle:function(e,i){var s=this.isSelected(i),o=!1,n=null,u=this.optionTouched?!1:this.metaKeySelection;if(u){var f=e&&(e.metaKey||e.ctrlKey);s?f&&(n=null,o=!0):(n=this.getOptionValue(i),o=!0)}else n=s?null:this.getOptionValue(i),o=!0;o&&this.updateModel(e,n)},onOptionSelectMultiple:function(e,i){var s=this.isSelected
Line truncated
|
||||
@@ -1 +0,0 @@
|
||||
import v from"./Cm7Dkme4.js";import{a3 as b,av as h,i as P,Z as g,$ as O,t as i,v as c,aa as a,ag as w,Y as p,P as u,A as B,ab as S,O as j}from"./DRtWvKfJ.js";import{s as I}from"./B7nXBdam.js";import{s as $}from"./Bl_ZW1Xh.js";import"./CwRw2352.js";import"./B5fdn047.js";import"./BMCLKWyE.js";var C={root:function(t){var r=t.props;return["p-inplace p-component",{"p-inplace-closable":r.closable}]},display:function(t){var r=t.props;return["p-inplace-display",{"p-disabled":r.disabled}]},content:"p-inplace-content"},D=b.extend({name:"inplace",classes:C}),k={name:"BaseInplace",extends:$,props:{closable:{type:Boolean,default:!1},active:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},closeIcon:{type:String,default:void 0},displayProps:{type:null,default:null},closeButtonProps:{type:null,default:null}},style:D,provide:function(){return{$parentInstance:this}}},A={name:"Inplace",extends:k,inheritAttrs:!1,emits:["open","close","update:active"],data:function(){return{d_active:this.active}},watch:{active:function(t){this.d_active=t}},methods:{open:function(t){this.disabled||(this.$emit("open",t),this.d_active=!0,this.$emit("update:active",!0))},close:function(t){var r=this;this.$emit("close",t),this.d_active=!1,this.$emit("update:active",!1),setTimeout(function(){r.$refs.display.focus()},0)}},computed:{closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},components:{IPButton:v,TimesIcon:I},directives:{focustrap:h}};function s(e){"@babel/helpers - typeof";return s=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},s(e)}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?f(Object(r),!0).forEach(function(n){T(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function T(e,t,r){return t=E(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function E(e){var t=K(e,"string");return s(t)=="symbol"?t:String(t)}function K(e,t){if(s(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(s(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var L=["tabindex"];function N(e,t,r,n,l,o){var m=P("IPButton"),y=g("focustrap");return O((i(),c("div",a({class:e.cx("root"),"aria-live":"polite"},e.ptmi("root")),[l.d_active?(i(),c("div",a({key:1,class:e.cx("content")},e.ptm("content")),[p(e.$slots,"content"),e.closable?(i(),u(m,a({key:0,"aria-label":o.closeAriaLabel,onClick:o.close,unstyled:e.unstyled,pt:e.ptm("closeButton")},e.closeButtonProps),{icon:B(function(){return[p(e.$slots,"closeicon",{},function(){return[(i(),u(S(e.closeIcon?"span":"TimesIcon"),a({class:e.closeIcon},e.ptm("closeButton").icon,{"data-pc-section":"closebuttonicon"}),null,16,["class"]))]})]}),_:3},16,["aria-label","onClick","unstyled","pt"])):j("",!0)],16)):(i(),c("div",a({key:0,ref:"display",class:e.cx("display"),tabindex:e.$attrs.tabindex||"0",role:"button",onClick:t[0]||(t[0]=function(){return o.open&&o.open.apply(o,arguments)}),onKeydown:t[1]||(t[1]=w(function(){return o.open&&o.open.apply(o,arguments)},["enter"]))},d(d({},e.displayProps),e.ptm("display"))),[p(e.$slots,"display")],16,L))],16)),[[y]])}A.render=N;export{A as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{s as r}from"./Bl_ZW1Xh.js";import"./DRtWvKfJ.js";var s={name:"Row",extends:r,inject:["$rows"],mounted:function(){var t;(t=this.$rows)===null||t===void 0||t.add(this.$)},unmounted:function(){var t;(t=this.$rows)===null||t===void 0||t.delete(this.$)},render:function(){return null}};export{s as default};
|
||||
@@ -1,5 +0,0 @@
|
||||
import{u as F,a as me,_ as ve,l as ce}from"./lXe9j5XU.js";import W from"./Cm7Dkme4.js";import Ie from"./Cls9geQy.js";import te from"./ChcErU2V.js";import Ne from"./dbkXk2FM.js";import Re from"./_99QGe7X.js";import{c as C,M as g,t as c,P as T,O as D,v as $,N as q,z as o,y as I,r as x,A as u,x as e,X as le,R as j,U as fe,B as R,Y as Me,W as Le,_ as qe,o as _e,Z as be,$ as se,C as Oe,D as Ee,a0 as he,Q as ge,G as Ae,i as Pe,a1 as je,S as Fe,L as We,V as ne,a2 as He}from"./DRtWvKfJ.js";import ze from"./CP0-jfu8.js";import Ge from"./qKtqUDpn.js";import Je from"./BfPKB-F8.js";import Ke from"./ZYKRgrtt.js";import{a as ye,_ as Se,u as $e}from"./DV2bnluu.js";import ue from"./B14_1DDx.js";import Qe from"./1T5oFhIQ.js";import Ye from"./BjAXeOBb.js";import Xe from"./Ca3-bi3b.js";import Ze from"./Dh-jSmv_.js";import we from"./DMsZhJAp.js";import es from"./KMkrkpbk.js";import ss from"./CZfe2Sfn.js";import os from"./CJA3DD2a.js";import xe from"./Ce0F-GHP.js";import ke from"./D2IhmS2j.js";import ns from"./DOsY_IVn.js";import ts from"./BMYrlhrg.js";import ls from"./Cw-7pq-7.js";const Ce={__name:"SessionChip",props:{session:Object,image:String},setup(t){const l=t,s=C(()=>{if(l.session.me)return`${l.session.me.pushName} (${l.session.me.id})`});return(a,d)=>{const i=Re;return g(s)?(c(),T(i,{key:0,label:g(s),image:t.image},null,8,["label","image"])):D("",!0)}}},Ve={__name:"RefreshButton",props:["refreshing"],setup(t){const l=t,s=C(()=>l.refreshing?"pi pi-refresh pi-spin":"pi pi-refresh");return(a,d)=>{const i=W;return c(),T(i,{icon:g(s),rounded:"",text:"",disabled:t.refreshing},null,8,["icon","disabled"])}}},is=["src"],as={__name:"Base64Img",props:{data:String,mimetype:String},setup(t){const l=t,s=C(()=>`data:${l.mimetype};base64, ${l.data}`);return(a,d)=>(c(),$("img",{src:s.value,style:{"max-width":"100%"}},null,8,is))}};function rs(t){return new Promise(l=>setTimeout(l,t))}const ds={key:2,style:{"background-color":"#f8f9fa",padding:"1rem",color:"red","white-space":"pre-wrap"}},De={__name:"SessionScreenshot",props:{session:Object},setup(t,{expose:l}){const s=F(),a=t,{data:d,pending:i,error:m,refresh:r}=me(`session-screenshot-${a.session.server.id}-${a.session.name}`,async()=>(await rs(1e3),await s.getScreenshot(a.session.server.id,a.session.name)));return l({refresh:r}),(_,v)=>{const y=Ge,k=Je,b=as;return c(),$(q,null,[g(i)?(c(),$(q,{key:0},[o(y,{mode:"indeterminate",style:{height:"3px"}}),!g(d)&&!g(m)?(c(),T(k,{key:0,width:"100%",height:"20rem"})):D("",!0)],64)):D("",!0),g(d)?(c(),T(b,{key:1,data:g(d).data,mimetype:g(d).mimetype},null,8,["data","mimetype"])):D("",!0),g(m)?(c(),$("pre",ds,""+I(g(m).cause.response.data.message||g(m).cause.response.data||g(m))+`
|
||||
`,1)):D("",!0)],64)}}},cs={class:"",style:{"min-width":"20rem"}},us={class:"flex justify-content-center align-items-center"},ps=e("h5",{class:"m-0"},"Screenshot",-1),ms={class:"m-auto w-full"},vs={__name:"ScreenshotButton",props:["disabled","session"],setup(t){const l=x(null),s=x(null),a=i=>{l.value.toggle(i)},d=()=>{s.value.refresh()};return(i,m)=>{const r=W,_=Ve,v=De,y=Ke;return c(),$(q,null,[o(r,{disabled:t.disabled,type:"button",icon:"pi pi-camera",onClick:a,rounded:"",outlined:""},null,8,["disabled"]),o(y,{ref_key:"op",ref:l,appendTo:"body",showCloseIcon:!0},{default:u(()=>[e("div",cs,[e("div",us,[ps,o(_,{onClick:d})]),e("div",ms,[o(v,{ref_key:"screenshot",ref:s,session:t.session},null,8,["session"])])])]),_:1},512)],64)}}},fs={class:"ml-1"},_s={key:1},bs={class:"ml-1"},Te={__name:"ServerDropdown",props:le({showClear:Boolean,placeholder:String,required:Boolean,invalid:Boolean,disabled:Boolean},{server:{},serverModifiers:{}}),emits:["update:server"],setup(t){const l=j(t,"server"),s=F();return(a,d)=>{const i=ye,m=ue;return c(),T(m,{optionValue:"id",modelValue:l.value,"onUpdate:modelValue":d[0]||(d[0]=r=>l.value=r),options:g(s).servers,onChange:d[1]||(d[1]=r=>a.$emit("change",l.value)),placeholder:t.placeholder,class:"p-column-filter",showClear:t.showClear,required:t.required,invalid:t.invalid,disabled:t.disabled},{value:u(r=>[r.value?(c(),$(q,{key:0},[o(i,{connected:g(s).getServer(r.value).connected},null,8,["connected"]),e("span",fs,I(g(s).getServer(r.value).name),1)],64)):(c(),$("span",_s,I(r.placeholder),1))]),option:u(r=>[o(i,{connected:r.option.connected},null,8,["connected"]),e("span",bs,I(r.option.name)+" ("+I(r.option.connection.url)+") ",1)]),_:1},8,["modelValue","options","placeholder","showClear","required","invalid","disabled"])}}},hs={class:"p-dialog-title flex gap-2 align-items-center"},gs=e("span",null,"(",-1),ys={class:"ml-1"},Ss=e("span",null,")",-1),$s=["disabled"],ws=e("i",{class:"pi pi-refresh"},null,-1),xs=[ws],Ue={__name:"SessionHeader",props:{session:Object,refresh:Boolean},setup(t){const l=t,s=F(),{refreshing:a}=fe(s),d=C(()=>l.session.server.id?l.session.server:s.getServer(l.session.server));async function i(){await s.refresh()}return(m,r)=>{var k;const _=Se,v=ye,y=ve;return c(),$("div",hs,[e("span",null,I((k=t.session)==null?void 0:k.name),1),o(_,{status:t.session.status},null,8,["status"]),e("div",null,[gs,o(v,{connected:d.value.connected},null,8,["connected"]),e("span",ys,I(d.value.name),1),Ss]),t.refresh?(c(),$("button",{key:0,onClick:r[0]||(r[0]=b=>i()),class:"p-link layout-topbar-button",disabled:g(a)},xs,8,$s)):D("",!0),o(y,{refreshing:g(a)},null,8,["refreshing"])])}}},ks={class:"-mt-4 p-0 line-height-3 block",style:{"font-family":"monaco, Consolas, 'Lucida Console', monospace"}},Cs={__name:"CodeHighlight",props:["invalid"],setup(t){const l=t,s=C(()=>l.invalid?"p-invalid p-component p-inputtext":"");return(a,d)=>(c(),$("pre",{class:Le(["border-round surface-ground text-900 p-5 overflow-auto",s.value])},[R(" "),e("code",ks,[Me(a.$slots,"default")])],2))}},pe=t=>(Oe("data-v-ca11cfb1"),t=t(),Ee(),t),Vs={class:"h-full flex flex-column"},Ds={class:"flex justify-content-center align-items-center"},Ts=pe(()=>e("h5",{class:"m-0"},"Request",-1)),Us={class:"flex flex-column justify-content-between h-full"},Bs={class:"flex flex-column gap-2"},Is={class:"flex gap-2"},Ns={class:"text-center"},Rs=pe(()=>e("div",{class:"mb-2"},"Body",-1)),Ms={class:"text-center mt-2"},Ls={class:"flex flex-column h-full"},qs={class:"flex justify-content-center align-items-center"},Os=pe(()=>e("h5",{class:"m-0"},"Response",-1)),Es={__name:"SessionRequestResponse",props:["session"],setup(t){const l=F(),s=t,a=x(null),d=x("POST"),i=x("/api/sendText"),m=x(""),r=x(!1),_=x(!1);function v(w){return JSON.stringify(w,null,2)}function y(w){try{return JSON.parse(w)}catch{return w}}const k=C(()=>({method:d.value,uri:i.value,params:void 0,body:y(m.value)})),b=["GET","POST","PUT","DELETE","PATCH"];async function U(w){await navigator.clipboard.writeText(a.value),w.preventDefault()}async function B(w){await navigator.clipboard.writeText(v(k.value)),w.preventDefault()}async function O(){try{_.value=!1,r.value=!0;const w=await l.callServerAPI(s.session.server.id,k.value);a.value=v(w)}catch(w){_.value=!0,w.response?a.value=v(w.response.data):a.value=v(w)}finally{r.value=!1}}return _e(()=>{const w={chatId:"11111111111@c.us",text:"Hi there!",session:s.session.name};m.value=v(w),a.value="..."}),(w,V)=>{const E=W,H=ue,z=te,Y=Xe,G=Ze,A=Cs,S=be("tooltip");return c(),$(q,null,[e("div",null,[e("div",Vs,[e("div",Ds,[Ts,se(o(E,{rounded:"",text:"",tabindex:0,icon:"pi pi-copy",onClick:V[0]||(V[0]=n=>B(n))},null,512),[[S,{value:"Copied to clipboard"},void 0,{focus:!0,bottom:!0}]])]),e("div",Us,[e("div",Bs,[e("div",Is,[o(H,{modelValue:d.value,"onUpdate:modelValue":V[1]||(V[1]=n=>d.value=n),options:b},null,8,["modelValue"]),o(z,{type:"text",class:"w-full",modelValue:i.value,"onUpdate:modelValue":V[2]||(V[2]=n=>i.value=n),placehol
Line truncated
|
||||
Otherwise the store can miss some information.`]])])])]),_:1})]),_:1})])):D("",!0),e("div",Lo,[o(oe,{ref:"webhooks",webhooks:s.value.config.webhooks,"onUpdate:webhooks":n[4]||(n[4]=h=>s.value.config.webhooks=h),disabled:r.value},null,8,["webhooks","disabled"])]),e("div",null,[e("div",qo,[Oo,o(K,{modelValue:U.value,"onUpdate:modelValue":n[5]||(n[5]=h=>U.value=h),onLabel:"Proxy On",offLabel:"Proxy Off",disabled:r.value},{icon:u(()=>[o(J,{icon:"fa-solid fa-server",class:"mr-2"})]),_:1},8,["modelValue","disabled"])]),U.value?(c(),$("div",Eo,[e("div",Ao,[Po,o(X,{id:"proxy-server",modelValue:s.value.config.proxy.server,"onUpdate:modelValue":n[6]||(n[6]=h=>s.value.config.proxy.server=h),modelModifiers:{trim:!0},required:"true",invalid:B.value&&!s.value.config.proxy.server,disabled:i.value,placeholder:"host:port"},null,8,["modelValue","invalid","disabled"]),B.value&&!s.value.config.proxy.server?(c(),$("small",jo,"Server is required.")):D("",!0)]),e("div",Fo,[e("div",Wo,[Ho,o(X,{id:"proxy-username",modelValue:s.value.config.proxy.username,"onUpdate:modelValue":n[7]||(n[7]=h=>s.value.config.proxy.username=h),modelModifiers:{trim:!0},disabled:i.value},null,8,["modelValue","disabled"])]),e("div",zo,[Go,o(re,{id:"proxy-password",modelValue:s.value.config.proxy.password,"onUpdate:modelValue":n[8]||(n[8]=h=>s.value.config.proxy.password=h),modelModifiers:{trim:!0},disabled:i.value,feedback:!1,toggleMask:""},null,8,["modelValue","disabled"])])])])):D("",!0)]),e("div",Jo,[Ko,o(K,{modelValue:s.value.config.debug,"onUpdate:modelValue":n[9]||(n[9]=h=>s.value.config.debug=h),onLabel:"Debug Enabled",offLabel:"Debug Disabled",onIcon:"fa fa-bug",disabled:r.value},{icon:u(()=>[o(J,{icon:"fa-solid fa-bug",class:"mr-2"})]),_:1},8,["modelValue","disabled"])])]),_:2},[d.value?void 0:{name:"header",fn:u(()=>[o(f,{session:s.value},null,8,["session"])]),key:"0"}]),1032,["visible"])}}},Zo=["WORKING","FAILED","STARTING","SCAN_QR_CODE","STOPPED"],en={class:"flex justify-content-between"},sn={class:"flex align-items-center gap-1"},on=e("i",{class:"pi pi-whatsapp"},null,-1),nn=e("span",{class:"mr-1"}," Sessions ",-1),tn=["disabled"],ln=e("i",{class:"pi pi-refresh"},null,-1),an=[ln],rn={class:"flex justify-content-between flex-column sm:flex-row gap-2 sm:gap-0"},dn={class:"flex gap-2 align-items-center"},cn={class:"flex gap-2"},un={class:"my-auto"},pn={class:"flex flex-row gap-2 justify-content-end"},En={__name:"SessionTable",setup(t){const l=he(),s=Fe(),a=F(),{allSessions:d,refreshing:i,servers:m}=fe(a),r=d,_=$e(),v=x({config:{webhooks:[]}}),y=x(!1),k=x(void 0),b=x(!1);x(null);const U=x({}),B=x(null);We(()=>{O()});const O=()=>{U.value={global:{value:null,matchMode:ne.CONTAINS},status:{value:null,matchMode:ne.EQUALS},"server.id":{value:null,matchMode:ne.EQUALS},name:{operator:He.AND,constraints:[{value:null,matchMode:ne.STARTS_WITH}]}}};function w(){const n=m.value.find(f=>f.connected);if(!n){l.add({severity:"error",summary:"No connected server",detail:"Please connect to a server first",life:3e3});return}v.value={server:n.id,name:"session_"+Math.random().toString(36).substring(7),config:{webhooks:[{url:"https://httpbin.org/post",events:["session.status","message","message.reaction"],hmac:{key:null},retries:{delaySeconds:2,attempts:15}}],noweb:{store:{enabled:!0,fullSync:!1}},proxy:{}}},k.value="new",y.value=!0}function V(n){v.value=ce.cloneDeep({name:n.name,status:n.status,server:n.server.id,config:n.config}),k.value="view",y.value=!0}function E(n){v.value=ce.cloneDeep({name:n.name,status:n.status,server:n.server.id,config:n.config}),k.value="start",y.value=!0}function H(n,f){s.require({target:n.target,message:`Stop '${f.name}' session?
|
||||
`,icon:"pi pi-exclamation-triangle",rejectClass:"p-button-secondary p-button-outlined p-button-sm",acceptClass:"p-button-warning p-button-sm",rejectLabel:"No",acceptLabel:"Yes, Stop",accept:async()=>{await _(a.stopSession(f.server.id,f.name,!1),"Stopped","Failed to stop session")},reject:()=>{}})}function z(n,f){s.require({target:n.target,message:`Logout '${f.name}' session?
|
||||
`,icon:"pi pi-exclamation-triangle",rejectClass:"p-button-secondary p-button-outlined p-button-sm",acceptClass:"p-button-danger p-button-sm",rejectLabel:"No",acceptLabel:"Yes, Logout",accept:async()=>{await _(a.logoutSession(f.server.id,f.name),"Logged out","Failed to logout session")},reject:()=>{}})}function Y(){me("store",async()=>await a.refresh())}function G(n){A(n.data)}function A(n){b.value=!0,v.value=n}const S=["name","me.id"];return(n,f)=>{const P=ve,M=W,X=Ie,ie=te,J=Ne,K=Ce,Q=ze,ae=vs,oe=Se,re=ue,Z=Te,de=Qe,ee=Ye,h=eo,Be=Xo;return c(),$(q,null,[e("div",en,[e("div",null,[e("h5",sn,[on,nn,o(P,{refreshing:g(i)},null,8,["refreshing"])])]),e("div",null,[e("button",{onClick:Y,class:"p-link layout-topbar-button",disabled:g(i)},an,8,tn)])]),o(de,{value:g(r).length>0?g(r):[],paginator:!0,rows:20,dataKey:p=>`${p.name}-${p.server.id}-${p.status}`,rowHover:!0,filters:U.value,"onUpdate:filters":f[1]||(f[1]=p=>U.value=p),filterDisplay:"row",loading:B.value,globalFilterFields:S,onRowClick:G,showGridlines:"",class:"p-datatable--clickable",style:{"white-space":"nowrap"}},{header:u(()=>[e("div",rn,[o(M,{label:"Start New",icon:"pi pi-play",severity:"success",onClick:w}),o(J,{iconPosition:"left"},{default:u(()=>[o(X,{class:"pi pi-search"}),o(ie,{modelValue:U.value.global.value,"onUpdate:modelValue":f[0]||(f[0]=p=>U.value.global.value=p),placeholder:"Search by name or phone number",style:{width:"100%"}},null,8,["modelValue"])]),_:1})])]),empty:u(()=>[R(" No sessions found")]),loading:u(()=>[R(" Loading sessions...")]),default:u(()=>[o(Q,{field:"name",header:"Name",sortable:""},{body:u(({data:p})=>[e("div",dn,[o(M,{icon:"pi pi-info",rounded:"",outlined:"",onClick:N=>A(p)},null,8,["onClick"]),e("span",null,I(p.name),1),o(K,{session:p},null,8,["session"])])]),_:1}),o(Q,{field:"status",header:"Status",showFilterMenu:!1,style:{width:"9rem"}},{body:u(({data:p})=>[e("div",cn,[e("div",null,[o(ae,{session:p},null,8,["session"])]),e("div",un,[o(oe,{status:p.status},null,8,["status"])])])]),filter:u(({filterModel:p,filterCallback:N})=>[o(re,{modelValue:p.value,"onUpdate:modelValue":L=>p.value=L,options:g(Zo),onChange:L=>N(),placeholder:"Any",class:"p-column-filter",showClear:!0},{option:u(({option:L})=>[o(oe,{status:L,value:L},null,8,["status","value"])]),_:2},1032,["modelValue","onUpdate:modelValue","options","onChange"])]),_:1}),o(Q,{field:"server.name",filterField:"server.id",header:"Server",showFilterMenu:!1},{filter:u(({filterModel:p,filterCallback:N})=>[o(Z,{placeholder:"Any",onChange:L=>N(),modelValue:p.value,"onUpdate:modelValue":L=>p.value=L,showClear:!0,required:!1},null,8,["onChange","modelValue","onUpdate:modelValue"])]),_:1}),o(Q,null,{body:u(({data:p})=>[e("div",pn,[o(M,{icon:"pi pi-cog",severity:"secondary",rounded:"",outlined:"",onClick:N=>V(p)},null,8,["onClick"]),o(M,{icon:"pi pi-play",severity:"success",rounded:"",outlined:"",onClick:N=>E(p)},null,8,["onClick"]),o(M,{icon:"pi pi-stop",severity:"warning",rounded:"",outlined:"",onClick:N=>H(N,p)},null,8,["onClick"]),o(M,{icon:"pi pi-trash",severity:"danger",rounded:"",outlined:"",onClick:N=>z(N,p)},null,8,["onClick"])])]),_:1})]),_:1},8,["value","dataKey","filters","loading"]),o(ee),o(h,{visible:b.value,"onUpdate:visible":f[2]||(f[2]=p=>b.value=p),session:v.value,"onUpdate:session":f[3]||(f[3]=p=>v.value=p)},null,8,["visible","session"]),o(Be,{visible:y.value,"onUpdate:visible":f[4]||(f[4]=p=>y.value=p),session:v.value,"onUpdate:session":f[5]||(f[5]=p=>v.value=p),mode:k.value},null,8,["visible","session","mode"])],64)}}};export{En as _};
|
||||
@@ -1 +0,0 @@
|
||||
import{s as i}from"./Bl_ZW1Xh.js";import{t as s,v as l,Y as d,O as a,aa as c}from"./DRtWvKfJ.js";var u={},f={name:"DeferredContent",extends:i,inheritAttrs:!1,emits:["load"],style:u,data:function(){return{loaded:!1}},mounted:function(){this.loaded||(this.shouldLoad()?this.load():this.bindScrollListener())},beforeUnmount:function(){this.unbindScrollListener()},methods:{bindScrollListener:function(){var t=this;this.documentScrollListener=function(){t.shouldLoad()&&(t.load(),t.unbindScrollListener())},window.addEventListener("scroll",this.documentScrollListener)},unbindScrollListener:function(){this.documentScrollListener&&(window.removeEventListener("scroll",this.documentScrollListener),this.documentScrollListener=null)},shouldLoad:function(){if(this.loaded)return!1;var t=this.$refs.container.getBoundingClientRect(),n=document.documentElement,o=n.clientHeight;return o>=t.top},load:function(t){this.loaded=!0,this.$emit("load",t)}}};function m(e,t,n,o,r,h){return s(),l("div",c({ref:"container"},e.ptmi("root")),[r.loaded?d(e.$slots,"default",{key:0}):a("",!0)],16)}f.render=m;export{f as default};
|
||||
@@ -1 +0,0 @@
|
||||
import i from"./XrWOLLJc.js";import{r as l,v as r,N as a,Q as p,t as e,P as c,O as o}from"./DRtWvKfJ.js";import"./yXaOlmbx.js";const m={class:"layout-menu"},u={key:1,class:"menu-separator"},v={__name:"AppMenu",setup(_){const t=l([{label:"Home",items:[{label:"Dashboard",icon:"pi pi-fw pi-home",to:"/"},{label:"Servers",icon:"pi pi-fw pi-server",to:"/servers"},{label:"Sessions",icon:"pi pi-fw pi-whatsapp",to:"/sessions"}]}]);return(d,f)=>(e(),r("ul",m,[(e(!0),r(a,null,p(t.value,(s,n)=>(e(),r(a,{key:s},[s.separator?o("",!0):(e(),c(i,{key:0,item:s,index:n},null,8,["item","index"])),s.separator?(e(),r("li",u)):o("",!0)],64))),128))]))}};export{v as default};
|
||||
@@ -1,2 +0,0 @@
|
||||
import{t as o,v as p,aa as l,x as y,a3 as J,a5 as X,a6 as T,a4 as c,a7 as a,a8 as $,ah as _,a9 as ee,i as w,Z as te,Y as h,B as P,y as O,P as v,ab as A,W as x,O as I,z as B,A as K,ac as ie,a1 as ne,N as H,Q as re,$ as se}from"./DRtWvKfJ.js";import{s as le}from"./BMCLKWyE.js";import{s as oe}from"./BKuF8g-Y.js";import{s as ae}from"./DpeyYdwe.js";import{s as ue}from"./D2eV2xTx.js";import{s as de}from"./B5fdn047.js";import{s as ce}from"./B7nXBdam.js";import{O as pe}from"./CELf783E.js";import{s as fe}from"./CFcFeTBy.js";import he from"./BnGLU8uI.js";import{s as ye}from"./Bl_ZW1Xh.js";var z={name:"BlankIcon",extends:le},be=y("rect",{width:"1",height:"1",fill:"currentColor","fill-opacity":"0"},null,-1),me=[be];function ge(t,e,i,r,s,n){return o(),p("svg",l({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.pti()),me,16)}z.render=ge;var Oe={root:function(e){var i=e.instance,r=e.props,s=e.state;return["p-dropdown p-component p-inputwrapper",{"p-disabled":r.disabled,"p-invalid":r.invalid,"p-variant-filled":r.variant?r.variant==="filled":i.$primevue.config.inputStyle==="filled","p-dropdown-clearable":r.showClear,"p-focus":s.focused,"p-inputwrapper-filled":i.hasSelectedOption,"p-inputwrapper-focus":s.focused||s.overlayVisible,"p-overlay-open":s.overlayVisible}]},input:function(e){var i,r=e.instance,s=e.props;return["p-dropdown-label p-inputtext",{"p-placeholder":!s.editable&&r.label===s.placeholder,"p-dropdown-label-empty":!s.editable&&!r.$slots.value&&(r.label==="p-emptylabel"||((i=r.label)===null||i===void 0?void 0:i.length)===0)}]},clearIcon:"p-dropdown-clear-icon",trigger:"p-dropdown-trigger",loadingicon:"p-dropdown-trigger-icon",dropdownIcon:"p-dropdown-trigger-icon",panel:function(e){e.props;var i=e.instance;return["p-dropdown-panel p-component",{"p-ripple-disabled":i.$primevue.config.ripple===!1}]},header:"p-dropdown-header",filterContainer:"p-dropdown-filter-container",filterInput:function(e){var i=e.props,r=e.instance;return["p-dropdown-filter p-inputtext p-component",{"p-variant-filled":i.variant?i.variant==="filled":r.$primevue.config.inputStyle==="filled"}]},filterIcon:"p-dropdown-filter-icon",wrapper:"p-dropdown-items-wrapper",list:"p-dropdown-items",itemGroup:"p-dropdown-item-group",itemGroupLabel:"p-dropdown-item-group-label",item:function(e){var i=e.instance,r=e.props,s=e.state,n=e.option,d=e.focusedOption;return["p-dropdown-item",{"p-highlight":i.isSelected(n)&&r.highlightOnSelect,"p-focus":s.focusedOptionIndex===d,"p-disabled":i.isOptionDisabled(n)}]},itemLabel:"p-dropdown-item-label",checkIcon:"p-dropdown-check-icon",blankIcon:"p-dropdown-blank-icon",emptyMessage:"p-dropdown-empty-message"},ve=J.extend({name:"dropdown",classes:Oe}),Ie={name:"BaseDropdown",extends:ye,props:{modelValue:null,options:Array,optionLabel:[String,Function],optionValue:[String,Function],optionDisabled:[String,Function],optionGroupLabel:[String,Function],optionGroupChildren:[String,Function],scrollHeight:{type:String,default:"200px"},filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},editable:Boolean,placeholder:{type:String,default:null},variant:{type:String,default:null},invalid:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dataKey:null,showClear:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},panelClass:{type:[String,Object],default:null},panelStyle:{type:Object,default:null},panelProps:{type:null,default:null},filterInputProps:{type:null,default:null},clearIconProps:{type:null,default:null},appendTo:{type:[String,Object],default:"body"},loading:{type:Boolean,default:!1},clearIcon:{type:String,default:void 0},dropdownIcon:{type:String,default:void 0},filterIcon:{type:String,default:void 0},loadingIcon:{type:String,default:void 0},resetFilterOnHide:{type:Boolean,default:!1},resetFilterOnClear:{type:Boolean,default:!1},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!1},autoFilterFocus:{type:Boolean,default:!1},selectOnFocus:{type:Boolean,default:!1},focusOnHover:{type:Boolean,default:!0},highlightOnSelect:{type:Boolean,default:!0},checkmark:{type:Boolean,default:!1},filterMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},ariaLabel:{type:String,default:null},ariaLabelledby:{type:String,default:null}},style:ve,provide:function(){return{$parentInstance:this}}};function L(t){"@babel/helpers - typeof";return L=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},L(t)}Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Le(t,e){if(t){if(typeof t=="string")return j(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor&&(i=t.constructor.name),i==="Map"||i==="Set")return Array.from(t);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return j(t,e)}}function ke(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Fe(t){if(Array.isArray(t))return j(t)}function j(t,e){(e==null||e>t.length)&&(e=t.length);for(var i=0,r=new Array(e);i<e;i++)r[i]=t[i];return r}function G(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),i.push.apply(i,r)}return i}function R(t){for(var e=1;e<arguments.length;e++){var i=arguments[e]!=null?arguments[e]:{};e%2?G(Object(i),!0).forEach(function(r){N(t,r,i[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):G(Object(i)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))})}return t}function N(t,e,i){return e=Ce(e),e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Ce(t){var e=Ve(t,"string");return L(e)=="symbol"?e:String(e)}function Ve(t,e){if(L(t)!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(L(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var xe={name:"Dropdown",extends:Ie,inheritAttrs:!1,emits:["update:modelValue","change","focus","blur","before-show","before-hide","show","hide","filter"],outsideClickListener:null,scrollHandler:null,resizeListener:null,labelClickListener:null,overlay:null,list:null,virtualScroller:null,searchTimeout:null,searchValue:null,isModelValueChanged:!1,data:function(){return{id:this.$attrs.id,clicked:!1,focused:!1,focusedOptionIndex:-1,filterValue:null,overlayVisible:!1}},watch:{"$attrs.id":{immediate:!0,handler:function(e){this.id=e||X()}},modelValue:function(){this.isModelValueChanged=!0},options:function(){this.autoUpdateModel()}},mounted:function(){this.autoUpdateModel(),this.bindLabelClickListener()},updated:function(){this.overlayVisible&&this.isModelValueChanged&&this.scrollInView(this.findSelectedOptionIndex()),this.isModelValueChanged=!1},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.unbindLabelClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(T.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex:function(e,i){return this.virtualScrollerDisabled?e:i&&i(e).index},getOptionLabel:function(e){return this.optionLabel?c.resolveFieldData(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?c.resolveFieldData(e,this.optionValue):e},getOptionRenderKey:function(e,i){return(this.dataKey?c.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+i},getPTItemOptions:function(e,i,r,s){return this.ptm(s,{context:{option:e,index:r,selected:this.isSelected(e),focused:this.focusedOptionIndex===this.getOptionIndex(r,i),disabled:this.isOptionDisabled(e)}})},isOptionDisabled:function(e){return this.optionDisabled?c.resolveFieldData(e,this.optionDisabled):!1},isOptionGroup:function(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel:function(e){return c.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren:function(e){return c.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset:function(e){var i=this;return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter(function(r){return i.isOptionGroup(r)}).length:e)+1},show:function(e){this.$emit("before-show"),this.overlayVisible=!0,this.focusedOptionIndex=this.focusedOptionIndex!==-1?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():this.editable?-1:this.findSelectedOptionIndex(),e&&a.focus(this.$refs.focusInput)},hide:function(e){var i=this,r=function(){i.$emit("before-hide"),i.overlayVisible=!1,i.clicked=!1,i.focusedOptionIndex=-1,i.searchValue="",i.resetFilterOnHide&&(i.filterValue=null),e&&a.focus(i.$refs.focusInput)};setTimeout(function(){r()},0)},onFocus:function(e){this.disabled||(this.focused=!0,this.overlayVisible&&(this.focusedOptionIndex=this.focusedOptionIndex!==-1?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():this.editable?-1:this.findSelectedOptionIndex(),this.scrollInView(this.focusedOptionIndex)),this.$emit("focus",e))},onBlur:function(e){this.focused=!1,this.focusedOptionIndex=-1,this.searchValue="",this.$emit("blur",e)},onKeyDown:function(e){if(this.disabled||a.isAndroid()){e.preventDefault();return}var i=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;c
Line truncated
|
||||
@@ -1 +0,0 @@
|
||||
import{s as l}from"./Bl_ZW1Xh.js";import{Y as n}from"./DRtWvKfJ.js";var a={},r={name:"BaseTabPanel",extends:l,props:{header:null,headerStyle:null,headerClass:null,headerProps:null,headerActionProps:null,contentStyle:null,contentClass:null,contentProps:null,disabled:Boolean},style:a},t={name:"TabPanel",extends:r};function s(e,o,d,p,u,c){return n(e.$slots,"default")}t.render=s;export{t as default};
|
||||
@@ -1,2 +0,0 @@
|
||||
import{a3 as z,a7 as o,a4 as f,t as p,v as c,N as g,Q as S,P as y,ab as E,aa as d,x as P,O as L}from"./DRtWvKfJ.js";import{s as b}from"./Bl_ZW1Xh.js";var T={root:function(e){var n=e.props;return["p-splitter p-component","p-splitter-"+n.layout]},gutter:"p-splitter-gutter",gutterHandler:"p-splitter-gutter-handle"},x={root:function(e){var n=e.props;return[{display:"flex","flex-wrap":"nowrap"},n.layout==="vertical"?{"flex-direction":"column"}:""]}},M=z.extend({name:"splitter",classes:T,inlineStyles:x}),w={name:"BaseSplitter",extends:b,props:{layout:{type:String,default:"horizontal"},gutterSize:{type:Number,default:4},stateKey:{type:String,default:null},stateStorage:{type:String,default:"session"},step:{type:Number,default:5}},style:M,provide:function(){return{$parentInstance:this}}};function v(t){return G(t)||R(t)||I(t)||A()}function A(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function I(t,e){if(t){if(typeof t=="string")return m(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(t,e)}}function R(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function G(t){if(Array.isArray(t))return m(t)}function m(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,s=new Array(e);n<e;n++)s[n]=t[n];return s}var O={name:"Splitter",extends:w,inheritAttrs:!1,emits:["resizestart","resizeend","resize"],dragging:!1,mouseMoveListener:null,mouseUpListener:null,touchMoveListener:null,touchEndListener:null,size:null,gutterElement:null,startPos:null,prevPanelElement:null,nextPanelElement:null,nextPanelSize:null,prevPanelSize:null,panelSizes:null,prevPanelIndex:null,timer:null,data:function(){return{prevSize:null}},mounted:function(){var e=this;if(this.panels&&this.panels.length){var n=!1;if(this.isStateful()&&(n=this.restoreState()),!n){var s=v(this.$el.children).filter(function(i){return i.getAttribute("data-pc-name")==="splitterpanel"}),r=[];this.panels.map(function(i,a){var u=i.props&&i.props.size?i.props.size:null,h=u||100/e.panels.length;r[a]=h,s[a].style.flexBasis="calc("+h+"% - "+(e.panels.length-1)*e.gutterSize+"px)"}),this.panelSizes=r,this.prevSize=parseFloat(r[0]).toFixed(4)}}},beforeUnmount:function(){this.clear(),this.unbindMouseListeners()},methods:{isSplitterPanel:function(e){return e.type.name==="SplitterPanel"},onResizeStart:function(e,n,s){this.gutterElement=e.currentTarget||e.target.parentElement,this.size=this.horizontal?o.getWidth(this.$el):o.getHeight(this.$el),s||(this.dragging=!0,this.startPos=this.layout==="horizontal"?e.pageX||e.changedTouches[0].pageX:e.pageY||e.changedTouches[0].pageY),this.prevPanelElement=this.gutterElement.previousElementSibling,this.nextPanelElement=this.gutterElement.nextElementSibling,s?(this.prevPanelSize=this.horizontal?o.getOuterWidth(this.prevPanelElement,!0):o.getOuterHeight(this.prevPanelElement,!0),this.nextPanelSize=this.horizontal?o.getOuterWidth(this.nextPanelElement,!0):o.getOuterHeight(this.nextPanelElement,!0)):(this.prevPanelSize=100*(this.horizontal?o.getOuterWidth(this.prevPanelElement,!0):o.getOuterHeight(this.prevPanelElement,!0))/this.size,this.nextPanelSize=100*(this.horizontal?o.getOuterWidth(this.nextPanelElement,!0):o.getOuterHeight(this.nextPanelElement,!0))/this.size),this.prevPanelIndex=n,this.$emit("resizestart",{originalEvent:e,sizes:this.panelSizes}),this.$refs.gutter[n].setAttribute("data-p-gutter-resizing",!0),this.$el.setAttribute("data-p-resizing",!0)},onResize:function(e,n,s){var r,i,a;s?this.horizontal?(i=100*(this.prevPanelSize+n)/this.size,a=100*(this.nextPanelSize-n)/this.size):(i=100*(this.prevPanelSize-n)/this.size,a=100*(this.nextPanelSize+n)/this.size):(this.horizontal?r=e.pageX*100/this.size-this.startPos*100/this.size:r=e.pageY*100/this.size-this.startPos*100/this.size,i=this.prevPanelSize+r,a=this.nextPanelSize-r),this.validateResize(i,a)&&(this.prevPanelElement.style.flexBasis="calc("+i+"% - "+(this.panels.length-1)*this.gutterSize+"px)",this.nextPanelElement.style.flexBasis="calc("+a+"% - "+(this.panels.length-1)*this.gutterSize+"px)",this.panelSizes[this.prevPanelIndex]=i,this.panelSizes[this.prevPanelIndex+1]=a,this.prevSize=parseFloat(i).toFixed(4)),this.$emit("resize",{originalEvent:e,sizes:this.panelSizes})},onResizeEnd:function(e){this.isStateful()&&this.saveState(),this.$emit("resizeend",{originalEvent:e,sizes:this.panelSizes}),this.$refs.gutter.forEach(function(n){return n.setAttribute("data-p-gutter-resizing",!1)}),this.$el.setAttribute("data-p-resizing",!1),this.clear()},repeat:function(e,n,s){this.onResizeStart(e,n,!0),this.onResize(e,s,!0)},setTimer:function(e,n,s){var r=this;this.timer||(this.timer=setInterval(function(){r.repeat(e,n,s)},40))},clearTimer:function(){this.timer&&(clearInterval(this.timer),this.timer=null)},onGutterKeyUp:function(){this.clearTimer(),this.onResizeEnd()},onGutterKeyDown:function(e,n){switch(e.code){case"ArrowLeft":{this.layout==="horizontal"&&this.setTimer(e,n,this.step*-1),e.preventDefault();break}case"ArrowRight":{this.layout==="horizontal"&&this.setTimer(e,n,this.step),e.preventDefault();break}case"ArrowDown":{this.layout==="vertical"&&this.setTimer(e,n,this.step*-1),e.preventDefault();break}case"ArrowUp":{this.layout==="vertical"&&this.setTimer(e,n,this.step),e.preventDefault();break}}},onGutterMouseDown:function(e,n){this.onResizeStart(e,n),this.bindMouseListeners()},onGutterTouchStart:function(e,n){this.onResizeStart(e,n),this.bindTouchListeners(),e.preventDefault()},onGutterTouchMove:function(e){this.onResize(e),e.preventDefault()},onGutterTouchEnd:function(e){this.onResizeEnd(e),this.unbindTouchListeners(),e.preventDefault()},bindMouseListeners:functio
Line truncated
|
||||
@@ -1 +0,0 @@
|
||||
import{s as C}from"./BMCLKWyE.js";import{t as r,v as t,aa as o,x as s}from"./DRtWvKfJ.js";var a={name:"SpinnerIcon",extends:C},n=s("path",{d:"M6.99701 14C5.85441 13.999 4.72939 13.7186 3.72012 13.1832C2.71084 12.6478 1.84795 11.8737 1.20673 10.9284C0.565504 9.98305 0.165424 8.89526 0.041387 7.75989C-0.0826496 6.62453 0.073125 5.47607 0.495122 4.4147C0.917119 3.35333 1.59252 2.4113 2.46241 1.67077C3.33229 0.930247 4.37024 0.413729 5.4857 0.166275C6.60117 -0.0811796 7.76026 -0.0520535 8.86188 0.251112C9.9635 0.554278 10.9742 1.12227 11.8057 1.90555C11.915 2.01493 11.9764 2.16319 11.9764 2.31778C11.9764 2.47236 11.915 2.62062 11.8057 2.73C11.7521 2.78503 11.688 2.82877 11.6171 2.85864C11.5463 2.8885 11.4702 2.90389 11.3933 2.90389C11.3165 2.90389 11.2404 2.8885 11.1695 2.85864C11.0987 2.82877 11.0346 2.78503 10.9809 2.73C9.9998 1.81273 8.73246 1.26138 7.39226 1.16876C6.05206 1.07615 4.72086 1.44794 3.62279 2.22152C2.52471 2.99511 1.72683 4.12325 1.36345 5.41602C1.00008 6.70879 1.09342 8.08723 1.62775 9.31926C2.16209 10.5513 3.10478 11.5617 4.29713 12.1803C5.48947 12.7989 6.85865 12.988 8.17414 12.7157C9.48963 12.4435 10.6711 11.7264 11.5196 10.6854C12.3681 9.64432 12.8319 8.34282 12.8328 7C12.8328 6.84529 12.8943 6.69692 13.0038 6.58752C13.1132 6.47812 13.2616 6.41667 13.4164 6.41667C13.5712 6.41667 13.7196 6.47812 13.8291 6.58752C13.9385 6.69692 14 6.84529 14 7C14 8.85651 13.2622 10.637 11.9489 11.9497C10.6356 13.2625 8.85432 14 6.99701 14Z",fill:"currentColor"},null,-1),i=[n];function p(e,c,l,d,h,m){return r(),t("svg",o({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.pti()),i,16)}a.render=p;export{a as s};
|
||||
@@ -1 +0,0 @@
|
||||
import{s as r}from"./Bl_ZW1Xh.js";import"./DRtWvKfJ.js";var e={},u={name:"BaseColumnGroup",extends:r,props:{type:{type:String,default:null}},style:e,provide:function(){return{$parentInstance:this}}},i={name:"ColumnGroup",extends:u,inheritAttrs:!1,inject:["$columnGroups"],mounted:function(){var n;(n=this.$columnGroups)===null||n===void 0||n.add(this.$)},unmounted:function(){var n;(n=this.$columnGroups)===null||n===void 0||n.delete(this.$)},render:function(){return null}};export{i as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{s as r}from"./BMCLKWyE.js";import{t,v as o,aa as s,x as C}from"./DRtWvKfJ.js";var a={name:"TimesIcon",extends:r},n=C("path",{d:"M8.01186 7.00933L12.27 2.75116C12.341 2.68501 12.398 2.60524 12.4375 2.51661C12.4769 2.42798 12.4982 2.3323 12.4999 2.23529C12.5016 2.13827 12.4838 2.0419 12.4474 1.95194C12.4111 1.86197 12.357 1.78024 12.2884 1.71163C12.2198 1.64302 12.138 1.58893 12.0481 1.55259C11.9581 1.51625 11.8617 1.4984 11.7647 1.50011C11.6677 1.50182 11.572 1.52306 11.4834 1.56255C11.3948 1.60204 11.315 1.65898 11.2488 1.72997L6.99067 5.98814L2.7325 1.72997C2.59553 1.60234 2.41437 1.53286 2.22718 1.53616C2.03999 1.53946 1.8614 1.61529 1.72901 1.74767C1.59663 1.88006 1.5208 2.05865 1.5175 2.24584C1.5142 2.43303 1.58368 2.61419 1.71131 2.75116L5.96948 7.00933L1.71131 11.2675C1.576 11.403 1.5 11.5866 1.5 11.7781C1.5 11.9696 1.576 12.1532 1.71131 12.2887C1.84679 12.424 2.03043 12.5 2.2219 12.5C2.41338 12.5 2.59702 12.424 2.7325 12.2887L6.99067 8.03052L11.2488 12.2887C11.3843 12.424 11.568 12.5 11.7594 12.5C11.9509 12.5 12.1346 12.424 12.27 12.2887C12.4053 12.1532 12.4813 11.9696 12.4813 11.7781C12.4813 11.5866 12.4053 11.403 12.27 11.2675L8.01186 7.00933Z",fill:"currentColor"},null,-1),i=[n];function p(e,c,l,d,m,h){return t(),o("svg",s({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.pti()),i,16)}a.render=p;export{a as s};
|
||||
@@ -1 +0,0 @@
|
||||
import b from"./Cm7Dkme4.js";import{s as B}from"./DpeyYdwe.js";import h from"./CpFoAXuV.js";import{a3 as v,a5 as $,i as m,t as f,v as C,z as r,a1 as c,A as a,Y as s,W as d,x as S,aa as l,P as w,ab as k}from"./DRtWvKfJ.js";import{s as D}from"./Bl_ZW1Xh.js";import"./CwRw2352.js";import"./B5fdn047.js";import"./BMCLKWyE.js";import"./CELf783E.js";import"./CFcFeTBy.js";import"./GnhOacnB.js";var I={root:function(t){var o=t.props;return["p-splitbutton p-component",{"p-button-raised":o.raised,"p-button-rounded":o.rounded,"p-button-text":o.text,"p-button-outlined":o.outlined,"p-button-sm":o.size==="small","p-button-lg":o.size==="large"}]},button:"p-splitbutton-defaultbutton",menuButton:"p-splitbutton-menubutton"},g=v.extend({name:"splitbutton",classes:I}),z={name:"BaseSplitButton",extends:D,props:{label:{type:String,default:null},icon:{type:String,default:null},model:{type:Array,default:null},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},appendTo:{type:[String,Object],default:"body"},disabled:{type:Boolean,default:!1},class:{type:null,default:null},style:{type:null,default:null},buttonProps:{type:null,default:null},menuButtonProps:{type:null,default:null},menuButtonIcon:{type:String,default:void 0},severity:{type:String,default:null},raised:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},text:{type:Boolean,default:!1},outlined:{type:Boolean,default:!1},size:{type:String,default:null},plain:{type:Boolean,default:!1}},style:g,provide:function(){return{$parentInstance:this}}},V={name:"SplitButton",extends:z,inheritAttrs:!1,emits:["click"],data:function(){return{id:this.$attrs.id,isExpanded:!1}},watch:{"$attrs.id":{immediate:!0,handler:function(t){this.id=t||$()}}},mounted:function(){var t=this;this.$watch("$refs.menu.visible",function(o){t.isExpanded=o})},methods:{onDropdownButtonClick:function(t){t&&t.preventDefault(),this.$refs.menu.toggle({currentTarget:this.$el,relatedTarget:this.$refs.button.$el}),this.isExpanded=this.$refs.menu.visible},onDropdownKeydown:function(t){(t.code==="ArrowDown"||t.code==="ArrowUp")&&(this.onDropdownButtonClick(),t.preventDefault())},onDefaultButtonClick:function(t){this.isExpanded&&this.$refs.menu.hide(t),this.$emit("click",t)}},computed:{containerClass:function(){return[this.cx("root"),this.class]}},components:{PVSButton:b,PVSMenu:h,ChevronDownIcon:B}},Z=["data-p-severity"];function E(e,t,o,P,u,i){var p=m("PVSButton"),y=m("PVSMenu");return f(),C("div",l({class:i.containerClass,style:e.style},e.ptmi("root"),{"data-p-severity":e.severity}),[r(p,l({type:"button",class:e.cx("button"),label:e.label,disabled:e.disabled,severity:e.severity,text:e.text,outlined:e.outlined,size:e.size,"aria-label":e.label,onClick:i.onDefaultButtonClick},e.buttonProps,{pt:e.ptm("button"),unstyled:e.unstyled}),c({default:a(function(){return[s(e.$slots,"default")]}),_:2},[e.$slots.icon?{name:"icon",fn:a(function(n){return[s(e.$slots,"icon",{class:d(n.class)},function(){return[S("span",l({class:[e.icon,n.class]},e.ptm("button").icon,{"data-pc-section":"buttonicon"}),null,16)]})]}),key:"0"}:void 0]),1040,["class","label","disabled","severity","text","outlined","size","aria-label","onClick","pt","unstyled"]),r(p,l({ref:"button",type:"button",class:e.cx("menuButton"),disabled:e.disabled,"aria-haspopup":"true","aria-expanded":u.isExpanded,"aria-controls":u.id+"_overlay",onClick:i.onDropdownButtonClick,onKeydown:i.onDropdownKeydown,severity:e.severity,text:e.text,outlined:e.outlined,size:e.size},e.menuButtonProps,{pt:e.ptm("menuButton"),unstyled:e.unstyled}),{icon:a(function(n){return[s(e.$slots,"menubuttonicon",{class:d(n.class)},function(){return[(f(),w(k(e.menuButtonIcon?"span":"ChevronDownIcon"),l({class:[e.menuButtonIcon,n.class]},e.ptm("menuButton").icon,{"data-pc-section":"menubuttonicon"}),null,16,["class"]))]})]}),_:3},16,["class","disabled","aria-expanded","aria-controls","onClick","onKeydown","severity","text","outlined","size","pt","unstyled"]),r(y,{ref:"menu",id:u.id+"_overlay",model:e.model,popup:!0,autoZIndex:e.autoZIndex,baseZIndex:e.baseZIndex,appendTo:e.appendTo,unstyled:e.unstyled,pt:e.ptm("menu")},c({_:2},[e.$slots.menuitemicon?{name:"itemicon",fn:a(function(n){return[s(e.$slots,"menuitemicon",{item:n.item,class:d(n.class)})]}),key:"0"}:void 0,e.$slots.item?{name:"item",fn:a(function(n){return[s(e.$slots,"item",{item:n.item,hasSubmenu:n.hasSubmenu,label:n.label,props:n.props})]}),key:"1"}:void 0]),1032,["id","model","autoZIndex","baseZIndex","appendTo","unstyled","pt"])],16,Z)}V.render=E;export{V as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{s as y}from"./HF1fbsar.js";import{s as h}from"./b2TVTf9x.js";import{a3 as v,a5 as P,a9 as w,Z as O,t as i,v as c,x as d,Y as s,aa as a,y as S,O as u,W as B,$ as g,P as D,ae as j,af as E,ab as K,z as C,A as I,ad as k,ac as A}from"./DRtWvKfJ.js";import{s as L}from"./Bl_ZW1Xh.js";import"./BMCLKWyE.js";var N={root:function(t){var o=t.props;return["p-panel p-component",{"p-panel-toggleable":o.toggleable}]},header:"p-panel-header",title:"p-panel-title",icons:"p-panel-icons",toggler:"p-panel-header-icon p-panel-toggler p-link",toggleablecontent:"p-toggleable-content",content:"p-panel-content",footer:"p-panel-footer"},z=v.extend({name:"panel",classes:N}),V={name:"BasePanel",extends:L,props:{header:String,toggleable:Boolean,collapsed:Boolean,toggleButtonProps:{type:null,default:null}},style:z,provide:function(){return{$parentInstance:this}}},$={name:"Panel",extends:V,inheritAttrs:!1,emits:["update:collapsed","toggle"],data:function(){return{id:this.$attrs.id,d_collapsed:this.collapsed}},watch:{"$attrs.id":{immediate:!0,handler:function(t){this.id=t||P()}},collapsed:function(t){this.d_collapsed=t}},methods:{toggle:function(t){this.d_collapsed=!this.d_collapsed,this.$emit("update:collapsed",this.d_collapsed),this.$emit("toggle",{originalEvent:t,value:this.d_collapsed})},onKeyDown:function(t){(t.code==="Enter"||t.code==="NumpadEnter"||t.code==="Space")&&(this.toggle(t),t.preventDefault())}},computed:{buttonAriaLabel:function(){return this.toggleButtonProps&&this.toggleButtonProps.ariaLabel?this.toggleButtonProps.ariaLabel:this.header}},components:{PlusIcon:h,MinusIcon:y},directives:{ripple:w}};function p(e){"@babel/helpers - typeof";return p=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},p(e)}function f(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),o.push.apply(o,r)}return o}function m(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?f(Object(o),!0).forEach(function(r){M(e,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):f(Object(o)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))})}return e}function M(e,t,o){return t=R(t),t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function R(e){var t=T(e,"string");return p(t)=="symbol"?t:String(t)}function T(e,t){if(p(e)!="object"||!e)return e;var o=e[Symbol.toPrimitive];if(o!==void 0){var r=o.call(e,t||"default");if(p(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var q=["id"],U=["id","aria-label","aria-controls","aria-expanded"],W=["id","aria-labelledby"];function Y(e,t,o,r,n,l){var b=O("ripple");return i(),c("div",a({class:e.cx("root")},e.ptmi("root")),[d("div",a({class:e.cx("header")},e.ptm("header")),[s(e.$slots,"header",{id:n.id+"_header",class:B(e.cx("title"))},function(){return[e.header?(i(),c("span",a({key:0,id:n.id+"_header",class:e.cx("title")},e.ptm("title")),S(e.header),17,q)):u("",!0)]}),d("div",a({class:e.cx("icons")},e.ptm("icons")),[s(e.$slots,"icons"),e.toggleable?g((i(),c("button",a({key:0,id:n.id+"_header",type:"button",role:"button",class:e.cx("toggler"),"aria-label":l.buttonAriaLabel,"aria-controls":n.id+"_content","aria-expanded":!n.d_collapsed,onClick:t[0]||(t[0]=function(){return l.toggle&&l.toggle.apply(l,arguments)}),onKeydown:t[1]||(t[1]=function(){return l.onKeyDown&&l.onKeyDown.apply(l,arguments)})},m(m({},e.toggleButtonProps),e.ptm("toggler"))),[s(e.$slots,"togglericon",{collapsed:n.d_collapsed},function(){return[(i(),D(K(n.d_collapsed?"PlusIcon":"MinusIcon"),j(E(e.ptm("togglericon"))),null,16))]})],16,U)),[[b]]):u("",!0)],16)],16),C(A,a({name:"p-toggleable-content"},e.ptm("transition")),{default:I(function(){return[g(d("div",a({id:n.id+"_content",class:e.cx("toggleablecontent"),role:"region","aria-labelledby":n.id+"_header"},e.ptm("toggleablecontent")),[d("div",a({class:e.cx("content")},e.ptm("content")),[s(e.$slots,"default")],16),e.$slots.footer?(i(),c("div",a({key:0,class:e.cx("footer")},e.ptm("footer")),[s(e.$slots,"footer")],16)):u("",!0)],16,W),[[k,!n.d_collapsed]])]}),_:3},16)],16)}$.render=Y;export{$ as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{s as h}from"./HF1fbsar.js";import{s as v}from"./b2TVTf9x.js";import{a3 as P,a5 as w,a9 as O,Z as S,t as d,v as c,x as a,Y as p,aa as l,y as u,O as g,$ as f,P as B,ab as D,z as j,A as E,ad as K,ac as I}from"./DRtWvKfJ.js";import{s as A}from"./Bl_ZW1Xh.js";import"./BMCLKWyE.js";var C={root:function(t){var o=t.props;return["p-fieldset p-component",{"p-fieldset-toggleable":o.toggleable}]},legend:"p-fieldset-legend",legendtitle:"p-fieldset-legend-text",togglericon:"p-fieldset-toggler",toggleablecontent:"p-toggleable-content",content:"p-fieldset-content"},L=P.extend({name:"fieldset",classes:C}),N={name:"BaseFieldset",extends:A,props:{legend:String,toggleable:Boolean,collapsed:Boolean,toggleButtonProps:{type:null,default:null}},style:L,provide:function(){return{$parentInstance:this}}},k={name:"Fieldset",extends:N,inheritAttrs:!1,emits:["update:collapsed","toggle"],data:function(){return{id:this.$attrs.id,d_collapsed:this.collapsed}},watch:{"$attrs.id":{immediate:!0,handler:function(t){this.id=t||w()}},collapsed:function(t){this.d_collapsed=t}},methods:{toggle:function(t){this.d_collapsed=!this.d_collapsed,this.$emit("update:collapsed",this.d_collapsed),this.$emit("toggle",{originalEvent:t,value:this.d_collapsed})},onKeyDown:function(t){(t.code==="Enter"||t.code==="NumpadEnter"||t.code==="Space")&&(this.toggle(t),t.preventDefault())}},computed:{buttonAriaLabel:function(){return this.toggleButtonProps&&this.toggleButtonProps.ariaLabel?this.toggleButtonProps.ariaLabel:this.legend}},directives:{ripple:O},components:{PlusIcon:v,MinusIcon:h}};function s(e){"@babel/helpers - typeof";return s=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},s(e)}function m(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),o.push.apply(o,n)}return o}function b(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?m(Object(o),!0).forEach(function(n){F(e,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):m(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}function F(e,t,o){return t=V(t),t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function V(e){var t=M(e,"string");return s(t)=="symbol"?t:String(t)}function M(e,t){if(s(e)!="object"||!e)return e;var o=e[Symbol.toPrimitive];if(o!==void 0){var n=o.call(e,t||"default");if(s(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var T=["id"],_=["id","aria-controls","aria-expanded","aria-label"],$=["id","aria-labelledby"];function q(e,t,o,n,r,i){var y=S("ripple");return d(),c("fieldset",l({class:e.cx("root")},e.ptmi("root")),[a("legend",l({class:e.cx("legend")},e.ptm("legend")),[e.toggleable?g("",!0):p(e.$slots,"legend",{key:0},function(){return[a("span",l({id:r.id+"_header",class:e.cx("legendtitle")},e.ptm("legendtitle")),u(e.legend),17,T)]}),e.toggleable?f((d(),c("a",l({key:1,id:r.id+"_header",tabindex:"0",role:"button","aria-controls":r.id+"_content","aria-expanded":!r.d_collapsed,"aria-label":i.buttonAriaLabel,onClick:t[0]||(t[0]=function(){return i.toggle&&i.toggle.apply(i,arguments)}),onKeydown:t[1]||(t[1]=function(){return i.onKeyDown&&i.onKeyDown.apply(i,arguments)})},b(b({},e.toggleButtonProps),e.ptm("toggler"))),[p(e.$slots,"togglericon",{collapsed:r.d_collapsed},function(){return[(d(),B(D(r.d_collapsed?"PlusIcon":"MinusIcon"),l({class:e.cx("togglericon")},e.ptm("togglericon")),null,16,["class"]))]}),p(e.$slots,"legend",{},function(){return[a("span",l({class:e.cx("legendtitle")},e.ptm("legendtitle")),u(e.legend),17)]})],16,_)),[[y]]):g("",!0)],16),j(I,l({name:"p-toggleable-content"},e.ptm("transition")),{default:E(function(){return[f(a("div",l({id:r.id+"_content",class:e.cx("toggleablecontent"),role:"region","aria-labelledby":r.id+"_header"},e.ptm("toggleablecontent")),[a("div",l({class:e.cx("content")},e.ptm("content")),[p(e.$slots,"default")],16)],16,$),[[K,!r.d_collapsed]])]}),_:3},16)],16)}k.render=q;export{k as default};
|
||||
@@ -1,5 +0,0 @@
|
||||
import{s as H}from"./D2eV2xTx.js";import{s as D}from"./B5fdn047.js";import{a3 as W,a4 as z,a7 as p,a9 as Q,i as k,Z as Y,t as c,v as h,x as C,$ as j,aa as u,N as S,P as f,W as m,ab as g,A as Z,O as w,aj as q,B as G,y as J,Q as F,Y as M,ai as X,z as _}from"./DRtWvKfJ.js";import{s as L}from"./Bl_ZW1Xh.js";import $ from"./Gj9DruUc.js";import{s as ee}from"./BKuF8g-Y.js";import{s as te}from"./DpeyYdwe.js";import{s as ne}from"./CTyYxNkn.js";import{s as re}from"./HF1fbsar.js";import"./BMCLKWyE.js";var ie={root:function(t){var n=t.props;return["p-tree p-component",{"p-tree-selectable":n.selectionMode!=null,"p-tree-loading":n.loading,"p-tree-flex-scrollable":n.scrollHeight==="flex"}]},loadingOverlay:"p-tree-loading-overlay p-component-overlay",loadingIcon:"p-tree-loading-icon",filterContainer:"p-tree-filter-container",input:"p-tree-filter p-inputtext p-component",searchIcon:"p-tree-filter-icon",wrapper:"p-tree-wrapper",container:"p-tree-container",node:function(t){var n=t.instance;return["p-treenode",{"p-treenode-leaf":n.leaf}]},content:function(t){var n=t.instance;return["p-treenode-content",n.node.styleClass,{"p-treenode-selectable":n.selectable,"p-highlight":n.checkboxMode&&n.$parentInstance.highlightOnSelect?n.checked:n.selected}]},toggler:"p-tree-toggler p-link",togglerIcon:"p-tree-toggler-icon",nodeTogglerIcon:"p-tree-node-toggler-icon",nodeCheckbox:function(t){var n=t.instance;return[{"p-indeterminate":n.partialChecked}]},nodeIcon:"p-treenode-icon",label:"p-treenode-label",subgroup:"p-treenode-children"},le=W.extend({name:"tree",classes:ie}),oe={name:"BaseTree",extends:L,props:{value:{type:null,default:null},expandedKeys:{type:null,default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},metaKeySelection:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},loadingIcon:{type:String,default:void 0},loadingMode:{type:String,default:"mask"},filter:{type:Boolean,default:!1},filterBy:{type:String,default:"label"},filterMode:{type:String,default:"lenient"},filterPlaceholder:{type:String,default:null},filterLocale:{type:String,default:void 0},highlightOnSelect:{type:Boolean,default:!1},scrollHeight:{type:String,default:null},level:{type:Number,default:0},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:le,provide:function(){return{$parentInstance:this}}};function x(e){"@babel/helpers - typeof";return x=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},x(e)}function O(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=V(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var r=0,l=function(){};return{s:l,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(s){throw s},f:l}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,d;return{s:function(){n=n.call(e)},n:function(){var s=n.next();return i=s.done,s},e:function(s){o=!0,d=s},f:function(){try{!i&&n.return!=null&&n.return()}finally{if(o)throw d}}}}function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?A(Object(n),!0).forEach(function(r){ae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ae(e,t,n){return t=se(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function se(e){var t=ce(e,"string");return x(t)=="symbol"?t:String(t)}function ce(e,t){if(x(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(x(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function v(e){return fe(e)||ue(e)||V(e)||de()}function de(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function V(e,t){if(e){if(typeof e=="string")return I(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return I(e,t)}}function ue(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fe(e){if(Array.isArray(e))return I(e)}function I(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var R={name:"TreeNode",hostName:"Tree",extends:L,emits:["node-toggle","node-click","checkbox-change"],props:{node:{type:null,default:null},expandedKeys:{type:null,default:null},loadingMode:{type:String,default:"mask"},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},templates:{type:null,default:null},level:{type:Number,default:null},index:null},nodeTouched:!1,toggleClicked:!1,mounted:function(){this.setAllNodesTabIndexes()},methods:{toggle:function(){this.$emit("node-toggle",this.node),this.toggleClicked=!0},label:function(t){return typeof t.label=="function"?t.label():t.label},onChildNodeToggle:function(t){this.$emit("node-toggle",t)},getPTOptions:function(t){return this.ptm(t,{context:{index:this.index,expanded:this.expanded,selected:this.selected,checked:this.checked,leaf:this.leaf}})},onClick:function(t){if(this.toggleClicked||p.getAttribute(t.target,'[data-pc-section="toggler"]')||p.getAttribute(t.target.parentElement,'[data-pc-section="toggler"]')){this.toggleClicked=!1;return}this.isCheckboxSelectionMode()?this.toggleCheckbox():this.$emit("node-click",{originalEvent:t,nodeTouched:this.nodeTouched,node:this.node}),this.nodeTouched=!1},onChildNodeClick:function(t){this.$emit("node-click",t)},onTouchEnd:function(){this.nodeTouched=!0},onKeyDown:function(t){if(this.isSameNode(t))switch(t.code){case"Tab":this.onTabKey(t);break;case"ArrowDown":this.onArrowDown(t);break;case"ArrowUp":this.onArrowUp(t);break;case"ArrowRight":this.onArrowRight(t);break;case"ArrowLeft":this.onArrowLeft(t);break;case"Enter":case"NumpadEnter":case"Space":this.onEnterKey(t);break}},onArrowDown:function(t){var n=t.target.getAttribute("data-pc-section")==="toggler"?t.target.closest('[role="treeitem"]'):t.target,r=n.children[1];if(r)this.focusRowChange(n,r.children[0]);else if(n.nextElementSibling)this.focusRowChange(n,n.nextElementSibling);else{var l=this.findNextSiblingOfAncestor(n);l&&this.focusRowChange(n,l)}t.preventDefault()},onArrowUp:function(t){var n=t.target;if(n.previousElementSibling)this.focusRowChange(n,n.previousElementSibling,this.findLastVisibleDescendant(n.previousElementSibling));else{var r=this.getParentNodeElement(n);r&&this.focusRowChange(n,r)}t.preventDefault()},onArrowRight:function(t){var n=this;this.leaf||this.expanded||(t.currentTarget.tabIndex=-1,this.$emit("node-toggle",this.node),this.$nextTick(function(){n.onArrowDown(t)}))},onArrowLeft:function(t){var n=p.findSingle(t.currentTarget,'[data-pc-section="toggler"]');if(this.level===0&&!this.expanded)return!1;if(this.expanded&&!this.leaf)return n.click(),!1;var r=this.findBeforeClickableNode(t.currentTarget);r&&this.focusRowChange(t.currentTarget,r)},onEnterKey:function(t){this.setTabIndexForSelectionMode(t,this.nodeTouched),this.onClick(t),t.preventDefault()},onTabKey:function(){this.setAllNodesTabIndexes()},setAllNodesTabIndexes:function(){var t=p.find(this.$refs.currentNode.closest('[data-pc-section="container"]'),'[role="treeitem"]'),n=v(t).some(function(l){return l.getAttribute("aria-selected")==="true"||l.getAttribute("aria-checked")==="true"});if(v(t).forEach(function(l){l.tabIndex=-1}),n){var r=v(t).filter(function(l){return l.getAttribute("aria-selected")==="true"||l.getAttribute("aria-checked")==="true"});r[0].tabIndex=0;return}v(t)[0].tabIndex=0},setTabIndexForSelectionMode:function(t,n){if(this.selectionMode!==null){var r=v(p.find(this.$refs.currentNode.parentElement,'[role="treeitem"]'));t.currentTarget.tabIndex=n===!1?-1:0,r.every(function(l){return l.tabIndex===-1})&&(r[0].tabIndex=0)}},focusRowChange:function(t,n,r){t.tabIndex="-1",n.tabIndex="0",this.focusNode(r||n)},findBeforeClickableNode:function(t){var n=t.closest("ul").closest("li");if(n){var r=p.findSingle(n,"button");return r&&r.style.visibility!=="hidden"?n:this.findBeforeClickableNode(t.previousElementSibling)}return null},toggleCheckbox:function(){var t=this.selectionKeys?E({},this.selectionKeys):{},n=!this.checked;this.propagateDown(this.node,n,t),this.$emit("checkbox-change",{node:this.node,check:n,selectionKeys:t})},propagateDown:function(t,n,r){if(n?r[t.key]={checked:!0,partialChecked:!1}:delete r[t.key],t.children&&t.children.length){var l=O(t.children),i;try{for(l.s();!(i=l.n()).done;){var o=i.value;this.propagateDown(o,n,r)}}catch(d){l.e(d)}finally{l.f()}}},propagateUp:function(t){var n=t.check,r=E({},t.selectionKeys
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,d;return{s:function(){n=n.call(e)},n:function(){var s=n.next();return i=s.done,s},e:function(s){o=!0,d=s},f:function(){try{!i&&n.return!=null&&n.return()}finally{if(o)throw d}}}}function pe(e){return ke(e)||me(e)||B(e)||be()}function be(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B(e,t){if(e){if(typeof e=="string")return N(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return N(e,t)}}function me(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ke(e){if(Array.isArray(e))return N(e)}function N(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P(Object(n),!0).forEach(function(r){ve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ve(e,t,n){return t=Se(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Se(e){var t=Ce(e,"string");return K(t)=="symbol"?t:String(t)}function Ce(e,t){if(K(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(K(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var xe={name:"Tree",extends:oe,inheritAttrs:!1,emits:["node-expand","node-collapse","update:expandedKeys","update:selectionKeys","node-select","node-unselect","filter"],data:function(){return{d_expandedKeys:this.expandedKeys||{},filterValue:null}},watch:{expandedKeys:function(t){this.d_expandedKeys=t}},methods:{onNodeToggle:function(t){var n=t.key;this.d_expandedKeys[n]?(delete this.d_expandedKeys[n],this.$emit("node-collapse",t)):(this.d_expandedKeys[n]=!0,this.$emit("node-expand",t)),this.d_expandedKeys=b({},this.d_expandedKeys),this.$emit("update:expandedKeys",this.d_expandedKeys)},onNodeClick:function(t){if(this.selectionMode!=null&&t.node.selectable!==!1){var n=t.nodeTouched?!1:this.metaKeySelection,r=n?this.handleSelectionWithMetaKey(t):this.handleSelectionWithoutMetaKey(t);this.$emit("update:selectionKeys",r)}},onCheckboxChange:function(t){this.$emit("update:selectionKeys",t.selectionKeys),t.check?this.$emit("node-select",t.node):this.$emit("node-unselect",t.node)},handleSelectionWithMetaKey:function(t){var n=t.originalEvent,r=t.node,l=n.metaKey||n.ctrlKey,i=this.isNodeSelected(r),o;return i&&l?(this.isSingleSelectionMode()?o={}:(o=b({},this.selectionKeys),delete o[r.key]),this.$emit("node-unselect",r)):(this.isSingleSelectionMode()?o={}:this.isMultipleSelectionMode()&&(o=l?this.selectionKeys?b({},this.selectionKeys):{}:{}),o[r.key]=!0,this.$emit("node-select",r)),o},handleSelectionWithoutMetaKey:function(t){var n=t.node,r=this.isNodeSelected(n),l;return this.isSingleSelectionMode()?r?(l={},this.$emit("node-unselect",n)):(l={},l[n.key]=!0,this.$emit("node-select",n)):r?(l=b({},this.selectionKeys),delete l[n.key],this.$emit("node-unselect",n)):(l=this.selectionKeys?b({},this.selectionKeys):{},l[n.key]=!0,this.$emit("node-select",n)),l},isSingleSelectionMode:function(){return this.selectionMode==="single"},isMultipleSelectionMode:function(){return this.selectionMode==="multiple"},isNodeSelected:function(t){return this.selectionMode&&this.selectionKeys?this.selectionKeys[t.key]===!0:!1},isChecked:function(t){return this.selectionKeys?this.selectionKeys[t.key]&&this.selectionKeys[t.key].checked:!1},isNodeLeaf:function(t){return t.leaf===!1?!1:!(t.children&&t.children.length)},onFilterKeydown:function(t){(t.code==="Enter"||t.code==="NumpadEnter")&&t.preventDefault(),this.$emit("filter",{originalEvent:t,value:t.target.value})},findFilteredNodes:function(t,n){if(t){var r=!1;if(t.children){var l=pe(t.children);t.children=[];var i=T(l),o;try{for(i.s();!(o=i.n()).done;){var d=o.value,a=b({},d);this.isFilterMatched(a,n)&&(r=!0,t.children.push(a))}}catch(s){i.e(s)}finally{i.f()}}if(r)return!0}},isFilterMatched:function(t,n){var r=n.searchFields,l=n.filterText,i=n.strict,o=!1,d=T(r),a;try{for(d.s();!(a=d.n()).done;){var s=a.value,y=String(z.resolveFieldData(t,s)).toLocaleLowerCase(this.filterLocale);y.indexOf(l)>-1&&(o=!0)}}catch(U){d.e(U)}finally{d.f()}return(!o||i&&!this.isNodeLeaf(t))&&(o=this.findFilteredNodes(t,{searchFields:r,filterText:l,strict:i})||o),o}},computed:{filteredValue:function(){var t=[],n=this.filterBy.split(","),r=this.filterValue.trim().toLocaleLowerCase(this.filterLocale),l=this.filterMode==="strict",i=T(this.value),o;try{for(i.s();!(o=i.n()).done;){var d=o.value,a=b({},d),s={searchFields:n,filterText:r,strict:l};(l&&(this.findFilteredNodes(a,s)||this.isFilterMat
Line truncated
|
||||
@@ -1 +0,0 @@
|
||||
import{s as r}from"./BMCLKWyE.js";import{t,v as o,aa as s,x as a}from"./DRtWvKfJ.js";var C={name:"CheckIcon",extends:r},n=a("path",{d:"M4.86199 11.5948C4.78717 11.5923 4.71366 11.5745 4.64596 11.5426C4.57826 11.5107 4.51779 11.4652 4.46827 11.4091L0.753985 7.69483C0.683167 7.64891 0.623706 7.58751 0.580092 7.51525C0.536478 7.44299 0.509851 7.36177 0.502221 7.27771C0.49459 7.19366 0.506156 7.10897 0.536046 7.03004C0.565935 6.95111 0.613367 6.88 0.674759 6.82208C0.736151 6.76416 0.8099 6.72095 0.890436 6.69571C0.970973 6.67046 1.05619 6.66385 1.13966 6.67635C1.22313 6.68886 1.30266 6.72017 1.37226 6.76792C1.44186 6.81567 1.4997 6.8786 1.54141 6.95197L4.86199 10.2503L12.6397 2.49483C12.7444 2.42694 12.8689 2.39617 12.9932 2.40745C13.1174 2.41873 13.2343 2.47141 13.3251 2.55705C13.4159 2.64268 13.4753 2.75632 13.4938 2.87973C13.5123 3.00315 13.4888 3.1292 13.4271 3.23768L5.2557 11.4091C5.20618 11.4652 5.14571 11.5107 5.07801 11.5426C5.01031 11.5745 4.9368 11.5923 4.86199 11.5948Z",fill:"currentColor"},null,-1),i=[n];function p(e,c,l,d,h,m){return t(),o("svg",s({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.pti()),i,16)}C.render=p;export{C as s};
|
||||
Loaded 100 of 681 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user