diff --git a/README.md b/README.md index fc5c29c..bcb8a36 100644 --- a/README.md +++ b/README.md @@ -26,12 +26,144 @@ cd desktop && npm install && npm run electron:dev **文档不写死任何生产域名或公网 IP。** 每台机器 / 每个环境用你自己的变量;下面用占位符说明。 +本仓库有两种 **Linux 生产形态**(另有 Windows 桌面端,见上节): + +| 形态 | 说明 | 文档 | +|------|------|------| +| **VPS 本机** | 应用与 TLS 反代在**同一台**海外 VPS;浏览器直打该机 443 | [INSTALL.md](docs/INSTALL.md) · `bootstrap_vps.sh` | +| **物理机** | 应用在家里 Ubuntu / PVE 客户机;**边缘机**只做 HTTPS + WireGuard(可 1~2 台边缘) | [INSTALL.md](docs/INSTALL.md) · [PHYSICAL_DEPLOY.md](docs/PHYSICAL_DEPLOY.md) | + +> **先认形态再改配置。** 纯 VPS:没有 `wg-dy` / 国内边缘 / ShellCrash `:7890` 假设。物理机:不要在家里再跑公网证书,也不要把 `DY_PUBLIC_BASE_URL` 写成 WG IP。 + | 占位符 | 含义 | 典型来源 | |--------|------|----------| | `${DOMAIN}` | 对外 HTTPS 域名 | `bootstrap_vps.sh` 必填 | | `${PUBLIC_BASE}` | 站点根 URL | 默认 `https://${DOMAIN}`,写入 `DY_PUBLIC_BASE_URL` | | `${APP_DIR}` | 代码目录 | 默认 `/opt/douyinWEB` | -| `${API_PORT}` / `${WEB_PORT}` | 本机监听端口 | 默认 `8014` / `4015`(仅 `127.0.0.1`) | +| `${API_PORT}` / `${WEB_PORT}` | 本机监听端口 | 默认 `8014` / `4015`(VPS 本机多为 `127.0.0.1`;物理机需 `0.0.0.0` 供 WG 访问) | + +### 双形态对照(共用 · 纯 VPS · 物理机) + +同一套代码,**两种生产形状**。改配置时先认清自己在哪一列;**不要**把物理机经验套到纯 VPS,也不要把 VPS 的 sing-box 住宅方案硬套到家里。 + +#### 共用(两边都兼容) + +| 项 | 说明 | +|----|------| +| 代码 / systemd 单元名 | `douyinweb-web` / `api` / `pb` / `yt` / `s3*` | +| Next ↔ API | 始终 `DY_INTERNAL_API_URL=http://127.0.0.1:8014`(同机) | +| 公网站点根 | `DY_PUBLIC_BASE_URL=https://${DOMAIN}`(**禁止**写成 `127.0.0.1` / WG IP) | +| 登录 / Shorts / YouTube / OAuth 路径 | `${PUBLIC_BASE}/…`、`${PUBLIC_BASE}/api/shorts/oauth/callback` | +| 新装零房间 | 不打包、不恢复 `monitor.db`;见 fresh-install 规则 | +| 抖音相关 | 监控轮询、拉流:**尽量 DIRECT**(不走翻墙);物理机靠 Clash 规则,VPS 靠直连出口 | +| 安装入口 | `sudo bash scripts/install.sh` → 选形态 | + +#### 仅纯 VPS(应用 + TLS 同机) + +| 项 | 说明 | +|----|------| +| 脚本 | `scripts/bootstrap_vps.sh` | +| TLS | 本机 Nginx / 宝塔 / Caddy → `127.0.0.1:4015/8014` | +| 进程绑定 | 通常 `127.0.0.1` | +| 业务出海(可选) | 文档后文「全局 SOCKS5 / DouyinWEB 专用 sing-box」规划;**勿动** VPS 上已有 v2ray-agent `sing-box` | +| ShellCrash | **不是**默认栈;不要在纯 VPS 上假设有 `:7890` ShellCrash | +| Neko WebRTC | `NEKO_WEBRTC_NAT1TO1` / `DY_NEKO_NAT1TO1` = **本机公网 IP**;UDP/TCP mux 在本机安全组放行(无第二跳 DNAT) | +| 边缘 Caddy | 不需要 `bootstrap_physical_edge.sh` | + +#### 仅物理机(应用在家;TLS 在边缘机) + +| 项 | 说明 | +|----|------| +| 脚本 | 应用:`bootstrap_physical.sh`;海外边缘:`bootstrap_physical_edge.sh` | +| TLS(单边缘,基础) | **海外 VPS** Caddy → `wg-dy` → `10.8.0.2:4015/8014`;只 `reload caddy`,勿乱 restart 整机业务 | +| TLS(双边缘,推荐国内访问) | 见下节「物理机双边缘」:海外域名走 `wg-dy`,国内域名走 `wg-dy-cn` | +| 进程绑定 | **`0.0.0.0`**(供 WG 访问) | +| WireGuard | `wg-dy`(海外,示例 `10.8.0.0/24`);可选 `wg-dy-cn`(国内 hub,示例 `10.9.0.0/24`)。AllowedIPs **仅** VPN 网段,禁止 `0.0.0.0/0`(会抢 ShellCrash) | +| 业务出海 | **默认 ShellCrash mixed `:7890`**(见下节);非抖音(Google / YouTube / OAuth / Neko / 上传等)走代理 | +| ShellCrash Web 面板 | 公网:`${PUBLIC_BASE}/ui/#/proxies`(边缘把 `/ui` + Clash API 反代到物理机 `:9999`);WG 直连:`http://10.8.0.2:9999/ui/#/proxies` | +| Neko HTTP | **原生边缘反代**(默认):`${PUBLIC_BASE}/neko/{1..N}/` → WG `:9200+(N-1)`;`DY_NEKO_GATEWAY_ENABLED=0`;`DY_NEKO_MAX_INSTANCES` 默认 **64**(须与边缘已发布的 `/neko/N` 条数对齐);**务必带尾斜杠**(`/neko/5/`,裸 `/neko/5` 会相对资源 404) | +| Neko 网关模式 | 可选 `DY_NEKO_GATEWAY_ENABLED=1` → 边缘只反代到物理机 `:9199`;物理双边缘当前推荐 **关网关、开原生 `/neko/{id}`** | +| Neko WebRTC | `DY_NEKO_NAT1TO1` = **国内边缘公网 IP**(双边缘)或海外边缘公网 IP(单边缘);**禁止**写成 WG/`127.0.0.1`;mux/UDP 在该边缘 DNAT → 物理机;容器 `NEKO_BROWSER_PROXY=http://host.docker.internal:7890` | +| Neko 启停 | 新建/删除分组、切换启用:**不**全量 reconcile 停兄弟实例(避免独占直播误杀 Studio);面板「停止」会持久化 `neko_enabled=false`,避免开机复活 | +| Neko 黑屏排查 | 先确认 URL 有尾斜杠 → WebRTC(安全组 UDP)→ `supervisorctl status google-chrome`;`browser-launch.sh` 须 **可执行** | +| OAuth | 换 token / 拉频道资料必须经 `:7890`;直连 Google 会超时 →「授权失败 / 订阅 —」;同一 `youtube_channel_id` 挂两张 Shorts 卡时会软警告 | +| 登录跳转 | Next middleware **优先用请求 Host**(`.cn` 不会被 `DY_PUBLIC_BASE_URL` 强跳到 `.com`);CORS 需包含所有公网域名 | +| 细节全文 | [PHYSICAL_DEPLOY.md](docs/PHYSICAL_DEPLOY.md) | + +#### 物理机双边缘(海外 + 国内 TLS,可选) + +适用:应用仍只跑在**一台物理机**;希望海外用户与国内用户各走就近 HTTPS / WebRTC。 + +```text +浏览器 (海外) + │ HTTPS ${DOMAIN} 例:*.com + ▼ +海外 VPS Caddy + │ wg-dy 10.8.0.0/24 + ▼ +物理机 10.8.0.2 Next/API/Neko … + +浏览器 (国内) + │ HTTPS ${DOMAIN_CN} 例:*.cn + ▼ +国内云 Nginx/Caddy(宝塔等) + │ wg-dy-cn 10.9.0.0/24 + ▼ +物理机 10.9.0.2 (同一台应用) +``` + +| 项 | 海外边缘 | 国内边缘 | +|----|----------|----------| +| DNS A | `${DOMAIN}` → 海外 VPS | `${DOMAIN_CN}` → 国内云 | +| TLS | Caddy site → `10.8.0.2` | 宝塔 Nginx / Caddy → `10.9.0.2`(勿与已有 80/443 抢端口再装第二套) | +| WG | `wg-dy`(VPS `10.8.0.1` ↔ 物理 `10.8.0.2`) | `wg-dy-cn`(国内 hub `10.9.0.1` ↔ 物理 `10.9.0.2`;海外 VPS 可作 peer `10.9.0.3` 备用) | +| 改配置 | 只动本站 Caddy;**先**验证旧站 health | 只新增站点;UFW + **云安全组** 放行业务口 | +| Neko HTTP | 原生 `handle_path /neko/{1..64}/*` → `10.8.0.2:920x`;裸 `/neko/N` → 308 `/neko/N/` | Nginx 等价 → `10.9.0.2:920x` + 尾斜杠重定向 | +| Neko WebRTC | DNAT mux/UDP → `10.8.0.2`(海外客户端备用) | DNAT → `10.9.0.2`;**ICE 主用国内公网 IP**(`DY_NEKO_NAT1TO1`) | + +物理机环境建议: + +```bash +# /etc/systemd/system/douyinweb-api.service(或 /etc/douyinweb.env) +DY_PUBLIC_BASE_URL=https://${DOMAIN} # OAuth 主登记域名仍用一个 +DY_CORS_ORIGINS=https://${DOMAIN},https://${DOMAIN_CN},http://127.0.0.1:4015 +DY_NEKO_HTTP_BIND=0.0.0.0 +DY_NEKO_GATEWAY_ENABLED=0 # 物理双边缘:原生 /neko/{id},勿开 :9199 网关 +DY_NEKO_MAX_INSTANCES=64 # 须 ≤ 边缘已发布的 /neko/N 条数 +DY_NEKO_EDGE_UPSTREAM=10.8.0.2 # 生成 snippet 默认上游;国内站手写 10.9.0.2 +DY_NEKO_NAT1TO1=<国内边缘公网IP> # 改后清 nat1to1 缓存并 force-recreate 容器 +``` + +边缘 WebRTC(按实例 `i=1..64`,基址可配 `DY_NEKO_WEBRTC_MUX_BASE`,默认 `52300`): + +| 流量 | 公网口(边缘) | DNAT 目标 | +|------|----------------|-----------| +| mux TCP/UDP | `52300+(i-1)` | 物理机同端口(海外→`10.8.0.2`,国内→`10.9.0.2`) | +| EPR UDP | 每实例一段(常见 `52500+` 起,按 compose 实际为准) | 同上 | + +**云安全组**须放行上述 UDP/TCP(本机 UFW 开了 ≠ 安全组已开)。画面一直转圈、HTTP 正常 → 优先查 WebRTC DNAT / 安全组,不是 Next 构建。 + +> **纯 VPS 没有这一节。** 应用与 TLS 同机时,Neko `NAT1TO1` = 该 VPS 本机公网 IP,WebRTC 口直接在本机安全组放行即可。 + +#### 物理机业务出口(ShellCrash)— 当前实现 + +```text +抖音监控 / 抖音 CDN → DIRECT(Clash 规则强制,不可改坏) +其余业务(Google OAuth、YouTube API/上传、Neko 浏览器、 + Studio、海外探测等)→ 127.0.0.1:7890(ShellCrash mixed) +可选「住宅落地」 → ShellCrash dialer-proxy 链式(家宽→前置节点→住宅 SOCKS) +``` + +| 项 | 值 | +|----|------| +| 默认 `egress_mode` | `shellcrash`(显式 `off` 才关) | +| 代理入口 | `http://127.0.0.1:7890` | +| Neko 浏览器 | `http://host.docker.internal:7890`(容器 → 宿主机) | +| FFmpeg 推流等 | `proxychains4` → `127.0.0.1:7890`(与开关联动) | +| UI | 控制台 **网络** 页:启停 ShellCrash、住宅链、WireGuard、FRP | +| 透明劫持 | ShellCrash `firewall_area=0`,避免 nft 透明代理打断 WG | + +> **与后文「全局 SOCKS5 / DouyinWEB 专用 sing-box」的关系**:那一节描述的是 **纯 VPS / 可选住宅** 规划,监听多为 `127.0.0.1:17891`,且须与 v2ray-agent 隔离。**物理机当前以 ShellCrash `:7890` 为准**,不要混用两套默认出口。 部署完成后,控制台与 API 路径为: @@ -47,11 +179,37 @@ cd desktop && npm install && npm run electron:dev | 运维 | `${PUBLIC_BASE}/ops` | | Web 分析 | `${PUBLIC_BASE}/web` | | Netdata(可选,需登录) | `${PUBLIC_BASE}/netdata/`(反代 `127.0.0.1:19999`,见 [运维与 Netdata](#运维与-netdata)) | +| ShellCrash 面板(**物理机**) | `${PUBLIC_BASE}/ui/#/proxies`(纯 VPS 无此路径,除非自建) | +| Neko 虚拟浏览器 | `${PUBLIC_BASE}/neko/1/` … `/neko/N/`(`N≤DY_NEKO_MAX_INSTANCES`,**带尾斜杠**) | | S3 封面(若启用) | `${PUBLIC_BASE}/${S3_BUCKET}/…` 或独立 `DY_S3_PUBLIC_BASE` | > **OAuth / 回调**:Google、TikTok 等第三方控制台里登记的 redirect URI 必须与 **`DY_PUBLIC_BASE_URL`** 一致,例如 `${PUBLIC_BASE}/api/shorts/oauth/callback`。换域名后需同步改 Google Cloud 与设置页里的 OAuth 配置。 -### 新 VPS 一键引导(推荐) +### 新机器一键安装(配置化,不依赖 AI) + +完整说明:[docs/INSTALL.md](docs/INSTALL.md)。 + +```bash +# 目标机 root;交互选择 VPS / 物理机 / 边缘 Caddy +sudo bash scripts/install.sh + +# 或先填配置再跑 +cp scripts/install.env.example /etc/douyinweb.install.env +# 编辑 DOMAIN、ADMIN_USER、ADMIN_PASS、GIT_URL、INSTALL_SHAPE=… +sudo bash scripts/install.sh +``` + +| 形态 | 脚本 | +|------|------| +| VPS 本机(应用+Nginx) | `scripts/bootstrap_vps.sh` | +| 物理机应用(PVE/家宽 Ubuntu) | `scripts/bootstrap_physical.sh` | +| 物理机边缘(海外 Caddy→WG) | `scripts/bootstrap_physical_edge.sh` | + +> 家里物理机 + 海外 TLS:不要只用 VPS 脚本;按 [INSTALL.md](docs/INSTALL.md) 物理机顺序,细节约束见 [PHYSICAL_DEPLOY.md](docs/PHYSICAL_DEPLOY.md)。 + +### 新 VPS 一键引导(环境变量,兼容旧用法) + +> 若目标是 **家里物理机 / PVE Ubuntu,海外 VPS 只做 HTTPS**,不要用本节;请看 **[安装指南](docs/INSTALL.md)** / **[物理机部署](docs/PHYSICAL_DEPLOY.md)**。 在目标机器上以 root 执行(**先设好域名 DNS 与 TLS 证书**,脚本只加 vhost、不装 Caddy): @@ -65,11 +223,14 @@ bash scripts/bootstrap_vps.sh ``` 可选环境变量见脚本头部注释:`APP_DIR`、`PUBLIC_BASE`、`WEB_PORT`、`API_PORT`、`PB_PORT`、`YT_PORT`、`S3_PORT` 等。 -引导会生成 **`/etc/douyinweb.env`**(含 `SESSION_SECRET`、`S3_SECRET`),并创建 systemd 单元;**不会**打包或恢复 `monitor.db`(新装零房间,见仓库规则)。 +引导会生成 **`/etc/douyinweb.env`**(含 `SESSION_SECRET`、`S3_SECRET`),并创建 systemd 单元;**不会**打包或恢复 `monitor.db`(新装零房间,见仓库规则)。缺省必填项时也会进入交互向导。 ### 本机进程端口(默认) -应用进程绑定 **127.0.0.1**,由 Nginx / 宝塔反代对外;公网只暴露 443(及 WebRTC 等按需放行)。 +| 形态 | 绑定 | 对外 | +|------|------|------| +| **纯 VPS** | 多为 `127.0.0.1` | 本机 Nginx / 宝塔 / Caddy → 公网 443 | +| **物理机** | **`0.0.0.0`** | 海外 VPS Caddy 经 WG 访问;公网 443 只在边缘 VPS | | 服务 | 默认端口 | systemd 单元名 | |------|----------|----------------| @@ -78,6 +239,8 @@ bash scripts/bootstrap_vps.sh | PocketBase | `8092` | `douyinweb-pb` | | youtube-svc | `8020` | `douyinweb-yt` | | SeaweedFS S3 | `8333` | `douyinweb-s3` (+ master/volume/filer) | +| ShellCrash mixed / 面板(**物理机**) | `7890` / `9999` | ShellCrash 自带 | +| Neko Chrome(物理机,按实例) | `9200+(N-1)` HTTP;`52300+(N-1)` mux | Docker | | Netdata(可选) | `19999` | `netdata` | 时区建议:`TZ=Asia/Shanghai`(界面与「北京日」配额逻辑使用北京时间)。 @@ -148,14 +311,14 @@ Windows 上可用 `python scripts\_deploy.py`(需自行配置 SSH 目标,** ### YouTube Pro 转播(Douyin → YouTube RTMPS) -控制台 **`/youtube` → 分配**:按频道分组配置直播 KEY、精选抖音源、可选 **Neko 工作室**(Docker 内 Chrome 打开 YouTube Studio),由后台 **FFmpeg** 将抖音 FLV 转码后推到 YouTube RTMP/RTMPS。 +控制台 **`/youtube` → 分配**:按已授权 Shorts 频道分组配置直播 KEY、精选抖音源、可选 **Neko 工作室**(Docker 内 Chrome 打开 YouTube Studio),由后台 **FFmpeg** 将抖音 FLV 转码后推到 YouTube RTMP/RTMPS。同一 `channel_pk` / `youtube_channel_id` 只能建一组;标题上传会剥离 `<>`(YouTube `invalidTitle`)。 | 概念 | 说明 | |------|------| | **自动推流** | 设置 `youtube_relay_enabled=true` 或 UI「自动推流」;Worker 约 7s 轮询 | | **手动开始/停止** | 单频道「开始」= 武装监听(`manual_hold`),开播后自动推;「停止」释放 | -| **时间段模式** | `youtube_relay_time_slot_mode`;**与自动推流独立开关**。开启后:仅 **已配置 KEY 的 N 个频道** 按北京时 **24/N 小时** 轮播独占;**源 = 监控库当前在播抖音房**(非精选列表);非当前时段自动停 FFmpeg + Neko | -| **单频道独占** | 时间段模式强制开启;同一时刻仅一个分组推流 + 一个 Neko 运行 | +| **时间段模式** | `youtube_relay_time_slot_mode`;**与自动推流、单路独占独立**。开启后:有 KEY 的 N 个频道按北京时 **24/N** 轮播;**源 = 监控库当前在播抖音房**(非精选列表);非当前时段停 FFmpeg | +| **单路独占** | `youtube_relay_exclusive_live`(默认开,偏 VPS)。开:开播时只留一路 FFmpeg 并停兄弟 Neko。**物理机建议关**,可与时间段并用,Neko 常驻预热 | | **画质预设** | `youtube_relay_quality_preset`(如 `720p`、`vps_ultra`);含分辨率、码率、AAC **128k** | | **Cookie** | 解析拉流地址依赖 `dy_cookie`(同 sh2 `[Cookie]抖音cookie`);缺失时保持监听、不退出 Worker | @@ -382,16 +545,18 @@ python scripts\_deploy.py - 多 Google 项目:Shorts 频道绑定 OAuth Client **A/B/C/D**,各 Client 独立计数、互不影响 - 实现:`backend/app/shorts_yt_quota.py`(按 Client 计数展示、429 识别);Shorts 页展示用量提示与接口错误,**禁止本地自设上传暂停** -## 全局 SOCKS5(sing-box + proxychains) +## 全局 SOCKS5(sing-box + proxychains)— 主要针对纯 VPS -> **文档状态**:以下为推荐生产架构(静态住宅 IP + 与 [mack-a/v2ray-agent](https://github.com/mack-a/v2ray-agent) 翻墙 sing-box **隔离共存**)。代码按此方案迭代;**当前仓库实现可能仍为「仅 Shorts 上传可选 SOCKS」**,以 `backend/app/shorts_socks.py` 为准。 +> **形态**:本节是 **纯 VPS** 上「静态住宅 IP + 与 v2ray-agent 翻墙隔离」的规划。 +> **物理机请用上一节「ShellCrash `:7890`」**,不要默认改成 `17891` sing-box。 +> 代码仍在演进;以 `egress_hub` / `shellcrash_hub`(物理)与 `shorts_socks` / 规划中的 `douyinweb-singbox`(VPS)为准。 ### 目标 -| 开关 | 行为 | +| 开关 | 行为(纯 VPS) | |------|------| -| **开启** | Shorts / 长视频 / TikTok / X / OAuth / Neko 浏览器 / FFmpeg 拉流与推流等业务出站,尽量统一走 **静态住宅 SOCKS5** | -| **关闭** | 停止 DouyinWEB 专用代理组件,**本机业务直连 VPS 出口**(不影响 v2ray-agent 翻墙) | +| **开启** | Shorts / 长视频 / TikTok / X / OAuth / Neko / FFmpeg 等尽量走 **静态住宅 SOCKS5**(经本机 mixed) | +| **关闭** | 停 DouyinWEB 专用代理组件,业务直连 **VPS 出口**(不影响 v2ray-agent 翻墙) | 设置页规划名称:**全局 SOCKS5**(不再叫「仅 Shorts 上传 SOCKS」)。 @@ -564,7 +729,12 @@ proxychains4 -f /opt/douyinWEB/config/proxychains.conf \ | `DY_YOUTUBE_SVC_URL` | InnerTube sidecar,默认 `http://127.0.0.1:8020` | | `DY_AUTH_ENABLED` | 站点登录,默认 `true`;本地调试可 `false` | | `DY_API_KEY` | 非空时写操作需 `X-API-Key` | -| `DY_NEKO_NAT1TO1` | Neko WebRTC 对外 IP(留空则自动探测) | +| `DY_NEKO_NAT1TO1` | Neko WebRTC ICE 对外 IP;物理双边缘填**国内边缘公网 IP**;纯 VPS 填本机公网 IP;**勿**填 WG/`127.0.0.1`(留空仅作探测,失败则空) | +| `DY_NEKO_HTTP_BIND` | Neko HTTP 绑定;物理机 **`0.0.0.0`**;纯 VPS 可 `127.0.0.1` | +| `DY_NEKO_GATEWAY_ENABLED` | 默认 `false`;`true` 时走本机 `:9199` 路径网关(物理双边缘一般保持 `0`) | +| `DY_NEKO_MAX_INSTANCES` | 软上限,默认 `64`;须与边缘 `/neko/{1..N}` 发布容量一致 | +| `DY_NEKO_EDGE_UPSTREAM` | 生成 Caddy snippet 时的 WG 上游(例 `10.8.0.2`) | +| `DY_CORS_ORIGINS` | 逗号分隔公网 origin;双边缘须含 `${DOMAIN}` 与 `${DOMAIN_CN}` | | `TZ` | 建议 `Asia/Shanghai` | 示例(**请替换占位符,勿照抄到生产**): diff --git a/backend/app/clash_assets/clash.yaml b/backend/app/clash_assets/clash.yaml index ed51fd3..f2d08a3 100644 --- a/backend/app/clash_assets/clash.yaml +++ b/backend/app/clash_assets/clash.yaml @@ -313,42 +313,43 @@ proxy-groups: - type: select name: 🚀 节点选择 proxies: + - 1d2da142-singbox_hysteria5 + - 1d2da142-singbox_tuic5 + - 1d2da142-VLESS_Reality_Vision5 + - ⚡ 自动选择 - DIRECT - REJECT - - ⚡ 自动选择 - - proxycheap + - e3ea3b30-singbox_hysteria_vultr + - e3ea3b30-singbox_tuic_vultr + - e3ea3b30-VLESS_Reality_Vision_vultr - 242af835-singbox_hysteria - hackrobot-singbox_tuic - VLESS_Reality_Vision - 242af835-singbox_hysteria2 - hackrobot-singbox_tuic2 - VLESS_Reality_Vision2 - - 1d2da142-singbox_hysteria5 - - 1d2da142-VLESS_Reality_Vision5 - - 1d2da142-singbox_tuic5 - - e3ea3b30-singbox_hysteria_vultr - - e3ea3b30-VLESS_Reality_Vision_vultr - - e3ea3b30-singbox_tuic_vultr + - proxycheap + - socks5 - name: dialer type: select proxies: + - 1d2da142-singbox_hysteria5 + - 1d2da142-singbox_tuic5 + - 1d2da142-VLESS_Reality_Vision5 + - e3ea3b30-singbox_hysteria_vultr + - e3ea3b30-singbox_tuic_vultr + - e3ea3b30-VLESS_Reality_Vision_vultr - 242af835-singbox_hysteria - hackrobot-singbox_tuic - VLESS_Reality_Vision - 242af835-singbox_hysteria2 - hackrobot-singbox_tuic2 - VLESS_Reality_Vision2 - - 1d2da142-singbox_hysteria5 - - 1d2da142-VLESS_Reality_Vision5 - - 1d2da142-singbox_tuic5 - - e3ea3b30-singbox_hysteria_vultr - - e3ea3b30-VLESS_Reality_Vision_vultr - - e3ea3b30-singbox_tuic_vultr - name: ⚡ 自动选择 type: url-test proxies: - - 1d2da142-singbox_tuic5 - 1d2da142-singbox_hysteria5 + - 1d2da142-singbox_tuic5 - 1d2da142-VLESS_Reality_Vision5 - e3ea3b30-singbox_hysteria_vultr - e3ea3b30-VLESS_Reality_Vision_vultr @@ -389,6 +390,14 @@ proxy-groups: - ⚡ 自动选择 - 242af835-singbox_hysteria2 rules: + # 抖音必须直连(物理机家宽);经 ShellCrash/proxychains 时也由规则打回 DIRECT + - DOMAIN-SUFFIX,douyin.com,DIRECT + - DOMAIN-SUFFIX,douyincdn.com,DIRECT + - DOMAIN-SUFFIX,douyinpic.com,DIRECT + - DOMAIN-SUFFIX,douyinvod.com,DIRECT + - DOMAIN-SUFFIX,douyinstatic.com,DIRECT + - DOMAIN-SUFFIX,iesdouyin.com,DIRECT + - DOMAIN-KEYWORD,douyin,DIRECT - RULE-SET,geolocation-cn,🔒 国内服务 - RULE-SET,geolocation-!cn,🌐 非中国 - RULE-SET,private,🏠 私有网络,no-resolve diff --git a/backend/app/config.py b/backend/app/config.py index b7148ee..e077aea 100644 --- a/backend/app/config.py +++ b/backend/app/config.py @@ -66,6 +66,13 @@ class Settings(BaseSettings): # Neko browser (per YouTube assign group) — US VPS direct, no ShellClash neko_enabled: bool = True neko_http_port_base: int = 9200 + # Soft cap for docker compose / instance ids (keep ≤ edge Caddy/Nginx published /neko/N). + neko_max_instances: int = 64 + # Path gateway :9199 — optional; dual-edge physical uses native Caddy/Nginx /neko/{id}. + neko_gateway_enabled: bool = False + neko_gateway_port: int = 9199 + # 127.0.0.1 = VPS colocated; 0.0.0.0 = physical (reachable via WireGuard) + neko_http_bind: str = "127.0.0.1" neko_webrtc_mux_base: int = 52300 neko_user_pass: str = "douyinweb" neko_admin_pass: str = "Xiao4669805@" diff --git a/backend/app/db.py b/backend/app/db.py index 34dc9d5..7a984e7 100644 --- a/backend/app/db.py +++ b/backend/app/db.py @@ -365,6 +365,8 @@ def init_db() -> None: ("oauth_email", "TEXT NOT NULL DEFAULT ''"), ("yt_profile_json", "TEXT NOT NULL DEFAULT ''"), ("yt_profile_at", "REAL NOT NULL DEFAULT 0"), + ("ypp_ok", "INTEGER NOT NULL DEFAULT -1"), + ("ypp_checked_at", "REAL NOT NULL DEFAULT 0"), ]: if col not in sc_cols: conn.execute(f"ALTER TABLE shorts_channels ADD COLUMN {col} {ddl}") @@ -491,18 +493,15 @@ def _seed_defaults(conn: sqlite3.Connection) -> None: "shorts_yt_uploads_pt_count": 0, # Shorts upload SOCKS5 (optional, default off — does not affect monitor) "shorts_upload_socks_enabled": False, - "shorts_upload_socks_profile_id": "residential-1", - "shorts_upload_socks_profiles": [ - { - "id": "residential-1", - "label": "静态住宅 IP", - "type": "socks5", - "server": "185.124.61.35", - "port": 43676, - "username": "V0sI3BsI1bxgKRx", - "password": "QGwGeRTAa9YcVhM", - } - ], + "shorts_upload_socks_profile_id": "", + "shorts_upload_socks_profiles": [], + "global_socks_enabled": False, + "global_socks_profile_id": "", + "global_socks_profiles": [], + "egress_mode": "off", + "egress_cover_neko": True, + "egress_cover_relay": True, + "egress_cover_uploads": True, # TikTok pipeline (fully isolated from Shorts) "tiktok_enabled": False, "tiktok_clip_sec": 75, @@ -649,7 +648,10 @@ def monitor_status_data(*, light: bool = False) -> dict[str, Any]: cfg = _settings_map_from_conn(conn) rooms = int(conn.execute("SELECT COUNT(*) AS c FROM rooms").fetchone()["c"] or 0) live = int( - conn.execute("SELECT COUNT(*) AS c FROM rooms WHERE last_status = 'live'").fetchone()["c"] or 0 + conn.execute( + "SELECT COUNT(*) AS c FROM rooms WHERE enabled = 1 AND last_status = 'live'" + ).fetchone()["c"] + or 0 ) bl = int(conn.execute("SELECT COUNT(*) AS c FROM blacklist").fetchone()["c"] or 0) events = int(conn.execute("SELECT COUNT(*) AS c FROM events").fetchone()["c"] or 0) @@ -1244,12 +1246,32 @@ def update_room( new_clip = 0 if new_clip > 120: new_clip = 120 + now = time.time() + extra_sql = "" + extra_args: list[Any] = [] + if enabled is False and int(row["enabled"] or 0) == 1: + extra_sql = ", last_status = 'offline'" + sid = str(row["active_session_id"] or "").strip() + if sid: + sess = conn.execute( + "SELECT * FROM sessions WHERE id = ? AND ended_at IS NULL", (sid,) + ).fetchone() + if sess: + duration = max(0.0, now - float(sess["started_at"])) + conn.execute( + """ + UPDATE sessions SET ended_at = ?, duration_seconds = ?, status = 'ended', + end_reason = 'room_disabled', updated_at = ? WHERE id = ? + """, + (now, duration, now, sid), + ) + extra_sql += ", active_session_id = ''" conn.execute( - """ - UPDATE rooms SET url = ?, room_id = ?, note = ?, enabled = ?, tags = ?, clip_sec = ?, updated_at = ? + f""" + UPDATE rooms SET url = ?, room_id = ?, note = ?, enabled = ?, tags = ?, clip_sec = ?, updated_at = ?{extra_sql} WHERE id = ? """, - (new_url, new_rid, new_note, new_enabled, new_tags, new_clip, time.time(), room_pk), + (new_url, new_rid, new_note, new_enabled, new_tags, new_clip, now, room_pk), ) conn.commit() return _row_to_dict(conn.execute("SELECT * FROM rooms WHERE id = ?", (room_pk,)).fetchone()) # type: ignore @@ -1580,7 +1602,7 @@ def add_blacklist(value: str, reason: str = "") -> dict[str, Any]: if not hit: continue conn.execute( - "UPDATE rooms SET enabled = 0, updated_at = ? WHERE id = ?", + "UPDATE rooms SET enabled = 0, last_status = 'offline', updated_at = ? WHERE id = ?", (now, room["id"]), ) disabled_ids.append(room["id"]) @@ -3723,7 +3745,12 @@ def list_live_douyin_rooms_for_shorts(*, limit: int = 300) -> list[dict[str, Any """, (max(1, min(int(limit), 1000)),), ).fetchall() - return [_row_to_dict(r) for r in rows] + out: list[dict[str, Any]] = [] + for r in rows: + item = _row_to_dict(r) + if item and not _is_blacklisted_conn(conn, str(item.get("room_id") or ""), str(item.get("url") or "")): + out.append(item) + return out finally: conn.close() diff --git a/backend/app/douyin_ingest.py b/backend/app/douyin_ingest.py new file mode 100644 index 0000000..99f7d14 --- /dev/null +++ b/backend/app/douyin_ingest.py @@ -0,0 +1,147 @@ +# -*- coding: utf-8 -*- +"""Unified Douyin live-URL ingest → rooms (直播池). + +All UI surfaces that accept Douyin live URLs should call ensure_in_live_pool +so overview / monitor / live-map stay in sync with assign pools. +""" +from __future__ import annotations + +import time +import uuid +from typing import Any, Optional + +from .db import _connect, _is_blacklisted_conn, _lock, _row_to_dict +from .models import extract_room_id, normalize_room_url + + +def parse_douyin_line(raw: str) -> dict[str, str]: + """Parse paste line → {url, title, room_id}. Reuses assign pool parser.""" + from .yt_assign_db import parse_pool_line + + return parse_pool_line(raw) + + +def ensure_in_live_pool_conn( + conn, + url: str, + *, + note: str = "", + title: str = "", + enabled: bool = True, + tags: str = "", +) -> dict[str, Any]: + """Insert or soft-update a rooms row. Caller holds db._lock / open conn. + + Returns {ok, created, skipped_blacklist, room, reason}. + """ + normalized = normalize_room_url(str(url or "").strip()) or str(url or "").strip() + rid = extract_room_id(normalized) + if not rid: + return {"ok": False, "created": False, "reason": "无法解析抖音直播间 URL / 房间号"} + + blocked = _is_blacklisted_conn(conn, rid, normalized) + if blocked: + return { + "ok": False, + "created": False, + "skipped_blacklist": True, + "reason": f"黑名单:{blocked.get('reason') or blocked.get('value') or ''}", + } + + label = (str(title or "").strip() or str(note or "").strip())[:120] + now = time.time() + existing = conn.execute( + "SELECT * FROM rooms WHERE room_id = ? OR url = ? LIMIT 1", + (rid, normalized), + ).fetchone() + if existing: + row = _row_to_dict(existing) or {} + pk = str(row.get("id") or "") + cur_note = str(row.get("note") or "").strip() + cur_anchor = str(row.get("last_anchor") or "").strip() + new_note = cur_note or label + new_anchor = cur_anchor or label + # Kick monitor sooner so overview/live-map refresh. + conn.execute( + """ + UPDATE rooms SET + note = CASE WHEN TRIM(COALESCE(note, '')) = '' AND ? != '' THEN ? ELSE note END, + last_anchor = CASE WHEN TRIM(COALESCE(last_anchor, '')) = '' AND ? != '' THEN ? ELSE last_anchor END, + next_check_at = MIN(COALESCE(next_check_at, ?), ?), + updated_at = ? + WHERE id = ? + """, + (label, new_note, label, new_anchor, now, now, now, pk), + ) + fresh = conn.execute("SELECT * FROM rooms WHERE id = ?", (pk,)).fetchone() + return {"ok": True, "created": False, "room": _row_to_dict(fresh), "reason": "exists"} + + pk = str(uuid.uuid4()) + conn.execute( + """ + INSERT INTO rooms( + id, url, room_id, note, enabled, last_status, last_anchor, tags, + created_at, updated_at, next_check_at + ) VALUES (?, ?, ?, ?, ?, 'unknown', ?, ?, ?, ?, ?) + """, + ( + pk, + normalized, + rid, + label, + 1 if enabled else 0, + label, + tags or "", + now, + now, + now, + ), + ) + fresh = conn.execute("SELECT * FROM rooms WHERE id = ?", (pk,)).fetchone() + return {"ok": True, "created": True, "room": _row_to_dict(fresh), "reason": "created"} + + +def ensure_in_live_pool( + url: str, + *, + note: str = "", + title: str = "", + enabled: bool = True, + tags: Any = None, +) -> dict[str, Any]: + """Public wrapper with lock — for API handlers outside assign txn.""" + from .db import _normalize_tags + + tags_s = _normalize_tags(tags) if tags is not None else "" + with _lock: + conn = _connect() + try: + result = ensure_in_live_pool_conn( + conn, + url, + note=note, + title=title, + enabled=enabled, + tags=tags_s, + ) + conn.commit() + return result + finally: + conn.close() + + +def sync_pool_titles_from_anchor_conn(conn, room_id: str, anchor: str) -> int: + """Fill empty yt_assign_pool_urls.title from rooms.last_anchor.""" + rid = str(room_id or "").strip() + name = str(anchor or "").strip()[:120] + if not rid or not name: + return 0 + cur = conn.execute( + """ + UPDATE yt_assign_pool_urls + SET title = ?, updated_at = ? + WHERE room_id = ? AND TRIM(COALESCE(title, '')) = '' + """, + (name, time.time(), rid), + ) + return int(cur.rowcount or 0) diff --git a/backend/app/douyin_live.py b/backend/app/douyin_live.py index 99fab81..c0dff3b 100644 --- a/backend/app/douyin_live.py +++ b/backend/app/douyin_live.py @@ -11,20 +11,32 @@ _CACHE: dict[str, Any] = {"at": 0.0, "payload": None, "key": ""} _CACHE_TTL_SEC = 12.0 +def _counts_as_live(row: dict[str, Any]) -> bool: + if not row.get("enabled", True): + return False + rid = str(row.get("room_id") or "").strip() + url = str(row.get("url") or "").strip() + if db.is_blacklisted(rid, url): + return False + return str(row.get("last_status") or "").strip() == "live" + + def _entry(row: dict[str, Any]) -> dict[str, Any]: status = str(row.get("last_status") or "unknown").strip() or "unknown" rid = str(row.get("room_id") or "").strip() url = str(row.get("url") or "").strip() anchor = str(row.get("last_anchor") or row.get("note") or "").strip() avatar = str(row.get("avatar_url") or "").strip() + live = _counts_as_live(row) return { - "is_live": status == "live", - "last_status": status, + "is_live": live, + "last_status": "live" if live else (status if status != "live" else "offline"), "anchor": anchor, "url": url, "avatar_url": avatar, "last_checked_at": row.get("last_checked_at"), "active_session_id": str(row.get("active_session_id") or ""), + "enabled": bool(row.get("enabled", True)), } diff --git a/backend/app/egress_hub.py b/backend/app/egress_hub.py new file mode 100644 index 0000000..67537c8 --- /dev/null +++ b/backend/app/egress_hub.py @@ -0,0 +1,461 @@ +# -*- coding: utf-8 -*- +"""Business egress — always via ShellCrash on China physical hosts. + +Correct model (虚空终端 dialer-proxy): + App → 127.0.0.1:7890 (ShellCrash mixed) + ├─ 默认:选机场节点直接出海 + └─ 勾选「住宅落地」:选 dy-residential(socks5 + dialer-proxy) + → 先经 ShellCrash 前置节点拨号,再连住宅 SOCKS 落地 + (家宽无法直连海外住宅 SOCKS) + +Docs: https://wiki.metacubex.one/config/proxies/dialer-proxy/ +""" +from __future__ import annotations + +import shutil +import subprocess +import time +from pathlib import Path +from typing import Any + +from .config import BACKEND, ROOT +from .global_socks import CONFIG_DIR + +MODES = ("off", "shellcrash") +PROXYCHAINS_CONF = CONFIG_DIR / "proxychains.conf" +RESIDENTIAL_PROXY_NAME = "dy-residential" +DEFAULT_DIALER = "dialer" + +_MODE_KEY = "egress_mode" +_CHAIN_KEY = "egress_chain_residential" +_NEKO_KEY = "egress_cover_neko" +_RELAY_KEY = "egress_cover_relay" +_UPLOADS_KEY = "egress_cover_uploads" + + +def _settings(cfg: dict[str, Any] | None = None) -> dict[str, Any]: + if cfg is not None: + return dict(cfg) + from . import db + + return dict(db.get_settings_map()) + + +def get_mode(cfg: dict[str, Any] | None = None) -> str: + s = _settings(cfg) + raw = str(s.get(_MODE_KEY) or "").strip().lower() + # Legacy: "residential" meant chain-on ShellCrash, never direct SOCKS. + if raw == "residential": + return "shellcrash" + if raw in MODES: + return raw + if s.get("global_socks_enabled") or s.get("shorts_upload_socks_enabled"): + return "shellcrash" + # Default ON for China physical: all non-Douyin business via ShellCrash. + # Explicit "off" in settings still wins (handled above via MODES). + return "shellcrash" + + +def google_http_proxy(cfg: dict[str, Any] | None = None) -> str: + """Proxy for Google / YouTube / TikTok / overseas APIs. Douyin stays DIRECT via Clash rules. + + - shellcrash mode → mixed :7890 + - mode off but ShellCrash still running → still use it (physical soft path) + - mode off + no ShellCrash → empty string (pure VPS direct) + """ + if get_mode(cfg) == "shellcrash": + return _host_http_proxy(cfg) + try: + from . import shellcrash_hub + + st = shellcrash_hub.status() or {} + if st.get("running"): + return f"http://127.0.0.1:{shellcrash_mixed_port(cfg)}" + except Exception: + pass + return "" + + +def google_httpx_kwargs(*, timeout: float = 45.0, cfg: dict[str, Any] | None = None) -> dict[str, Any]: + kw: dict[str, Any] = {"timeout": timeout, "trust_env": False} + proxy = google_http_proxy(cfg) + if proxy: + kw["proxy"] = proxy + return kw + + +# Alias — overseas APIs (TikTok Open API, etc.) share the same egress. +overseas_httpx_kwargs = google_httpx_kwargs +overseas_http_proxy = google_http_proxy + + +def chain_residential(cfg: dict[str, Any] | None = None) -> bool: + s = _settings(cfg) + if _CHAIN_KEY in s: + return bool(s.get(_CHAIN_KEY)) + # Legacy residential mode / socks toggle → chain on + raw = str(s.get(_MODE_KEY) or "").strip().lower() + if raw == "residential": + return True + return bool(s.get("global_socks_enabled") or s.get("shorts_upload_socks_enabled")) + + +def cover_neko(cfg: dict[str, Any] | None = None) -> bool: + s = _settings(cfg) + if _NEKO_KEY in s: + return bool(s.get(_NEKO_KEY)) + return get_mode(s) != "off" + + +def cover_relay(cfg: dict[str, Any] | None = None) -> bool: + s = _settings(cfg) + if _RELAY_KEY in s: + return bool(s.get(_RELAY_KEY)) + return get_mode(s) == "shellcrash" + + +def cover_uploads(cfg: dict[str, Any] | None = None) -> bool: + s = _settings(cfg) + if _UPLOADS_KEY in s: + return bool(s.get(_UPLOADS_KEY)) + return get_mode(s) != "off" + + +def shellcrash_mixed_port(cfg: dict[str, Any] | None = None) -> int: + try: + from . import shellcrash_hub + + st = shellcrash_hub.status() + port = int(st.get("mixed_port") or 7890) + return port if port > 0 else 7890 + except Exception: + return 7890 + + +def _host_http_proxy(cfg: dict[str, Any] | None = None) -> str: + if get_mode(cfg) != "shellcrash": + return "" + return f"http://127.0.0.1:{shellcrash_mixed_port(cfg)}" + + +def resolve_http_proxy(cfg: dict[str, Any] | None = None) -> str: + if get_mode(cfg) == "off": + return "" + return _host_http_proxy(cfg) + + +def resolve_upload_proxy(cfg: dict[str, Any] | None = None) -> str: + if get_mode(cfg) == "off" or not cover_uploads(cfg): + return "" + return _host_http_proxy(cfg) + + +def neko_browser_proxy(cfg: dict[str, Any] | None = None) -> str: + """Chromium inside Neko → host ShellCrash. + + Physical (DY_NEKO_EDGE_UPSTREAM set): always inject proxy unless egress mode is explicit off. + """ + import os + + physical = bool(str(os.environ.get("DY_NEKO_EDGE_UPSTREAM") or "").strip()) + if get_mode(cfg) == "off": + return "" + if not cover_neko(cfg) and not physical: + return "" + return f"http://host.docker.internal:{shellcrash_mixed_port(cfg)}" + + +def write_proxychains_conf(cfg: dict[str, Any] | None = None) -> Path: + """Always point proxychains at ShellCrash mixed SOCKS — never raw residential.""" + CONFIG_DIR.mkdir(parents=True, exist_ok=True) + if get_mode(cfg) != "shellcrash": + PROXYCHAINS_CONF.write_text( + "# egress off\nstrict_chain\nproxy_dns\n[ProxyList]\n", + encoding="utf-8", + ) + return PROXYCHAINS_CONF + port = shellcrash_mixed_port(cfg) + text = ( + "strict_chain\n" + "proxy_dns\n" + "tcp_read_time_out 15000\n" + "tcp_connect_time_out 8000\n" + "localnet 127.0.0.0/8\n" + "localnet 10.0.0.0/8\n" + "localnet 192.168.0.0/16\n" + "[ProxyList]\n" + f"socks5 127.0.0.1 {port}\n" + ) + PROXYCHAINS_CONF.write_text(text, encoding="utf-8") + return PROXYCHAINS_CONF + + +def proxychains_bin() -> str: + return shutil.which("proxychains4") or shutil.which("proxychains") or "" + + +def wrap_ffmpeg_cmd(cmd: list[str], cfg: dict[str, Any] | None = None) -> list[str]: + if get_mode(cfg) == "off" or not cover_relay(cfg): + return list(cmd) + pc = proxychains_bin() + if not pc: + return list(cmd) + write_proxychains_conf(cfg) + return [pc, "-q", "-f", str(PROXYCHAINS_CONF), *cmd] + + +def ffmpeg_uses_proxy(cfg: dict[str, Any] | None = None) -> bool: + return get_mode(cfg) != "off" and cover_relay(cfg) and bool(proxychains_bin()) + + +def apply_mode( + mode: str, + *, + chain: bool | None = None, + cover_neko_flag: bool | None = None, + cover_relay_flag: bool | None = None, + cover_uploads_flag: bool | None = None, + refresh_neko: bool = True, + dialer: str | None = None, + cfg: dict[str, Any] | None = None, +) -> dict[str, Any]: + from . import db + from . import shellcrash_hub + from . import singbox_manager + + raw = str(mode or "off").strip().lower() + if raw == "residential": + mode = "shellcrash" + if chain is None: + chain = True + elif raw not in MODES: + raise ValueError(f"unsupported egress mode: {raw}") + else: + mode = raw + + s = _settings(cfg) + if chain is None: + chain = chain_residential(s) if mode == "shellcrash" else False + chain = bool(chain) and mode == "shellcrash" + + if cover_neko_flag is None: + cover_neko_flag = mode != "off" + if cover_relay_flag is None: + cover_relay_flag = mode == "shellcrash" + if cover_uploads_flag is None: + cover_uploads_flag = mode != "off" + + updates: dict[str, Any] = { + _MODE_KEY: mode, + _CHAIN_KEY: chain, + _NEKO_KEY: bool(cover_neko_flag), + _RELAY_KEY: bool(cover_relay_flag), + _UPLOADS_KEY: bool(cover_uploads_flag), + # Keep legacy flags aligned with «住宅链式» checkbox only (not a separate engine). + "global_socks_enabled": chain, + "shorts_upload_socks_enabled": chain, + } + db.update_settings_map(updates) + s = db.get_settings_map() + + # Never run douyinweb-singbox as China residential path — stop if leftover. + try: + singbox_manager.stop() + except Exception: + pass + + chain_result: dict[str, Any] = {"skipped": True} + if mode == "shellcrash": + if chain: + from . import global_socks + + prof = global_socks.active_profile(s) + if not prof: + raise ValueError("已勾选住宅落地,但未配置 SOCKS5 账号(在下方业务 SOCKS 填写)") + chain_result = shellcrash_hub.apply_residential_chain( + prof, + dialer=(dialer or DEFAULT_DIALER).strip() or DEFAULT_DIALER, + ) + else: + # Normal ShellCrash node (not residential landing). + try: + chain_result = shellcrash_hub.apply_profile( + shellcrash_hub.DEFAULT_PROFILE, + shellcrash_hub.DEFAULT_NODE, + ) + except Exception as exc: + chain_result = {"ok": False, "error": str(exc)} + + pc_path = "" + if mode == "shellcrash" and (cover_relay_flag or cover_uploads_flag): + pc_path = str(write_proxychains_conf(s)) + + neko_result: dict[str, Any] = {"skipped": True} + if refresh_neko: + try: + from . import youtube_neko + + neko_result = youtube_neko.refresh_compose_for_egress() + except Exception as exc: + neko_result = {"ok": False, "error": str(exc)} + + return { + "ok": True, + "egress": status(s), + "chain": chain_result, + "proxychains_conf": pc_path, + "neko": neko_result, + } + + +def probe(cfg: dict[str, Any] | None = None) -> dict[str, Any]: + mode = get_mode(cfg) + proxy = _host_http_proxy(cfg) if mode != "off" else "" + targets = [ + ("google", "https://www.google.com/generate_204"), + ("youtube", "https://www.youtube.com/"), + ("douyin", "https://www.douyin.com/"), + ] + rows = [] + for name, url in targets: + # Douyin: always probe DIRECT; also via proxy to show rule should still work for pull via ShellCrash + if name == "douyin": + rows.append(_curl_probe("douyin_direct", url, proxy="")) + if proxy: + rows.append(_curl_probe("douyin_via_sc", url, proxy=proxy)) + continue + rows.append(_curl_probe(name, url, proxy=proxy)) + rows.append(_curl_probe(f"{name}_direct", url, proxy="")) + return { + "ok": True, + "mode": mode, + "chain_residential": chain_residential(cfg), + "proxy": proxy, + "probes": rows, + "policy": {"douyin": "DIRECT", "domains": ["*.douyin.com", "*.douyincdn.com", "…"]}, + "at": int(time.time()), + } + + +def _curl_probe(name: str, url: str, *, proxy: str) -> dict[str, Any]: + cmd = ["curl", "-sS", "-m", "10", "-o", "/dev/null", "-w", "%{http_code}"] + if proxy: + cmd.extend(["-x", proxy]) + cmd.append(url) + t0 = time.time() + try: + p = subprocess.run(cmd, capture_output=True, text=True, timeout=14, check=False) + code = (p.stdout or "").strip() or "000" + ok = code in {"200", "204", "301", "302"} + return { + "target": name, + "ok": ok, + "http_code": code, + "elapsed_ms": int((time.time() - t0) * 1000), + "via": proxy or "direct", + "error": (p.stderr or "").strip()[:160] if not ok else "", + } + except Exception as exc: + return { + "target": name, + "ok": False, + "http_code": "000", + "elapsed_ms": int((time.time() - t0) * 1000), + "via": proxy or "direct", + "error": str(exc)[:160], + } + + +def status(cfg: dict[str, Any] | None = None) -> dict[str, Any]: + from . import shellcrash_hub + + s = _settings(cfg) + mode = get_mode(s) + chain = chain_residential(s) if mode == "shellcrash" else False + sc = shellcrash_hub.status() + host_proxy = _host_http_proxy(s) + neko_proxy = neko_browser_proxy(s) + pc = proxychains_bin() + exit_label = RESIDENTIAL_PROXY_NAME if chain else (sc.get("selected_node") or shellcrash_hub.DEFAULT_NODE) + return { + "mode": mode, + "chain_residential": chain, + "modes": [ + {"id": "off", "label": "直连", "description": "不经 ShellCrash"}, + { + "id": "shellcrash", + "label": "ShellCrash", + "description": "业务统一走本机 :7890;可选住宅链式落地", + "ready": bool(sc.get("running") or sc.get("installed")), + }, + ], + "cover": { + "neko": cover_neko(s), + "relay": cover_relay(s), + "uploads": cover_uploads(s), + }, + "host_proxy": host_proxy, + "neko_proxy": neko_proxy, + "exit_node": exit_label, + "dialer": DEFAULT_DIALER, + "residential_proxy_name": RESIDENTIAL_PROXY_NAME, + "socks_url": f"socks5://127.0.0.1:{shellcrash_mixed_port(s)}" if mode == "shellcrash" else "", + "proxychains": { + "installed": bool(pc), + "bin": pc, + "conf": str(PROXYCHAINS_CONF) if PROXYCHAINS_CONF.is_file() else "", + "relay_active": ffmpeg_uses_proxy(s), + }, + "shellcrash": { + "running": bool(sc.get("running")), + "mixed_port": sc.get("mixed_port") or "7890", + "selected_node": sc.get("selected_node"), + }, + "matrix": [ + { + "id": "neko", + "label": "Neko Chrome", + "active": bool(neko_proxy), + "detail": (neko_proxy + (f" → {exit_label}" if chain else "")) if neko_proxy else "直连", + }, + { + "id": "relay", + "label": "直播推流 FFmpeg", + "active": ffmpeg_uses_proxy(s), + "detail": ( + f"proxychains → ShellCrash → {exit_label}" + if ffmpeg_uses_proxy(s) + else ("缺 proxychains" if cover_relay(s) and not pc else "直连") + ), + }, + { + "id": "uploads", + "label": "Shorts / 长视频 / 上传", + "active": bool(resolve_upload_proxy(s)), + "detail": (host_proxy + (f" → {exit_label}" if chain else "")) if resolve_upload_proxy(s) else "直连", + }, + ], + "hints": _hints(mode, chain, sc, pc), + "app_root": str(ROOT), + "backend": str(BACKEND), + } + + +def _hints(mode: str, chain: bool, sc: dict[str, Any], pc: str) -> list[str]: + out: list[str] = [] + if mode == "shellcrash": + out.append("硬规则:*.douyin.com / 抖音 CDN 必须 DIRECT(拉流与监控不可走机场)") + if mode == "shellcrash" and not sc.get("running"): + out.append("ShellCrash 未运行 — 先启动,再应用出海") + if mode == "shellcrash" and chain: + out.append( + "住宅落地 = ShellCrash 链式(dialer-proxy):家宽 → 前置节点 → 住宅 SOCKS。" + "详见虚空终端 docs:dialer-proxy" + ) + if mode == "shellcrash" and not chain: + out.append("当前用 ShellCrash 机场线路出海;勾选「住宅落地」才会链式到 SOCKS5") + if mode != "off" and not pc: + out.append("未安装 proxychains4 — 直播推流无法走代理") + if mode == "off": + out.append("直连:国内物理机上 YouTube Studio / 推流通常不可用") + return out diff --git a/backend/app/global_socks.py b/backend/app/global_socks.py new file mode 100644 index 0000000..f1d0488 --- /dev/null +++ b/backend/app/global_socks.py @@ -0,0 +1,291 @@ +# -*- coding: utf-8 -*- +"""Global SOCKS5 via local sing-box mixed inbound (Linux best practice). + +Architecture: + App / FFmpeg / Neko / httpx → 127.0.0.1:MIXED_PORT (HTTP+SOCKS) + ↓ sing-box + remote static residential SOCKS5 + +When disabled: sing-box stopped, no proxy env injected — direct egress. +""" +from __future__ import annotations + +import uuid +from typing import Any +from urllib.parse import quote + +from .config import BACKEND + +DEFAULT_PROFILE_ID = "residential-1" +LOCAL_MIXED_HOST = "127.0.0.1" +LOCAL_MIXED_PORT = 17891 + +CONFIG_DIR = BACKEND.parent / "config" +SINGBOX_CONFIG_PATH = CONFIG_DIR / "sing-box.json" + +DEFAULT_PROFILES: list[dict[str, Any]] = [] +# Fresh installs start with zero SOCKS profiles — operators add their own. +# Never ship another project's residential credentials here. + +# Legacy DB keys kept in sync on save. +_LEGACY_ENABLED_KEY = "shorts_upload_socks_enabled" +_LEGACY_PROFILE_ID_KEY = "shorts_upload_socks_profile_id" +_LEGACY_PROFILES_KEY = "shorts_upload_socks_profiles" +_ENABLED_KEY = "global_socks_enabled" +_PROFILE_ID_KEY = "global_socks_profile_id" +_PROFILES_KEY = "global_socks_profiles" + + +def _norm_profile(raw: Any) -> dict[str, Any] | None: + if not isinstance(raw, dict): + return None + pid = str(raw.get("id") or "").strip() or str(uuid.uuid4()) + server = str(raw.get("server") or "").strip() + try: + port = int(raw.get("port") or 0) + except Exception: + port = 0 + ptype = str(raw.get("type") or "socks5").strip().lower() or "socks5" + if ptype not in {"socks5", "socks5h"}: + ptype = "socks5" + return { + "id": pid, + "label": str(raw.get("label") or server or pid).strip() or pid, + "type": ptype, + "server": server, + "port": port, + "username": str(raw.get("username") or ""), + "password": str(raw.get("password") or ""), + } + + +def _settings_dict(cfg: dict[str, Any] | None = None) -> dict[str, Any]: + if cfg is not None: + return dict(cfg) + from . import db + + return dict(db.get_settings_map()) + + +def is_global_socks_enabled(cfg: dict[str, Any] | None = None) -> bool: + settings = _settings_dict(cfg) + if settings.get(_ENABLED_KEY) is not None: + return bool(settings.get(_ENABLED_KEY)) + return bool(settings.get(_LEGACY_ENABLED_KEY)) + + +def list_socks_profiles(cfg: dict[str, Any] | None = None, *, public: bool = False) -> list[dict[str, Any]]: + settings = _settings_dict(cfg) + raw = settings.get(_PROFILES_KEY) + if not isinstance(raw, list) or not raw: + raw = settings.get(_LEGACY_PROFILES_KEY) + rows: list[dict[str, Any]] = [] + if isinstance(raw, list): + for item in raw: + p = _norm_profile(item) + if p and p["server"] and p["port"] > 0: + rows.append(p) + if not rows: + rows = [dict(x) for x in DEFAULT_PROFILES] + if not public: + return rows + out = [] + for p in rows: + pwd = str(p.get("password") or "") + q = dict(p) + q["has_password"] = bool(pwd.strip()) + q["password"] = ("***" + pwd[-4:]) if len(pwd) > 4 else ("***" if pwd else "") + out.append(q) + return out + + +def get_socks_profile(profile_id: str, cfg: dict[str, Any] | None = None) -> dict[str, Any] | None: + pid = str(profile_id or "").strip() + for p in list_socks_profiles(cfg, public=False): + if str(p.get("id") or "") == pid: + return p + return None + + +def active_profile_id(cfg: dict[str, Any] | None = None) -> str: + settings = _settings_dict(cfg) + pid = str(settings.get(_PROFILE_ID_KEY) or settings.get(_LEGACY_PROFILE_ID_KEY) or "").strip() + if pid: + return pid + rows = list_socks_profiles(cfg, public=False) + if rows: + return str(rows[0].get("id") or "").strip() + return "" + + +def active_profile(cfg: dict[str, Any] | None = None) -> dict[str, Any] | None: + prof = get_socks_profile(active_profile_id(cfg), cfg) + if prof: + return prof + rows = list_socks_profiles(cfg, public=False) + return rows[0] if rows else None + + +def upstream_socks_url(profile: dict[str, Any] | None) -> str: + """Direct socks5h URL to residential provider (sing-box upstream).""" + if not profile: + return "" + server = str(profile.get("server") or "").strip() + try: + port = int(profile.get("port") or 0) + except Exception: + port = 0 + if not server or port <= 0: + return "" + user = str(profile.get("username") or "") + pwd = str(profile.get("password") or "") + if user or pwd: + return f"socks5h://{quote(user, safe='')}:{quote(pwd, safe='')}@{server}:{port}" + return f"socks5h://{server}:{port}" + + +def local_mixed_url() -> str: + """Local sing-box mixed inbound — preferred for httpx / curl / ffmpeg -http_proxy.""" + return f"http://{LOCAL_MIXED_HOST}:{LOCAL_MIXED_PORT}" + + +def local_socks_url() -> str: + return f"socks5://{LOCAL_MIXED_HOST}:{LOCAL_MIXED_PORT}" + + +def resolve_app_proxy(cfg: dict[str, Any] | None = None) -> str: + """Return local mixed proxy URL when global SOCKS is on and sing-box is up; else ''.""" + if not is_global_socks_enabled(cfg): + return "" + from . import singbox_manager + + if not singbox_manager.is_running(): + # Best-effort start (settings save should have started it already). + try: + singbox_manager.apply_from_settings(cfg) + except Exception: + pass + if singbox_manager.is_running(): + return local_mixed_url() + # Fallback: direct socks5h if sing-box binary missing. + return upstream_socks_url(active_profile(cfg)) + + +def httpx_proxy(cfg: dict[str, Any] | None = None) -> str | None: + url = resolve_app_proxy(cfg) + return url or None + + +def requests_proxies(cfg: dict[str, Any] | None = None) -> dict[str, str]: + url = resolve_app_proxy(cfg) + if not url: + return {} + return {"http": url, "https": url} + + +def subprocess_env(cfg: dict[str, Any] | None = None, base: dict[str, str] | None = None) -> dict[str, str]: + """Linux convention: ALL_PROXY / HTTP_PROXY / HTTPS_PROXY for child processes.""" + env = dict(base or {}) + url = resolve_app_proxy(cfg) + if not url: + for key in ("HTTP_PROXY", "HTTPS_PROXY", "ALL_PROXY", "http_proxy", "https_proxy", "all_proxy"): + env.pop(key, None) + return env + env["HTTP_PROXY"] = url + env["HTTPS_PROXY"] = url + env["ALL_PROXY"] = local_socks_url() + env["http_proxy"] = url + env["https_proxy"] = url + env["all_proxy"] = local_socks_url() + # Never proxy loopback / local services. + no_proxy = "127.0.0.1,localhost,::1" + env["NO_PROXY"] = no_proxy + env["no_proxy"] = no_proxy + return env + + +def neko_browser_proxy(cfg: dict[str, Any] | None = None) -> str: + """Chromium proxy for Neko containers — delegates to egress_hub.""" + try: + from . import egress_hub + + return egress_hub.neko_browser_proxy(cfg) + except Exception: + return resolve_app_proxy(cfg) if is_global_socks_enabled(cfg) else "" + + +def merge_profiles_patch(incoming: Any, existing_cfg: dict[str, Any] | None = None) -> list[dict[str, Any]]: + existing = {str(p["id"]): p for p in list_socks_profiles(existing_cfg, public=False)} + out: list[dict[str, Any]] = [] + if not isinstance(incoming, list): + return list(existing.values()) or [dict(x) for x in DEFAULT_PROFILES] + # Explicit empty list clears all profiles (fresh install / wipe). + if len(incoming) == 0: + return [] + for item in incoming: + p = _norm_profile(item) + if not p: + continue + pid = str(p["id"]) + old = existing.get(pid) or {} + pwd = str(p.get("password") or "") + if (not pwd.strip()) or pwd.startswith("***"): + p["password"] = str(old.get("password") or "") + if not p["server"] or int(p.get("port") or 0) <= 0: + continue + out.append(p) + return out or [dict(x) for x in DEFAULT_PROFILES] + + +def normalize_settings_patch(patch: dict[str, Any], existing: dict[str, Any] | None = None) -> dict[str, Any]: + """Sync global + legacy keys; apply sing-box when toggled.""" + out = dict(patch) + ex = dict(existing or {}) + + # Accept either global_* or legacy shorts_upload_socks_* from UI. + if "global_socks_enabled" in out: + out[_LEGACY_ENABLED_KEY] = bool(out["global_socks_enabled"]) + elif _LEGACY_ENABLED_KEY in out: + out["global_socks_enabled"] = bool(out[_LEGACY_ENABLED_KEY]) + + if "global_socks_profile_id" in out: + out[_LEGACY_PROFILE_ID_KEY] = str(out["global_socks_profile_id"] or "") + elif _LEGACY_PROFILE_ID_KEY in out: + out["global_socks_profile_id"] = str(out[_LEGACY_PROFILE_ID_KEY] or "") + + if "global_socks_profiles" in out: + merged = merge_profiles_patch(out.get("global_socks_profiles"), ex) + out["global_socks_profiles"] = merged + out[_LEGACY_PROFILES_KEY] = merged + elif _LEGACY_PROFILES_KEY in out: + merged = merge_profiles_patch(out.get(_LEGACY_PROFILES_KEY), ex) + out["global_socks_profiles"] = merged + out[_LEGACY_PROFILES_KEY] = merged + + return out + + +def apply_runtime(cfg: dict[str, Any] | None = None) -> dict[str, Any]: + from . import singbox_manager + + return singbox_manager.apply_from_settings(cfg) + + +def public_settings(cfg: dict[str, Any]) -> dict[str, Any]: + from . import singbox_manager + + enabled = is_global_socks_enabled(cfg) + st = singbox_manager.status() + return { + "global_socks_enabled": enabled, + "global_socks_profile_id": active_profile_id(cfg), + "global_socks_profiles": list_socks_profiles(cfg, public=True), + "global_socks_local_mixed": local_mixed_url(), + "global_socks_engine": "sing-box", + "global_socks_running": bool(st.get("running")), + "global_socks_error": str(st.get("error") or ""), + # Legacy aliases for older UI / API clients. + "shorts_upload_socks_enabled": enabled, + "shorts_upload_socks_profile_id": active_profile_id(cfg), + "shorts_upload_socks_profiles": list_socks_profiles(cfg, public=True), + } diff --git a/backend/app/main.py b/backend/app/main.py index 9ed0e2a..508f1f0 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -19,7 +19,7 @@ if sys.platform == "win32": except Exception: pass -from fastapi import FastAPI, HTTPException, Query, Request, WebSocket, WebSocketDisconnect +from fastapi import Body, FastAPI, HTTPException, Query, Request, WebSocket, WebSocketDisconnect from fastapi.middleware.cors import CORSMiddleware from fastapi.responses import FileResponse, JSONResponse, RedirectResponse, Response, StreamingResponse from fastapi.staticfiles import StaticFiles @@ -143,6 +143,18 @@ async def lifespan(_: FastAPI): if not _desktop_light: asyncio.create_task(_live_map_refresh_loop()) + async def _studio_cdp_poll_loop() -> None: + """Host-side CDP backup for YouTube Studio on-air + minute reports (never restarts Chrome).""" + try: + await youtube_neko.studio_cdp_poll_loop() + except asyncio.CancelledError: + raise + except Exception: + pass + + if not _desktop_light: + asyncio.create_task(_studio_cdp_poll_loop()) + async def _ops_background_loops() -> None: if _desktop_light: return @@ -181,13 +193,32 @@ async def lifespan(_: FastAPI): await _boot("youtube_relay", youtube_relay_pipeline.start) async def _neko_boot() -> None: - groups = await asyncio.to_thread(yt_assign_db.list_groups, False) - await asyncio.to_thread(youtube_neko.sync_for_groups, groups) + try: + from . import neko_edge_gateway + + await neko_edge_gateway.start_gateway() + except Exception as exc: + db.add_event( + kind="ops", + level="warn", + message=f"Neko 边缘网关启动失败:{str(exc)[:160]}", + ) + groups = await asyncio.to_thread(yt_assign_db.list_groups, include_urls=False) + # Physical keep-warm: never stop already-running Studio browsers on API boot. + await asyncio.to_thread( + lambda: youtube_neko.sync_for_groups(groups, reconcile_running=False) + ) await _boot("neko", _neko_boot) asyncio.create_task(_start_workers()) yield + try: + from . import neko_edge_gateway + + await neko_edge_gateway.stop_gateway() + except Exception: + pass try: await youtube_relay_pipeline.stop() except Exception: @@ -569,21 +600,35 @@ def _public_settings(cfg: dict[str, Any]) -> dict[str, Any]: return out +def _host_is_private(host: str) -> bool: + h = (host or "").split(",")[0].strip().split(":")[0].lower() + if not h or h in {"localhost", "127.0.0.1", "::1"}: + return True + if h.startswith("10.") or h.startswith("192.168.") or h.startswith("172."): + return True + return False + + def _request_public_base(request: Request) -> str: - """Prefer reverse-proxy headers for OAuth redirect base (whichever host user opened).""" + """Public HTTPS origin for OAuth redirects. + + Prefer DY_PUBLIC_BASE_URL when the request Host is loopback / WG private + (physical edge: API sees 10.8.0.2 or 127.0.0.1 without proper Host header). + """ + pub = str(settings.public_base_url or "").strip().rstrip("/") proto = (request.headers.get("x-forwarded-proto") or request.url.scheme or "https").split(",")[0].strip() host = (request.headers.get("x-forwarded-host") or request.headers.get("host") or "").split(",")[0].strip() if host: - # strip port from Host if present for standard :443 if host.endswith(":443") and proto == "https": host = host[:-4] elif host.endswith(":80") and proto == "http": host = host[:-3] - return f"{proto}://{host}" - pub = str(settings.public_base_url or "").strip().rstrip("/") - if pub: - return pub - return "" + if _host_is_private(host): + if pub: + return pub + else: + return f"{proto}://{host}" + return pub or "" def _enrich_shorts_job( @@ -714,7 +759,11 @@ async def shorts_live_analytics( row["authorized"] = bool(str(ch.get("refresh_token") or "").strip()) row["oauth_ok"] = ch.get("oauth_ok") row["oauth_profile_id"] = str(ch.get("oauth_profile_id") or "").strip().upper() - row["ypp_ok"] = ypp_by_shorts.get(pk, -1) + try: + sc_ypp = int(ch.get("ypp_ok") if ch.get("ypp_ok") is not None else -1) + except Exception: + sc_ypp = -1 + row["ypp_ok"] = sc_ypp if sc_ypp in (0, 1) else ypp_by_shorts.get(pk, -1) enriched.append(row) channels = enriched except Exception: @@ -771,6 +820,9 @@ async def shorts_oauth_callback( handle = quote(str(result.get("youtube_handle") or "")) ret = str(result.get("return_to") or "").strip() extra = f"&title={title}" + (f"&handle={handle}" if handle else "") + dup = str(result.get("duplicate_channel_warning") or "").strip() + if dup: + extra += f"&dup=1&dup_msg={quote(dup[:240])}" if ret: sep = "&" if "?" in ret else "?" return RedirectResponse(f"{base}{ret}{sep}oauth=ok{extra}", status_code=302) @@ -778,10 +830,16 @@ async def shorts_oauth_callback( except Exception as exc: ret = str(request.query_params.get("return_to") or "").strip() msg = quote(str(exc)[:320]) + # Best-effort: stamp error on channel if state still maps (popped already inside exchange). + try: + # state already consumed; error text is enough in redirect query + pass + except Exception: + pass if ret and ret.startswith("/") and not ret.startswith("//"): sep = "&" if "?" in ret else "?" return RedirectResponse(f"{base}{ret}{sep}oauth=error&msg={msg}", status_code=302) - return RedirectResponse(f"{base}/shorts?oauth=error&msg={quote(str(exc)[:320])}", status_code=302) + return RedirectResponse(f"{base}/shorts?oauth=error&msg={msg}", status_code=302) @app.post("/api/shorts/start") @@ -3092,7 +3150,7 @@ async def youtube_relay_session_detail(session_id: int) -> dict[str, Any]: @app.get("/api/youtube/neko/status") async def youtube_neko_status() -> dict[str, Any]: """Read-only Neko status — no compose/nginx sync (avoids 12s poll thrash).""" - groups = await asyncio.to_thread(yt_assign_db.list_groups, False) + groups = await asyncio.to_thread(yt_assign_db.list_groups, include_urls=False) ids = [int(g.get("neko_instance_id") or 0) for g in groups] desired = max(ids) if ids else 0 return await asyncio.to_thread(youtube_neko.status_summary, desired=desired) @@ -3135,6 +3193,9 @@ async def youtube_assign_group_neko(group_id: str, body: dict[str, Any] | None = if action in {"start", "stop", "restart"}: if action == "start" and not g.get("neko_enabled"): g = yt_assign_db.update_group(group_id, neko_enabled=True) + elif action == "stop" and g.get("neko_enabled") and "enabled" not in body: + # Persist stop so boot/restore does not revive the container. + g = yt_assign_db.update_group(group_id, neko_enabled=False) try: neko_result = await asyncio.to_thread(youtube_neko.instance_action, instance_id, action) except (ValueError, RuntimeError) as exc: @@ -3687,6 +3748,287 @@ async def clash_catalog() -> dict[str, Any]: return await _db(clash_dl.catalog) +@app.get("/api/network") +async def network_hub_status() -> dict[str, Any]: + """WireGuard / FRP / ShellCrash / SOCKS overview (SH2-adapted controls).""" + from . import network_hub + + return await asyncio.to_thread(network_hub.network_overview) + + +@app.get("/api/network/socks") +async def network_socks_get() -> dict[str, Any]: + from . import network_hub + + return await asyncio.to_thread(network_hub.socks_status) + + +@app.patch("/api/network/socks") +async def network_socks_patch(body: dict[str, Any]) -> dict[str, Any]: + """Update global SOCKS profiles — empty list allowed (fresh install).""" + from . import db + from . import global_socks + from . import singbox_manager + + cfg = await asyncio.to_thread(db.get_settings_map) + updates: dict[str, Any] = {} + if "enabled" in body: + updates["global_socks_enabled"] = bool(body.get("enabled")) + updates["shorts_upload_socks_enabled"] = bool(body.get("enabled")) + # 住宅 SOCKS 勾选 = ShellCrash 链式落地,不是独立引擎 + updates["egress_chain_residential"] = bool(body.get("enabled")) + if bool(body.get("enabled")): + updates["egress_mode"] = "shellcrash" + elif str(cfg.get("egress_mode") or "") == "residential": + updates["egress_mode"] = "shellcrash" + if "active_profile_id" in body: + updates["global_socks_profile_id"] = str(body.get("active_profile_id") or "").strip() + updates["shorts_upload_socks_profile_id"] = updates["global_socks_profile_id"] + if "profiles" in body: + raw = body.get("profiles") + rows = [] + if isinstance(raw, list): + for item in raw: + p = global_socks._norm_profile(item) + if p and p["server"] and p["port"] > 0: + # Keep existing password if client sent masked *** + old = global_socks.get_socks_profile(str(p["id"]), cfg) + pwd = str(p.get("password") or "") + if old and (not pwd or pwd.startswith("***")): + p["password"] = str(old.get("password") or "") + rows.append(p) + updates["global_socks_profiles"] = rows + updates["shorts_upload_socks_profiles"] = rows + if updates: + await asyncio.to_thread(db.update_settings_map, updates) + cfg = await asyncio.to_thread(db.get_settings_map) + try: + await asyncio.to_thread(singbox_manager.apply_from_settings, cfg) + except Exception: + pass + from . import network_hub + + return await asyncio.to_thread(network_hub.socks_status) + + +@app.get("/api/network/egress") +async def network_egress_get() -> dict[str, Any]: + from . import egress_hub + + return {"ok": True, "egress": await asyncio.to_thread(egress_hub.status)} + + +@app.patch("/api/network/egress") +async def network_egress_patch(body: dict[str, Any] = Body(default={})) -> dict[str, Any]: + from . import egress_hub + + mode = str(body.get("mode") or "").strip().lower() + if not mode: + raise HTTPException(status_code=400, detail="mode required") + cover = body.get("cover") if isinstance(body.get("cover"), dict) else {} + chain = body.get("chain_residential") + if chain is None: + chain = body.get("chain") + try: + result = await asyncio.to_thread( + egress_hub.apply_mode, + mode, + chain=None if chain is None else bool(chain), + cover_neko_flag=cover.get("neko") if "neko" in cover else body.get("cover_neko"), + cover_relay_flag=cover.get("relay") if "relay" in cover else body.get("cover_relay"), + cover_uploads_flag=cover.get("uploads") if "uploads" in cover else body.get("cover_uploads"), + refresh_neko=bool(body.get("refresh_neko", True)), + dialer=str(body.get("dialer") or "") or None, + ) + except ValueError as exc: + raise HTTPException(status_code=400, detail=str(exc)) from exc + return result + + +@app.post("/api/network/egress/probe") +async def network_egress_probe() -> dict[str, Any]: + from . import egress_hub + + return await asyncio.to_thread(egress_hub.probe) + + +@app.get("/api/network/wireguard/status") +async def network_wireguard_status() -> dict[str, Any]: + from . import wireguard_hub + + return {"ok": True, "wireguard": await asyncio.to_thread(wireguard_hub.runtime_status)} + + +@app.post("/api/network/wireguard/save") +async def network_wireguard_save(body: dict[str, Any]) -> dict[str, Any]: + """Import WireGuard conf (default overlay — strip 0.0.0.0/0). apply=true installs + starts.""" + from . import wireguard_hub + + content = str(body.get("content") or "") + name = str(body.get("name") or wireguard_hub.PREFERRED_IFACE).strip() or wireguard_hub.PREFERRED_IFACE + route_mode = str(body.get("route_mode") or "overlay").strip() or "overlay" + apply = bool(body.get("apply")) + try: + if apply: + result = await asyncio.to_thread( + wireguard_hub.apply_wireguard_config, + content, + name=name, + route_mode=route_mode, + ) + return {"ok": True, "message": "applied", "wireguard": result} + result = await asyncio.to_thread( + wireguard_hub.save_imported_wireguard_config, + content, + name=name, + route_mode=route_mode, + ) + return {"ok": True, "message": "saved", "wireguard": result} + except wireguard_hub.WireGuardConfigError as exc: + raise HTTPException(400, str(exc)) from exc + except OSError as exc: + raise HTTPException(500, f"WireGuard 保存失败: {exc}") from exc + + +@app.post("/api/network/wireguard/apply") +async def network_wireguard_apply(body: dict[str, Any]) -> dict[str, Any]: + next_body = {**(body or {}), "apply": True, "route_mode": (body or {}).get("route_mode") or "overlay"} + return await network_wireguard_save(next_body) + + +@app.get("/api/network/wireguard/config/{name}") +async def network_wireguard_config(name: str) -> dict[str, Any]: + from . import wireguard_hub + + try: + return {"ok": True, **(await asyncio.to_thread(wireguard_hub.read_config, name))} + except wireguard_hub.WireGuardConfigError as exc: + raise HTTPException(404, str(exc)) from exc + + +@app.delete("/api/network/wireguard/config/{name}") +async def network_wireguard_config_delete(name: str) -> dict[str, Any]: + """Delete an imported (non-system) WireGuard conf leftover.""" + from . import wireguard_hub + + try: + return await asyncio.to_thread(wireguard_hub.delete_imported_config, name) + except wireguard_hub.WireGuardConfigError as exc: + raise HTTPException(400, str(exc)) from exc + + +@app.post("/api/network/wireguard/{name}/{action}") +async def network_wireguard_iface_action(name: str, action: str) -> dict[str, Any]: + """start / stop / restart / status for wg-quick@{name}.""" + from . import wireguard_hub + + try: + return await asyncio.to_thread(wireguard_hub.iface_action, name, action) + except wireguard_hub.WireGuardConfigError as exc: + raise HTTPException(400, str(exc)) from exc + + +@app.get("/api/network/shellcrash/status") +async def network_shellcrash_status() -> dict[str, Any]: + from . import shellcrash_hub + + return {"ok": True, "shellcrash": await asyncio.to_thread(shellcrash_hub.status)} + + +@app.get("/api/network/shellcrash/files") +async def network_shellcrash_files(root: str = Query("shellcrash-yamls")) -> dict[str, Any]: + from . import shellcrash_hub + + try: + return await asyncio.to_thread(shellcrash_hub.list_files, root) + except ValueError as exc: + raise HTTPException(400, str(exc)) from exc + + +@app.get("/api/network/shellcrash/file") +async def network_shellcrash_file_get( + root: str = Query("shellcrash-yamls"), + path: str = Query(...), +) -> dict[str, Any]: + from . import shellcrash_hub + + try: + return await asyncio.to_thread(shellcrash_hub.read_file, root, path) + except FileNotFoundError as exc: + raise HTTPException(404, str(exc)) from exc + except ValueError as exc: + raise HTTPException(400, str(exc)) from exc + + +@app.put("/api/network/shellcrash/file") +async def network_shellcrash_file_put(body: dict[str, Any] = Body(...)) -> dict[str, Any]: + from . import shellcrash_hub + + root = str(body.get("root") or "shellcrash-yamls") + path = str(body.get("path") or "").strip() + content = str(body.get("content") or "") + if not path: + raise HTTPException(400, "path required") + try: + return await asyncio.to_thread(shellcrash_hub.write_file, root, path, content) + except ValueError as exc: + raise HTTPException(400, str(exc)) from exc + except RuntimeError as exc: + raise HTTPException(500, str(exc)) from exc + + +@app.delete("/api/network/shellcrash/file") +async def network_shellcrash_file_delete( + root: str = Query("shellcrash-yamls"), + path: str = Query(...), +) -> dict[str, Any]: + from . import shellcrash_hub + + try: + return await asyncio.to_thread(shellcrash_hub.delete_file, root, path) + except FileNotFoundError as exc: + raise HTTPException(404, str(exc)) from exc + except ValueError as exc: + raise HTTPException(400, str(exc)) from exc + + +@app.post("/api/network/shellcrash/apply_profile") +async def network_shellcrash_apply_profile(body: dict[str, Any] = Body(default={})) -> dict[str, Any]: + from . import shellcrash_hub + + path = str(body.get("path") or shellcrash_hub.default_profile()) + node = str(body.get("target_node") or shellcrash_hub.default_node()) + try: + return await asyncio.to_thread(shellcrash_hub.apply_profile, path, node) + except FileNotFoundError as exc: + raise HTTPException(404, str(exc)) from exc + except Exception as exc: + raise HTTPException(500, f"应用失败: {exc}") from exc + + +@app.post("/api/network/shellcrash/web_panel") +async def network_shellcrash_web_panel() -> dict[str, Any]: + from . import shellcrash_hub + + try: + return await asyncio.to_thread(shellcrash_hub.web_panel) + except Exception as exc: + raise HTTPException(500, str(exc)) from exc + + +@app.post("/api/network/shellcrash/{action}") +async def network_shellcrash_action(action: str) -> dict[str, Any]: + """start / stop / restart / pick / status ShellCrash (SH2-compatible).""" + from . import shellcrash_hub + + try: + return await asyncio.to_thread(shellcrash_hub.action, action) + except ValueError as exc: + raise HTTPException(400, str(exc)) from exc + except RuntimeError as exc: + raise HTTPException(400, str(exc)) from exc + + @app.post("/api/clash/sync") async def clash_sync(force: bool = Query(False)) -> dict[str, Any]: """Pull latest Clash Verge Rev Win x64 from GitHub and publish clash.yaml to S3.""" diff --git a/backend/app/neko_edge_gateway.py b/backend/app/neko_edge_gateway.py new file mode 100644 index 0000000..02df9be --- /dev/null +++ b/backend/app/neko_edge_gateway.py @@ -0,0 +1,296 @@ +# -*- coding: utf-8 -*- +"""Unlimited Neko HTTP/WebSocket gateway. + +Public edges should reverse_proxy ALL `/neko/*` to this listener (default :9199). +Path `/neko/{id}/…` is stripped and forwarded to `127.0.0.1:{base+id-1}/…`. + +This removes the hard-coded /neko/1…N blocks on Caddy/Nginx edges. +""" +from __future__ import annotations + +import asyncio +import logging +import re +from typing import Any + +import httpx +from starlette.applications import Starlette +from starlette.requests import Request +from starlette.responses import Response +from starlette.routing import Route, WebSocketRoute +from starlette.websockets import WebSocket, WebSocketDisconnect + +from .config import settings + +log = logging.getLogger("neko_gateway") + +_PATH_RE = re.compile(r"^/neko/(\d+)(/.*)?$") +_HOP_BY_HOP = { + "connection", + "keep-alive", + "proxy-authenticate", + "proxy-authorization", + "te", + "trailers", + "transfer-encoding", + "upgrade", + "host", + "content-length", +} + + +def _max_instances() -> int: + raw = getattr(settings, "neko_max_instances", None) + try: + n = int(raw or 0) + except Exception: + n = 0 + return max(1, n) if n else 256 + + +def _http_port(instance_id: int) -> int: + base = int(getattr(settings, "neko_http_port_base", 9200) or 9200) + return base + instance_id - 1 + + +def _parse(path: str) -> tuple[int, str] | None: + m = _PATH_RE.match(path or "") + if not m: + return None + idx = int(m.group(1)) + if idx < 1 or idx > _max_instances(): + return None + rest = m.group(2) or "/" + if not rest.startswith("/"): + rest = "/" + rest + return idx, rest + + +def _upstream(idx: int, rest: str, query: str = "") -> str: + url = f"http://127.0.0.1:{_http_port(idx)}{rest}" + if query: + url = f"{url}?{query}" + return url + + +async def _proxy_http(request: Request) -> Response: + path = request.url.path or "" + # Relative asset URLs in Neko HTML require a trailing slash on /neko/{id} + m_bare = re.match(r"^/neko/(\d+)$", path) + if m_bare: + dest = f"/neko/{m_bare.group(1)}/" + if request.url.query: + dest = f"{dest}?{request.url.query}" + return Response(status_code=308, headers={"location": dest}) + + parsed = _parse(path) + if not parsed: + return Response("Neko gateway: bad path (expect /neko/{id}/…)", status_code=404) + idx, rest = parsed + url = _upstream(idx, rest, request.url.query) + headers = { + k: v + for k, v in request.headers.items() + if k.lower() not in _HOP_BY_HOP + } + headers["host"] = f"127.0.0.1:{_http_port(idx)}" + body = await request.body() + try: + async with httpx.AsyncClient(timeout=None, follow_redirects=False) as client: + upstream = await client.request( + request.method, + url, + headers=headers, + content=body, + ) + except httpx.ConnectError: + return Response( + f"Neko instance {idx} not reachable on :{_http_port(idx)}", + status_code=502, + ) + except Exception as exc: + log.exception("neko gateway http error idx=%s", idx) + return Response(f"Neko gateway error: {exc}", status_code=502) + + out_headers = { + k: v + for k, v in upstream.headers.multi_items() + if k.lower() not in _HOP_BY_HOP and k.lower() != "content-encoding" + } + return Response( + content=upstream.content, + status_code=upstream.status_code, + headers=out_headers, + media_type=upstream.headers.get("content-type"), + ) + + +async def _proxy_ws(websocket: WebSocket) -> None: + parsed = _parse(websocket.url.path) + if not parsed: + await websocket.close(code=1008) + return + idx, rest = parsed + qs = websocket.url.query + # Prefer websockets lib (uvicorn[standard]); fall back closes. + try: + import websockets + except ImportError: + await websocket.close(code=1011) + return + + upstream_url = _upstream(idx, rest, qs).replace("http://", "ws://", 1) + headers = { + k: v + for k, v in websocket.headers.items() + if k.lower() + not in { + "host", + "connection", + "upgrade", + "sec-websocket-key", + "sec-websocket-version", + "sec-websocket-extensions", + "sec-websocket-protocol", + "content-length", + } + } + await websocket.accept( + subprotocol=websocket.headers.get("sec-websocket-protocol") + ) + connect_kwargs: dict = {"max_size": None, "ping_interval": 20, "ping_timeout": 20} + try: + async with websockets.connect( + upstream_url, additional_headers=headers, **connect_kwargs + ) as upstream: + await _bridge(websocket, upstream) + return + except TypeError: + # websockets<14 + async with websockets.connect( + upstream_url, extra_headers=headers, **connect_kwargs + ) as upstream: + await _bridge(websocket, upstream) + return + except Exception as exc: + log.warning("neko gateway ws idx=%s err=%s", idx, exc) + try: + await websocket.close(code=1011) + except Exception: + pass + + +async def _bridge(websocket: WebSocket, upstream) -> None: + async def client_to_up() -> None: + try: + while True: + msg = await websocket.receive() + if msg["type"] == "websocket.disconnect": + break + if msg.get("text") is not None: + await upstream.send(msg["text"]) + elif msg.get("bytes") is not None: + await upstream.send(msg["bytes"]) + except WebSocketDisconnect: + pass + except Exception: + pass + + async def up_to_client() -> None: + try: + async for message in upstream: + if isinstance(message, bytes): + await websocket.send_bytes(message) + else: + await websocket.send_text(message) + except Exception: + pass + + t1 = asyncio.create_task(client_to_up()) + t2 = asyncio.create_task(up_to_client()) + _done, pending = await asyncio.wait({t1, t2}, return_when=asyncio.FIRST_COMPLETED) + for t in pending: + t.cancel() + + +def build_app() -> Starlette: + async def http_catchall(request: Request) -> Response: + return await _proxy_http(request) + + async def ws_catchall(websocket: WebSocket) -> None: + await _proxy_ws(websocket) + + return Starlette( + routes=[ + WebSocketRoute("/neko/{path:path}", ws_catchall), + WebSocketRoute("/neko/{instance_id:int}", ws_catchall), + WebSocketRoute("/neko/{instance_id:int}/{path:path}", ws_catchall), + Route("/neko/{path:path}", http_catchall, methods=["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"]), + Route("/neko/{instance_id:int}", http_catchall, methods=["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"]), + Route("/neko/{instance_id:int}/{path:path}", http_catchall, methods=["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"]), + Route( + "/", + lambda r: Response( + "neko gateway ok — use /neko/{id}/", + media_type="text/plain", + ), + ), + ] + ) + + +_server: Any = None +_serve_task: asyncio.Task | None = None + + +def gateway_port() -> int: + try: + return int(getattr(settings, "neko_gateway_port", 9199) or 9199) + except Exception: + return 9199 + + +def gateway_enabled() -> bool: + raw = getattr(settings, "neko_gateway_enabled", True) + if isinstance(raw, str): + return raw.strip().lower() not in {"0", "false", "no", "off"} + return bool(raw) + + +async def start_gateway() -> dict[str, Any]: + """Start gateway on 0.0.0.0:DY_NEKO_GATEWAY_PORT (idempotent).""" + global _server, _serve_task + if not gateway_enabled(): + return {"ok": True, "skipped": True, "reason": "disabled"} + if _serve_task and not _serve_task.done(): + return {"ok": True, "already": True, "port": gateway_port()} + + import uvicorn + + port = gateway_port() + config = uvicorn.Config( + build_app(), + host="0.0.0.0", + port=port, + log_level="warning", + ws="websockets", + access_log=False, + ) + _server = uvicorn.Server(config) + _serve_task = asyncio.create_task(_server.serve(), name="neko-edge-gateway") + # Give it a moment to bind + await asyncio.sleep(0.3) + return {"ok": True, "port": port, "max_instances": _max_instances()} + + +async def stop_gateway() -> None: + global _server, _serve_task + if _server is not None: + _server.should_exit = True + if _serve_task is not None: + try: + await asyncio.wait_for(_serve_task, timeout=5) + except Exception: + _serve_task.cancel() + _server = None + _serve_task = None diff --git a/backend/app/network_hub.py b/backend/app/network_hub.py new file mode 100644 index 0000000..f47b7b0 --- /dev/null +++ b/backend/app/network_hub.py @@ -0,0 +1,265 @@ +# -*- coding: utf-8 -*- +"""Network hub — WireGuard primary + FRP auxiliary (SH2-adapted). + +Physical dual-path policy: +- Primary: WireGuard (wg-dy) carries app traffic VPS Caddy → 10.8.0.2 and preferred SSH. +- Auxiliary: FRP (frpp :4014) is emergency SSH / ops only — never the app data path. +""" +from __future__ import annotations + +import os +import re +import shutil +import time +from pathlib import Path +from typing import Any + +from . import global_socks +from . import shellcrash_hub +from . import wireguard_hub + + +def _run(cmd: list[str], timeout: int = 12) -> tuple[int, str]: + import subprocess + + try: + p = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout, check=False) + return int(p.returncode), ((p.stdout or "") + (p.stderr or "")).strip() + except Exception as exc: + return 1, str(exc) + + +def _unit_active(name: str) -> str: + code, out = _run(["systemctl", "is-active", name], timeout=5) + return (out.splitlines()[0] if out else ("inactive" if code else "unknown")).strip() + + +def path_roles() -> dict[str, Any]: + """Declare which transport is primary vs auxiliary.""" + cn_up = Path("/sys/class/net/wg-dy-cn").exists() if Path("/sys/class/net").is_dir() else False + wg_target = "10.9.0.2(wg-dy-cn 国内优先)" if cn_up else "10.8.0.2(wg-dy 海外)" + return { + "app_https": { + "primary": "wireguard", + "detail": f"VPS Caddy → WG {wg_target}:4015/8014;wg-dy 海外链路保留作备份", + }, + "ops_ssh": { + "primary": "wireguard", + "auxiliary": "frp", + "detail": "优先 WG(wg-dy-cn → 10.9.0.1 或 wg-dy → 10.8.0.1);FRP :4014 仅应急", + }, + "policy": "wg_cn_primary_wg_us_backup_frp_aux", + } + + +def frp_status() -> dict[str, Any]: + """FRP is auxiliary — SSH/ops fallback only; do not carry app reverse_proxy.""" + unit = None + for name in ("frpp", "frpc", "frp-panel"): + st = _unit_active(name) + if st in {"active", "activating"}: + unit = {"name": name, "state": st} + break + if unit is None and st not in {"inactive", "unknown", ""}: + unit = {"name": name, "state": st} + code, ps = _run(["bash", "-lc", "ps aux | grep -E '[f]rpc|[f]rpp|[f]rp-panel' | head -5"], timeout=8) + procs = [ln.strip() for ln in (ps or "").splitlines() if ln.strip()] + # Detect common SSH tunnel port hint + ports: list[int] = [] + for ln in procs: + for m in re.finditer(r":(\d{2,5})\b", ln): + try: + ports.append(int(m.group(1))) + except ValueError: + pass + return { + "ok": True, + "role": "auxiliary", + "purpose": "ops_ssh_emergency", + "unit": unit, + "processes": procs[:5], + "hint_ports": sorted(set(ports))[:8], + "detail": "辅路径:仅应急 SSH/运维(如 VPS:4014→guest:22)。应用 HTTPS 必须走 WireGuard,勿把业务反代挂到 FRP。", + } + + +def socks_status() -> dict[str, Any]: + from . import db + + cfg = db.get_settings_map() + enabled = global_socks.is_global_socks_enabled(cfg) + profiles = global_socks.list_socks_profiles(cfg, public=True) + active_id = global_socks.active_profile_id(cfg) + from . import singbox_manager + + return { + "ok": True, + "enabled": enabled, + "active_profile_id": active_id, + "profiles": profiles, + "local_mixed": global_socks.local_mixed_url() if enabled else "", + "singbox_running": bool(singbox_manager.is_running()) if enabled else False, + "hint": "新装默认无住宅节点;自行添加 SOCKS5", + } + + +def _deploy_shape_hint() -> str: + if Path("/etc/wireguard/wg-dy.conf").is_file() or any( + p.name == "wg-dy" for p in Path("/sys/class/net").iterdir() if Path("/sys/class/net").is_dir() + ): + return "physical_or_wg" + return "colocated_or_unknown" + + +def _wg_handshake_age_sec() -> int | None: + """Seconds since latest handshake on primary WG iface (wg-dy-cn preferred).""" + for iface in ("wg-dy-cn", "wg-dy"): + code, out = _run(["wg", "show", iface, "latest-handshakes"], timeout=5) + if code != 0 or not out.strip(): + continue + parts = out.split() + if len(parts) < 2: + continue + try: + ts = int(parts[-1]) + except ValueError: + continue + if ts <= 0: + continue + return max(0, int(time.time()) - ts) + return None + + +def _ping_wg_peer() -> dict[str, Any]: + if Path("/sys/class/net/wg-dy-cn").exists() if Path("/sys/class/net").is_dir() else False: + peer = str(os.environ.get("DY_WG_CN_PEER_IP") or "10.9.0.1").strip() or "10.9.0.1" + else: + peer = str(os.environ.get("DY_WG_PEER_IP") or "10.8.0.1").strip() or "10.8.0.1" + code, out = _run(["ping", "-c", "1", "-W", "2", peer], timeout=6) + ok = code == 0 and "1 received" in out.replace("packets ", "") + if not ok: + ok = code == 0 and ("bytes from" in out or "ttl=" in out.lower()) + rtt = "" + m = re.search(r"time[=<]([0-9.]+)\s*ms", out) + if m: + rtt = m.group(1) + "ms" + return {"ok": ok, "peer": peer, "rtt": rtt, "detail": (out.splitlines()[-1] if out else "")[:120]} + + +def wireguard_watch_status() -> dict[str, Any]: + unit = _unit_active("douyinweb-wireguard-watch") + path = Path("/opt/douyinWEB/scripts/linux/wireguard_watch.sh") + return { + "unit": unit, + "installed": path.is_file(), + "path": str(path) if path.is_file() else "", + "hint": "stale handshake 自动重启 wg-dy-cn / wg-dy(主路径保活)", + } + + +def network_overview() -> dict[str, Any]: + wg = wireguard_hub.runtime_status() + age = _wg_handshake_age_sec() + ping = _ping_wg_peer() + wg["role"] = "primary" + wg["purpose"] = "app_https_and_ops_ssh" + wg["handshake_age_sec"] = age + wg["handshake_fresh"] = age is not None and age < 180 + wg["peer_ping"] = ping + wg["watch"] = wireguard_watch_status() + if age is not None and age >= 300: + wg.setdefault("recommendations", []).append( + f"握手已 {age}s 未刷新 — watch 应重启 wg-dy;勿改用 FRP 扛业务" + ) + + frp = frp_status() + from . import egress_hub + + return { + "ok": True, + "path_roles": path_roles(), + "wireguard": wg, + "frp": frp, + "shellcrash": shellcrash_hub.status(), + "socks": socks_status(), + "egress": egress_hub.status(), + "deploy_shape": _deploy_shape_hint(), + "physical_checklist": physical_checklist(wg=wg, frp=frp), + } + + +def physical_checklist( + *, + wg: dict[str, Any] | None = None, + frp: dict[str, Any] | None = None, +) -> dict[str, Any]: + """Operator checklist — WireGuard primary, FRP auxiliary.""" + checks: list[dict[str, Any]] = [] + + def add(name: str, ok: bool, detail: str = "") -> None: + checks.append({"name": name, "ok": bool(ok), "detail": detail}) + + pub = str(os.environ.get("DY_PUBLIC_BASE_URL") or "").strip() + add( + "public_base_url", + pub.startswith("https://") and "127.0.0.1" not in pub and not pub.startswith("http://10."), + pub or "missing DY_PUBLIC_BASE_URL", + ) + bind = str(os.environ.get("DY_NEKO_HTTP_BIND") or "127.0.0.1").strip() + shape = _deploy_shape_hint() + if shape.startswith("physical"): + add("neko_http_bind", bind in {"0.0.0.0", "*"}, f"DY_NEKO_HTTP_BIND={bind} (physical needs 0.0.0.0)") + else: + add("neko_http_bind", True, f"DY_NEKO_HTTP_BIND={bind}") + + docker_ok = bool(shutil.which("docker")) + add("docker", docker_ok, "docker binary" if docker_ok else "missing") + seed = Path(__file__).resolve().parent.parent / "neko" / "tampermonkey-seed" / "Default" / "Extensions" + add("neko_seed", seed.is_dir(), str(seed)) + + wg_up = Path("/sys/class/net/wg-dy").exists() if Path("/sys/class/net").is_dir() else False + add("wg_primary_link", wg_up or shape != "physical_or_wg", "wg-dy iface (主路径)" if wg_up else "no wg-dy") + + wg = wg or {} + age = wg.get("handshake_age_sec") + if isinstance(age, int): + add("wg_handshake", age < 300, f"age={age}s (主路径保活)") + elif wg_up: + add("wg_handshake", False, "无法读取 handshake") + + ping = wg.get("peer_ping") if isinstance(wg.get("peer_ping"), dict) else {} + if ping: + add("wg_peer_ping", bool(ping.get("ok")), f"{ping.get('peer')} {ping.get('rtt') or ''}".strip()) + + watch = wg.get("watch") if isinstance(wg.get("watch"), dict) else {} + if shape.startswith("physical"): + add( + "wg_watch", + watch.get("unit") == "active", + f"unit={watch.get('unit') or 'missing'} — douyinweb-wireguard-watch 保活主路径", + ) + + frp = frp or {} + frp_unit = (frp.get("unit") or {}) if isinstance(frp.get("unit"), dict) else {} + add( + "frp_aux_ssh", + True, + f"role=auxiliary state={frp_unit.get('state') or 'n/a'} — 仅应急 SSH,不扛业务", + ) + + sc = shellcrash_hub.status() + if shape.startswith("physical"): + add( + "shellcrash", + bool(sc.get("installed")) and bool(sc.get("running")), + f"installed={sc.get('installed')} unit={sc.get('unit')} mixed=:{sc.get('mixed_port') or '?'}", + ) + + failed = sum(1 for c in checks if not c["ok"]) + return { + "ok": failed == 0, + "failed": failed, + "checks": checks, + "deploy_shape": shape, + "policy": "wg_primary_frp_aux", + } diff --git a/backend/app/platform_dashboard.py b/backend/app/platform_dashboard.py index a247e93..972ee81 100644 --- a/backend/app/platform_dashboard.py +++ b/backend/app/platform_dashboard.py @@ -85,7 +85,11 @@ def oauth_health_board(*, probe: bool = False) -> dict[str, Any]: "brand_hint": brand, "authorized": bool(meta.get("authorized")), "enabled": bool(ch.get("enabled")), - "ypp_ok": ypp_map.get(pk, -1), + "ypp_ok": ( + int(ch.get("ypp_ok")) + if ch.get("ypp_ok") is not None and int(ch.get("ypp_ok")) in (0, 1) + else ypp_map.get(pk, -1) + ), } out.append(row) return {"channels": out, "total": len(out)} @@ -93,8 +97,11 @@ def oauth_health_board(*, probe: bool = False) -> dict[str, Any]: async def oauth_health_probe_all() -> dict[str, Any]: from .shorts_oauth import probe_all_enabled_channels + from .yt_long_monetize import refresh_all_ypp_from_shorts result = await probe_all_enabled_channels() + ypp = await refresh_all_ypp_from_shorts(limit=100) board = oauth_health_board(probe=False) board["probe"] = result + board["ypp_probe"] = ypp return board diff --git a/backend/app/shellcrash_hub.py b/backend/app/shellcrash_hub.py new file mode 100644 index 0000000..95692af --- /dev/null +++ b/backend/app/shellcrash_hub.py @@ -0,0 +1,618 @@ +# -*- coding: utf-8 -*- +"""ShellCrash hub — SH2-compatible controls + managed files + apply_profile.""" +from __future__ import annotations + +import json +import os +import re +import shutil +import subprocess +import time +import urllib.error +import urllib.parse +import urllib.request +from pathlib import Path +from typing import Any + +CONTROLLER = "http://127.0.0.1:9999" +DEFAULT_NODE = os.environ.get("DY_SHELLCRASH_DEFAULT_NODE", "1d2da142-singbox_hysteria5") +DEFAULT_PROFILE = os.environ.get("DY_SHELLCRASH_DEFAULT_PROFILE", "config.yaml") +CANDIDATE_NODES = ( + "1d2da142-singbox_hysteria5", + "1d2da142-singbox_tuic5", + "1d2da142-VLESS_Reality_Vision5", + "e3ea3b30-singbox_hysteria_vultr", + "e3ea3b30-singbox_tuic_vultr", + "242af835-singbox_hysteria", + "hackrobot-singbox_tuic", + "VLESS_Reality_Vision", + "socks5", + "proxycheap", +) +SELECT_GROUPS = ("GLOBAL", "🚀 节点选择") + +MANAGED_ROOTS: dict[str, tuple[str, str]] = { + "shellcrash-yamls": ("yamls", "YAML 配置"), + "shellcrash-configs": ("configs", "配置文件"), + "shellcrash-jsons": ("jsons", "JSON"), +} + + +def _run(cmd: list[str], *, timeout: float = 15.0) -> dict[str, Any]: + try: + proc = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout, check=False) + except (OSError, subprocess.TimeoutExpired) as exc: + return {"ok": False, "code": 124, "stdout": "", "stderr": str(exc)} + return { + "ok": proc.returncode == 0, + "code": proc.returncode or 0, + "stdout": (proc.stdout or "").strip(), + "stderr": (proc.stderr or "").strip(), + } + + +def _priv(cmd: list[str], *, timeout: float = 20.0) -> dict[str, Any]: + if hasattr(os, "geteuid") and os.geteuid() == 0: + return _run(cmd, timeout=timeout) + if shutil.which("sudo"): + return _run(["sudo", "-n", *cmd], timeout=timeout) + return _run(cmd, timeout=timeout) + + +def shellcrash_dir() -> Path: + return Path(os.environ.get("SHELLCRASH_DIR", "/etc/ShellCrash")) + + +def default_node() -> str: + return DEFAULT_NODE + + +def default_profile() -> str: + return DEFAULT_PROFILE + + +def _read_cfg() -> dict[str, str]: + cfg = shellcrash_dir() / "configs" / "ShellCrash.cfg" + out: dict[str, str] = {} + if not cfg.is_file(): + return out + try: + lines = cfg.read_text(encoding="utf-8", errors="ignore").splitlines() + except OSError: + return out + for raw in lines: + if "=" not in raw or raw.lstrip().startswith("#"): + continue + key, _, value = raw.partition("=") + out[key.strip()] = value.strip() + return out + + +def _config_yaml() -> dict[str, Any]: + base = shellcrash_dir() + for path in (base / "yamls" / "config.yaml", Path("/tmp/ShellCrash/config.yaml"), base / "config.yaml"): + try: + if path.is_file() and path.stat().st_size > 0: + return {"available": True, "path": str(path), "bytes": path.stat().st_size} + except OSError: + continue + return {"available": False, "path": "", "bytes": 0} + + +def _unit_exists(unit: str) -> bool: + r = _run(["systemctl", "list-unit-files", unit, "--no-legend"], timeout=3.0) + return r["ok"] and unit in (r["stdout"] + r["stderr"]) + + +def _stage_runtime_config(config_path: str) -> None: + src = Path(config_path) + if not src.is_file(): + return + dst = Path("/tmp/ShellCrash/config.yaml") + try: + dst.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(src, dst) + dst.chmod(0o644) + except OSError: + return + + +def _http_json(url: str, *, method: str = "GET", body: dict[str, Any] | None = None, timeout: float = 6.0) -> dict[str, Any]: + data = None if body is None else json.dumps(body).encode("utf-8") + req = urllib.request.Request( + url, + data=data, + method=method, + headers={"Content-Type": "application/json"} if body is not None else {}, + ) + try: + with urllib.request.urlopen(req, timeout=timeout) as resp: + raw = resp.read().decode("utf-8", "replace") + return {"ok": True, "status": getattr(resp, "status", 200), "data": json.loads(raw) if raw.strip() else {}} + except urllib.error.HTTPError as exc: + return {"ok": False, "status": int(exc.code), "error": str(exc)} + except Exception as exc: # noqa: BLE001 + return {"ok": False, "status": 0, "error": str(exc)} + + +def _safe_rel(root: Path, rel: str) -> Path: + rel = (rel or "").replace("\\", "/").lstrip("/") + if not rel or ".." in rel.split("/"): + raise ValueError("非法路径") + target = (root / rel).resolve() + root_res = root.resolve() + if root_res not in target.parents and target != root_res: + raise ValueError("路径越界") + return target + + +def managed_roots() -> list[dict[str, Any]]: + base = shellcrash_dir() + out: list[dict[str, Any]] = [] + for root_id, (subdir, label) in MANAGED_ROOTS.items(): + path = base / subdir + path.mkdir(parents=True, exist_ok=True) + files = [] + try: + for p in sorted(path.rglob("*")): + if p.is_file(): + rel = p.relative_to(path).as_posix() + files.append({"path": rel, "size": p.stat().st_size}) + except OSError: + files = [] + out.append({"root_id": root_id, "label": label, "file_count": len(files), "files": files}) + return out + + +def list_files(root_id: str) -> dict[str, Any]: + if root_id not in MANAGED_ROOTS: + raise ValueError(f"unknown root: {root_id}") + subdir, label = MANAGED_ROOTS[root_id] + path = shellcrash_dir() / subdir + path.mkdir(parents=True, exist_ok=True) + files: list[dict[str, Any]] = [] + for p in sorted(path.rglob("*")): + if p.is_file(): + files.append({"path": p.relative_to(path).as_posix(), "size": p.stat().st_size}) + return {"ok": True, "root_id": root_id, "label": label, "files": files} + + +def read_file(root_id: str, rel_path: str) -> dict[str, Any]: + if root_id not in MANAGED_ROOTS: + raise ValueError(f"unknown root: {root_id}") + subdir, _ = MANAGED_ROOTS[root_id] + target = _safe_rel(shellcrash_dir() / subdir, rel_path) + if not target.is_file(): + raise FileNotFoundError(rel_path) + text = target.read_text(encoding="utf-8", errors="replace") + return {"ok": True, "root_id": root_id, "path": rel_path, "content": text, "bytes": len(text.encode("utf-8"))} + + +def write_file(root_id: str, rel_path: str, content: str) -> dict[str, Any]: + if root_id not in MANAGED_ROOTS: + raise ValueError(f"unknown root: {root_id}") + subdir, _ = MANAGED_ROOTS[root_id] + target = _safe_rel(shellcrash_dir() / subdir, rel_path) + target.parent.mkdir(parents=True, exist_ok=True) + # Write via temp then install with sudo if needed + tmp = Path("/tmp") / f"_sc_write_{os.getpid()}_{target.name}" + tmp.write_text(content if content.endswith("\n") else content + "\n", encoding="utf-8") + r = _priv(["install", "-m", "644", str(tmp), str(target)], timeout=10.0) + try: + tmp.unlink(missing_ok=True) + except OSError: + pass + if not r.get("ok") and not target.is_file(): + raise RuntimeError(r.get("stderr") or "写入失败(需要 sudo 权限)") + if not r.get("ok"): + # fallback direct write + try: + target.write_text(content if content.endswith("\n") else content + "\n", encoding="utf-8") + except OSError as exc: + raise RuntimeError(str(exc)) from exc + return {"ok": True, "root_id": root_id, "path": rel_path, "bytes": target.stat().st_size} + + +def delete_file(root_id: str, rel_path: str) -> dict[str, Any]: + if root_id not in MANAGED_ROOTS: + raise ValueError(f"unknown root: {root_id}") + subdir, _ = MANAGED_ROOTS[root_id] + target = _safe_rel(shellcrash_dir() / subdir, rel_path) + if not target.is_file(): + raise FileNotFoundError(rel_path) + r = _priv(["rm", "-f", str(target)], timeout=10.0) + if target.exists(): + try: + target.unlink() + except OSError as exc: + if not r.get("ok"): + raise RuntimeError(str(exc)) from exc + return {"ok": True, "root_id": root_id, "path": rel_path} + + +def _patch_yaml_listeners(text: str) -> str: + lines: list[str] = [] + found_ec = found_mp = False + for line in text.splitlines(): + if line.startswith("global-client-fingerprint:"): + continue + if line.startswith("external-controller:"): + lines.append("external-controller: 0.0.0.0:9999") + found_ec = True + continue + if line.startswith("mixed-port:"): + lines.append("mixed-port: 7890") + found_mp = True + continue + lines.append(line) + if not found_ec: + lines.append("external-controller: 0.0.0.0:9999") + if not found_mp: + lines.append("mixed-port: 7890") + return _ensure_douyin_direct_rules("\n".join(lines).rstrip() + "\n") + + +# Hard requirement: Douyin must never go through overseas proxy nodes. +_DOUYIN_DIRECT_RULES = ( + " - DOMAIN-SUFFIX,douyin.com,DIRECT", + " - DOMAIN-SUFFIX,douyincdn.com,DIRECT", + " - DOMAIN-SUFFIX,douyinpic.com,DIRECT", + " - DOMAIN-SUFFIX,douyinvod.com,DIRECT", + " - DOMAIN-SUFFIX,douyinstatic.com,DIRECT", + " - DOMAIN-SUFFIX,iesdouyin.com,DIRECT", + " - DOMAIN-KEYWORD,douyin,DIRECT", +) + + +def _ensure_douyin_direct_rules(text: str) -> str: + """Prepend explicit Douyin DIRECT rules under `rules:` (idempotent).""" + if "DOMAIN-SUFFIX,douyin.com,DIRECT" in text: + return text + block = "\n".join(_DOUYIN_DIRECT_RULES) + "\n" + if re.search(r"(?m)^rules:\s*$", text): + return re.sub(r"(?m)^(rules:\s*\n)", r"\1" + block, text, count=1) + # No rules section — append one. + return text.rstrip() + "\n\nrules:\n" + block + " - MATCH,DIRECT\n" + + +def _select_node_in_groups(node: str) -> list[dict[str, Any]]: + listed = _http_json(f"{CONTROLLER}/proxies", timeout=5.0) + proxies = (listed.get("data") or {}).get("proxies") or {} if listed.get("ok") else {} + applied: list[dict[str, Any]] = [] + for group in SELECT_GROUPS: + if group != "GLOBAL" and group not in proxies: + continue + enc = urllib.parse.quote(group, safe="") + put = _http_json(f"{CONTROLLER}/proxies/{enc}", method="PUT", body={"name": node}, timeout=5.0) + applied.append({"group": group, "ok": bool(put.get("ok")), "status": put.get("status")}) + return applied + + +def apply_profile(rel_path: str | None = None, target_node: str | None = None) -> dict[str, Any]: + """SH2-compatible: stage YAML → config.yaml → restart → select node.""" + rel = (rel_path or DEFAULT_PROFILE).strip() or DEFAULT_PROFILE + node = (target_node or DEFAULT_NODE).strip() or DEFAULT_NODE + yamls = shellcrash_dir() / "yamls" + yamls.mkdir(parents=True, exist_ok=True) + source = _safe_rel(yamls, rel) + if not source.is_file(): + # allow reading from staged clash assets copy + assets = Path(__file__).resolve().parent / "clash_assets" / "clash.yaml" + if assets.is_file() and rel in {"config.yaml", "clash.yaml", DEFAULT_PROFILE}: + text = assets.read_text(encoding="utf-8", errors="replace") + else: + raise FileNotFoundError(rel) + else: + text = source.read_text(encoding="utf-8", errors="replace") + + text = _patch_yaml_listeners(text) + # Prefer target node first in select groups when present as a name token + if node and re.search(rf"(?m)^\s*-\s*{re.escape(node)}\s*$", text): + # light-touch: no full YAML reorder required; runtime select via API after restart + pass + + write_file("shellcrash-yamls", rel if rel.endswith((".yaml", ".yml")) else "config.yaml", text) + write_file("shellcrash-yamls", "config.yaml", text) + _stage_runtime_config(str(yamls / "config.yaml")) + + unit = "shellcrash.service" + _priv(["systemctl", "reset-failed", unit], timeout=5.0) + run = _priv(["systemctl", "restart", unit], timeout=40.0) + time.sleep(3.0) + applied = _select_node_in_groups(node) + st = status() + return { + "ok": bool(st.get("running")), + "message": "ShellCrash 配置已应用", + "path": rel, + "target_node": node, + "selected": st.get("selected_node") or node, + "applied_groups": applied, + "command_ok": bool(run.get("ok")), + "shellcrash": st, + } + + +def apply_residential_chain(profile: dict[str, Any], *, dialer: str = "dialer") -> dict[str, Any]: + """Upsert socks5 landing with dialer-proxy, restart ShellCrash, select it. + + Path: local → ShellCrash → [dialer group/node] → residential SOCKS → target + See: https://wiki.metacubex.one/config/proxies/dialer-proxy/ + """ + name = "dy-residential" + dialer = (dialer or "dialer").strip() or "dialer" + server = str(profile.get("server") or "").strip() + try: + port = int(profile.get("port") or 0) + except Exception: + port = 0 + user = str(profile.get("username") or "") + pwd = str(profile.get("password") or "") + if not server or port <= 0: + raise ValueError("住宅 SOCKS 服务器/端口无效") + + block_lines = [ + f" - name: {name}", + f" dialer-proxy: {dialer}", + " type: socks5", + f" server: {server}", + f" port: {port}", + ] + if user: + block_lines.append(f" username: {user}") + if pwd: + block_lines.append(f" password: {pwd}") + block = "\n".join(block_lines) + "\n" + + yamls = shellcrash_dir() / "yamls" + yamls.mkdir(parents=True, exist_ok=True) + cfg_path = yamls / "config.yaml" + if cfg_path.is_file(): + text = cfg_path.read_text(encoding="utf-8", errors="replace") + else: + assets = Path(__file__).resolve().parent / "clash_assets" / "clash.yaml" + text = assets.read_text(encoding="utf-8", errors="replace") if assets.is_file() else "proxies:\n" + + text = _upsert_proxy_block(text, name, block) + text = _ensure_proxy_in_select_groups(text, name) + text = _patch_yaml_listeners(text) + + write_file("shellcrash-yamls", "config.yaml", text) + _stage_runtime_config(str(yamls / "config.yaml")) + + unit = "shellcrash.service" + _priv(["systemctl", "reset-failed", unit], timeout=5.0) + run = _priv(["systemctl", "restart", unit], timeout=40.0) + time.sleep(3.0) + applied = _select_node_in_groups(name) + st = status() + return { + "ok": bool(st.get("running")), + "message": "已启用住宅链式落地(dialer-proxy)", + "proxy_name": name, + "dialer": dialer, + "selected": st.get("selected_node") or name, + "applied_groups": applied, + "command_ok": bool(run.get("ok")), + "shellcrash": st, + "docs": "https://wiki.metacubex.one/config/proxies/dialer-proxy/", + } + + +def _upsert_proxy_block(text: str, name: str, block: str) -> str: + """Replace existing `- name: {name}` proxy entry or insert under proxies:.""" + # Remove existing block for this name (from its "- name:" until next top-level proxy or section). + pattern = re.compile( + rf"(?ms)^ - name:\s*{re.escape(name)}\s*\n(?: .*\n)*", + ) + text2, n = pattern.subn("", text) + if "proxies:" not in text2: + return "proxies:\n" + block + text2 + # Insert right after `proxies:` line + return re.sub(r"(?m)^(proxies:\s*\n)", r"\1" + block, text2, count=1) + + +def _ensure_proxy_in_select_groups(text: str, name: str) -> str: + """Append proxy name into main select groups if missing (best-effort).""" + if re.search(rf"(?m)^\s*-\s*{re.escape(name)}\s*$", text): + return text + # Insert into first proxy-groups select list after `proxies:` under that group — skip if hard. + # Prefer injecting near proxycheap if present. + if re.search(r"(?m)^\s*-\s*proxycheap\s*$", text): + return re.sub(r"(?m)^(\s*-\s*proxycheap\s*)$", rf"\1\n - {name}", text, count=1) + return text + + +def _wg_overlay_ip() -> str: + """Best-effort WireGuard overlay address (e.g. 10.8.0.2) for direct :9999 access.""" + r = _run(["bash", "-lc", "ip -4 -o addr show wg-dy 2>/dev/null | awk '{print $4}' | cut -d/ -f1 | head -1"]) + ip = (r.get("stdout") or "").strip().splitlines() + if ip and ip[0]: + return ip[0].strip() + env_ip = (os.environ.get("DY_NEKO_EDGE_UPSTREAM") or os.environ.get("DY_WG_OVERLAY_IP") or "").strip() + return env_ip + + +def _controller_secret() -> str: + yml = shellcrash_dir() / "yamls" / "config.yaml" + try: + text = yml.read_text(encoding="utf-8", errors="replace") + except OSError: + return "" + m = re.search(r"(?m)^\s*secret:\s*[\"']?([^\"'\n#]+)", text) + return (m.group(1).strip() if m else "") + + +def web_panel() -> dict[str, Any]: + """Ensure service up; return dashboard URL on our public domain. + + Physical edge Caddy proxies ``/ui`` + Clash API → WG ``:9999``. + Open ``/ui/#/setup?...`` with HTTPS backend prefilled so Zashboard does not + default to ``http://127.0.0.1:9090`` (mixed-content / unreachable). + """ + st = status() + if not st.get("running"): + action("start") + time.sleep(2.0) + st = status() + public = (os.environ.get("DY_PUBLIC_BASE_URL") or "").rstrip("/") + secret = _controller_secret() + secret_q = f"&secret={urllib.parse.quote(secret)}" if secret else "" + wg_ip = _wg_overlay_ip() + direct_url = f"http://{wg_ip}:9999/ui/#/proxies" if wg_ip else "http://127.0.0.1:9999/ui/#/proxies" + if public: + host = urllib.parse.urlparse(public).hostname or "" + # Must stay under /ui/; prefill HTTPS controller (same origin, port 443). + url = ( + f"{public}/ui/#/setup?hostname={urllib.parse.quote(host)}" + f"&port=443&protocol=https{secret_q}" + ) + proxies_url = f"{public}/ui/#/proxies" + else: + url = direct_url + proxies_url = direct_url + ui_dir = shellcrash_dir() / "ui" + ui_ok = ui_dir.is_dir() and (ui_dir / "index.html").is_file() + return { + "ok": True, + "message": "ShellCrash web 面板已就绪" if st.get("running") else "服务未就绪,仍返回面板地址", + "url": url, + "proxies_url": proxies_url, + "direct_url": direct_url, + "port": "9999", + "ui_installed": ui_ok, + "shellcrash": status(), + } + + +def probe_mixed(*, timeout: float = 10.0) -> dict[str, Any]: + cfg = _read_cfg() + port = cfg.get("mix_port") or "7890" + cmd = [ + "curl", "-sS", "-m", str(int(timeout)), "-o", "/dev/null", "-w", "%{http_code}", + "-x", f"http://127.0.0.1:{port}", "https://www.google.com/generate_204", + ] + r = _run(cmd, timeout=timeout + 2) + code = (r.get("stdout") or "").strip() + return {"ok": code in {"204", "200", "301", "302"}, "http_code": code, "mixed_port": port, "detail": r.get("stderr") or ""} + + +def pick_best_node(*, timeout_ms: int = 5000) -> dict[str, Any]: + listed = _http_json(f"{CONTROLLER}/proxies", timeout=5.0) + if not listed.get("ok"): + return {"ok": False, "error": listed.get("error") or "controller unreachable", "picked": None} + proxies = (listed.get("data") or {}).get("proxies") or {} + delays: list[dict[str, Any]] = [] + best_name: str | None = None + best_delay = 10**9 + for name in CANDIDATE_NODES: + if name not in proxies: + continue + enc = urllib.parse.quote(name, safe="") + url = f"{CONTROLLER}/proxies/{enc}/delay?timeout={timeout_ms}&url=http://www.gstatic.com/generate_204" + res = _http_json(url, timeout=(timeout_ms / 1000.0) + 3.0) + delay = int((res.get("data") or {}).get("delay") or 0) if res.get("ok") else 0 + delays.append({"name": name, "delay": delay, "ok": delay > 0}) + if delay > 0 and delay < best_delay: + best_name, best_delay = name, delay + applied: list[dict[str, Any]] = [] + if best_name: + applied = _select_node_in_groups(best_name) + egress = probe_mixed() if best_name else {"ok": False, "http_code": ""} + return { + "ok": bool(best_name) and bool(egress.get("ok")), + "picked": best_name, + "delay_ms": best_delay if best_name else None, + "delays": delays, + "applied": applied, + "egress": egress, + } + + +def status() -> dict[str, Any]: + cfg_vals = _read_cfg() + yaml = _config_yaml() + unit_name = "shellcrash.service" + active = _run(["systemctl", "is-active", unit_name], timeout=3.0) if shutil.which("systemctl") else {"ok": False, "stdout": "unknown"} + enabled = _run(["systemctl", "is-enabled", unit_name], timeout=3.0) if shutil.which("systemctl") else {"ok": False, "stdout": "unknown"} + pgrep = _run(["pgrep", "-fa", "CrashCore|mihomo"], timeout=2.0) if shutil.which("pgrep") else {"ok": False, "stdout": ""} + unit_active = (active.get("stdout") or "").splitlines()[0] if active.get("stdout") else ("active" if active.get("ok") else "inactive") + running = unit_active == "active" or bool((pgrep.get("stdout") or "").strip()) + start_sh = shellcrash_dir() / "start.sh" + mixed = cfg_vals.get("mix_port") or "7890" + selected = None + if running: + prox = _http_json(f"{CONTROLLER}/proxies", timeout=3.0) + if prox.get("ok"): + pdata = (prox.get("data") or {}).get("proxies") or {} + selected = (pdata.get("🚀 节点选择") or {}).get("now") or (pdata.get("GLOBAL") or {}).get("now") + return { + "ok": True, + "available": yaml.get("available") or start_sh.is_file() or unit_active == "active", + "installed": start_sh.is_file() or _unit_exists(unit_name), + "running": running, + "unit": unit_active, + "enabled": (enabled.get("stdout") or "").splitlines()[0] if enabled.get("stdout") else "unknown", + "label": "ShellCrash", + "description": "代理上网 / 规则分流", + "detail": f"mixed :{mixed}" + (f" · 节点 {selected}" if selected else ""), + "status": "online" if running else ("configured" if start_sh.is_file() or _unit_exists(unit_name) else "missing"), + "mixed_port": mixed, + "selected_node": selected, + "default_node": DEFAULT_NODE, + "default_profile": DEFAULT_PROFILE, + "config": yaml, + "roots": managed_roots(), + "hint": "应用配置会写入 config.yaml 并重启;web 面板打开 mihomo UI。", + } + + +def action(act: str) -> dict[str, Any]: + act = str(act or "").strip().lower() + if act not in {"start", "stop", "restart", "status", "pick"}: + raise ValueError(f"unsupported shellcrash action: {act}") + if act == "status": + return {"ok": True, "action": "status", **status()} + if act == "pick": + picked = pick_best_node() + return {"ok": bool(picked.get("ok")), "action": "pick", "pick": picked, "shellcrash": status()} + + unit = "shellcrash.service" + cfg = _config_yaml() + if cfg.get("available") and act in {"start", "restart"}: + _stage_runtime_config(str(cfg.get("path") or "")) + + if _unit_exists(unit) or shutil.which("systemctl"): + if act == "start": + _priv(["systemctl", "reset-failed", unit], timeout=5.0) + run = _priv(["systemctl", "enable", "--now", unit], timeout=25.0) + elif act == "stop": + run = _priv(["systemctl", "stop", unit], timeout=20.0) + else: + _priv(["systemctl", "reset-failed", unit], timeout=5.0) + run = _priv(["systemctl", "restart", unit], timeout=25.0) + else: + start = shellcrash_dir() / "start.sh" + if not start.is_file(): + raise RuntimeError("未安装 ShellCrash(无 systemd 单元且无 start.sh)") + run = _priv(["bash", str(start), act if act != "restart" else "restart"], timeout=25.0) + + time.sleep(2.0) + picked = None + if act in {"start", "restart"}: + time.sleep(1.0) + # Prefer configured default node first, then pick if needed + _select_node_in_groups(DEFAULT_NODE) + egress = probe_mixed(timeout=6.0) + if not egress.get("ok"): + picked = pick_best_node() + st = status() + ok = bool(st.get("running")) if act in {"start", "restart"} else (not st.get("running") if act == "stop" else True) + return { + "ok": bool(run.get("ok")) or ok, + "action": act, + "command_ok": bool(run.get("ok")), + "detail": run.get("stderr") or run.get("stdout") or "", + "pick": picked, + "shellcrash": st, + } diff --git a/backend/app/shorts_oauth.py b/backend/app/shorts_oauth.py index 8d39675..4b3dec1 100644 --- a/backend/app/shorts_oauth.py +++ b/backend/app/shorts_oauth.py @@ -40,6 +40,99 @@ DEFAULT_OAUTH_PROFILES: list[dict[str, str]] = [ # state -> (channel_pk, expires_at, client_id, client_secret, return_to?) _oauth_states: dict[str, tuple[str, float, str, str] | tuple[str, float, str, str, str]] = {} +_OAUTH_STATE_KEY = "shorts_oauth_pending_states" + + +def _persist_oauth_states() -> None: + """Survive API restarts between Google consent and callback.""" + now = time.time() + payload: dict[str, list[Any]] = {} + for k, packed in list(_oauth_states.items()): + if len(packed) < 2 or float(packed[1]) < now: + _oauth_states.pop(k, None) + continue + payload[k] = list(packed) + try: + db.update_settings_map({_OAUTH_STATE_KEY: payload}) + except Exception: + pass + + +def _hydrate_oauth_states() -> None: + if _oauth_states: + return + try: + raw = (_cfg() or {}).get(_OAUTH_STATE_KEY) or {} + except Exception: + raw = {} + if not isinstance(raw, dict): + return + now = time.time() + for k, packed in raw.items(): + if not isinstance(packed, (list, tuple)) or len(packed) < 4: + continue + try: + exp = float(packed[1]) + except Exception: + continue + if exp < now: + continue + if len(packed) >= 5: + _oauth_states[str(k)] = ( + str(packed[0]), + exp, + str(packed[2]), + str(packed[3]), + str(packed[4] or ""), + ) + else: + _oauth_states[str(k)] = (str(packed[0]), exp, str(packed[2]), str(packed[3])) + + +def _stamp_oauth_error(channel_pk: str, err: str) -> None: + pk = str(channel_pk or "").strip() + if not pk: + return + try: + db.update_shorts_channel( + pk, + oauth_ok=0, + oauth_checked_at=time.time(), + oauth_error=str(err or "授权失败")[:500], + ) + except Exception: + pass + + +def _oauth_log(msg: str) -> None: + try: + with open("/tmp/shorts_oauth.log", "a", encoding="utf-8") as f: + f.write(f"{time.strftime('%F %T')} {msg}\n") + except Exception: + pass + + +def _google_http_proxy() -> str: + """Google APIs must egress via ShellCrash on China physical hosts.""" + try: + from . import egress_hub + + return egress_hub.google_http_proxy() + except Exception: + return "http://127.0.0.1:7890" + + +def _google_client_kwargs(*, timeout: float = 45.0) -> dict[str, Any]: + try: + from . import egress_hub + + return egress_hub.google_httpx_kwargs(timeout=timeout) + except Exception: + proxy = _google_http_proxy() + kw: dict[str, Any] = {"timeout": timeout, "trust_env": False} + if proxy: + kw["proxy"] = proxy + return kw def _cfg() -> dict[str, Any]: @@ -187,7 +280,7 @@ async def fetch_google_account_email(access_token: str) -> str: if not token: return "" try: - async with httpx.AsyncClient(timeout=20.0, trust_env=False) as client: + async with httpx.AsyncClient(**_google_client_kwargs(timeout=20.0)) as client: resp = await client.get( "https://openidconnect.googleapis.com/v1/userinfo", headers={"Authorization": f"Bearer {token}"}, @@ -276,6 +369,7 @@ def channel_can_authorize(channel: dict[str, Any] | None, cfg: dict[str, Any] | def build_authorize_url(*, channel_pk: str, request_base: str = "", return_to: str = "") -> str: + _hydrate_oauth_states() cfg = _cfg() channel = db.get_shorts_channel(channel_pk) if not channel: @@ -291,22 +385,25 @@ def build_authorize_url(*, channel_pk: str, request_base: str = "", return_to: s if ret and (not ret.startswith("/") or ret.startswith("//")): ret = "" now = time.time() + # Drop expired + any prior pending state for this same card (double-click / double-fetch). for k, packed in list(_oauth_states.items()): - if len(packed) < 2 or packed[1] < now: + if len(packed) < 2 or packed[1] < now or str(packed[0]) == str(channel_pk): _oauth_states.pop(k, None) state = secrets.token_urlsafe(24) if ret: _oauth_states[state] = (channel_pk, now + 600, client_id, client_secret, ret) else: _oauth_states[state] = (channel_pk, now + 600, client_id, client_secret) + _persist_oauth_states() params = { "client_id": client_id, "redirect_uri": resolve_redirect_uri(request_base), "response_type": "code", "scope": authorize_scopes(), "access_type": "offline", + # Must force consent to obtain refresh_token. Do NOT set include_granted_scopes — + # Google often omits refresh_token when the app "already has some access". "prompt": "consent select_account", - "include_granted_scopes": "true", "state": state, } return "https://accounts.google.com/o/oauth2/v2/auth?" + urlencode(params) @@ -330,7 +427,7 @@ async def token_scopes(access_token: str) -> set[str]: if not access_token: return set() try: - async with httpx.AsyncClient(timeout=20.0, trust_env=False) as client: + async with httpx.AsyncClient(**_google_client_kwargs(timeout=20.0)) as client: resp = await client.get( "https://oauth2.googleapis.com/tokeninfo", params={"access_token": access_token}, @@ -353,7 +450,7 @@ async def revoke_refresh_token(*, refresh_token: str, client_id: str = "", clien if not rt: return False try: - async with httpx.AsyncClient(timeout=20.0, trust_env=False) as client: + async with httpx.AsyncClient(**_google_client_kwargs(timeout=20.0)) as client: resp = await client.post( "https://oauth2.googleapis.com/revoke", data={"token": rt}, @@ -377,8 +474,11 @@ async def prepare_reauthorize(channel_pk: str) -> None: async def exchange_code(*, code: str, state: str, request_base: str = "") -> dict[str, Any]: + _hydrate_oauth_states() packed = _oauth_states.pop(state, None) + _persist_oauth_states() if not packed: + _oauth_log(f"state_miss state={state[:12]} mem={len(_oauth_states)}") raise ValueError("授权 state 无效或已过期,请重新点击授权") # Always bind OAuth result to the card the operator clicked. channel_pk = packed[0] @@ -387,9 +487,12 @@ async def exchange_code(*, code: str, state: str, request_base: str = "") -> dic if return_to and (not return_to.startswith("/") or return_to.startswith("//")): return_to = "" if exp < time.time(): + _stamp_oauth_error(channel_pk, "授权已过期,请重新点击授权") raise ValueError("授权已过期,请重新点击授权") cfg = _cfg() channel = db.get_shorts_channel(channel_pk) or {} + if not channel: + raise ValueError("授权对应的频道已被删除,请新建频道后再授权") if len(packed) >= 4 and packed[2] and packed[3]: client_id, client_secret = packed[2], packed[3] else: @@ -400,120 +503,212 @@ async def exchange_code(*, code: str, state: str, request_base: str = "") -> dic source = str(source_meta.get("source") or "none") profile_id = str(source_meta.get("profile_id") or channel.get("oauth_profile_id") or "").strip().upper() if not client_id or not client_secret: - raise ValueError("缺少 OAuth Client 配置") + err = "缺少 OAuth Client 配置" + _stamp_oauth_error(channel_pk, err) + raise ValueError(err) redirect_uri = resolve_redirect_uri(request_base) - async with httpx.AsyncClient(timeout=30.0, trust_env=False) as client: - token_resp = await client.post( - "https://oauth2.googleapis.com/token", - data={ - "code": code, - "client_id": client_id, - "client_secret": client_secret, - "redirect_uri": redirect_uri, - "grant_type": "authorization_code", - }, - ) - token = token_resp.json() if token_resp.content else {} - if token_resp.status_code >= 400 or not token.get("access_token"): - raise ValueError(f"换取 token 失败: {token.get('error_description') or token or token_resp.text}") - access = str(token["access_token"]) - refresh = str(token.get("refresh_token") or "").strip() - granted = await token_scopes(access) - missing = missing_required_scopes(granted) - if missing: - scope_hint = "、".join(s.rsplit("/", 1)[-1] for s in missing) - raise ValueError( - f"授权权限不完整(缺 {scope_hint})。" - f"请再点「重授权」;若仍失败,到 Google 账号 → 第三方应用访问权限,移除本应用后再授权。" - ) - - ch_resp = await client.get( - "https://www.googleapis.com/youtube/v3/channels", - params={"part": "snippet,contentDetails", "mine": "true"}, - headers={"Authorization": f"Bearer {access}"}, - ) - ch_data = ch_resp.json() if ch_resp.content else {} - if ch_resp.status_code >= 400: - err = (ch_data.get("error") or {}).get("message") or ch_resp.text - if "has not been used in project" in str(err) or "youtube.googleapis.com" in str(err): - raise ValueError( - f"OAuth 配置档 {profile_id or '?'} 的 Google 项目未启用 YouTube Data API v3。" - "请到 Google Cloud Console → API 和服务 → 启用「YouTube Data API v3」后,再点「重授权」。" - ) - raise ValueError(f"读取 YouTube 频道失败: {err}") - items = ch_data.get("items") or [] - yt_id = "" - yt_title = "" - yt_handle = "" - if items: - sn = items[0].get("snippet") or {} - yt_id = str(items[0].get("id") or "") - yt_title = str(sn.get("title") or "") - yt_handle = str(sn.get("customUrl") or "").strip() - - google_email = await fetch_google_account_email(access) - - # Clicked card wins: accept whatever brand Google returned; never reject / never rewrite siblings. - had_old = bool(str(channel.get("refresh_token") or "").strip()) - if not refresh: - if had_old: - refresh = str(channel.get("refresh_token") or "").strip() - else: - raise ValueError("未拿到 refresh_token,请在 Google 账号权限里撤销本应用后重试") - - patch: dict[str, Any] = { - "client_id": client_id, - "client_secret": client_secret, - "refresh_token": refresh, - } - if yt_id: - patch["youtube_channel_id"] = yt_id - if google_email: - patch["oauth_email"] = google_email - # Refresh display name/handle from Google — brand label may differ from old card title. - if yt_title: - patch["name"] = yt_title - if profile_id and not str(channel.get("oauth_profile_id") or "").strip(): - patch["oauth_profile_id"] = profile_id - updated = db.update_shorts_channel( - channel_pk, - **patch, - oauth_ok=1, - oauth_checked_at=time.time(), - oauth_error="", + proxy = _google_http_proxy() + _oauth_log( + f"exchange pk={channel_pk} redirect={redirect_uri} " + f"secret_tail={client_secret[-4:]} proxy={proxy or 'direct'}" ) - if google_email and profile_id: + try: + async with httpx.AsyncClient(**_google_client_kwargs(timeout=60.0)) as client: + token_resp = await client.post( + "https://oauth2.googleapis.com/token", + data={ + "code": code, + "client_id": client_id, + "client_secret": client_secret, + "redirect_uri": redirect_uri, + "grant_type": "authorization_code", + }, + ) + token = token_resp.json() if token_resp.content else {} + if token_resp.status_code >= 400 or not token.get("access_token"): + err = f"换取 token 失败: {token.get('error_description') or token.get('error') or token or token_resp.text}" + _oauth_log(err) + _stamp_oauth_error(channel_pk, err) + raise ValueError(err) + access = str(token["access_token"]) + refresh = str(token.get("refresh_token") or "").strip() + _oauth_log( + f"token_ok has_refresh={bool(refresh)} keys={sorted(token.keys())} " + f"scope={token.get('scope') or ''}" + ) + granted = await token_scopes(access) + missing = missing_required_scopes(granted) + if missing: + scope_hint = "、".join(s.rsplit("/", 1)[-1] for s in missing) + err = ( + f"授权权限不完整(缺 {scope_hint})。" + f"请到 https://myaccount.google.com/connections 移除 dylive 后再授权。" + ) + _stamp_oauth_error(channel_pk, err) + raise ValueError(err) + + ch_resp = await client.get( + "https://www.googleapis.com/youtube/v3/channels", + params={"part": "snippet,contentDetails", "mine": "true"}, + headers={"Authorization": f"Bearer {access}"}, + ) + ch_data = ch_resp.json() if ch_resp.content else {} + if ch_resp.status_code >= 400: + err_msg = (ch_data.get("error") or {}).get("message") or ch_resp.text + if "has not been used in project" in str(err_msg) or "youtube.googleapis.com" in str(err_msg): + err = ( + f"OAuth 配置档 {profile_id or '?'} 的 Google 项目未启用 YouTube Data API v3。" + "请到 Google Cloud Console → API 和服务 → 启用「YouTube Data API v3」后,再点「重授权」。" + ) + else: + err = f"读取 YouTube 频道失败: {err_msg}" + _stamp_oauth_error(channel_pk, err) + raise ValueError(err) + items = ch_data.get("items") or [] + yt_id = "" + yt_title = "" + yt_handle = "" + if items: + sn = items[0].get("snippet") or {} + yt_id = str(items[0].get("id") or "") + yt_title = str(sn.get("title") or "") + yt_handle = str(sn.get("customUrl") or "").strip() + if not items: + err = ( + "Google 账号下没有可用的 YouTube 频道(mine=true 为空)。" + "请确认授权时选的是有频道的品牌账号,不是空的 Google 登录号。" + ) + _stamp_oauth_error(channel_pk, err) + raise ValueError(err) + + google_email = await fetch_google_account_email(access) + + # Clicked card wins: accept whatever brand Google returned; never rewrite siblings. + # Soft-warn if the same YouTube channel is already bound to another Shorts card. + dup_warn = "" + if yt_id: + try: + for other in db.list_shorts_channels(enabled=None): + oid = str(other.get("id") or "") + if oid == channel_pk: + continue + if str(other.get("youtube_channel_id") or "").strip() == yt_id: + dup_warn = ( + f"注意:YouTube 频道 {yt_id} 已挂在另一张卡 " + f"「{other.get('name') or oid}」。两张卡会共用同一频道身份,建议删掉重复卡。" + ) + try: + db.add_event( + kind="ops", + level="warn", + message=dup_warn, + meta={"channel_pk": channel_pk, "dup_channel_pk": oid, "youtube_channel_id": yt_id}, + ) + except Exception: + pass + break + except Exception: + pass + had_old = bool(str(channel.get("refresh_token") or "").strip()) + if not refresh: + if had_old: + refresh = str(channel.get("refresh_token") or "").strip() + else: + # Revoke this access so the next consent can mint a refresh_token. + try: + async with httpx.AsyncClient(**_google_client_kwargs(timeout=20.0)) as client: + await client.post( + "https://oauth2.googleapis.com/revoke", + data={"token": access}, + headers={"Content-Type": "application/x-www-form-urlencoded"}, + ) + except Exception: + pass + err = ( + "未拿到 refresh_token(Google 未下发长期凭证)。" + "已尝试撤销本次临时授权。请打开 https://myaccount.google.com/connections " + "移除 dylive,再回到本页点一次「授权」。" + ) + _stamp_oauth_error(channel_pk, err) + raise ValueError(err) + + patch: dict[str, Any] = { + "client_id": client_id, + "client_secret": client_secret, + "refresh_token": refresh, + } + if yt_id: + patch["youtube_channel_id"] = yt_id + if google_email: + patch["oauth_email"] = google_email + # Refresh display name/handle from Google — brand label may differ from old card title. + if yt_title: + patch["name"] = yt_title + if profile_id and not str(channel.get("oauth_profile_id") or "").strip(): + patch["oauth_profile_id"] = profile_id + updated = db.update_shorts_channel( + channel_pk, + **patch, + oauth_ok=1, + oauth_checked_at=time.time(), + oauth_error="", + ) + if google_email and profile_id: + try: + set_oauth_profile_email(profile_id, google_email) + except Exception: + pass try: - set_oauth_profile_email(profile_id, google_email) + from . import yt_long_db + + yt_long_db.sync_channels_from_shorts() except Exception: pass - try: - from . import yt_long_db + profile_err = "" + ypp_err = "" + try: + from . import youtube_manage as ytm - yt_long_db.sync_channels_from_shorts() - except Exception: - pass - try: - from . import youtube_manage as ytm - from .yt_long_monetize import refresh_ypp_for_shorts_channel + await ytm.fetch_channel_profile(channel_pk) + except Exception as exc: + profile_err = str(exc).strip() or "拉取频道资料失败" + try: + from .yt_long_monetize import refresh_ypp_for_shorts_channel - await ytm.fetch_channel_profile(channel_pk) - await refresh_ypp_for_shorts_channel(channel_pk) + ypp_r = await refresh_ypp_for_shorts_channel(channel_pk) + if not ypp_r.get("ok"): + ypp_err = str(ypp_r.get("error") or "YPP 探测失败")[:200] + except Exception as exc: + ypp_err = str(exc).strip() or "YPP 探测失败" + note = " · ".join(x for x in (profile_err, ypp_err) if x) + if note: + db.update_shorts_channel(channel_pk, oauth_error=note) + updated = db.get_shorts_channel(channel_pk) or updated + _oauth_log(f"exchange_ok pk={channel_pk} yt={yt_id} title={yt_title} profile_err={profile_err!r} ypp_err={ypp_err!r}") + return { + "ok": True, + "channel": updated, + "youtube_channel_id": yt_id, + "youtube_title": yt_title or str((updated or {}).get("name") or ""), + "youtube_handle": yt_handle, + "oauth_email": google_email, + "oauth_scopes_ok": True, + "oauth_client_source": source, + "oauth_profile_id": profile_id, + "profile_ok": not bool(profile_err), + "ypp_ok": not bool(ypp_err), + "profile_error": profile_err, + "ypp_error": ypp_err, + "duplicate_channel_warning": dup_warn, + "return_to": return_to, + } + except ValueError: + raise except Exception as exc: - err = str(exc).strip() or "拉取频道资料失败" - db.update_shorts_channel(channel_pk, oauth_error=err) - return { - "ok": True, - "channel": updated, - "youtube_channel_id": yt_id, - "youtube_title": yt_title or str((updated or {}).get("name") or ""), - "youtube_handle": yt_handle, - "oauth_email": google_email, - "oauth_scopes_ok": True, - "oauth_client_source": source, - "oauth_profile_id": profile_id, - "return_to": return_to, - } + err = f"授权处理异常: {type(exc).__name__}: {exc}" + _oauth_log(err) + _stamp_oauth_error(channel_pk, err) + raise ValueError(err) from exc def channel_oauth_creds(channel: dict[str, Any], cfg: dict[str, Any] | None = None) -> dict[str, str]: diff --git a/backend/app/shorts_schedule.py b/backend/app/shorts_schedule.py index 871d609..fca30b6 100644 --- a/backend/app/shorts_schedule.py +++ b/backend/app/shorts_schedule.py @@ -260,7 +260,11 @@ def schedule_board(limit: int = 24) -> dict[str, Any]: "oauth_error": meta.get("oauth_error", str(c.get("oauth_error") or "")), "brand_hint": meta.get("brand_hint") or "", "note": str(c.get("note") or ""), - "ypp_ok": ypp_by_shorts.get(cid, -1), + "ypp_ok": ( + int(c.get("ypp_ok")) + if c.get("ypp_ok") is not None and int(c.get("ypp_ok")) in (0, 1) + else ypp_by_shorts.get(cid, -1) + ), **stats, } ) diff --git a/backend/app/shorts_socks.py b/backend/app/shorts_socks.py index bf8b341..865cd4e 100644 --- a/backend/app/shorts_socks.py +++ b/backend/app/shorts_socks.py @@ -8,17 +8,8 @@ from urllib.parse import quote DEFAULT_SOCKS_PROFILE_ID = "residential-1" -DEFAULT_SOCKS_PROFILES: list[dict[str, Any]] = [ - { - "id": DEFAULT_SOCKS_PROFILE_ID, - "label": "静态住宅 IP", - "type": "socks5", - "server": "185.124.61.35", - "port": 43676, - "username": "V0sI3BsI1bxgKRx", - "password": "QGwGeRTAa9YcVhM", - } -] +DEFAULT_SOCKS_PROFILES: list[dict[str, Any]] = [] +# Fresh installs: no baked-in residential credentials. def _norm_profile(raw: Any) -> dict[str, Any] | None: @@ -99,12 +90,27 @@ def socks_proxy_url(profile: dict[str, Any] | None) -> str: def resolve_upload_socks_proxy(cfg: dict[str, Any] | None = None) -> str: - """Return proxy URL when Shorts SOCKS upload is enabled; else empty (direct).""" + """Return proxy URL when business egress uploads cover is on; else empty (direct).""" + try: + from . import egress_hub + + url = egress_hub.resolve_upload_proxy(cfg) + if url: + return url + # Fall through if egress off — keep legacy shorts toggle for older DBs. + except Exception: + pass from . import db settings = dict(cfg if cfg is not None else db.get_settings_map()) - if not settings.get("shorts_upload_socks_enabled"): + if not settings.get("shorts_upload_socks_enabled") and not settings.get("global_socks_enabled"): return "" + try: + from . import global_socks + + return global_socks.resolve_app_proxy(settings) or "" + except Exception: + pass pid = str(settings.get("shorts_upload_socks_profile_id") or "").strip() or DEFAULT_SOCKS_PROFILE_ID prof = get_socks_profile(pid, settings) if not prof: diff --git a/backend/app/shorts_upload.py b/backend/app/shorts_upload.py index 3e5ee25..8d79b0f 100644 --- a/backend/app/shorts_upload.py +++ b/backend/app/shorts_upload.py @@ -36,9 +36,25 @@ def quota_error_message(profile_id: str = "") -> str: ) +def _sanitize_yt_title(title: str) -> str: + """YouTube rejects empty titles and angle brackets (invalidTitle).""" + import re + + t = re.sub(r"[<>]+", " ", str(title or "")) + t = re.sub(r"\s+", " ", t).strip() + return (t or "Shorts")[:100] + + def _client_kwargs(*, timeout: float, proxy_url: str = "") -> dict[str, Any]: kw: dict[str, Any] = {"timeout": timeout, "trust_env": False} proxy = str(proxy_url or "").strip() + if not proxy: + try: + from . import egress_hub + + proxy = egress_hub.google_http_proxy() + except Exception: + proxy = "" if proxy: kw["proxy"] = proxy return kw @@ -96,7 +112,7 @@ async def upload_shorts_mp4( raise ValueError("成片文件不存在,已重新排队录制") from exc meta = { "snippet": { - "title": (title or "Shorts")[:100], + "title": _sanitize_yt_title(title), "description": description or "", "categoryId": "22", }, diff --git a/backend/app/singbox_manager.py b/backend/app/singbox_manager.py new file mode 100644 index 0000000..c8d9d3d --- /dev/null +++ b/backend/app/singbox_manager.py @@ -0,0 +1,210 @@ +# -*- coding: utf-8 -*- +"""sing-box local mixed inbound → remote SOCKS5 upstream.""" +from __future__ import annotations + +import json +import os +import shutil +import signal +import subprocess +import time +from pathlib import Path +from typing import Any + +from .config import BACKEND +from .global_socks import ( + CONFIG_DIR, + LOCAL_MIXED_HOST, + LOCAL_MIXED_PORT, + SINGBOX_CONFIG_PATH, + active_profile, + is_global_socks_enabled, +) + +_PID_FILE = CONFIG_DIR / "sing-box.pid" +_LOG_PATH = CONFIG_DIR / "sing-box.log" + + +def _find_binary() -> str: + for name in ("sing-box", "/usr/bin/sing-box", "/usr/local/bin/sing-box"): + p = shutil.which(name) if not name.startswith("/") else (name if Path(name).is_file() else None) + if p and Path(p).is_file(): + return str(p) + return "" + + +def build_config(profile: dict[str, Any] | None) -> dict[str, Any]: + if not profile: + raise ValueError("SOCKS 配置无效") + server = str(profile.get("server") or "").strip() + port = int(profile.get("port") or 0) + if not server or port <= 0: + raise ValueError("SOCKS 服务器或端口无效") + outbound: dict[str, Any] = { + "type": "socks", + "tag": "upstream", + "server": server, + "server_port": port, + "version": "5", + } + user = str(profile.get("username") or "").strip() + pwd = str(profile.get("password") or "") + if user: + outbound["username"] = user + if pwd: + outbound["password"] = pwd + return { + "log": {"level": "warn", "timestamp": True}, + "inbounds": [ + { + "type": "mixed", + "tag": "mixed-in", + "listen": LOCAL_MIXED_HOST, + "listen_port": LOCAL_MIXED_PORT, + "sniff": True, + } + ], + "outbounds": [ + outbound, + {"type": "direct", "tag": "direct"}, + ], + "route": { + "rules": [], + "final": "upstream", + }, + } + + +def write_config(cfg_dict: dict[str, Any]) -> Path: + CONFIG_DIR.mkdir(parents=True, exist_ok=True) + SINGBOX_CONFIG_PATH.write_text(json.dumps(cfg_dict, ensure_ascii=False, indent=2), encoding="utf-8") + return SINGBOX_CONFIG_PATH + + +def _read_pid() -> int: + try: + return int(_PID_FILE.read_text(encoding="utf-8").strip()) + except Exception: + return 0 + + +def _pid_alive(pid: int) -> bool: + if pid <= 0: + return False + try: + os.kill(pid, 0) + return True + except OSError: + return False + + +def is_running() -> bool: + pid = _read_pid() + if _pid_alive(pid): + return True + # systemd fallback + try: + r = subprocess.run( + ["systemctl", "is-active", "douyinweb-singbox"], + capture_output=True, + text=True, + timeout=5, + ) + return r.returncode == 0 and "active" in (r.stdout or "") + except Exception: + return False + + +def stop() -> dict[str, Any]: + pid = _read_pid() + if _pid_alive(pid): + try: + os.kill(pid, signal.SIGTERM) + time.sleep(0.8) + except Exception: + pass + try: + subprocess.run(["systemctl", "stop", "douyinweb-singbox"], capture_output=True, timeout=15) + except Exception: + pass + _PID_FILE.unlink(missing_ok=True) + return {"ok": True, "running": False} + + +def start_with_config(cfg_dict: dict[str, Any]) -> dict[str, Any]: + binary = _find_binary() + if not binary: + return {"ok": False, "running": False, "error": "未安装 sing-box(apt install sing-box 或官方脚本)"} + write_config(cfg_dict) + stop() + CONFIG_DIR.mkdir(parents=True, exist_ok=True) + log_f = open(_LOG_PATH, "a", encoding="utf-8") # noqa: SIM115 + try: + proc = subprocess.Popen( + [binary, "run", "-c", str(SINGBOX_CONFIG_PATH)], + stdin=subprocess.DEVNULL, + stdout=log_f, + stderr=subprocess.STDOUT, + cwd=str(BACKEND), + start_new_session=True, + ) + except Exception as exc: + log_f.close() + return {"ok": False, "running": False, "error": str(exc)} + _PID_FILE.write_text(str(proc.pid), encoding="utf-8") + time.sleep(0.6) + if proc.poll() is not None: + tail = "" + try: + tail = _LOG_PATH.read_text(encoding="utf-8", errors="replace")[-800:] + except Exception: + pass + return {"ok": False, "running": False, "error": f"sing-box 启动失败: {tail}"} + return {"ok": True, "running": True, "pid": proc.pid, "binary": binary} + + +def apply_from_settings(cfg: dict[str, Any] | None = None) -> dict[str, Any]: + from .global_socks import _settings_dict + + settings = _settings_dict(cfg) + if not is_global_socks_enabled(settings): + stop() + return {"ok": True, "running": False, "enabled": False} + prof = active_profile(settings) + if not prof: + stop() + return {"ok": False, "running": False, "enabled": True, "error": "无有效 SOCKS 配置"} + try: + cfg_dict = build_config(prof) + except ValueError as exc: + stop() + return {"ok": False, "running": False, "enabled": True, "error": str(exc)} + # Prefer systemd unit when present. + write_config(cfg_dict) + try: + r = subprocess.run( + ["systemctl", "restart", "douyinweb-singbox"], + capture_output=True, + text=True, + timeout=20, + ) + if r.returncode == 0: + time.sleep(0.5) + if is_running(): + return {"ok": True, "running": True, "enabled": True, "via": "systemd"} + except Exception: + pass + return {**start_with_config(cfg_dict), "enabled": True, "via": "subprocess"} + + +def status() -> dict[str, Any]: + binary = _find_binary() + pid = _read_pid() + return { + "running": is_running(), + "pid": pid if _pid_alive(pid) else 0, + "binary": binary, + "config": str(SINGBOX_CONFIG_PATH), + "mixed": f"http://{LOCAL_MIXED_HOST}:{LOCAL_MIXED_PORT}", + "error": "", + } diff --git a/backend/app/tiktok_oauth.py b/backend/app/tiktok_oauth.py index af4b674..ee59602 100644 --- a/backend/app/tiktok_oauth.py +++ b/backend/app/tiktok_oauth.py @@ -21,6 +21,15 @@ def _cfg() -> dict[str, Any]: return db.get_settings_map() +def _overseas_kwargs(*, timeout: float = 30.0) -> dict[str, Any]: + try: + from . import egress_hub + + return egress_hub.overseas_httpx_kwargs(timeout=timeout) + except Exception: + return {"timeout": timeout, "trust_env": False} + + def resolve_client_key_secret(cfg: dict[str, Any] | None = None) -> tuple[str, str]: settings = cfg or _cfg() key = str(settings.get("tiktok_oauth_client_key") or "").strip() @@ -123,7 +132,7 @@ async def exchange_code(*, code: str, state: str, request_base: str = "") -> dic if exp < time.time(): raise ValueError("授权已过期,请重新点击授权") redirect_uri = resolve_redirect_uri(request_base) - async with httpx.AsyncClient(timeout=30.0, trust_env=False) as client: + async with httpx.AsyncClient(**_overseas_kwargs(timeout=45.0)) as client: resp = await client.post( "https://open.tiktokapis.com/v2/oauth/token/", headers={"Content-Type": "application/x-www-form-urlencoded"}, @@ -204,7 +213,7 @@ async def refresh_access_token( ) -> dict[str, str]: if not (client_key and client_secret and refresh_token): raise ValueError("缺少 TikTok OAuth 凭证") - async with httpx.AsyncClient(timeout=30.0, trust_env=False) as client: + async with httpx.AsyncClient(**_overseas_kwargs(timeout=45.0)) as client: resp = await client.post( "https://open.tiktokapis.com/v2/oauth/token/", headers={"Content-Type": "application/x-www-form-urlencoded"}, diff --git a/backend/app/wireguard_hub.py b/backend/app/wireguard_hub.py new file mode 100644 index 0000000..b161a37 --- /dev/null +++ b/backend/app/wireguard_hub.py @@ -0,0 +1,723 @@ +# -*- coding: utf-8 -*- +"""WireGuard hub — adapted from sh2/d2ypp2 wireguard_config.py for douyinWEB. + +Physical deploy rule: prefer overlay AllowedIPs (VPN subnet only), never 0.0.0.0/0, +so ShellCrash / soft-router default routes stay intact. +""" +from __future__ import annotations + +import ipaddress +import json +import os +import platform +import re +import shutil +import subprocess +import time +from pathlib import Path +from typing import Any + +from .config import settings + +MAX_WIREGUARD_CONFIG_BYTES = 128 * 1024 +_SAFE_NAME_RE = re.compile(r"[^A-Za-z0-9_.-]+") +_BASE64_KEY_RE = re.compile(r"^[A-Za-z0-9+/]{43}=$") +_DEFAULT_ROUTES = {"0.0.0.0/0", "::/0"} +DEFAULT_OVERLAY_MTU = 1360 +DEFAULT_KEEPALIVE_SECONDS = 25 +PREFERRED_IFACE = "wg-dy" + + +class WireGuardConfigError(ValueError): + pass + + +def _imports_dir() -> Path: + p = settings.data_dir / "wireguard" / "imports" + p.mkdir(parents=True, exist_ok=True) + return p + + +def _run(cmd: list[str], *, timeout: float = 12.0) -> dict[str, Any]: + try: + proc = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout, check=False) + except (OSError, subprocess.TimeoutExpired) as exc: + return {"ok": False, "code": 124, "stdout": "", "stderr": str(exc)} + out = (proc.stdout or "").strip() + err = (proc.stderr or "").strip() + return {"ok": proc.returncode == 0, "code": proc.returncode or 0, "stdout": out, "stderr": err} + + +def _priv(cmd: list[str], *, timeout: float = 20.0) -> dict[str, Any]: + """Run as root when needed (API may be non-root with passwordless sudo).""" + if hasattr(os, "geteuid") and os.geteuid() == 0: + return _run(cmd, timeout=timeout) + if shutil.which("sudo"): + return _run(["sudo", "-n", *cmd], timeout=timeout) + return _run(cmd, timeout=timeout) + + +def _unit_state(unit: str) -> dict[str, str]: + if not shutil.which("systemctl"): + return {"active": "unknown", "enabled": "unknown"} + active = _run(["systemctl", "is-active", unit], timeout=3.0) + enabled = _run(["systemctl", "is-enabled", unit], timeout=3.0) + return { + "active": (active["stdout"] or ("active" if active["ok"] else "inactive")).splitlines()[0], + "enabled": (enabled["stdout"] or ("enabled" if enabled["ok"] else "disabled")).splitlines()[0], + } + + +def _strip_inline_comment(line: str) -> str: + in_quote = False + quote = "" + for idx, ch in enumerate(line): + if ch in {"'", '"'}: + if in_quote and ch == quote: + in_quote = False + quote = "" + elif not in_quote: + in_quote = True + quote = ch + if not in_quote and ch in {"#", ";"}: + return line[:idx] + return line + + +def _normalized_config_text(content: str) -> str: + return content.replace("\r\n", "\n").replace("\r", "\n") + + +def safe_wireguard_name(name: str | None) -> str: + raw = (name or PREFERRED_IFACE).strip() + raw = raw[:-5] if raw.lower().endswith(".conf") else raw + safe = _SAFE_NAME_RE.sub("-", raw).strip(".-") + return (safe or PREFERRED_IFACE)[:64] + + +def _split_csv(value: str) -> list[str]: + return [p.strip() for p in value.split(",") if p.strip()] + + +def _validate_ip_networks(values: list[str], label: str) -> list[str]: + out: list[str] = [] + for raw in values: + try: + out.append(str(ipaddress.ip_network(raw, strict=False))) + except ValueError as exc: + raise WireGuardConfigError(f"Invalid {label}: {raw}") from exc + return out + + +def _validate_ip_interfaces(values: list[str], label: str) -> list[str]: + out: list[str] = [] + for raw in values: + try: + out.append(str(ipaddress.ip_interface(raw))) + except ValueError as exc: + raise WireGuardConfigError(f"Invalid {label}: {raw}") from exc + return out + + +def _parse_endpoint(value: str) -> tuple[str, int]: + raw = value.strip() + if raw.startswith("["): + end = raw.find("]") + if end < 0 or end + 2 > len(raw) or raw[end + 1] != ":": + raise WireGuardConfigError(f"Invalid Endpoint: {raw}") + host, port_raw = raw[1:end], raw[end + 2 :] + else: + host, sep, port_raw = raw.rpartition(":") + if not sep: + raise WireGuardConfigError(f"Invalid Endpoint: {raw}") + try: + port = int(port_raw) + except ValueError as exc: + raise WireGuardConfigError(f"Invalid Endpoint port: {raw}") from exc + if not host or port < 1 or port > 65535: + raise WireGuardConfigError(f"Invalid Endpoint: {raw}") + return host.strip(), port + + +def _redact_key(value: str) -> str: + v = value.strip() + if len(v) < 12: + return "***" + return v[:8] + "…" + v[-4:] + + +def redact_wireguard_config(content: str) -> str: + lines: list[str] = [] + for raw in _normalized_config_text(content).splitlines(): + stripped = _strip_inline_comment(raw) + if "=" in stripped: + key, _, _val = stripped.partition("=") + if key.strip().lower() in {"privatekey", "presharedkey"}: + lines.append(f"{key.strip()} = ***REDACTED***") + continue + lines.append(raw) + return "\n".join(lines).rstrip() + "\n" + + +def parse_wireguard_config(content: str, *, name: str | None = None) -> dict[str, Any]: + if "\x00" in content: + raise WireGuardConfigError("config contains NUL") + if len(content.encode("utf-8")) > MAX_WIREGUARD_CONFIG_BYTES: + raise WireGuardConfigError("config too large") + + sections: list[dict[str, Any]] = [] + current: dict[str, Any] | None = None + warnings: list[str] = [] + for lineno, raw in enumerate(_normalized_config_text(content).splitlines(), start=1): + line = _strip_inline_comment(raw).strip() + if not line: + continue + if line.startswith("[") and line.endswith("]"): + section_name = line[1:-1].strip() + if section_name not in {"Interface", "Peer"}: + warnings.append(f"Line {lineno}: ignored [{section_name}]") + current = {"name": section_name, "items": {}} + sections.append(current) + continue + if current is None: + raise WireGuardConfigError(f"Line {lineno}: value before section") + if "=" not in line: + raise WireGuardConfigError(f"Line {lineno}: expected key=value") + key, _, value = line.partition("=") + current["items"].setdefault(key.strip(), []).append(value.strip().strip('"').strip("'")) + + interfaces = [s for s in sections if s["name"] == "Interface"] + peers = [s for s in sections if s["name"] == "Peer"] + if not interfaces: + raise WireGuardConfigError("missing [Interface]") + if not peers: + raise WireGuardConfigError("missing [Peer]") + + iface_items = interfaces[0]["items"] + addresses = _validate_ip_interfaces(_split_csv(",".join(iface_items.get("Address", []))), "Address") + peer_summaries: list[dict[str, Any]] = [] + for idx, peer in enumerate(peers, start=1): + items = peer["items"] + allowed = _validate_ip_networks(_split_csv(",".join(items.get("AllowedIPs", []))), "AllowedIPs") + routes_default = any(a in _DEFAULT_ROUTES for a in allowed) + if routes_default: + warnings.append( + f"Peer {idx}: AllowedIPs has default route — overlay mode strips this so ShellCrash keeps working" + ) + endpoint_raw = (items.get("Endpoint") or [""])[-1] + endpoint_host, endpoint_port = ("", None) + if endpoint_raw: + endpoint_host, endpoint_port = _parse_endpoint(endpoint_raw) + keepalive = None + if items.get("PersistentKeepalive"): + try: + keepalive = int(items["PersistentKeepalive"][-1]) + except ValueError as exc: + raise WireGuardConfigError("Invalid PersistentKeepalive") from exc + if endpoint_raw and keepalive is None: + warnings.append(f"Peer {idx}: add PersistentKeepalive=25 for NAT/VPS links") + pub = (items.get("PublicKey") or [""])[-1] + peer_summaries.append( + { + "id": idx, + "public_key": _redact_key(pub) if pub else "", + "endpoint": endpoint_raw, + "endpoint_host": endpoint_host, + "endpoint_port": endpoint_port, + "allowed_ips": allowed, + "routes_default": routes_default, + "persistent_keepalive": keepalive, + } + ) + + return { + "name": safe_wireguard_name(name), + "interface": { + "addresses": addresses, + "listen_port": (iface_items.get("ListenPort") or [None])[-1], + "dns": _split_csv(",".join(iface_items.get("DNS", []))), + "mtu": int(iface_items["MTU"][-1]) if iface_items.get("MTU") else None, + "has_private_key": bool((iface_items.get("PrivateKey") or [""])[-1]), + }, + "peers": peer_summaries, + "peer_count": len(peer_summaries), + "warnings": warnings, + "routes_default": any(p.get("routes_default") for p in peer_summaries), + } + + +def _infer_overlay_allowed_ips(summary: dict[str, Any]) -> list[str]: + out: list[str] = [] + for raw in (summary.get("interface") or {}).get("addresses") or []: + try: + iface = ipaddress.ip_interface(str(raw)) + except ValueError: + continue + if not iface.ip.is_private: + continue + network = iface.network if iface.network.prefixlen < 32 else ipaddress.ip_network(f"{iface.ip}/24", strict=False) + value = str(network) + if value not in out: + out.append(value) + return out + + +def normalize_wireguard_keepalive_config(content: str) -> tuple[str, dict[str, Any]]: + lines = _normalized_config_text(content).splitlines() + next_lines: list[str] = [] + section = "" + peer_has_keepalive = False + peer_seen_endpoint = False + changed = False + added = 0 + + def flush() -> None: + nonlocal added, changed, peer_has_keepalive, peer_seen_endpoint + if section == "Peer" and peer_seen_endpoint and not peer_has_keepalive: + next_lines.append(f"PersistentKeepalive = {DEFAULT_KEEPALIVE_SECONDS}") + added += 1 + changed = True + peer_has_keepalive = False + peer_seen_endpoint = False + + for raw in lines: + stripped = _strip_inline_comment(raw).strip() + if stripped.startswith("[") and stripped.endswith("]"): + flush() + section = stripped[1:-1].strip() + next_lines.append(raw) + continue + if "=" in stripped and section == "Peer": + key = stripped.partition("=")[0].strip().lower() + if key == "endpoint": + peer_seen_endpoint = True + elif key == "persistentkeepalive": + peer_has_keepalive = True + next_lines.append(raw) + flush() + warnings = [] + if added: + warnings.append(f"Added PersistentKeepalive={DEFAULT_KEEPALIVE_SECONDS} to {added} peer(s)") + return "\n".join(next_lines).strip() + "\n", {"changed": changed, "added_keepalive": added, "warnings": warnings} + + +def normalize_wireguard_overlay_config(content: str, *, name: str | None = None) -> tuple[str, dict[str, Any]]: + """Strip default routes → VPN subnet only (SH2 overlay).""" + summary = parse_wireguard_config(content, name=name) + overlay_allowed = _infer_overlay_allowed_ips(summary) + warnings: list[str] = [] + if not overlay_allowed: + warnings.append("No private Interface Address; kept AllowedIPs") + normalized, keepalive = normalize_wireguard_keepalive_config(content) + warnings.extend(keepalive.get("warnings") or []) + return normalized, { + "changed": bool(keepalive.get("changed")), + "allowed_ips": [], + "warnings": warnings, + "keepalive": keepalive, + } + + lines = _normalized_config_text(content).splitlines() + next_lines: list[str] = [] + section = "" + peer_has_keepalive = False + peer_seen_endpoint = False + changed = False + added_keepalive = 0 + added_mtu = False + interface_has_mtu = False + interface_seen_address = False + + def maybe_keepalive() -> None: + nonlocal added_keepalive, changed, peer_has_keepalive, peer_seen_endpoint + if section == "Peer" and peer_seen_endpoint and not peer_has_keepalive: + next_lines.append(f"PersistentKeepalive = {DEFAULT_KEEPALIVE_SECONDS}") + added_keepalive += 1 + changed = True + peer_has_keepalive = False + peer_seen_endpoint = False + + for raw in lines: + stripped = _strip_inline_comment(raw).strip() + if stripped.startswith("[") and stripped.endswith("]"): + if section == "Interface" and interface_seen_address and not interface_has_mtu: + next_lines.append(f"MTU = {DEFAULT_OVERLAY_MTU}") + added_mtu = True + changed = True + maybe_keepalive() + section = stripped[1:-1].strip() + if section == "Interface": + interface_has_mtu = False + interface_seen_address = False + next_lines.append(raw) + continue + if "=" not in stripped: + next_lines.append(raw) + continue + key, _, value = stripped.partition("=") + key_l = key.strip().lower() + if section == "Interface": + if key_l == "address": + interface_seen_address = True + elif key_l == "mtu": + interface_has_mtu = True + elif section == "Peer": + if key_l == "endpoint": + peer_seen_endpoint = True + elif key_l == "persistentkeepalive": + peer_has_keepalive = True + elif key_l == "allowedips": + allowed = _validate_ip_networks(_split_csv(value), "AllowedIPs") + if any(item in _DEFAULT_ROUTES for item in allowed): + next_lines.append(f"AllowedIPs = {', '.join(overlay_allowed)}") + changed = True + continue + next_lines.append(raw) + + if section == "Interface" and interface_seen_address and not interface_has_mtu: + next_lines.append(f"MTU = {DEFAULT_OVERLAY_MTU}") + added_mtu = True + changed = True + maybe_keepalive() + + if changed: + warnings.append("Overlay removed 0.0.0.0/0 so WireGuard will not hijack ShellCrash egress") + if added_mtu: + warnings.append(f"Added MTU {DEFAULT_OVERLAY_MTU}") + if added_keepalive: + warnings.append(f"Added PersistentKeepalive={DEFAULT_KEEPALIVE_SECONDS} ×{added_keepalive}") + return "\n".join(next_lines).strip() + "\n", { + "changed": changed, + "allowed_ips": overlay_allowed, + "warnings": warnings, + } + + +def save_imported_wireguard_config( + content: str, + *, + name: str | None = None, + route_mode: str = "overlay", +) -> dict[str, Any]: + route_mode = (route_mode or "overlay").strip().lower() + overlay: dict[str, Any] = {"changed": False, "allowed_ips": [], "warnings": []} + if route_mode == "overlay": + normalized, overlay = normalize_wireguard_overlay_config(content, name=name) + elif route_mode == "preserve": + normalized, keepalive = normalize_wireguard_keepalive_config(content) + overlay = {"changed": bool(keepalive.get("changed")), "allowed_ips": [], "warnings": keepalive.get("warnings") or [], "keepalive": keepalive} + else: + raise WireGuardConfigError(f"unsupported route_mode: {route_mode}") + + summary = parse_wireguard_config(normalized, name=name) + summary["warnings"] = [*summary.get("warnings", []), *(overlay.get("warnings") or [])] + summary["route_mode"] = route_mode + summary["overlay"] = overlay + safe_name = str(summary["name"]) + target = _imports_dir() / f"{safe_name}.conf" + target.write_text(normalized, encoding="utf-8") + try: + os.chmod(target, 0o600) + except OSError: + pass + (target.with_suffix(".summary.json")).write_text(json.dumps(summary, ensure_ascii=False, indent=2) + "\n", encoding="utf-8") + return { + "name": safe_name, + "path": str(target), + "summary": summary, + "redacted_config": redact_wireguard_config(normalized), + "overlay": overlay, + "route_mode": route_mode, + } + + +def list_imported_configs() -> list[dict[str, Any]]: + out: list[dict[str, Any]] = [] + for path in sorted(_imports_dir().glob("*.conf")): + try: + content = path.read_text(encoding="utf-8", errors="replace") + summary = parse_wireguard_config(content, name=path.stem) + out.append({"name": path.stem, "path": str(path), "source": "import", "peer_count": summary.get("peer_count"), "summary": summary}) + except Exception as exc: + out.append({"name": path.stem, "path": str(path), "source": "import", "error": str(exc)}) + return out + + +def list_system_configs() -> list[dict[str, Any]]: + etc = Path("/etc/wireguard") + # Non-root API: list via sudo when directory not readable. + names: list[str] = [] + if etc.is_dir(): + try: + names = [p.stem for p in sorted(etc.glob("*.conf"))] + except OSError: + names = [] + if not names: + ls = _priv(["bash", "-lc", "ls -1 /etc/wireguard/*.conf 2>/dev/null"], timeout=5.0) + for line in (ls.get("stdout") or "").splitlines(): + p = Path(line.strip()) + if p.suffix == ".conf": + names.append(p.stem) + out: list[dict[str, Any]] = [] + for stem in names: + try: + content = _read_conf_text(stem, prefer_system=True) + summary = parse_wireguard_config(content, name=stem) + out.append( + { + "name": stem, + "path": f"/etc/wireguard/{stem}.conf", + "source": "system", + "peer_count": summary.get("peer_count"), + "routes_default": summary.get("routes_default"), + "summary": summary, + } + ) + except Exception as exc: + out.append({"name": stem, "path": f"/etc/wireguard/{stem}.conf", "source": "system", "error": str(exc)}) + return out + + +def _read_conf_text(name: str, *, prefer_system: bool = False) -> str: + safe = safe_wireguard_name(name) + bases = [Path("/etc/wireguard"), _imports_dir()] if prefer_system else [_imports_dir(), Path("/etc/wireguard")] + for base in bases: + path = base / f"{safe}.conf" + if path.is_file(): + try: + return path.read_text(encoding="utf-8", errors="replace") + except OSError: + pass + # sudo cat for /etc/wireguard + if str(base) == "/etc/wireguard": + r = _priv(["cat", str(path)], timeout=5.0) + if r.get("ok") and r.get("stdout") is not None: + return str(r.get("stdout") or "") + raise WireGuardConfigError(f"config not found: {safe}") + + +def read_config(name: str) -> dict[str, Any]: + safe = safe_wireguard_name(name) + # Prefer live system conf when present — that is what wg-quick is running. + content = _read_conf_text(safe, prefer_system=True) + sys_path = Path("/etc/wireguard") / f"{safe}.conf" + imp_path = _imports_dir() / f"{safe}.conf" + if sys_path.is_file() or _priv(["test", "-f", str(sys_path)], timeout=3.0).get("ok"): + path_hint = str(sys_path) + source = "system" + else: + path_hint = str(imp_path) + source = "import" + return { + "name": safe, + "path": path_hint, + "source": source, + "content": content, + "redacted_config": redact_wireguard_config(content), + "summary": parse_wireguard_config(content, name=safe), + } + + +def delete_imported_config(name: str) -> dict[str, Any]: + safe = safe_wireguard_name(name) + path = _imports_dir() / f"{safe}.conf" + if not path.is_file(): + raise WireGuardConfigError(f"导入配置不存在: {safe}") + path.unlink(missing_ok=True) + path.with_suffix(".summary.json").unlink(missing_ok=True) + return {"ok": True, "deleted": safe} + + +def apply_wireguard_config( + content: str, + *, + name: str | None = None, + route_mode: str = "overlay", +) -> dict[str, Any]: + """Save (overlay by default) + install to /etc/wireguard + enable/restart unit.""" + result = save_imported_wireguard_config(content, name=name, route_mode=route_mode) + safe_name = str(result["name"]) + source = Path(str(result["path"])) + if platform.system().lower() != "linux": + result["applied"] = False + result["apply_error"] = "WireGuard apply only on Linux" + return result + if not shutil.which("wg-quick"): + raise WireGuardConfigError("wg-quick 未安装") + + target = Path("/etc/wireguard") / f"{safe_name}.conf" + for cmd in ( + ["mkdir", "-p", "/etc/wireguard"], + ["install", "-m", "600", str(source), str(target)], + ): + run = _priv(cmd, timeout=10.0) + if not run["ok"]: + raise WireGuardConfigError(run["stderr"] or run["stdout"] or f"failed: {' '.join(cmd)}") + + unit = f"wg-quick@{safe_name}.service" + st = _unit_state(unit) + if st.get("active") == "active": + run = _priv(["systemctl", "restart", unit], timeout=30.0) + else: + run = _priv(["systemctl", "enable", "--now", unit], timeout=30.0) + if not run["ok"]: + # iface may already be up outside systemd — try wg-quick + fallback = _priv(["wg-quick", "down", safe_name], timeout=15.0) + up = _priv(["wg-quick", "up", safe_name], timeout=20.0) + if not up["ok"]: + raise WireGuardConfigError( + (run["stderr"] or run["stdout"] or "") + + " | " + + (up["stderr"] or up["stdout"] or fallback.get("stderr") or "wg-quick failed") + ) + result["applied"] = True + result["system_path"] = str(target) + result["status"] = runtime_status() + return result + + +def iface_action(name: str, action: str) -> dict[str, Any]: + action = str(action or "").strip().lower() + if action not in {"start", "stop", "restart", "status"}: + raise WireGuardConfigError(f"unsupported action: {action}") + safe = safe_wireguard_name(name) + unit = f"wg-quick@{safe}.service" + if action == "status": + return {"ok": True, "name": safe, "unit": _unit_state(unit), "runtime": runtime_status()} + + if platform.system().lower() != "linux": + raise WireGuardConfigError("only Linux") + conf = Path("/etc/wireguard") / f"{safe}.conf" + if not conf.is_file() and action != "stop": + raise WireGuardConfigError(f"/etc/wireguard/{safe}.conf missing — import/apply first") + + if action == "start": + run = _priv(["systemctl", "enable", "--now", unit], timeout=30.0) + if not run["ok"]: + run = _priv(["wg-quick", "up", safe], timeout=20.0) + elif action == "stop": + run = _priv(["systemctl", "stop", unit], timeout=20.0) + _priv(["wg-quick", "down", safe], timeout=15.0) # best-effort if unit failed + else: # restart + run = _priv(["systemctl", "restart", unit], timeout=30.0) + if not run["ok"]: + _priv(["wg-quick", "down", safe], timeout=15.0) + run = _priv(["wg-quick", "up", safe], timeout=20.0) + + if action != "stop" and not run["ok"]: + # stop is ok even if already down + if action == "stop": + pass + else: + raise WireGuardConfigError(run["stderr"] or run["stdout"] or f"{action} failed") + + return {"ok": True, "name": safe, "action": action, "unit": _unit_state(unit), "detail": run.get("stdout") or run.get("stderr") or "", "runtime": runtime_status()} + + +def _parse_wg_show(text: str) -> list[dict[str, Any]]: + ifaces: list[dict[str, Any]] = [] + current: dict[str, Any] | None = None + for line in (text or "").splitlines(): + if line.startswith("interface:"): + if current: + ifaces.append(current) + current = {"name": line.split(":", 1)[1].strip(), "peers": [], "listening_port": None, "public_key": ""} + elif current is None: + continue + elif "listening port:" in line: + try: + current["listening_port"] = int(line.split(":")[-1].strip()) + except Exception: + pass + elif "public key:" in line: + current["public_key"] = _redact_key(line.split(":", 1)[1].strip()) + elif line.strip().startswith("peer:"): + current["peers"].append( + { + "public_key": _redact_key(line.split(":", 1)[1].strip()), + "endpoint": "", + "allowed_ips": "", + "latest_handshake": "", + "transfer": "", + } + ) + elif current["peers"] and "endpoint:" in line: + current["peers"][-1]["endpoint"] = line.split(":", 1)[1].strip() + elif current["peers"] and "allowed ips:" in line: + current["peers"][-1]["allowed_ips"] = line.split(":", 1)[1].strip() + current["peers"][-1]["routes_default"] = any( + x.strip() in _DEFAULT_ROUTES for x in current["peers"][-1]["allowed_ips"].split(",") + ) + elif current["peers"] and "latest handshake:" in line: + current["peers"][-1]["latest_handshake"] = line.split(":", 1)[1].strip() + elif current["peers"] and "transfer:" in line: + current["peers"][-1]["transfer"] = line.split(":", 1)[1].strip() + if current: + ifaces.append(current) + for item in ifaces: + item["systemd"] = _unit_state(f"wg-quick@{item['name']}.service") + # iface up counts as healthy even if systemd unit failed (common with manual wg) + item["link_up"] = True + return ifaces + + +def runtime_status() -> dict[str, Any]: + from . import shellcrash_hub + + commands = {n: bool(shutil.which(n)) for n in ("wg", "wg-quick", "ip", "systemctl")} + show = _priv(["wg", "show"], timeout=5.0) if commands["wg"] else {"ok": False, "stdout": "", "stderr": "no wg"} + # wg show often needs root; try without if priv failed + if not show["ok"] and commands["wg"]: + show = _run(["wg", "show"], timeout=5.0) + interfaces = _parse_wg_show(show["stdout"]) if show.get("ok") or show.get("stdout") else [] + if not interfaces and commands["ip"]: + # detect wg-* links + ip_out = _run(["ip", "-br", "link", "show", "type", "wireguard"], timeout=4.0) + for line in (ip_out.get("stdout") or "").splitlines(): + name = line.split()[0].rstrip(":") if line.split() else "" + if name: + interfaces.append({"name": name, "peers": [], "link_up": True, "systemd": _unit_state(f"wg-quick@{name}.service")}) + + system_configs = list_system_configs() + repo_configs = list_imported_configs() + recommendations: list[str] = [] + if not interfaces: + names = [c["name"] for c in system_configs + repo_configs] + if names: + recommendations.append(f"配置存在但接口未激活 — 启动 wg-quick@{names[0]}") + else: + recommendations.append("未检测到 WireGuard 接口;导入 conf 后 Apply(overlay)") + for iface in interfaces: + for peer in iface.get("peers") or []: + if peer.get("routes_default"): + recommendations.append(f"{iface.get('name')}: peer 含 0.0.0.0/0 — 建议 overlay 重导入,避免劫持 ShellCrash") + unit = (iface.get("systemd") or {}).get("active") + if unit == "failed" and iface.get("link_up"): + recommendations.append(f"{iface.get('name')}: 接口已 up 但 systemd 为 failed(可忽略或 systemctl reset-failed)") + + preferred = next((i for i in interfaces if i.get("name") == PREFERRED_IFACE), interfaces[0] if interfaces else None) + active_names = {str(i.get("name") or "") for i in interfaces if i.get("name")} + for row in system_configs: + row["active"] = str(row.get("name") or "") in active_names + row["role"] = "current" if row.get("name") == (preferred or {}).get("name") else "system" + for row in repo_configs: + row["active"] = str(row.get("name") or "") in active_names + row["role"] = "import" + shell = shellcrash_hub.status() + return { + "ok": True, + "available": bool(commands.get("wg") and commands.get("wg-quick")), + "commands": commands, + "active": bool(interfaces), + "interfaces": interfaces, + "primary": preferred, + "active_config_name": str((preferred or {}).get("name") or PREFERRED_IFACE), + "unit_wg_dy": _unit_state(f"wg-quick@{PREFERRED_IFACE}.service").get("active"), + "system_configs": system_configs, + "repo_configs": repo_configs, + "shellcrash": shell, + "recommendations": recommendations, + "hint": "物理机 AllowedIPs 仅 VPN 网段(如 10.8.0.0/24);导入默认 overlay,勿写 0.0.0.0/0", + "last_checked_at": int(time.time()), + "wg_error": "" if (show.get("ok") or interfaces) else (show.get("stderr") or show.get("stdout") or ""), + } diff --git a/backend/app/youtube_live.py b/backend/app/youtube_live.py index 1c8c331..28b85cc 100644 --- a/backend/app/youtube_live.py +++ b/backend/app/youtube_live.py @@ -233,9 +233,16 @@ async def build_live_map(*, force: bool = False) -> dict[str, Any]: now = time.time() cached = _CACHE.get("payload") fresh = bool(cached) and now - float(_CACHE.get("at") or 0) < _CACHE_TTL_SEC - if cached and (fresh or not force): - if force or not fresh: - _schedule_live_map_refresh() + + # force=True must actually rebuild (homepage/ops probes rely on this). + if force: + async with _refresh_lock(): + return await _build_live_map_unlocked(now=time.time()) + + if cached and fresh: + return cached + if cached: + _schedule_live_map_refresh() return cached # No cache yet: return empty immediately and refresh in background @@ -383,7 +390,158 @@ async def _build_live_map_unlocked(*, now: float) -> dict[str, Any]: if cid: entries[f"channel:{cid}"] = dict(old) - live_count = sum(1 for k, v in entries.items() if k.startswith(("group:", "shorts:")) and v.get("is_live")) + # Mirror live Shorts → Live 分配;FFmpeg 转推 / Studio 遥测补洞 + try: + from . import yt_assign_db + from . import youtube_neko + from .youtube_relay_pipeline import youtube_relay_pipeline + + assign_groups = await asyncio.to_thread( + lambda: yt_assign_db.list_groups(include_urls=False) + ) + relay_payload = await asyncio.to_thread(youtube_relay_pipeline.status) + relay_rows = { + str(r.get("group_id") or ""): r for r in (relay_payload.get("groups") or []) + } + pk_to_gid: dict[str, str] = {} + gid_to_name: dict[str, str] = {} + for g in assign_groups: + pk = str(g.get("channel_pk") or "").strip() + gid = str(g.get("id") or "").strip() + if pk and gid: + pk_to_gid[pk] = gid + gid_to_name[gid] = str(g.get("name") or "").strip() + + for ref, ent in list(entries.items()): + if not str(ref).startswith("shorts:"): + continue + if not isinstance(ent, dict) or not ent.get("is_live"): + continue + pk = str(ref).split(":", 1)[1] + gid = pk_to_gid.get(pk) + if not gid: + continue + ent["assign_group_id"] = gid + assign_ent = dict(ent) + assign_ent["source"] = "assign" + assign_ent["assign_group_id"] = gid + assign_ent["channel_pk"] = pk + if gid_to_name.get(gid): + assign_ent["title"] = gid_to_name[gid] + entries[f"assign:{gid}"] = assign_ent + + for g in assign_groups: + gid = str(g.get("id") or "").strip() + if not gid: + continue + pk = str(g.get("channel_pk") or "").strip() + row = relay_rows.get(gid) or {} + nid = 0 + try: + nid = int(g.get("neko_instance_id") or 0) + except (TypeError, ValueError): + nid = 0 + + studio_snap: dict[str, Any] = {} + if nid > 0: + try: + studio_snap = await asyncio.to_thread( + lambda n=nid: youtube_neko.studio_on_air_lookup(n, max_age_sec=120.0) + ) + except Exception: + studio_snap = {} + + # Fallback: match telemetry by group's saved studio URL (no CDP / no instance tag). + if not studio_snap.get("on_air"): + studio_url = str(g.get("neko_studio_url") or "") + vid = "" + if "/video/" in studio_url: + try: + vid = studio_url.split("/video/", 1)[1].split("/", 1)[0] + except Exception: + vid = "" + if vid: + for ev in youtube_neko.latest_studio_telemetry(limit=40): + payload = ev.get("payload") if isinstance(ev.get("payload"), dict) else {} + url = str(payload.get("url") or "") + if vid not in url: + continue + if str(payload.get("live_status") or "").lower() in {"live", "streaming"} or str( + payload.get("health") or "" + ).lower() in {"excellent", "good"}: + studio_snap = { + "on_air": True, + "live_page_open": True, + "live_status": str(payload.get("live_status") or "live"), + "health": str(payload.get("health") or ""), + "viewer_count": payload.get("viewer_count"), + "url": url[:200], + "received_at": float(ev.get("received_at") or 0), + "detect_source": "telemetry_url_match", + "neko_instance_id": nid, + } + break + + mark_live = bool(row.get("is_pushing") or studio_snap.get("on_air")) + if not mark_live: + # Keep studio snapshot on assign entry for UI even when offline. + if studio_snap.get("live_page_open") and f"assign:{gid}" in entries: + entries[f"assign:{gid}"]["studio"] = studio_snap + continue + + prev = entries.get(f"assign:{gid}") or {} + source = "relay" if row.get("is_pushing") else "studio_telemetry" + if prev.get("is_live") and prev.get("source") not in {"relay", "studio_telemetry"}: + source = str(prev.get("source") or source) + entries[f"assign:{gid}"] = { + **prev, + "is_live": True, + "source": source, + "assign_group_id": gid, + "channel_pk": pk, + "title": gid_to_name.get(gid) or prev.get("title") or str(g.get("name") or ""), + "live_url": str(studio_snap.get("url") or prev.get("live_url") or ""), + "studio": studio_snap or prev.get("studio") or {}, + } + if pk: + shorts_ref = f"shorts:{pk}" + shorts_prev = entries.get(shorts_ref) or {} + if not shorts_prev.get("is_live"): + entries[shorts_ref] = { + **shorts_prev, + "is_live": True, + "source": source, + "assign_group_id": gid, + "title": shorts_prev.get("title") or gid_to_name.get(gid) or "", + "live_url": str(studio_snap.get("url") or shorts_prev.get("live_url") or ""), + } + else: + entries[shorts_ref]["assign_group_id"] = gid + cid = str(shorts_prev.get("channel_id") or g.get("youtube_channel_id") or "").strip() + if cid: + entries[f"channel:{cid}"] = dict(entries[shorts_ref]) + except Exception as exc: + import logging + + logging.getLogger(__name__).warning("live-map assign/studio mirror failed: %s", exc) + + live_count = 0 + seen_assign: set[str] = set() + for k, v in entries.items(): + if not k.startswith("assign:") or not v.get("is_live"): + continue + live_count += 1 + seen_assign.add(k.split(":", 1)[1]) + for k, v in entries.items(): + if not v.get("is_live"): + continue + if k.startswith("shorts:"): + gid = str(v.get("assign_group_id") or "") + if gid and gid in seen_assign: + continue + live_count += 1 + elif k.startswith("group:"): + live_count += 1 sources = {str(v.get("source") or "") for v in entries.values() if v.get("is_live")} primary_source = "youtubei" if "youtubei" in sources else (next(iter(sources)) if sources else "none") diff --git a/backend/app/youtube_manage.py b/backend/app/youtube_manage.py index 13b4e32..bb1dd9e 100644 --- a/backend/app/youtube_manage.py +++ b/backend/app/youtube_manage.py @@ -15,6 +15,19 @@ from . import s3_storage from .shorts_oauth import channel_oauth_creds from .shorts_upload import refresh_access_token + +def _httpx_kwargs(*, timeout: float = 45.0, follow_redirects: bool = False) -> dict[str, Any]: + try: + from . import egress_hub + + kw = egress_hub.google_httpx_kwargs(timeout=timeout) + except Exception: + kw = {"timeout": timeout, "trust_env": False} + if follow_redirects: + kw["follow_redirects"] = True + return kw + + API = "https://www.googleapis.com/youtube/v3" log = logging.getLogger("youtube_manage") @@ -67,7 +80,7 @@ async def _access_for_channel(channel_pk: str) -> tuple[str, dict[str, Any]]: async def _get(path: str, *, token: str, params: dict[str, Any]) -> dict[str, Any]: - async with httpx.AsyncClient(timeout=45.0, trust_env=False) as client: + async with httpx.AsyncClient(**_httpx_kwargs(timeout=45.0)) as client: resp = await client.get( f"{API}/{path}", params=params, @@ -81,7 +94,7 @@ async def _get(path: str, *, token: str, params: dict[str, Any]) -> dict[str, An async def _post(path: str, *, token: str, params: dict[str, Any], json_body: dict[str, Any]) -> dict[str, Any]: - async with httpx.AsyncClient(timeout=45.0, trust_env=False) as client: + async with httpx.AsyncClient(**_httpx_kwargs(timeout=45.0)) as client: resp = await client.post( f"{API}/{path}", params=params, @@ -96,7 +109,7 @@ async def _post(path: str, *, token: str, params: dict[str, Any], json_body: dic async def _put(path: str, *, token: str, params: dict[str, Any], json_body: dict[str, Any]) -> dict[str, Any]: - async with httpx.AsyncClient(timeout=45.0, trust_env=False) as client: + async with httpx.AsyncClient(**_httpx_kwargs(timeout=45.0)) as client: resp = await client.put( f"{API}/{path}", params=params, @@ -111,7 +124,7 @@ async def _put(path: str, *, token: str, params: dict[str, Any], json_body: dict async def _delete(path: str, *, token: str, params: dict[str, Any]) -> None: - async with httpx.AsyncClient(timeout=45.0, trust_env=False) as client: + async with httpx.AsyncClient(**_httpx_kwargs(timeout=45.0)) as client: resp = await client.delete( f"{API}/{path}", params=params, @@ -143,6 +156,11 @@ def list_managed_channels() -> list[dict[str, Any]]: meta = oauth_meta_from_channel(ch) except Exception: meta = {} + try: + sc_ypp = int(ch.get("ypp_ok") if ch.get("ypp_ok") is not None else -1) + except Exception: + sc_ypp = -1 + ypp_ok = sc_ypp if sc_ypp in (0, 1) else ypp_by_shorts.get(cid, -1) out.append( { "id": ch.get("id"), @@ -158,7 +176,7 @@ def list_managed_channels() -> list[dict[str, Any]]: "last_status": str(ch.get("last_status") or "offline"), "last_title": str(ch.get("last_title") or ""), "last_live_url": str(ch.get("last_live_url") or ""), - "ypp_ok": ypp_by_shorts.get(cid, -1), + "ypp_ok": ypp_ok, "daily_min": ch.get("daily_min"), "daily_max": ch.get("daily_max"), "privacy": ch.get("privacy"), @@ -181,7 +199,7 @@ async def _mirror_avatar_to_s3(channel_pk: str, cdn_url: str) -> str: if not s3_storage.s3_enabled(): return url try: - async with httpx.AsyncClient(timeout=30.0, trust_env=False, follow_redirects=True) as client: + async with httpx.AsyncClient(**_httpx_kwargs(timeout=30.0, follow_redirects=True)) as client: resp = await client.get(url, headers={"User-Agent": "Mozilla/5.0"}) resp.raise_for_status() data = resp.content @@ -204,7 +222,8 @@ async def _mirror_avatar_to_s3(channel_pk: str, cdn_url: str) -> str: async def fetch_channel_profile(channel_pk: str) -> dict[str, Any]: token, ch = await _access_for_channel(channel_pk) yt_id = str(ch.get("youtube_channel_id") or "").strip() - params: dict[str, Any] = {"part": "snippet,contentDetails,statistics,brandingSettings"} + # Include status → isChannelMonetizationEnabled so YPP is written with the same call. + params: dict[str, Any] = {"part": "snippet,contentDetails,statistics,brandingSettings,status"} if yt_id: params["id"] = yt_id else: @@ -216,7 +235,7 @@ async def fetch_channel_profile(channel_pk: str) -> dict[str, Any]: data = await _get( "channels", token=token, - params={"part": "snippet,contentDetails,statistics,brandingSettings", "mine": "true"}, + params={"part": "snippet,contentDetails,statistics,brandingSettings,status", "mine": "true"}, ) items = data.get("items") or [] if not items: @@ -232,6 +251,8 @@ async def fetch_channel_profile(channel_pk: str) -> dict[str, Any]: uploads = ((item.get("contentDetails") or {}).get("relatedPlaylists") or {}).get("uploads") or "" sn = item.get("snippet") or {} st = item.get("statistics") or {} + ch_status = item.get("status") or {} + ypp = bool(ch_status.get("isChannelMonetizationEnabled")) thumbs = sn.get("thumbnails") or {} thumb_cdn = ( ((thumbs.get("medium") or {}).get("url")) @@ -240,6 +261,12 @@ async def fetch_channel_profile(channel_pk: str) -> dict[str, Any]: or "" ) thumb_url = await _mirror_avatar_to_s3(channel_pk, thumb_cdn) if thumb_cdn else "" + try: + from .yt_long_monetize import _persist_ypp_for_shorts + + _persist_ypp_for_shorts(shorts_pk=channel_pk, ypp=ypp, youtube_channel_id=yt_id) + except Exception: + log.exception("persist ypp_ok failed for %s", channel_pk) profile = { "ok": True, "channel_pk": channel_pk, @@ -260,6 +287,7 @@ async def fetch_channel_profile(channel_pk: str) -> dict[str, Any]: "videoCount": st.get("videoCount"), "hiddenSubscriberCount": st.get("hiddenSubscriberCount"), }, + "ypp_ok": 1 if ypp else 0, "raw": item, } try: @@ -613,7 +641,7 @@ async def set_thumbnail_from_path(channel_pk: str, video_id: str, file_path: str ctype = "image/jpeg" if path.suffix.lower() == ".png": ctype = "image/png" - async with httpx.AsyncClient(timeout=60.0, trust_env=False) as client: + async with httpx.AsyncClient(**_httpx_kwargs(timeout=60.0)) as client: resp = await client.post( "https://www.googleapis.com/upload/youtube/v3/thumbnails/set", params={"videoId": video_id}, diff --git a/backend/app/youtube_neko.py b/backend/app/youtube_neko.py index ee8537e..e63f0d8 100644 --- a/backend/app/youtube_neko.py +++ b/backend/app/youtube_neko.py @@ -26,7 +26,18 @@ from urllib.parse import urlparse from .config import settings _lock = threading.RLock() -MAX_INSTANCES = 32 + + +def _max_instances() -> int: + try: + n = int(getattr(settings, "neko_max_instances", 256) or 256) + except Exception: + n = 256 + return max(1, min(n, 1024)) + + +# Back-compat alias used across this module +MAX_INSTANCES = _max_instances() _nat_ip_cache: str = "" _nat_ip_cached_at: float = 0.0 _NAT_CACHE_TTL_SEC = 3600.0 @@ -50,6 +61,60 @@ def _asset_root() -> Path: return Path(__file__).resolve().parent.parent / "neko" +def _neko_browser_proxy_value() -> str: + """Host-reachable proxy for Chromium inside the container.""" + try: + from . import egress_hub + + return str(egress_hub.neko_browser_proxy() or "").strip() + except Exception: + return str(os.environ.get("DY_NEKO_BROWSER_PROXY") or "").strip() + + +def refresh_compose_for_egress() -> dict[str, Any]: + """Rewrite compose with current NEKO_BROWSER_PROXY and recreate stopped containers.""" + with _lock: + try: + desired = max(1, min(_max_instances(), int(_desired_from_db()))) + except Exception: + desired = 2 + compose = _compose_path() + text = _render_compose(desired) + compose.write_text(text, encoding="utf-8") + # Recreate so env NEKO_BROWSER_PROXY is picked up; keep running set running. + running: set[int] = set() + try: + for idx in range(1, desired + 1): + name = _container_name(idx) + code, out = _run(["docker", "inspect", "-f", "{{.State.Running}}", name], timeout=8) + if code == 0 and "true" in (out or "").lower(): + running.add(idx) + except Exception: + pass + code, out = _run( + _compose_cmd("up", "-d", "--force-recreate", "--no-start"), + timeout=900, + ) + started: list[int] = [] + errors: list[str] = [] + if code != 0: + errors.append(out[-500:]) + for idx in sorted(running): + c2, o2 = _run(_compose_cmd("start", f"neko{idx}"), timeout=120) + if c2 == 0: + started.append(idx) + else: + errors.append(f"neko{idx}: {o2[-200:]}") + proxy = _neko_browser_proxy_value() + return { + "ok": code == 0 and not errors, + "desired": desired, + "proxy": proxy, + "restarted": started, + "error": "; ".join(errors) if errors else "", + } + + def _compose_path() -> Path: return _neko_root() / "docker-compose.yml" @@ -70,6 +135,30 @@ def _http_port(instance_id: int) -> int: return int(getattr(settings, "neko_http_port_base", 9200) or 9200) + instance_id - 1 +def _http_bind() -> str: + """Host bind for Neko HTTP publish. + + VPS colocated (nginx/Caddy on same box): 127.0.0.1 + Physical (edge TLS on VPS via WireGuard): 0.0.0.0 so 10.8.0.2:920x is reachable + """ + raw = str(os.environ.get("DY_NEKO_HTTP_BIND") or getattr(settings, "neko_http_bind", "") or "").strip() + if raw: + return raw + if str(os.environ.get("DY_NEKO_EDGE_UPSTREAM") or "").strip(): + return "0.0.0.0" + return "127.0.0.1" + + +def _ensure_browser_launch_exec() -> None: + """Windows→Linux deploys often drop +x; Chromium supervisor requires executable.""" + path = _asset_root() / "browser-launch.sh" + try: + if path.is_file(): + os.chmod(path, 0o755) + except OSError: + pass + + def _webrtc_mux(instance_id: int) -> int: return int(getattr(settings, "neko_webrtc_mux_base", 52300) or 52300) + instance_id - 1 @@ -95,7 +184,7 @@ def _docker_available() -> bool: return bool(shutil.which("docker")) -def _run(cmd: list[str], *, timeout: float = 120.0) -> tuple[int, str]: +def _run(cmd: list[str], *, timeout: float = 120.0, input_text: str | None = None) -> tuple[int, str]: try: proc = subprocess.run( cmd, @@ -103,6 +192,7 @@ def _run(cmd: list[str], *, timeout: float = 120.0) -> tuple[int, str]: text=True, timeout=timeout, check=False, + input=input_text, ) out = (proc.stdout or "") + (proc.stderr or "") return proc.returncode, out.strip() @@ -151,14 +241,27 @@ def _detect_public_ip() -> str: pass ip = "" + proxy = "" + try: + from . import egress_hub + + proxy = str(egress_hub.google_http_proxy() or "").strip() + except Exception: + proxy = "" for url in ( "https://checkip.amazonaws.com", "https://api.ipify.org", "https://ifconfig.me/ip", ): try: - with urllib.request.urlopen(url, timeout=4) as resp: - cand = (resp.read().decode("utf-8", "replace") or "").strip() + if proxy: + import httpx + + with httpx.Client(timeout=6.0, trust_env=False, proxy=proxy) as client: + cand = (client.get(url).text or "").strip() + else: + with urllib.request.urlopen(url, timeout=4) as resp: + cand = (resp.read().decode("utf-8", "replace") or "").strip() if re.fullmatch(r"\d{1,3}(?:\.\d{1,3}){3}", cand): ip = cand break @@ -176,8 +279,11 @@ def _detect_public_ip() -> str: except OSError: pass if not ip: - ip = _nat_ip_cache or "108.174.50.68" - _nat_ip_cache = ip + # Prefer explicit NAT1TO1; never invent a datacenter IP for the wrong host. + env_fallback = str(os.environ.get("DY_NEKO_NAT1TO1") or "").strip() + ip = env_fallback or _nat_ip_cache or "" + if ip: + _nat_ip_cache = ip _nat_ip_cached_at = now try: cache_file.write_text(ip + "\n", encoding="utf-8") @@ -217,6 +323,20 @@ def _ensure_profile(instance_id: int) -> Path: return profile +def _ensure_instance_id_file(instance_id: int) -> Path: + """Per-container file bind-mounted into the live-ops extension for telemetry tagging.""" + meta = _neko_root() / "instance-meta" / str(int(instance_id)) + meta.mkdir(parents=True, exist_ok=True) + path = meta / "instance_id.txt" + want = f"{int(instance_id)}\n" + try: + if not path.exists() or path.read_text(encoding="utf-8") != want: + path.write_text(want, encoding="utf-8") + except OSError: + pass + return path + + _TM_EXT_ID = "dhdgffkkebhmkfjojejmpbldmpobfkfo" def _q(value: str) -> str: @@ -254,6 +374,7 @@ def _render_compose(count: int) -> str: for required in (seed_dir, live_ops_dir, provisioning_dir, browser_launch, supervisor, policy_dir): if not required.exists(): raise RuntimeError(f"Neko sh2 asset missing: {required}") + _ensure_browser_launch_exec() lines = [ "# Generated by douyinWEB youtube_neko — sh2-aligned assets; do not edit", @@ -264,6 +385,7 @@ def _render_compose(count: int) -> str: mux = _webrtc_mux(idx) udp = _udp_range(idx) profile = _ensure_profile(idx) + instance_id_file = _ensure_instance_id_file(idx) lines.extend( [ f" neko{idx}:", @@ -286,6 +408,7 @@ def _render_compose(count: int) -> str: ' HOME: "/home/neko"', ' NEKO_CONTAINER_USER: "neko"', ' NEKO_CONTAINER_HOME: "/home/neko"', + f" NEKO_INSTANCE_ID: {_q(str(idx))}", ' NEKO_SERVER_BIND: ":8080"', # Trust X-Forwarded-* from nginx; NO path prefix (nginx strips /neko/N/). ' NEKO_SERVER_PROXY: "true"', @@ -301,8 +424,8 @@ def _render_compose(count: int) -> str: f" NEKO_WEBRTC_UDPMUX: {_q(str(mux))}", f" NEKO_WEBRTC_EPR: {_q(udp)}", f" NEKO_START_URL: {_q(start_url)}", - # US VPS: direct egress, no ShellClash. - ' NEKO_BROWSER_PROXY: ""', + # Physical: ShellCrash/住宅 via host.docker.internal; VPS colocated: usually "". + f" NEKO_BROWSER_PROXY: {_q(_neko_browser_proxy_value())}", ' NEKO_BROWSER_RENDER_MODE: "auto"', f" NEKO_MANAGED_POLICIES: {_q('1' if managed else '0')}", ' NEKO_TAMPERMONKEY_REPAIR: "1"', @@ -310,9 +433,9 @@ def _render_compose(count: int) -> str: ' NEKO_LIVE_OPS_EXTENSION_DIR: "/etc/neko/live-ops-extension"', ' NEKO_TAMPERMONKEY_SEED_DIR: "/etc/neko/tampermonkey-seed"', " ports:", - # HTTP only localhost — HTTPS via nginx /neko/{id}/ - f' - "127.0.0.1:{http_port}:8080"', - # WebRTC must be public (cannot go through nginx). + # HTTP bind: 127.0.0.1 on colocated VPS; 0.0.0.0 on physical (WG edge). + f' - "{_http_bind()}:{http_port}:8080"', + # WebRTC must be public (cannot go through nginx/Caddy HTTP). f' - "{mux}:{mux}/tcp"', f' - "{mux}:{mux}/udp"', f' - "{udp}:{udp}/udp"', @@ -324,6 +447,8 @@ def _render_compose(count: int) -> str: f" - {_q(f'{policy_dir}:/etc/opt/chrome/policies/managed:ro')}", f" - {_q(f'{seed_dir}:/etc/neko/tampermonkey-seed:ro')}", f" - {_q(f'{live_ops_dir}:/etc/neko/live-ops-extension:ro')}", + # Overlay instance id into the extension so telemetry can tag neko-N. + f" - {_q(f'{instance_id_file}:/etc/neko/live-ops-extension/instance_id.txt:ro')}", f" - {_q(f'{provisioning_dir}:/var/www/provisioning:ro')}", f" - {_q(f'{browser_launch}:/etc/neko/browser-launch.sh:ro')}", f" - {_q(f'{supervisor}:/etc/neko/supervisord/{_supervisor_conf_name()}:ro')}", @@ -531,7 +656,8 @@ def ensure_capacity( reconcile_running=True (sync_for_groups): stop instances not in start_instances. reconcile_running=False (single start/restart): never stop siblings. """ - desired = max(0, min(MAX_INSTANCES, int(desired or 0))) + _ensure_browser_launch_exec() + desired = max(0, min(_max_instances(), int(desired or 0))) # Never shrink below DB assignment (protects against start(#2) wiping #3+). desired = max(desired, _desired_from_db()) if desired == 0: @@ -547,10 +673,13 @@ def ensure_capacity( text = _render_compose(desired) changed = not compose.is_file() or compose.read_text(encoding="utf-8") != text if changed: + # Persist desired compose for next explicit recreate — do NOT force + # `compose up` solely because YAML text changed (that kills keep-warm + # Chrome logins/tabs on every API deploy that touches render). compose.write_text(text, encoding="utf-8") missing = [i for i in range(1, desired + 1) if not _container_state(i).get("exists")] - need_up = changed or bool(missing) + need_up = bool(missing) out = "" if need_up: code, out = _compose_up(desired=desired, start_instances=start_set) @@ -590,14 +719,15 @@ def ensure_capacity( def sync_nginx_proxy(count: int) -> dict[str, Any]: """Nginx: /neko/{id}/ → http://127.0.0.1:920x/ (strip prefix; Neko has no path_prefix).""" + caddy = sync_caddy_neko_snippet(count) base = _public_base() if not base: - return {"ok": False, "skipped": "no_public_base"} + return {"ok": False, "skipped": "no_public_base", "caddy": caddy} host = urlparse(base).hostname or "" if not host: - return {"ok": False, "skipped": "no_host"} + return {"ok": False, "skipped": "no_host", "caddy": caddy} if not Path("/etc/nginx/conf.d").is_dir(): - return {"ok": False, "skipped": "no_nginx"} + return {"ok": False, "skipped": "no_nginx", "caddy": caddy} blocks: list[str] = [] for idx in range(1, max(0, int(count)) + 1): @@ -654,7 +784,77 @@ def sync_nginx_proxy(count: int) -> dict[str, Any]: if code != 0: return {"ok": False, "error": out[:400] or "nginx -t failed"} _run(["systemctl", "reload", "nginx"], timeout=15) - return {"ok": True, "instances": count} + return {"ok": True, "instances": count, "caddy": caddy} + except OSError as exc: + return {"ok": False, "error": str(exc), "caddy": caddy} + + +def sync_caddy_neko_snippet(count: int) -> dict[str, Any]: + """Write Caddy fragment for edges. + + Preferred (unlimited): single `/neko/*` → `{upstream}:{gateway_port}` where the + physical API runs neko_edge_gateway. Legacy per-id blocks still generated as + fallback when DY_NEKO_GATEWAY_ENABLED=0. + """ + n = max(0, min(_max_instances(), int(count or 0))) + upstream_host = str(os.environ.get("DY_NEKO_EDGE_UPSTREAM") or "127.0.0.1").strip() or "127.0.0.1" + gw_port = int(getattr(settings, "neko_gateway_port", 9199) or 9199) + gw_on = True + try: + from . import neko_edge_gateway + + gw_on = neko_edge_gateway.gateway_enabled() + except Exception: + gw_on = bool(getattr(settings, "neko_gateway_enabled", True)) + + lines = [ + "# Generated by douyinWEB youtube_neko.sync_caddy_neko_snippet — do not hand-edit", + f"# instances={n} upstream={upstream_host} gateway={gw_on} gw_port={gw_port}", + ] + if gw_on: + lines.extend( + [ + "handle /neko {", + "\tredir /neko/ 308", + "}", + "@neko path /neko /neko/*", + "handle @neko {", + f"\treverse_proxy {upstream_host}:{gw_port} {{", + "\t\theader_up Host {host}", + "\t\theader_up X-Forwarded-Proto {scheme}", + "\t\theader_up X-Forwarded-Host {host}", + "\t}", + "}", + ] + ) + else: + for idx in range(1, n + 1): + port = _http_port(idx) + lines.extend( + [ + f"handle /neko/{idx} {{", + f"\tredir /neko/{idx}/ 308", + "}", + f"handle_path /neko/{idx}/* {{", + f"\treverse_proxy {upstream_host}:{port} {{", + "\t\theader_up Host {host}", + "\t\theader_up X-Forwarded-Proto {scheme}", + "\t}", + "}", + ] + ) + out = _neko_root() / "caddy-neko.snippet" + try: + _neko_root().mkdir(parents=True, exist_ok=True) + out.write_text("\n".join(lines) + "\n", encoding="utf-8") + return { + "ok": True, + "path": str(out), + "instances": n, + "upstream": upstream_host, + "gateway": gw_on, + "gateway_port": gw_port, + } except OSError as exc: return {"ok": False, "error": str(exc)} @@ -663,8 +863,8 @@ def instance_action(instance_id: int, action: str) -> dict[str, Any]: action = str(action or "").strip().lower() if action not in {"status", "start", "stop", "restart"}: raise ValueError(f"不支持的操作: {action}") - if instance_id < 1 or instance_id > MAX_INSTANCES: - raise ValueError(f"实例编号须在 1–{MAX_INSTANCES}") + if instance_id < 1 or instance_id > _max_instances(): + raise ValueError(f"实例编号须在 1–{_max_instances()}") before = _container_state(instance_id) message = f"Neko {instance_id}: {before.get('status')}" @@ -732,11 +932,44 @@ def _invalidate_list_cache() -> None: _list_cache_at = 0.0 +def _docker_max_instance_id() -> int: + """Highest douyinweb-neko-N that exists (even if groups table is empty).""" + if not _docker_available(): + return 0 + code, text = _run( + [ + "docker", + "ps", + "-a", + "--filter", + "name=douyinweb-neko-", + "--format", + "{{.Names}}", + ], + timeout=12, + ) + if code != 0: + return 0 + best = 0 + for line in (text or "").splitlines(): + name = line.strip().lstrip("/") + if not name.startswith("douyinweb-neko-"): + continue + suffix = name[len("douyinweb-neko-") :] + try: + best = max(best, int(suffix)) + except ValueError: + continue + return best + + def status_summary(*, desired: int) -> dict[str, Any]: """Read-only status — does not run compose/nginx.""" - desired = max(0, min(MAX_INSTANCES, int(desired or 0))) + desired = max(0, min(_max_instances(), int(desired or 0))) if desired < 1: desired = _desired_from_db() + # Physical / ops: show already-created containers even before assign groups exist. + desired = max(desired, _docker_max_instance_id()) instances = list_instances(desired) running = sum(1 for x in instances if x.get("running")) assets = _asset_root() @@ -747,6 +980,7 @@ def status_summary(*, desired: int) -> dict[str, Any]: "instances": instances, "enabled": bool(getattr(settings, "neko_enabled", True)), "nat1to1": _detect_public_ip(), + "http_bind": _http_bind(), # No plaintext passwords in API responses. "login_hint": "用户名任意;普通密码见 DY_NEKO_USER_PASS;管理员密码见 DY_NEKO_ADMIN_PASS", "assets": { @@ -761,8 +995,17 @@ def status_summary(*, desired: int) -> dict[str, Any]: } -def sync_for_groups(groups: list[dict[str, Any]]) -> dict[str, Any]: - """Ensure docker containers exist for all assign groups; start only neko_enabled.""" +def sync_for_groups( + groups: list[dict[str, Any]], + *, + reconcile_running: bool = False, +) -> dict[str, Any]: + """Ensure docker containers exist for all assign groups; start only neko_enabled. + + reconcile_running=False (default): create capacity / start enabled — never stop + siblings (physical keep-warm + exclusive-live Studio must survive API boot). + True: stop containers whose groups are not neko_enabled (explicit ops only). + """ ids = [int(g.get("neko_instance_id") or 0) for g in groups if int(g.get("neko_instance_id") or 0) > 0] desired = max(ids) if ids else 0 if desired == 0: @@ -772,7 +1015,7 @@ def sync_for_groups(groups: list[dict[str, Any]]) -> dict[str, Any]: for g in groups if g.get("neko_enabled") and int(g.get("neko_instance_id") or 0) > 0 } - return ensure_capacity(desired, start_instances=start_set, reconcile_running=True) + return ensure_capacity(desired, start_instances=start_set, reconcile_running=reconcile_running) def stop_instance(instance_id: int) -> dict[str, Any]: @@ -808,6 +1051,7 @@ def stop_instances_except(keep_instance_id: int) -> list[int]: def ensure_instance_running(instance_id: int) -> dict[str, Any]: """Ensure one Neko container exists and is running (for exclusive-live winner).""" + _ensure_browser_launch_exec() idx = int(instance_id or 0) if idx < 1: return {"ok": False, "skipped": "no_instance"} @@ -832,13 +1076,36 @@ def _payload_is_livestreaming(payload: dict[str, Any] | None) -> bool: def _payload_stream_confirmed(payload: dict[str, Any] | None) -> bool: """True when Studio telemetry says this channel is actually live / healthy.""" body = payload or {} + text = str(body.get("text") or "").lower() + # Strong negatives first (preview / encoder not connected). + if any( + x in text + for x in ( + "connect your encoder", + "waiting for you to start", + "stream offline", + "not streaming", + "no data key", + "直播已结束", + "未在直播", + ) + ): + return False status = str(body.get("live_status") or "").strip().lower() health = str(body.get("health") or "").strip().lower() + if status in {"ended", "waiting", "offline"}: + return False if status in {"live", "streaming"}: return True if health in {"excellent", "good"}: return True - text = str(body.get("text") or "").lower() + # Concurrent viewers on Control Room almost always means on-air. + try: + viewers = body.get("viewer_count") + if viewers is not None and int(viewers) >= 0 and _payload_is_livestreaming(body): + return True + except (TypeError, ValueError): + pass if any( x in text for x in ( @@ -846,10 +1113,16 @@ def _payload_stream_confirmed(payload: dict[str, Any] | None) -> bool: "you are live", "stream is healthy", "excellent connection", + "concurrent viewers", + "watching now", + "stop streaming", + "end stream", "正在直播", "直播中", "连接状况极佳", "状况良好", + "人正在观看", + "结束直播", ) ): return True @@ -878,14 +1151,76 @@ def _cdp_fetch_tabs(instance_id: int) -> list[dict[str, Any]]: def _cdp_live_studio_urls(instance_id: int) -> list[str]: + from urllib.parse import urlparse + urls: list[str] = [] for tab in _cdp_fetch_tabs(instance_id): u = str(tab.get("url") or "").strip() - if "studio.youtube.com" in u and "livestreaming" in u: + try: + p = urlparse(u) + except Exception: + continue + host = (p.netloc or "").lower() + path = (p.path or "").lower() + if host.endswith("studio.youtube.com") and "livestreaming" in path: urls.append(u) return urls +_cdp_signal_cache: dict[int, tuple[float, dict[str, Any]]] = {} + + +def _cdp_studio_page_signals( + instance_id: int, + *, + max_age_sec: float = 45.0, + force: bool = False, +) -> dict[str, Any]: + """Read-only CDP scrape of Studio Live page text (no tab close / no Chrome restart). + + Script is fed via ``docker exec -i … python3 -`` stdin (no docker cp / no Chrome restart). + """ + import time as _time + + nid = int(instance_id or 0) + if nid < 1: + return {"ok": False, "error": "bad_id"} + now = _time.time() + cached = _cdp_signal_cache.get(nid) + if (not force) and cached and (now - float(cached[0])) <= max_age_sec: + return dict(cached[1]) + + name = _container_name(nid) + script = _asset_root() / "cdp_studio_scrape.py" + if not script.is_file(): + row = {"ok": False, "error": "scrape_script_missing"} + _cdp_signal_cache[nid] = (now, row) + return row + + # Feed script via stdin — avoids docker cp onto read-only overlay mounts. + try: + script_text = script.read_text(encoding="utf-8") + except OSError as exc: + row = {"ok": False, "error": f"read_script:{exc}"} + _cdp_signal_cache[nid] = (now, row) + return row + code, out = _run( + ["docker", "exec", "-i", name, "python3", "-"], + timeout=25, + input_text=script_text, + ) + row: dict[str, Any] = {"ok": False, "error": "cdp_scrape_failed"} + try: + line = (out or "").strip().splitlines()[-1] if (out or "").strip() else "{}" + parsed = json.loads(line) + if isinstance(parsed, dict): + row = parsed + except Exception: + row = {"ok": False, "error": (out or f"exit_{code}")[:220]} + _cdp_signal_cache[nid] = (now, row) + return row + + def _cdp_nudge_live_studio_tab(instance_id: int) -> dict[str, Any]: """Focus + reload YouTube Live Control Room tab (CDP), like browser-launch.sh.""" name = _container_name(instance_id) @@ -925,12 +1260,14 @@ def latest_live_studio_event( *, max_age_sec: float = 60.0, since_ts: float = 0.0, + neko_id: int = 0, ) -> dict[str, Any] | None: """Newest Studio Control Room telemetry, optionally only after `since_ts`.""" import time as _time now = _time.time() since = float(since_ts or 0) + want = int(neko_id or 0) for ev in _studio_events[:80]: received = float(ev.get("received_at") or 0) if since > 0 and received < since: @@ -940,6 +1277,12 @@ def latest_live_studio_event( payload = ev.get("payload") or {} if not _payload_is_livestreaming(payload if isinstance(payload, dict) else {}): continue + ev_nid = int(ev.get("neko_instance_id") or 0) + if want > 0: + # Strict: only events tagged for this instance (never share untagged globally). + if ev_nid == want: + return ev + continue return ev return None @@ -950,36 +1293,61 @@ def recent_live_studio_seen(*, max_age_sec: float = 120.0, since_ts: float = 0.0 def youtube_live_confirmed(*, max_age_sec: float = 45.0, since_ts: float = 0.0, neko_id: int = 0) -> dict[str, Any]: - """Detect whether Studio reports 1 live stream is truly on-air.""" - ev = latest_live_studio_event(max_age_sec=max_age_sec, since_ts=since_ts) + """Detect whether Studio reports a stream is truly on-air (tab open alone is NOT live).""" + ev = latest_live_studio_event(max_age_sec=max_age_sec, since_ts=since_ts, neko_id=neko_id) if ev: payload = ev.get("payload") if isinstance(ev.get("payload"), dict) else {} confirmed = _payload_stream_confirmed(payload) return { "ok": True, "live": confirmed, + "page_open": _payload_is_livestreaming(payload), "live_status": str(payload.get("live_status") or ""), "health": str(payload.get("health") or ""), "url": str(payload.get("url") or "")[:200], "received_at": float(ev.get("received_at") or 0), + "neko_instance_id": int(ev.get("neko_instance_id") or neko_id or 0), + "viewer_count": payload.get("viewer_count"), "reason": "stream_confirmed" if confirmed else "page_open_not_confirmed_live", "detect_source": "telemetry", } if neko_id > 0: + # Prefer cached CDP DOM (poller / prior lookup); do not treat bare tab URL as on-air. + try: + sig = _cdp_studio_page_signals(int(neko_id), max_age_sec=max(45.0, float(max_age_sec))) + except Exception: + sig = {} + if isinstance(sig, dict) and sig.get("ok"): + on_air = bool(sig.get("on_air")) + return { + "ok": True, + "live": on_air, + "page_open": True, + "live_status": str(sig.get("live_status") or ""), + "health": str(sig.get("health") or ""), + "url": str(sig.get("url") or "")[:200], + "received_at": 0.0, + "neko_instance_id": int(neko_id), + "viewer_count": sig.get("viewer_count"), + "reason": "cdp_dom_on_air" if on_air else "cdp_dom_page_not_on_air", + "detect_source": "cdp_dom", + } cdp_urls = _cdp_live_studio_urls(neko_id) if cdp_urls: return { "ok": True, - "live": True, + "live": False, + "page_open": True, "live_status": "cdp_live_tab", "health": "", "url": cdp_urls[0][:200], "received_at": 0.0, - "reason": "cdp_livestreaming_tab", + "neko_instance_id": int(neko_id), + "viewer_count": None, + "reason": "cdp_livestreaming_tab_not_confirmed", "detect_source": "cdp", } - return {"ok": False, "live": False, "reason": "no_live_studio_page"} - + return {"ok": False, "live": False, "page_open": False, "reason": "no_live_studio_page"} def wait_instance_ready_for_live( instance_id: int, @@ -1161,6 +1529,178 @@ def recreate_all_instances(*, start_enabled: bool = True) -> dict[str, Any]: # --- Studio telemetry ingest (sh2 live-ops extension) --- _studio_events: list[dict[str, Any]] = [] _STUDIO_EVENTS_MAX = 200 +_studio_latest_by_neko: dict[int, dict[str, Any]] = {} +_studio_minute_reports: dict[int, list[dict[str, Any]]] = {} +_studio_minute_last_at: dict[int, float] = {} +_STUDIO_MINUTE_MAX = 120 +_studio_bootstrapped = False +_CDP_POLL_INTERVAL_SEC = 55.0 + + +def _minute_report_dir() -> Path: + d = _neko_root() / "studio_minute" + d.mkdir(parents=True, exist_ok=True) + return d + + +def _persist_minute_report(neko_id: int, report: dict[str, Any]) -> None: + nid = int(neko_id or 0) + if nid < 1: + return + try: + path = _minute_report_dir() / f"{nid}.jsonl" + with path.open("a", encoding="utf-8") as fh: + fh.write(json.dumps(report, ensure_ascii=False) + "\n") + except OSError: + pass + + +def _bootstrap_minute_reports_from_disk() -> None: + """Load recent per-neko minute reports after API restart.""" + try: + root = _minute_report_dir() + except Exception: + return + for path in root.glob("*.jsonl"): + try: + nid = int(path.stem) + except ValueError: + continue + if nid < 1: + continue + rows: list[dict[str, Any]] = [] + try: + lines = path.read_text(encoding="utf-8").splitlines() + except OSError: + continue + for line in lines[-_STUDIO_MINUTE_MAX :]: + line = (line or "").strip() + if not line: + continue + try: + row = json.loads(line) + except json.JSONDecodeError: + continue + if isinstance(row, dict): + rows.append(row) + if not rows: + continue + rows.reverse() # newest first + _studio_minute_reports[nid] = rows[:_STUDIO_MINUTE_MAX] + try: + _studio_minute_last_at[nid] = float(rows[0].get("ts") or 0) + except (TypeError, ValueError): + pass + + +def _bootstrap_studio_telemetry_from_disk() -> None: + """Reload last telemetry after API restart so live-map isn't empty until next Chrome tick.""" + global _studio_bootstrapped + if _studio_bootstrapped: + return + _studio_bootstrapped = True + _bootstrap_minute_reports_from_disk() + try: + path = _neko_root() / "studio_telemetry_latest.json" + if not path.exists(): + return + raw = json.loads(path.read_text(encoding="utf-8")) + if not isinstance(raw, dict) or not isinstance(raw.get("payload"), dict): + return + neko_id = int(raw.get("neko_instance_id") or raw["payload"].get("neko_instance_id") or 0) + if neko_id < 1: + neko_id = _resolve_neko_id_for_payload(raw["payload"]) + event = { + "id": str(raw.get("id") or "disk"), + "received_at": float(raw.get("received_at") or 0), + "neko_instance_id": neko_id, + "payload": raw["payload"], + } + if event["received_at"] <= 0: + return + _studio_events.insert(0, event) + if neko_id > 0: + _studio_latest_by_neko[neko_id] = event + except Exception: + pass + + +def _extract_studio_video_id(url: str) -> str: + import re + + m = re.search(r"/video/([^/]+)/livestreaming", str(url or ""), re.I) + return str(m.group(1) if m else "").strip() + + +def _resolve_neko_id_for_payload(payload: dict[str, Any]) -> int: + """Tag telemetry to a Neko instance via explicit id, assign studio URL, or CDP.""" + body = payload or {} + for key in ("neko_instance_id", "neko_id", "instance_id"): + try: + nid = int(body.get(key) or 0) + if nid > 0: + return nid + except (TypeError, ValueError): + pass + + url = str(body.get("url") or "") + video_id = _extract_studio_video_id(url) + try: + from . import yt_assign_db + + for g in yt_assign_db.list_groups(include_urls=False): + try: + nid = int(g.get("neko_instance_id") or 0) + except (TypeError, ValueError): + nid = 0 + if nid < 1: + continue + studio = str(g.get("neko_studio_url") or "") + if video_id and video_id in studio: + return nid + if url and studio and (studio.rstrip("/") in url or url.rstrip("/") in studio): + return nid + except Exception: + pass + + if not _payload_is_livestreaming(body): + return 0 + # CDP attribution is expensive; rely on instance_id.txt + assign studio URL match. + return 0 + + +def _maybe_append_minute_report(neko_id: int, event: dict[str, Any]) -> None: + import time as _time + + nid = int(neko_id or 0) + if nid < 1: + return + now = float(event.get("received_at") or _time.time()) + last = float(_studio_minute_last_at.get(nid) or 0) + if last and (now - last) < 55.0: + return + payload = event.get("payload") if isinstance(event.get("payload"), dict) else {} + report = { + "ts": int(now), + "neko_instance_id": nid, + "live_page_open": bool(_payload_is_livestreaming(payload)), + "on_air": bool(_payload_stream_confirmed(payload)), + "live_status": str(payload.get("live_status") or ""), + "health": str(payload.get("health") or ""), + "viewer_count": payload.get("viewer_count"), + "total_views": payload.get("total_views"), + "live_duration": str(payload.get("live_duration") or "")[:16], + "live_duration_sec": payload.get("live_duration_sec"), + "like_count": payload.get("like_count"), + "stream_title": str(payload.get("stream_title") or "")[:120], + "url": str(payload.get("url") or "")[:200], + "source": str(payload.get("source") or "extension")[:32], + } + bucket = _studio_minute_reports.setdefault(nid, []) + bucket.insert(0, report) + del bucket[_STUDIO_MINUTE_MAX:] + _studio_minute_last_at[nid] = now + _persist_minute_report(nid, report) def ingest_studio_telemetry(payload: dict[str, Any] | None) -> dict[str, Any]: @@ -1168,21 +1708,387 @@ def ingest_studio_telemetry(payload: dict[str, Any] | None) -> dict[str, Any]: import time as _time import uuid + _bootstrap_studio_telemetry_from_disk() body = dict(payload or {}) + neko_id = _resolve_neko_id_for_payload(body) + if neko_id > 0: + body["neko_instance_id"] = neko_id event = { "id": str(uuid.uuid4()), "received_at": float(body.get("received_at") or _time.time()), + "neko_instance_id": neko_id, "payload": body, } _studio_events.insert(0, event) del _studio_events[_STUDIO_EVENTS_MAX:] + if neko_id > 0: + _studio_latest_by_neko[neko_id] = event + _maybe_append_minute_report(neko_id, event) try: path = _neko_root() / "studio_telemetry_latest.json" path.write_text(json.dumps(event, ensure_ascii=False, indent=2), encoding="utf-8") except OSError: pass - return {"ok": True, "event": {"id": event["id"]}} + return { + "ok": True, + "event": {"id": event["id"], "neko_instance_id": neko_id}, + } def latest_studio_telemetry(*, limit: int = 20) -> list[dict[str, Any]]: + _bootstrap_studio_telemetry_from_disk() return list(_studio_events[: max(1, min(100, int(limit)))]) + + +def list_studio_minute_reports(neko_id: int = 0, *, limit: int = 30) -> list[dict[str, Any]]: + _bootstrap_studio_telemetry_from_disk() + nid = int(neko_id or 0) + lim = max(1, min(120, int(limit))) + if nid > 0: + return list(_studio_minute_reports.get(nid, [])[:lim]) + out: list[dict[str, Any]] = [] + for rows in _studio_minute_reports.values(): + out.extend(rows) + out.sort(key=lambda r: float(r.get("ts") or 0), reverse=True) + return out[:lim] + + +def studio_snapshot_for_instance( + neko_id: int, + *, + max_age_sec: float = 90.0, + allow_cdp: bool = False, +) -> dict[str, Any]: + """UI-facing Neko Studio feedback: Live page open? On-air? Viewers? Health?""" + import time as _time + + nid = int(neko_id or 0) + now = _time.time() + out: dict[str, Any] = { + "neko_instance_id": nid, + "live_page_open": False, + "on_air": False, + "live_status": "", + "health": "", + "viewer_count": None, + "like_count": None, + "total_views": None, + "live_duration": "", + "live_duration_sec": None, + "stream_title": "", + "url": "", + "received_at": 0.0, + "age_sec": None, + "detect_source": "", + # ~90 pts ≈ 1.5h at 1/min — enough for Studio-style viewer timeline chart + "minute_reports": list_studio_minute_reports(nid, limit=90) if nid > 0 else [], + } + if nid < 1: + return out + + _bootstrap_studio_telemetry_from_disk() + ev = _studio_latest_by_neko.get(nid) + if isinstance(ev, dict): + received0 = float(ev.get("received_at") or 0) + if received0 and (now - received0) > max_age_sec: + ev = None + if not isinstance(ev, dict): + ev = latest_live_studio_event(max_age_sec=max_age_sec, neko_id=nid) + if isinstance(ev, dict): + received = float(ev.get("received_at") or 0) + age = (now - received) if received else None + if age is None or age <= max_age_sec: + payload = ev.get("payload") if isinstance(ev.get("payload"), dict) else {} + page_open = _payload_is_livestreaming(payload) + on_air = _payload_stream_confirmed(payload) if page_open else False + out.update( + { + "live_page_open": page_open, + "on_air": on_air, + "live_status": str(payload.get("live_status") or ""), + "health": str(payload.get("health") or ""), + "viewer_count": payload.get("viewer_count"), + "like_count": payload.get("like_count"), + "total_views": payload.get("total_views"), + "live_duration": str(payload.get("live_duration") or "")[:16], + "live_duration_sec": payload.get("live_duration_sec"), + "stream_title": str(payload.get("stream_title") or "")[:120], + "url": str(payload.get("url") or "")[:200], + "received_at": received, + "age_sec": round(age, 1) if age is not None else None, + "detect_source": "telemetry", + } + ) + return out + + if not allow_cdp: + return out + + # CDP fallback when extension ingest is quiet but Chrome still has Live tab. + # Prefer cached DOM signals from the host poller (never force a fresh scrape here). + try: + st = _container_state(nid, check_http=False) + if st.get("running"): + sig = _cdp_studio_page_signals(nid, max_age_sec=90.0) + if isinstance(sig, dict) and sig.get("ok"): + on_air = bool(sig.get("on_air")) + out.update( + { + "live_page_open": True, + "on_air": on_air, + "live_status": str(sig.get("live_status") or ("live" if on_air else "")), + "health": str(sig.get("health") or ""), + "viewer_count": sig.get("viewer_count"), + "total_views": sig.get("total_views"), + "live_duration": str(sig.get("live_duration") or "")[:16], + "live_duration_sec": sig.get("live_duration_sec"), + "url": str(sig.get("url") or "")[:200], + "detect_source": "cdp_dom", + "received_at": now, + "age_sec": 0.0, + } + ) + return out + urls = _cdp_live_studio_urls(nid) + if urls: + out.update( + { + "live_page_open": True, + "on_air": False, + "live_status": "cdp_live_tab", + "url": urls[0][:200], + "detect_source": "cdp", + } + ) + except Exception: + pass + return out + + +def studio_on_air_lookup(neko_id: int, *, max_age_sec: float = 120.0) -> dict[str, Any]: + """Non-destructive live detect: telemetry first, then read-only CDP URL match. + + Safe for keep-warm Nekos: never restarts Chrome / never recreates containers. + """ + import time as _time + + nid = int(neko_id or 0) + snap = studio_snapshot_for_instance(nid, max_age_sec=max_age_sec, allow_cdp=False) + if snap.get("on_air"): + # Enrich missing Analytics fields from CDP cache (Views / LIVE duration). + if nid > 0 and (snap.get("total_views") is None or not snap.get("live_duration")): + try: + sig = _cdp_studio_page_signals(nid, max_age_sec=90.0) + except Exception: + sig = {} + if isinstance(sig, dict) and sig.get("ok"): + if snap.get("total_views") is None and sig.get("total_views") is not None: + snap["total_views"] = sig.get("total_views") + if not snap.get("live_duration") and sig.get("live_duration"): + snap["live_duration"] = str(sig.get("live_duration") or "")[:16] + snap["live_duration_sec"] = sig.get("live_duration_sec") + if snap.get("viewer_count") is None and sig.get("viewer_count") is not None: + snap["viewer_count"] = sig.get("viewer_count") + return snap + + urls: list[str] = [] + if nid > 0: + try: + st = _container_state(nid, check_http=False) + if st.get("running"): + urls = _cdp_live_studio_urls(nid) + except Exception: + urls = [] + + if urls: + snap["live_page_open"] = True + if not snap.get("url"): + snap["url"] = urls[0][:200] + if not snap.get("detect_source"): + snap["detect_source"] = "cdp" + + vids = [v for v in (_extract_studio_video_id(u) for u in urls) if v] + if not vids and snap.get("url"): + v0 = _extract_studio_video_id(str(snap.get("url") or "")) + if v0: + vids = [v0] + + now = _time.time() + + # CDP DOM first — ground truth from the open Studio tab (read-only). Prefer poller cache. + if nid > 0 and urls: + try: + sig = _cdp_studio_page_signals(nid, max_age_sec=55.0) + except Exception: + sig = {} + if isinstance(sig, dict) and sig.get("ok"): + snap["live_page_open"] = True + if sig.get("url"): + snap["url"] = str(sig.get("url") or "")[:200] + snap["live_status"] = str(sig.get("live_status") or "") + snap["health"] = str(sig.get("health") or "") + if sig.get("viewer_count") is not None: + snap["viewer_count"] = sig.get("viewer_count") + if sig.get("total_views") is not None: + snap["total_views"] = sig.get("total_views") + if sig.get("live_duration"): + snap["live_duration"] = str(sig.get("live_duration") or "")[:16] + snap["live_duration_sec"] = sig.get("live_duration_sec") + snap["detect_source"] = "cdp_dom" + snap["received_at"] = now + snap["age_sec"] = 0.0 + if sig.get("on_air"): + snap["on_air"] = True + if not snap.get("live_status"): + snap["live_status"] = "live" + return snap + if str(sig.get("live_status") or "") in {"waiting", "ended", "signed_out"}: + snap["on_air"] = False + return snap + + if not vids: + return snap + + _bootstrap_studio_telemetry_from_disk() + for ev in _studio_events[:60]: + received = float(ev.get("received_at") or 0) + if received and (now - received) > max_age_sec: + continue + payload = ev.get("payload") if isinstance(ev.get("payload"), dict) else {} + url = str(payload.get("url") or "") + if not any(v in url for v in vids): + continue + if not _payload_stream_confirmed(payload): + if _payload_is_livestreaming(payload): + snap.setdefault("live_status", str(payload.get("live_status") or "")) + snap.setdefault("health", str(payload.get("health") or "")) + snap["viewer_count"] = payload.get("viewer_count") + snap["received_at"] = received + snap["age_sec"] = round(now - received, 1) if received else None + snap["detect_source"] = "cdp_telemetry_page" + continue + snap.update( + { + "on_air": True, + "live_page_open": True, + "live_status": str(payload.get("live_status") or "live"), + "health": str(payload.get("health") or ""), + "viewer_count": payload.get("viewer_count"), + "like_count": payload.get("like_count"), + "stream_title": str(payload.get("stream_title") or "")[:120], + "url": url[:200], + "received_at": received, + "age_sec": round(now - received, 1) if received else None, + "detect_source": "cdp_telemetry_match", + "neko_instance_id": nid, + } + ) + return snap + return snap + + +def _neko_ids_for_cdp_poll() -> list[int]: + """Assign groups that keep a Studio Neko warm (enabled + instance id).""" + ids: list[int] = [] + try: + from . import yt_assign_db + + for g in yt_assign_db.list_groups(include_urls=False): + if not g.get("neko_enabled"): + continue + try: + nid = int(g.get("neko_instance_id") or 0) + except (TypeError, ValueError): + nid = 0 + if nid > 0: + ids.append(nid) + except Exception: + return [] + return sorted(set(ids)) + + +def _ingest_cdp_signals(neko_id: int, sig: dict[str, Any]) -> dict[str, Any]: + """Turn a CDP scrape result into the same telemetry / minute-report path as the extension.""" + nid = int(neko_id or 0) + if nid < 1 or not isinstance(sig, dict) or not sig.get("ok"): + return {"ok": False, "skipped": True, "neko_instance_id": nid} + url = str(sig.get("url") or "") + live_status = str(sig.get("live_status") or "") + payload: dict[str, Any] = { + "neko_instance_id": nid, + "url": url[:400], + "live_status": live_status, + "health": str(sig.get("health") or ""), + "viewer_count": sig.get("viewer_count"), + "total_views": sig.get("total_views"), + "live_duration": str(sig.get("live_duration") or "")[:16], + "live_duration_sec": sig.get("live_duration_sec"), + "text": str(sig.get("text") or "")[:800], + "source": "cdp", + "signals": {"path": "/livestreaming"} if ("livestreaming" in url.lower() or live_status) else {}, + } + if sig.get("on_air") and not payload["live_status"]: + payload["live_status"] = "live" + return ingest_studio_telemetry(payload) + + +def poll_studio_cdp_once() -> dict[str, Any]: + """One host-side CDP pass over running Nekos. Never restarts Chrome / never recreates containers.""" + import time as _time + + ids = _neko_ids_for_cdp_poll() + polled: list[dict[str, Any]] = [] + for nid in ids: + try: + st = _container_state(nid, check_http=False) + if not st.get("running"): + polled.append({"neko_instance_id": nid, "skipped": "not_running"}) + continue + sig = _cdp_studio_page_signals(nid, force=True) + if isinstance(sig, dict) and sig.get("ok"): + ingest = _ingest_cdp_signals(nid, sig) + polled.append( + { + "neko_instance_id": nid, + "ok": True, + "on_air": bool(sig.get("on_air")), + "live_status": str(sig.get("live_status") or ""), + "viewer_count": sig.get("viewer_count"), + "ingested": bool(ingest.get("ok")), + } + ) + else: + polled.append( + { + "neko_instance_id": nid, + "ok": False, + "error": str((sig or {}).get("error") or "cdp_failed")[:120], + } + ) + except Exception as exc: + polled.append({"neko_instance_id": nid, "ok": False, "error": str(exc)[:160]}) + _time.sleep(1.2) + return {"ok": True, "count": len(polled), "polled": polled} + + +async def studio_cdp_poll_loop() -> None: + """Background ~55s CDP backup for Studio on-air + minute reports (extension primary).""" + import asyncio + + if str(os.environ.get("DY_DISABLE_STUDIO_CDP_LOOP") or "").strip().lower() in {"1", "true", "yes"}: + return + try: + await asyncio.sleep(50) + except asyncio.CancelledError: + raise + while True: + try: + await asyncio.wait_for(asyncio.to_thread(poll_studio_cdp_once), timeout=240) + except asyncio.CancelledError: + raise + except Exception: + pass + try: + await asyncio.sleep(_CDP_POLL_INTERVAL_SEC) + except asyncio.CancelledError: + raise diff --git a/backend/app/youtube_relay.py b/backend/app/youtube_relay.py index 80f2775..a5eef2e 100644 --- a/backend/app/youtube_relay.py +++ b/backend/app/youtube_relay.py @@ -346,6 +346,17 @@ class RelayPushSession: q.put(None) try: + try: + from . import egress_hub + + wrapped = egress_hub.wrap_ffmpeg_cmd(cmd) + if wrapped != cmd: + self.stats.recent_log.append( + f"[ffmpeg] egress proxychains mode={egress_hub.get_mode()}" + ) + cmd = wrapped + except Exception as exc: + self.stats.recent_log.append(f"[ffmpeg] egress wrap skipped: {exc}") self._proc = subprocess.Popen( cmd, stdin=subprocess.DEVNULL, diff --git a/backend/app/youtube_relay_pipeline.py b/backend/app/youtube_relay_pipeline.py index bdf198d..1ee11f6 100644 --- a/backend/app/youtube_relay_pipeline.py +++ b/backend/app/youtube_relay_pipeline.py @@ -40,14 +40,7 @@ def _time_slot_mode(cfg: dict[str, Any] | None = None) -> bool: def _group_in_active_slot(group_id: str, *, keyed_only: bool = False) -> bool: - sched = yt_assign_db.build_rotation_schedule(include_urls=False, keyed_only=keyed_only) - for c in sched.get("channels") or []: - if str(c.get("group_id") or "") == str(group_id): - return bool(c.get("active")) - # No schedule rows → treat as not active when keyed_only (nothing to rotate). - if keyed_only: - return False - return True + return yt_assign_db.group_in_rotation_slot(group_id, keyed_only=keyed_only) def pick_source_for_group( @@ -89,13 +82,8 @@ def pick_source_for_group( for row in rooms: if str(row.get("room_id") or "").strip() == prefer_rid: return _row_to_src(row) - # Monitor may briefly mark room offline while FFmpeg still has a valid pull. - if prefer_url: - return { - "source_url": prefer_url, - "room_id": prefer_rid, - "anchor_name": str(group.get("name") or prefer_rid).strip(), - } + # Slot mode: never reuse stale featured URL when monitor says offline. + # FFmpeg keep-alive on probe flake is handled in _ensure_group_relay_locked. for row in rooms: url = str(row.get("url") or "").strip() rid = str(row.get("room_id") or "").strip() @@ -202,8 +190,51 @@ class YoutubeRelayPipeline: lane_armed=gid in self._manual_hold or pipeline_enabled, time_slot_mode=_time_slot_mode(cfg), ) + receiving = bool(monitor.get("is_pushing")) if monitor.get("is_pushing"): pushing += 1 + # Drop stale DB rows that claim pushing while FFmpeg is gone. + raw_st = str(st.get("status") or "").lower() + armed = gid in self._manual_hold or pipeline_enabled + if not receiving and not running and raw_st in {"pushing", "streaming", "starting"}: + youtube_relay_db.upsert_relay_state( + gid, + status="idle", + ffmpeg_pid=0, + speed=0, + frame=0, + error="", + recent_log=st.get("recent_log") or [], + ) + elif not receiving: + err = str(st.get("error") or "") + raw_st2 = str(st.get("status") or "").lower() + if ( + err.startswith("非当前时段") + or err.startswith("时段外") + or raw_st2 == "outside_slot" + or "outside_slot" in str( + (st.get("recent_log") or [""])[-1] if isinstance(st.get("recent_log"), list) else "" + ) + ): + youtube_relay_db.upsert_relay_state( + gid, + status="outside_slot", + ffmpeg_pid=0, + error="", + recent_log=st.get("recent_log") or [], + ) + elif not armed: + if err.startswith("同频道备用 KEY") or "outside_slot" in str( + (st.get("recent_log") or [""])[-1] if isinstance(st.get("recent_log"), list) else "" + ): + youtube_relay_db.upsert_relay_state( + gid, + status="idle", + ffmpeg_pid=0, + error="", + recent_log=st.get("recent_log") or [], + ) neko_id = int(g.get("neko_instance_id") or 0) raw_neko = neko_by_id.get(neko_id) if neko_id > 0 else None neko_state = None @@ -216,6 +247,27 @@ class YoutubeRelayPipeline: "studio_url": raw_neko.get("studio_url"), "exists": bool(raw_neko.get("exists")), } + try: + snap = youtube_neko.studio_on_air_lookup(neko_id, max_age_sec=120.0) + neko_state["studio"] = { + "live_page_open": bool(snap.get("live_page_open")), + "on_air": bool(snap.get("on_air")), + "live_status": snap.get("live_status") or "", + "health": snap.get("health") or "", + "viewer_count": snap.get("viewer_count"), + "like_count": snap.get("like_count"), + "total_views": snap.get("total_views"), + "live_duration": snap.get("live_duration") or "", + "live_duration_sec": snap.get("live_duration_sec"), + "stream_title": snap.get("stream_title") or "", + "url": snap.get("url") or "", + "received_at": snap.get("received_at") or 0, + "age_sec": snap.get("age_sec"), + "detect_source": snap.get("detect_source") or "", + "minute_reports": snap.get("minute_reports") or [], + } + except Exception: + neko_state["studio"] = None # Trim log text for poll JSON (selected card still has enough to read). rl = monitor.get("recent_log") if isinstance(rl, str) and len(rl) > 3500: @@ -230,7 +282,15 @@ class YoutubeRelayPipeline: "name": g.get("name"), "channel_pk": g.get("channel_pk"), "enabled": bool(g.get("enabled")), - "status": "pushing" if running else str(st.get("status") or "idle"), + "status": ( + "pushing" + if receiving + else ( + "idle" + if raw_st in {"pushing", "streaming", "starting"} + else str(st.get("status") or "idle") + ) + ), "error": st.get("error") or "", "manual_hold": gid in self._manual_hold, "neko_instance_id": neko_id, @@ -444,20 +504,25 @@ class YoutubeRelayPipeline: if auto_on: from . import youtube_neko - # Time-slot: identify current winner once per tick. + # Time-slot: identify current winner once per tick (one group per YouTube channel). slot_winner_gid = "" slot_winner_g: dict[str, Any] | None = None if slot_mode and respect: - for g in groups: - gid0 = str(g.get("id") or "") - if not gid0 or not g.get("enabled"): - continue - if not (str(g.get("stream_key") or "").strip() or g.get("has_stream_key")): - continue - if _group_in_active_slot(gid0, keyed_only=True): - slot_winner_gid = gid0 - slot_winner_g = g - break + sched = yt_assign_db.build_rotation_schedule(include_urls=False, keyed_only=True) + active_ch = next((c for c in sched.get("channels") or [] if c.get("active")), None) + if active_ch: + candidate_ids = [str(active_ch.get("group_id") or "")] + candidate_ids.extend(str(x) for x in (active_ch.get("alias_group_ids") or []) if x) + candidate_ids = [g for g in candidate_ids if g and by_id.get(g)] + for gid0 in candidate_ids: + sess = self._sessions.get(gid0) + if sess and sess.stats.running: + slot_winner_gid = gid0 + slot_winner_g = by_id.get(gid0) + break + if not slot_winner_gid and candidate_ids: + slot_winner_gid = candidate_ids[0] + slot_winner_g = by_id.get(slot_winner_gid) for g in groups: gid = str(g.get("id") or "") @@ -467,19 +532,39 @@ class YoutubeRelayPipeline: continue if not str(g.get("stream_key") or "").strip() and not g.get("has_stream_key"): continue - # 时间段模式:非当前时段 → 停推流 + 停 Neko。 + # 时间段模式:非当前时段 → 停推流;仅在「单频道独占」时顺带停 Neko(物理机可常驻预热)。 if slot_mode and respect and gid != slot_winner_gid: - if gid in self._sessions: - await self._halt_session(gid, reason="outside_slot") - neko_id = int(g.get("neko_instance_id") or 0) - if neko_id > 0: - await asyncio.to_thread(youtube_neko.stop_instance, neko_id) - youtube_relay_db.upsert_relay_state( - gid, - status="idle", - error="非当前时段:已停推流并关闭 Neko", - recent_log=["[relay] outside_slot — ffmpeg+neko stopped"], + exclusive_on = bool(cfg.get("youtube_relay_exclusive_live", True)) + same_channel_as_winner = bool( + slot_winner_g and yt_assign_db.same_yt_channel(g, slot_winner_g) ) + in_active_slot = _group_in_active_slot(gid, keyed_only=True) + if same_channel_as_winner and in_active_slot: + if gid in self._sessions: + await self._halt_session(gid, reason="duplicate_channel_key") + neko_id = int(g.get("neko_instance_id") or 0) + if exclusive_on and neko_id > 0: + await asyncio.to_thread(youtube_neko.stop_instance, neko_id) + youtube_relay_db.upsert_relay_state( + gid, + status="paused_exclusive", + error=f"同频道备用 KEY:当前由 {slot_winner_g.get('name') if slot_winner_g else slot_winner_gid} 推流", + recent_log=["[relay] duplicate_yt_channel — paused"], + ) + continue + if not in_active_slot: + if gid in self._sessions: + await self._halt_session(gid, reason="outside_slot") + neko_id = int(g.get("neko_instance_id") or 0) + if exclusive_on and neko_id > 0: + await asyncio.to_thread(youtube_neko.stop_instance, neko_id) + youtube_relay_db.upsert_relay_state( + gid, + status="outside_slot", + error="", + recent_log=["[relay] outside_slot — waiting schedule window"], + ) + continue continue src = pick_source_for_group( g, @@ -530,26 +615,21 @@ class YoutubeRelayPipeline: await self.stop_group(gid) async def set_exclusive_live(self, enabled: bool) -> dict[str, Any]: + """Toggle hard exclusive (one FFmpeg + stop sibling Nekos). Independent of time-slot schedule.""" db.update_settings_map({"youtube_relay_exclusive_live": bool(enabled)}) if not enabled and (self._exclusive_winner or self._neko_paused_instances): - # 时间段模式强制独占,不允许关掉独占。 - if _time_slot_mode(): - db.update_settings_map({"youtube_relay_exclusive_live": True}) - st = await asyncio.to_thread(self.status) - st["note"] = "时间段模式已开启,单频道独占保持开启" - return st await self._release_exclusive_live() return await asyncio.to_thread(self.status) async def set_time_slot_mode(self, enabled: bool) -> dict[str, Any]: - """Enable 24/N keyed-channel slots + live Douyin sources + exclusive Neko/FFmpeg. + """Enable 24/N keyed-channel slots + live Douyin sources. - Does NOT turn on 自动推流 — operator must enable youtube_relay_enabled separately. + Does NOT force exclusive Neko/FFmpeg — operators on physical hosts may + keep multiple Studios warm. Does NOT turn on 自动推流. """ on = bool(enabled) patch: dict[str, Any] = {"youtube_relay_time_slot_mode": on} if on: - patch["youtube_relay_exclusive_live"] = True patch["youtube_relay_respect_schedule"] = True db.update_settings_map(patch) self._status_cache = None @@ -559,8 +639,7 @@ class YoutubeRelayPipeline: async def _enforce_exclusive_live(self, winner_gid: str, winner_group: dict[str, Any]) -> None: """When one channel actually pushes: stop other FFmpeg + Neko; keep winner Neko up.""" cfg = db.get_settings_map() - # 时间段模式始终独占;否则看开关。 - if not (_time_slot_mode(cfg) or bool(cfg.get("youtube_relay_exclusive_live", True))): + if not bool(cfg.get("youtube_relay_exclusive_live", True)): return winner_gid = str(winner_gid or "").strip() if not winner_gid: @@ -864,10 +943,11 @@ class YoutubeRelayPipeline: await self._enforce_exclusive_live(gid, group) - # Exclusive / time-slot: NEVER start FFmpeg until Studio Live Control Room is - # freshly open and settled. Skipping on stale telemetry causes YouTube green-loading. + # Exclusive: wait for Studio Live before FFmpeg. Without exclusive, only wait if this group's Neko is enabled. neko_id = int(group.get("neko_instance_id") or 0) - if neko_id > 0 and (_time_slot_mode(cfg) or bool(cfg.get("youtube_relay_exclusive_live", True))): + exclusive_on = bool(cfg.get("youtube_relay_exclusive_live", True)) + neko_gate = exclusive_on or bool(group.get("neko_enabled")) + if neko_id > 0 and neko_gate: from . import youtube_neko boot_log.append( diff --git a/backend/app/youtube_relay_status.py b/backend/app/youtube_relay_status.py index c190eb2..29280b3 100644 --- a/backend/app/youtube_relay_status.py +++ b/backend/app/youtube_relay_status.py @@ -191,10 +191,10 @@ def summarize_relay_group( business_note = "推流速度低于实时" elif session_running and (has_progress or healthy_speed) and (log_recent or healthy_speed): business_status = "streaming" - business_note = "正在推流到 YouTube" + business_note = "YouTube 正在接收推流" elif session_running and has_worker and log_recent and _has_any(tail, ("opening input", "opening output", "rtmps://", "starting ffmpeg", "quality=")): business_status = "relay_starting" - business_note = "FFmpeg 已启动,等待进度上报" + business_note = "FFmpeg 已连接,等待 YouTube 确认收流" elif session_running: business_status = "relay_starting" business_note = "推流进程运行中" @@ -218,6 +218,11 @@ def summarize_relay_group( else: business_status = "monitoring" business_note = "监听中,等待开播后自动推流" + elif raw_status == "outside_slot" or _has_any( + str(st.get("error") or "").lower(), ("非当前时段", "outside_slot", "时段外") + ): + business_status = "outside_slot" + business_note = str(st.get("error") or "时段外:等待本频道轮播窗口").strip() or "时段外:等待本频道轮播窗口" elif has_key and featured_urls and pipeline_enabled: business_status = "ready" business_note = "已配置,等待自动推流" @@ -225,8 +230,11 @@ def summarize_relay_group( business_status = "ready" business_note = "已配置(未推流)" - is_pushing = business_status in {"streaming", "relay_slow"} or ( - business_status == "source_stalled" and has_progress and has_worker + # YouTube 推流 = KEY 对应频道真正在收流;仅 FFmpeg 进程/DB 状态不算。 + is_pushing = bool( + session_running + and business_status in {"streaming", "relay_slow"} + and not _looks_like_youtube_key_rejected(tail) ) speed = latest.get("speed") diff --git a/backend/app/yt_assign_db.py b/backend/app/yt_assign_db.py index 5f141f4..da61947 100644 --- a/backend/app/yt_assign_db.py +++ b/backend/app/yt_assign_db.py @@ -498,12 +498,37 @@ def create_group( conn = _connect() try: ensure_yt_assign_tables(conn) + if ch_pk: + hit = conn.execute( + "SELECT id, name FROM yt_assign_groups WHERE channel_pk = ? LIMIT 1", + (ch_pk,), + ).fetchone() + if hit: + raise ValueError(f"该 Shorts 卡已分配给分组「{hit['name'] or hit['id']}」") + if yt_id: + hit = conn.execute( + "SELECT id, name FROM yt_assign_groups WHERE youtube_channel_id = ? LIMIT 1", + (yt_id,), + ).fetchone() + if hit: + raise ValueError( + f"YouTube 频道 {yt_id} 已分配给分组「{hit['name'] or hit['id']}」" + ) max_ord = conn.execute("SELECT COALESCE(MAX(sort_order), 0) AS m FROM yt_assign_groups").fetchone() sort_order = int(max_ord["m"] if max_ord else 0) + 1 max_neko = conn.execute( "SELECT COALESCE(MAX(neko_instance_id), 0) AS m FROM yt_assign_groups" ).fetchone() - neko_instance_id = int(max_neko["m"] if max_neko else 0) + 1 + from . import youtube_neko as _yn + + next_id = int(max_neko["m"] if max_neko else 0) + 1 + cap = int(_yn._max_instances()) + if next_id > cap: + raise ValueError( + f"Neko 实例已达上限 {cap}(DY_NEKO_MAX_INSTANCES / 边缘反代容量)。" + "请删除闲置分组或提高上限并同步边缘 /neko 路由。" + ) + neko_instance_id = next_id conn.execute( """ INSERT INTO yt_assign_groups( @@ -535,7 +560,11 @@ def create_group( try: from . import youtube_neko - neko_sync = youtube_neko.sync_for_groups(list_groups(include_urls=False)) + # Never reconcile_running here — would stop exclusive-live Studio browsers. + neko_sync = youtube_neko.sync_for_groups( + list_groups(include_urls=False), + reconcile_running=False, + ) if not neko_sync.get("ok"): db.add_event( kind="ops", @@ -606,10 +635,11 @@ def update_group(group_id: str, **fields: Any) -> dict[str, Any]: if "channel_pk" in patch and patch["channel_pk"]: ch = db.get_shorts_channel(str(patch["channel_pk"])) if ch: + yt_from_ch = str(ch.get("youtube_channel_id") or "").strip() + if yt_from_ch: + patch["youtube_channel_id"] = yt_from_ch[:64] if "name" not in patch or not patch.get("name"): patch["name"] = str(ch.get("name") or patch.get("name") or "")[:120] - if "youtube_channel_id" not in patch or not patch.get("youtube_channel_id"): - patch["youtube_channel_id"] = str(ch.get("youtube_channel_id") or "")[:64] if not patch: g = get_group(group_id) @@ -640,7 +670,12 @@ def update_group(group_id: str, **fields: Any) -> dict[str, Any]: try: from . import youtube_neko - youtube_neko.sync_for_groups(list_groups(include_urls=False)) + # Never reconcile_running — exclusive-live / time-slot may leave + # winner running with neko_enabled=0 and siblings flagged enabled. + youtube_neko.sync_for_groups( + list_groups(include_urls=False), + reconcile_running=False, + ) except Exception: pass return group @@ -662,7 +697,8 @@ def delete_group(group_id: str) -> dict[str, Any]: try: from . import youtube_neko - youtube_neko.sync_for_groups(list_groups(include_urls=False)) + # Do not stop siblings — deleted group's container can linger until manual stop. + youtube_neko.sync_for_groups(list_groups(include_urls=False), reconcile_running=False) except Exception: pass return result @@ -1468,6 +1504,109 @@ def _group_has_stream_key(g: dict[str, Any]) -> bool: return bool(str(g.get("stream_key") or "").strip()) +def _group_yt_channel_key(g: dict[str, Any]) -> str: + """Stable YouTube channel identity for time-slot dedupe (not per stream key / assign group).""" + meta = _group_yt_channel_meta(g) + if meta.get("youtube_channel_id"): + return f"yt:{meta['youtube_channel_id']}" + pk = str(g.get("channel_pk") or "").strip() + if pk: + return f"pk:{pk}" + return f"gid:{str(g.get('id') or '').strip()}" + + +def _group_yt_channel_meta(g: dict[str, Any]) -> dict[str, str]: + """Resolve YouTube channel id + display name from linked Shorts channel (source of truth).""" + pk = str(g.get("channel_pk") or "").strip() + yt = "" + name = str(g.get("name") or "").strip() + if pk: + try: + from . import db as _db + + ch = _db.get_shorts_channel(pk) + if ch: + yt = str(ch.get("youtube_channel_id") or "").strip() + name = str(ch.get("name") or name).strip() + except Exception: + pass + if not yt: + yt = str(g.get("youtube_channel_id") or "").strip() + return {"youtube_channel_id": yt, "display_name": name or str(g.get("name") or "")} + + +def same_yt_channel(a: dict[str, Any], b: dict[str, Any]) -> bool: + ka = _group_yt_channel_key(a) + kb = _group_yt_channel_key(b) + return bool(ka and kb and ka == kb) + + +def _pick_canonical_group(groups: list[dict[str, Any]]) -> dict[str, Any]: + """When multiple assign rows share one YouTube channel, pick one schedule row.""" + return min( + groups, + key=lambda g: ( + int(g.get("sort_order") or 0), + 0 if g.get("neko_enabled") else 1, + str(g.get("id") or ""), + ), + ) + + +def _dedupe_groups_by_yt_channel(groups: list[dict[str, Any]]) -> list[tuple[dict[str, Any], list[str]]]: + buckets: dict[str, list[dict[str, Any]]] = {} + order: list[str] = [] + for g in groups: + key = _group_yt_channel_key(g) + if key not in buckets: + buckets[key] = [] + order.append(key) + buckets[key].append(g) + out: list[tuple[dict[str, Any], list[str]]] = [] + for key in order: + gs = buckets[key] + canonical = _pick_canonical_group(gs) + cid = str(canonical.get("id") or "") + aliases = [str(g.get("id") or "") for g in gs if str(g.get("id") or "") and str(g.get("id") or "") != cid] + out.append((canonical, aliases)) + out.sort(key=lambda pair: (int(pair[0].get("sort_order") or 0), str(pair[0].get("name") or ""))) + return out + + +def group_in_rotation_slot(group_id: str, *, keyed_only: bool | None = None) -> bool: + """True when this assign group's YouTube channel is in the active 24/N window.""" + gid = str(group_id or "").strip() + if not gid: + return False + g = get_group(gid) + if not g or not g.get("enabled"): + return False + if keyed_only is None: + try: + from . import db as _db + + keyed_only = bool(_db.get_settings_map().get("youtube_relay_time_slot_mode")) + except Exception: + keyed_only = False + if keyed_only and not _group_has_stream_key(g): + return False + ch_key = _group_yt_channel_key(g) + sched = build_rotation_schedule(include_urls=False, keyed_only=keyed_only) + for c in sched.get("channels") or []: + if str(c.get("group_id") or "") == gid or gid in [str(x) for x in (c.get("alias_group_ids") or [])]: + return bool(c.get("active")) + slot_key = _group_yt_channel_key( + { + "youtube_channel_id": c.get("youtube_channel_id"), + "channel_pk": c.get("channel_pk"), + "id": c.get("group_id"), + } + ) + if slot_key == ch_key: + return bool(c.get("active")) + return False if keyed_only else True + + def build_rotation_schedule( *, include_urls: bool = True, @@ -1476,7 +1615,8 @@ def build_rotation_schedule( ) -> dict[str, Any]: """24h Beijing rotation: N channels → 24/N hours each, no overlap. - keyed_only=True (时间段模式): only enabled groups that have a YouTube stream key. + keyed_only=True (时间段模式): enabled groups with a stream key, deduped by YouTube channel + (same channel + different keys still counts as one slot; keys may be wrong/backups). """ if groups is None: raw = list_groups(include_urls=include_urls) @@ -1491,8 +1631,11 @@ def build_rotation_schedule( keyed_only = False enabled = [g for g in raw if g.get("enabled")] if keyed_only: - enabled = [g for g in enabled if _group_has_stream_key(g)] - n = len(enabled) + keyed = [g for g in enabled if _group_has_stream_key(g)] + rotation_rows = _dedupe_groups_by_yt_channel(keyed) + else: + rotation_rows = [(g, []) for g in enabled] + n = len(rotation_rows) now_h = _beijing_hour_fraction() if n == 0: return { @@ -1507,7 +1650,7 @@ def build_rotation_schedule( } slot_h = 24.0 / n channels: list[dict[str, Any]] = [] - for i, g in enumerate(enabled): + for i, (g, alias_ids) in enumerate(rotation_rows): start_h = i * slot_h end_h = (i + 1) * slot_h active = start_h <= now_h < end_h if end_h <= 24 else (now_h >= start_h or now_h < (end_h % 24)) @@ -1528,13 +1671,16 @@ def build_rotation_schedule( "window_hours": round(sub_h, 2), } ) + meta = _group_yt_channel_meta(g) channels.append( { "group_id": g.get("id"), - "name": g.get("name"), + "name": meta.get("display_name") or g.get("name"), "channel_pk": g.get("channel_pk"), - "youtube_channel_id": g.get("youtube_channel_id"), + "youtube_channel_id": meta.get("youtube_channel_id") or g.get("youtube_channel_id"), + "yt_channel_key": _group_yt_channel_key(g), "has_stream_key": _group_has_stream_key(g), + "alias_group_ids": alias_ids, "start_hour": round(start_h, 3), "end_hour": round(end_h, 3), "start_label": _fmt_hour(start_h), diff --git a/backend/app/yt_long_monetize.py b/backend/app/yt_long_monetize.py index a8a4bd9..78f7a14 100644 --- a/backend/app/yt_long_monetize.py +++ b/backend/app/yt_long_monetize.py @@ -122,12 +122,23 @@ async def fetch_channel_ypp_status( *, access_token: str, proxy_url: str = "", + youtube_channel_id: str = "", ) -> dict[str, Any]: - """Return {ypp: bool, channel_id, raw_status} for the authorized account.""" + """Return {ypp: bool, channel_id, raw_status} for the authorized account. + + Prefer explicit youtube_channel_id (multi-brand accounts); fall back to mine=true. + """ + yt_id = str(youtube_channel_id or "").strip() + params: dict[str, Any] = {"part": "id,status,snippet"} + if yt_id: + params["id"] = yt_id + else: + params["mine"] = "true" + async with httpx.AsyncClient(**_client_kwargs(timeout=45.0, proxy_url=proxy_url)) as client: resp = await client.get( "https://www.googleapis.com/youtube/v3/channels", - params={"part": "id,status,snippet", "mine": "true"}, + params=params, headers={"Authorization": f"Bearer {access_token}"}, ) data = resp.json() if resp.content else {} @@ -135,10 +146,22 @@ async def fetch_channel_ypp_status( err = ((data.get("error") or {}).get("message") if isinstance(data, dict) else None) or resp.text[:200] return {"ok": False, "ypp": False, "error": str(err)[:300]} items = data.get("items") or [] + if not items and yt_id: + resp2 = await client.get( + "https://www.googleapis.com/youtube/v3/channels", + params={"part": "id,status,snippet", "mine": "true"}, + headers={"Authorization": f"Bearer {access_token}"}, + ) + data = resp2.json() if resp2.content else {} + if resp2.status_code >= 400: + err = ((data.get("error") or {}).get("message") if isinstance(data, dict) else None) or resp2.text[:200] + return {"ok": False, "ypp": False, "error": str(err)[:300]} + items = data.get("items") or [] if not items: return {"ok": False, "ypp": False, "error": "no_channel"} item = items[0] st = item.get("status") or {} + # Field only present for owners; missing → treat as not monetized (not "unknown"). ypp = bool(st.get("isChannelMonetizationEnabled")) return { "ok": True, @@ -415,18 +438,54 @@ async def ensure_ypp_and_monetize( return out +def _persist_ypp_for_shorts(*, shorts_pk: str, ypp: bool, youtube_channel_id: str = "") -> str: + """Write ypp_ok onto Shorts row + linked yt_long (sync from Shorts if missing).""" + from . import db as appdb + from . import yt_long_db as yldb + + pk = str(shorts_pk or "").strip() + if not pk: + return "" + now = time.time() + yt_id = str(youtube_channel_id or "").strip() + # Source of truth for UI badges: shorts_channels (always present after OAuth). + try: + sc_patch: dict[str, Any] = {"ypp_ok": 1 if ypp else 0, "ypp_checked_at": now} + if yt_id: + sc_patch["youtube_channel_id"] = yt_id + appdb.update_shorts_channel(pk, **sc_patch) + except Exception: + pass + row = yldb.get_yt_long_by_shorts_pk(pk) + if not row: + try: + yldb.sync_channels_from_shorts() + except Exception: + pass + row = yldb.get_yt_long_by_shorts_pk(pk) + long_id = str((row or {}).get("id") or "").strip() + if not long_id: + return "" + patch: dict[str, Any] = { + "ypp_ok": 1 if ypp else 0, + "ypp_checked_at": now, + } + if yt_id: + patch["youtube_channel_id"] = yt_id + yldb.update_yt_long_channel(long_id, **patch) + return long_id + + async def refresh_ypp_for_shorts_channel(shorts_pk: str) -> dict[str, Any]: """Probe YPP via OAuth and update linked yt_long_channels row.""" from . import db as appdb - from . import yt_long_db as yldb from .shorts_oauth import channel_oauth_creds pk = str(shorts_pk or "").strip() if not pk: return {"ok": False, "error": "no_pk"} - row = yldb.get_yt_long_by_shorts_pk(pk) ch = appdb.get_shorts_channel(pk) or {} - creds = channel_oauth_creds(ch if ch else (row or {})) + creds = channel_oauth_creds(ch) if not (creds.get("refresh_token") and creds.get("client_id") and creds.get("client_secret")): return {"ok": False, "error": "no_oauth", "shorts_pk": pk} try: @@ -437,25 +496,23 @@ async def refresh_ypp_for_shorts_channel(shorts_pk: str) -> dict[str, Any]: ) except Exception as exc: return {"ok": False, "error": f"token:{exc}"[:200], "shorts_pk": pk} - info = await fetch_channel_ypp_status(access_token=access) + known_yt = str(ch.get("youtube_channel_id") or "").strip() + try: + info = await fetch_channel_ypp_status(access_token=access, youtube_channel_id=known_yt) + except Exception as exc: + return {"ok": False, "error": f"probe:{exc}"[:200], "shorts_pk": pk} ypp = bool(info.get("ypp")) - yt_id = str(info.get("channel_id") or ch.get("youtube_channel_id") or "").strip() - long_id = str((row or {}).get("id") or "").strip() - if long_id and info.get("ok"): - patch: dict[str, Any] = { - "ypp_ok": 1 if ypp else 0, - "ypp_checked_at": time.time(), - } - if yt_id: - patch["youtube_channel_id"] = yt_id - yldb.update_yt_long_channel(long_id, **patch) + yt_id = str(info.get("channel_id") or known_yt).strip() + long_id = "" + if info.get("ok"): + long_id = _persist_ypp_for_shorts(shorts_pk=pk, ypp=ypp, youtube_channel_id=yt_id) return { "ok": bool(info.get("ok")), "ypp": ypp, "shorts_pk": pk, "yt_long_pk": long_id, "youtube_channel_id": yt_id, - "error": info.get("error"), + "error": info.get("error") if not info.get("ok") else ("" if long_id else "no_yt_long_row"), } @@ -469,9 +526,14 @@ async def refresh_all_ypp_from_shorts(*, limit: int = 50) -> dict[str, Any]: for ch in rows[: max(1, min(limit, 200))]: if not str(ch.get("refresh_token") or "").strip(): continue - if not yldb.get_yt_long_by_shorts_pk(str(ch.get("id") or "")): - continue - r = await refresh_ypp_for_shorts_channel(str(ch.get("id") or "")) + # Ensure yt_long mirror exists; persist still writes shorts.ypp_ok even if missing. + pk = str(ch.get("id") or "") + if not yldb.get_yt_long_by_shorts_pk(pk): + try: + yldb.sync_channels_from_shorts() + except Exception: + pass + r = await refresh_ypp_for_shorts_channel(pk) results.append(r) if r.get("ypp"): ypp_count += 1 diff --git a/backend/app/yt_long_upload.py b/backend/app/yt_long_upload.py index 1e3b010..07eca5b 100644 --- a/backend/app/yt_long_upload.py +++ b/backend/app/yt_long_upload.py @@ -42,7 +42,12 @@ async def upload_youtube_long_mp4( raise ValueError("成片文件不存在") from exc # No #Shorts — this is a normal YouTube watch video (9:16 vertical by default). - clean_title = (title or "Live clip").replace("#Shorts", "").replace("#shorts", "").strip()[:100] + # Strip <> — YouTube API rejects them (invalidTitle); caption pool may contain ">". + import re + + clean_title = (title or "Live clip").replace("#Shorts", "").replace("#shorts", "").strip() + clean_title = re.sub(r"[<>]+", " ", clean_title) + clean_title = re.sub(r"\s+", " ", clean_title).strip()[:100] meta = { "snippet": { "title": clean_title or "Live clip", diff --git a/backend/neko/browser-launch.sh b/backend/neko/browser-launch.sh new file mode 100644 index 0000000..e8f9393 --- /dev/null +++ b/backend/neko/browser-launch.sh @@ -0,0 +1,504 @@ +#!/bin/sh +set -eu + +family="${1:-chromium}" +start_url="${NEKO_START_URL:-about:blank}" +arch="$(uname -m 2>/dev/null || echo unknown)" +DISPLAY="${DISPLAY:-${ENV_DISPLAY:-:99.0}}" +export DISPLAY + +prune_path() { + target="${1:-}" + [ -n "$target" ] || return 0 + [ -e "$target" ] || [ -L "$target" ] || return 0 + rm -rf "$target" 2>/dev/null || true +} + +ensure_writable_dir() { + target="${1:-}" + [ -n "$target" ] || return 0 + mkdir -p "$target" 2>/dev/null || true + chmod u+rwX "$target" 2>/dev/null || true +} + +repair_profile_runtime() { + mkdir -p "$profile_dir" 2>/dev/null || true + prune_path "$profile_dir/SingletonCookie" + prune_path "$profile_dir/SingletonLock" + prune_path "$profile_dir/SingletonSocket" + prune_path "$profile_dir/SingletonStartupLock" + prune_path "$profile_dir/lockfile" + prune_path "$profile_dir/DevToolsActivePort" + prune_path "$profile_dir/BrowserMetrics" + prune_path "$profile_dir/Crash Reports" + prune_path "$profile_dir/Crashpad" + prune_path "$profile_dir/ShaderCache" + prune_path "$profile_dir/GrShaderCache" + prune_path "$profile_dir/GraphiteDawnCache" + prune_path "$profile_dir/Default/Cache" + prune_path "$profile_dir/Default/Code Cache" + prune_path "$profile_dir/Default/GPUCache" + prune_path "$profile_dir/Default/DawnGraphiteCache" + prune_path "$profile_dir/Default/DawnWebGPUCache" + ensure_writable_dir "$profile_dir" + ensure_writable_dir "$profile_dir/Default" + ensure_writable_dir "$profile_dir/Crash Reports/pending" + ensure_writable_dir "$profile_dir/Default/WebStorage/3/IndexedDB" + ensure_writable_dir "$profile_dir/Default/IndexedDB" + ensure_writable_dir "$profile_dir/Default/Service Worker" + ensure_writable_dir "$profile_dir/Default/Service Worker/CacheStorage" + ensure_writable_dir "$profile_dir/Default/Local Extension Settings" + ensure_writable_dir "$profile_dir/Default/Managed Extension Settings" + chmod -R u+rwX "$profile_dir" 2>/dev/null || true +} + +ensure_profile_preferences() { + if ! command -v python3 >/dev/null 2>&1; then + return 0 + fi + mkdir -p "$profile_dir/Default" + PROFILE_DIR="$profile_dir" python3 - <<'PY' +import json +import os +from pathlib import Path + +profile_dir = Path(os.environ["PROFILE_DIR"]) + +def load_json(path: Path) -> dict: + if path.exists(): + try: + return json.loads(path.read_text(encoding="utf-8")) + except Exception: + return {} + return {} + +def save_json(path: Path, data: dict) -> None: + path.parent.mkdir(parents=True, exist_ok=True) + path.write_text( + json.dumps(data, ensure_ascii=False, separators=(",", ":")), + encoding="utf-8", + ) + +for relative_path in ("Default/Preferences", "Local State"): + path = profile_dir / relative_path + data = load_json(path) + extensions = data.setdefault("extensions", {}) + ui = extensions.setdefault("ui", {}) + ui["developer_mode"] = True + profile = data.setdefault("profile", {}) + profile["exit_type"] = "Normal" + save_json(path, data) +PY +} + +managed_policies_enabled() { + case "${NEKO_MANAGED_POLICIES:-1}" in + 1|true|TRUE|yes|YES|on|ON|enable|enabled) + return 0 + ;; + *) + return 1 + ;; + esac +} + +copy_seed_dir_if_missing() { + src="${1:-}" + dst="${2:-}" + marker="${3:-}" + [ -d "$src" ] || return 0 + if [ -e "$dst" ]; then + if [ -z "$marker" ] || grep -R -a -q "$marker" "$dst" 2>/dev/null; then + return 0 + fi + rm -rf "$dst" 2>/dev/null || true + fi + mkdir -p "$(dirname "$dst")" + cp -a "$src" "$dst" 2>/dev/null || true + rm -f "$dst/LOCK" 2>/dev/null || true + chmod -R u+rwX "$dst" 2>/dev/null || true +} + +seed_tampermonkey_storage_if_missing() { + src="${1:-}" + dst="${2:-}" + [ -d "$src" ] || return 0 + grep -R -a -q "YouTube Studio Auto Dismiss" "$src" 2>/dev/null || return 0 + if [ -d "$dst" ]; then + if grep -R -a -q "YouTube Studio Auto Dismiss" "$dst" 2>/dev/null; then + chmod -R u+rwX "$dst" 2>/dev/null || true + return 0 + fi + case "${NEKO_TAMPERMONKEY_REPAIR:-1}" in + 1|true|TRUE|yes|YES|on|ON|enable|enabled) + rm -rf "$dst" 2>/dev/null || true + ;; + *) + return 0 + ;; + esac + fi + mkdir -p "$(dirname "$dst")" + cp -a "$src" "$dst" 2>/dev/null || true + rm -f "$dst/LOCK" 2>/dev/null || true + chmod -R u+rwX "$dst" 2>/dev/null || true +} + +sync_tampermonkey_preferences() { + seed_preferences="${seed_dir}/Default/Preferences" + [ -f "$seed_preferences" ] || return 0 + command -v python3 >/dev/null 2>&1 || return 0 + SEED_PREFERENCES="$seed_preferences" PROFILE_DIR="$profile_dir" python3 - <<'PY' +import json +import os +from pathlib import Path + +ext_id = "dhdgffkkebhmkfjojejmpbldmpobfkfo" +seed_preferences = Path(os.environ["SEED_PREFERENCES"]) +profile_dir = Path(os.environ["PROFILE_DIR"]) +target_preferences = profile_dir / "Default" / "Preferences" +ext_root = profile_dir / "Default" / "Extensions" / ext_id + +def load(path: Path) -> dict: + if not path.exists(): + return {} + try: + return json.loads(path.read_text(encoding="utf-8")) + except Exception: + return {} + +def installed_versions(root: Path) -> list[str]: + if not root.is_dir(): + return [] + out = [] + for child in root.iterdir(): + if child.is_dir() and (child / "manifest.json").is_file(): + out.append(child.name) + return sorted(out) + +def version_from_path(path_value: str) -> str: + path_value = (path_value or "").strip() + if not path_value: + return "" + return path_value.split("/")[-1] + +seed = load(seed_preferences) +source = seed.get("extensions", {}).get("settings", {}).get(ext_id) +if not isinstance(source, dict): + raise SystemExit(0) +target = load(target_preferences) +settings = target.setdefault("extensions", {}).setdefault("settings", {}) +current = settings.get(ext_id) +installed = installed_versions(ext_root) + +def should_replace_current(value: object) -> bool: + if not isinstance(value, dict): + return True + if value.get("state") != 1: + return True + registered = version_from_path(str(value.get("path") or "")) + if registered and registered in installed: + return False + if installed: + return False + return True + +if should_replace_current(current): + settings[ext_id] = source + current = settings[ext_id] + +if isinstance(current, dict) and installed: + registered = version_from_path(str(current.get("path") or "")) + chosen = registered if registered in installed else installed[-1] + current["path"] = f"{ext_id}/{chosen}" + current["state"] = 1 + +target_preferences.parent.mkdir(parents=True, exist_ok=True) +target_preferences.write_text(json.dumps(target, ensure_ascii=False, separators=(",", ":")), encoding="utf-8") +PY +} + +ensure_tampermonkey_seed() { + seed_dir="${NEKO_TAMPERMONKEY_SEED_DIR:-/etc/neko/tampermonkey-seed}" + ext_id="dhdgffkkebhmkfjojejmpbldmpobfkfo" + [ -d "$seed_dir/Default" ] || return 0 + mkdir -p "$profile_dir/Default" + copy_seed_dir_if_missing \ + "$seed_dir/Default/Extensions/$ext_id" \ + "$profile_dir/Default/Extensions/$ext_id" \ + "Tampermonkey" + seed_tampermonkey_storage_if_missing \ + "$seed_dir/Default/Local Extension Settings/$ext_id" \ + "$profile_dir/Default/Local Extension Settings/$ext_id" + chown -R neko:neko "$profile_dir/Default/Local Extension Settings" "$profile_dir/Default/Managed Extension Settings" 2>/dev/null || true + sync_tampermonkey_preferences +} + +find_bin() { + if [ "$family" = "google-chrome" ]; then + command -v google-chrome 2>/dev/null || command -v google-chrome-stable 2>/dev/null || true + else + command -v chromium 2>/dev/null || command -v chromium-browser 2>/dev/null || true + fi +} + +browser_bin="$(find_bin)" +if [ -z "$browser_bin" ]; then + exit 0 +fi + +profile_dir="/home/neko/.config/chromium" +if [ "$family" = "google-chrome" ]; then + profile_dir="/home/neko/.config/google-chrome" +fi + +render_mode="${NEKO_BROWSER_RENDER_MODE:-auto}" +render_flags="--disable-gpu --disable-gpu-compositing --disable-software-rasterizer --disable-features=UseSkiaRenderer,Vulkan,VizDisplayCompositor,CanvasOopRasterization --disable-vulkan" +case "$render_mode" in + auto) + render_flags="--disable-gpu --disable-gpu-compositing --disable-software-rasterizer --disable-features=UseSkiaRenderer,Vulkan,VizDisplayCompositor,CanvasOopRasterization --disable-vulkan --disable-zero-copy --disable-accelerated-2d-canvas --disable-accelerated-video-decode --disable-accelerated-video-encode" + ;; + gpu) + render_flags="" + ;; + legacy|x11|disable-gpu) + render_flags="--disable-gpu --disable-gpu-compositing --disable-software-rasterizer --disable-features=UseSkiaRenderer,VizDisplayCompositor,CanvasOopRasterization" + ;; + software|swiftshader) + render_flags="--disable-gpu --use-gl=swiftshader --enable-unsafe-swiftshader --disable-features=UseSkiaRenderer,Vulkan,VizDisplayCompositor --disable-vulkan" + ;; +esac + +sandbox_flags="" +if [ "$(id -u 2>/dev/null || echo 0)" = "0" ]; then + sandbox_flags="--no-sandbox --disable-setuid-sandbox" +fi + +proxy_flags="" +quic_flags="" +case "${NEKO_BROWSER_PROXY:-}" in + ""|0|false|FALSE|off|OFF|none|NONE|direct|DIRECT) + ;; + *invalid*|*invalid\ IP*|*host-gateway*) + ;; + http://*|https://*) + proxy_bypass="${NEKO_BROWSER_PROXY_BYPASS:-<-loopback>;localhost;127.0.0.1;::1;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;192.168.*;*.local;host.docker.internal}" + proxy_flags="--proxy-server=${NEKO_BROWSER_PROXY} --proxy-bypass-list=${proxy_bypass}" + # Avoid Google login cancel when HTTP goes via proxy but WebRTC STUN leaks LAN/Docker IP. + quic_flags="--disable-quic --force-webrtc-ip-handling-policy=disable_non_proxied_udp --disable-features=WebRtcAllowInputVolumeAdjustment" + ;; +esac + +extension_flags="" +case "${NEKO_LIVE_OPS_EXTENSION:-1}" in + 0|false|FALSE|off|OFF|disable|disabled) + ;; + *) + live_ops_extension_dir="${NEKO_LIVE_OPS_EXTENSION_DIR:-/etc/neko/live-ops-extension}" + if [ -f "$live_ops_extension_dir/manifest.json" ]; then + extension_flags="--load-extension=${live_ops_extension_dir}" + fi + ;; +esac + +mkdir -p "${HOME:-/home/neko}/.local/share/icons/hicolor" 2>/dev/null || true + +browser_class="google-chrome" +if [ "$family" != "google-chrome" ]; then + browser_class="chromium" +fi + +profile_has_session() { + for candidate in \ + "$profile_dir/Default/Last Session" \ + "$profile_dir/Default/Current Session" \ + "$profile_dir/Default/Last Tabs" + do + if [ -f "$candidate" ]; then + return 0 + fi + done + if [ -d "$profile_dir/Default/Sessions" ] && [ -n "$(ls -A "$profile_dir/Default/Sessions" 2>/dev/null || true)" ]; then + return 0 + fi + return 1 +} + +launch_browser() { + launch_url="" + launch_window_flag="--new-window" + if profile_has_session; then + launch_url="" + launch_window_flag="" + elif [ -n "$start_url" ] && [ "$start_url" != "about:blank" ]; then + launch_url="$start_url" + fi + + set -- "$browser_bin" \ + ${render_flags} \ + ${proxy_flags} \ + ${quic_flags} \ + ${extension_flags} \ + ${sandbox_flags} \ + --window-position=0,0 \ + --display="${DISPLAY}" \ + --remote-debugging-address=127.0.0.1 \ + --remote-debugging-port=9222 \ + --user-data-dir="$profile_dir" \ + --password-store=basic \ + --no-first-run \ + --start-maximized \ + --disable-background-mode \ + --disable-dev-shm-usage \ + --disable-breakpad \ + --disable-default-apps \ + --disable-translate \ + --metrics-recording-only \ + --no-default-browser-check + if [ -n "$launch_window_flag" ]; then + set -- "$@" "$launch_window_flag" + fi + if [ -n "$launch_url" ]; then + set -- "$@" "$launch_url" + fi + "$@" & + browser_pid=$! +} + +visible_window_count() { + if ! command -v xdotool >/dev/null 2>&1; then + return 1 + fi + DISPLAY="${DISPLAY:?DISPLAY is required}" xdotool search --onlyvisible --class "$browser_class" 2>/dev/null | wc -l | tr -d ' ' +} + +devtools_ready() { + if command -v curl >/dev/null 2>&1; then + curl -fsS --max-time 1 http://127.0.0.1:9222/json/version >/dev/null 2>&1 && return 0 + fi + if command -v wget >/dev/null 2>&1; then + wget -q -T 1 -O /dev/null http://127.0.0.1:9222/json/version >/dev/null 2>&1 && return 0 + fi + return 1 +} + +browser_healthy() { + window_count="$(visible_window_count || true)" + if [ -n "${window_count:-}" ] && [ "$window_count" -gt 0 ] 2>/dev/null; then + return 0 + fi + devtools_ready +} + +focus_live_studio_tab_once() { + case "${NEKO_FOCUS_LIVE_TAB:-1}" in + 0|false|FALSE|off|OFF|disable|disabled) + return 0 + ;; + esac + command -v python3 >/dev/null 2>&1 || return 0 + python3 - <<'PY' +import json +import time +import urllib.request + +def fetch_tabs(): + with urllib.request.urlopen("http://127.0.0.1:9222/json/list", timeout=3) as resp: + return json.loads(resp.read().decode("utf-8", "replace")) + +for _ in range(40): + try: + tabs = fetch_tabs() + break + except Exception: + time.sleep(1) +else: + raise SystemExit(0) + +def is_live(url: str) -> bool: + return "studio.youtube.com" in url and "livestreaming" in url + +def is_junk(url: str) -> bool: + return any( + x in url + for x in ( + "tampermonkey.net/changelog", + "tampermonkey.net/installed", + "accounts.google.com/ServiceLogin", + "accounts.google.com/v3/signin", + "accounts.google.com/accountchooser", + "accounts.google.com/RotateCookiesPage", + ) + ) + +live = [t for t in tabs if is_live(t.get("url") or "")] +for tab in tabs: + if not is_junk(tab.get("url") or ""): + continue + tid = tab.get("id") + if not tid: + continue + try: + urllib.request.urlopen(f"http://127.0.0.1:9222/json/close/{tid}", timeout=2) + except Exception: + pass + +if not live: + raise SystemExit(0) + +target = live[0] +tid = target.get("id") +if not tid: + raise SystemExit(0) +try: + urllib.request.urlopen(f"http://127.0.0.1:9222/json/activate/{tid}", timeout=2) +except Exception: + pass +PY +} + +restart_delay="${NEKO_BROWSER_RESTART_DELAY:-2}" +while :; do + repair_profile_runtime + ensure_tampermonkey_seed + ensure_profile_preferences + launch_browser + + seen_window=0 + focused_live_tab=0 + startup_misses=0 + closed_misses=0 + while kill -0 "$browser_pid" 2>/dev/null; do + if browser_healthy; then + if [ "$focused_live_tab" -eq 0 ]; then + focus_live_studio_tab_once || true + focused_live_tab=1 + fi + seen_window=1 + startup_misses=0 + closed_misses=0 + else + if [ "$seen_window" -eq 0 ]; then + startup_misses=$((startup_misses + 1)) + if [ "$startup_misses" -ge 15 ]; then + echo "Chromium did not expose a visible window or DevTools endpoint; restarting" + kill -TERM "$browser_pid" 2>/dev/null || true + break + fi + else + closed_misses=$((closed_misses + 1)) + if [ "$closed_misses" -ge 3 ]; then + echo "Chromium health check failed after startup; restarting" + kill -TERM "$browser_pid" 2>/dev/null || true + break + fi + fi + fi + sleep 2 + done + + browser_rc=0 + wait "$browser_pid" 2>/dev/null || browser_rc=$? + echo "Chromium exited with status ${browser_rc}; restarting in ${restart_delay}s" + sleep "$restart_delay" +done diff --git a/backend/neko/cdp_studio_scrape.py b/backend/neko/cdp_studio_scrape.py new file mode 100644 index 0000000..d052059 --- /dev/null +++ b/backend/neko/cdp_studio_scrape.py @@ -0,0 +1,260 @@ +# -*- coding: utf-8 -*- +"""Read-only CDP scrape of YouTube Studio livestreaming page (inside Neko).""" +from __future__ import annotations + +import base64 +import json +import os +import re +import socket +import struct +import time +import urllib.request + + +def ws_connect(url: str) -> socket.socket: + assert url.startswith("ws://"), url + hostport, path = url[5:].split("/", 1) + path = "/" + path + host, port_s = hostport.split(":") + port = int(port_s) + key = base64.b64encode(os.urandom(16)).decode() + sock = socket.create_connection((host, port), timeout=6) + req = ( + f"GET {path} HTTP/1.1\r\n" + f"Host: {hostport}\r\n" + "Upgrade: websocket\r\n" + "Connection: Upgrade\r\n" + f"Sec-WebSocket-Key: {key}\r\n" + "Sec-WebSocket-Version: 13\r\n" + "\r\n" + ).encode() + sock.sendall(req) + buf = b"" + while b"\r\n\r\n" not in buf: + chunk = sock.recv(4096) + if not chunk: + raise RuntimeError("ws handshake closed") + buf += chunk + return sock + + +def ws_send(sock: socket.socket, payload: dict) -> None: + data = json.dumps(payload).encode() + mask = os.urandom(4) + header = bytearray([0x81]) + n = len(data) + if n < 126: + header.append(0x80 | n) + elif n < 65536: + header.append(0x80 | 126) + header.extend(struct.pack("!H", n)) + else: + header.append(0x80 | 127) + header.extend(struct.pack("!Q", n)) + header.extend(mask) + masked = bytes(b ^ mask[i % 4] for i, b in enumerate(data)) + sock.sendall(bytes(header) + masked) + + +def ws_recv(sock: socket.socket): + def readexact(n: int) -> bytes: + out = b"" + while len(out) < n: + chunk = sock.recv(n - len(out)) + if not chunk: + raise RuntimeError("ws closed") + out += chunk + return out + + hdr = readexact(2) + b1, b2 = hdr[0], hdr[1] + opcode = b1 & 0x0F + masked = (b2 & 0x80) != 0 + ln = b2 & 0x7F + if ln == 126: + ln = struct.unpack("!H", readexact(2))[0] + elif ln == 127: + ln = struct.unpack("!Q", readexact(8))[0] + mask = readexact(4) if masked else b"" + data = readexact(ln) + if masked: + data = bytes(b ^ mask[i % 4] for i, b in enumerate(data)) + if opcode == 0x8: + return None + if opcode != 0x1: + # ignore non-text frames + return {"id": None} + return json.loads(data.decode()) + + +def main() -> None: + tabs = json.loads( + urllib.request.urlopen("http://127.0.0.1:9222/json/list", timeout=4).read().decode() + ) + live = [] + chooser = None + for t in tabs: + u = t.get("url") or "" + try: + from urllib.parse import urlparse + + p = urlparse(u) + host = (p.netloc or "").lower() + path = (p.path or "").lower() + except Exception: + continue + if host.endswith("studio.youtube.com") and "livestreaming" in path: + live.append(t) + if "accounts.google.com" in host and chooser is None: + chooser = t + if not live: + if chooser: + print( + json.dumps( + { + "ok": True, + "url": (chooser.get("url") or "")[:200], + "live_status": "signed_out", + "health": "", + "viewer_count": None, + "on_air": False, + "text": "Google accountchooser / signed out", + }, + ensure_ascii=False, + ) + ) + return + print(json.dumps({"ok": False, "error": "no_live_tab"})) + return + tab = live[0] + ws_url = tab.get("webSocketDebuggerUrl") or "" + url = tab.get("url") or "" + if not ws_url: + print(json.dumps({"ok": False, "error": "no_ws", "url": url[:120]})) + return + + sock = ws_connect(ws_url) + ws_send( + sock, + { + "id": 1, + "method": "Runtime.evaluate", + "params": { + "expression": "(document.body && (document.body.innerText||'')).slice(0,12000)", + "returnByValue": True, + }, + }, + ) + deadline = time.time() + 5 + text = "" + while time.time() < deadline: + msg = ws_recv(sock) + if not msg: + break + if msg.get("id") == 1: + text = str(((msg.get("result") or {}).get("result") or {}).get("value") or "") + break + try: + sock.close() + except Exception: + pass + + lower = text.lower() + status = "" + if re.search(r"stream ended|not live|offline|直播已结束|未在直播", lower): + status = "ended" + elif re.search( + r"you.?re live|you are live|stream is healthy|excellent connection|" + r"concurrent viewers|watching now|stop streaming|end stream|" + r"直播中|正在直播|人正在观看|结束直播", + lower, + ): + status = "live" + elif re.search(r"\blive\b.{0,40}\d+:\d{2}:\d{2}", lower): + # e.g. "LIVE 1:19:36" on Studio control room + status = "live" + elif re.search(r"waiting|preview|scheduled|等待|预定|未开始", lower): + status = "waiting" + + health = "" + if re.search(r"excellent connection|stream is healthy|状况良好|连接状况极佳", lower): + health = "excellent" + elif re.search(r"good connection|healthy|良好", lower): + health = "good" + elif re.search(r"unstable|poor|buffer|warning|不稳定|卡顿", lower): + health = "warning" + + # Concurrent viewers (not cumulative Views) + viewers = None + m = re.search( + r"([\d,.]+)\s*(?:watching|concurrent viewers|人正在观看|正在观看)", + text, + re.I, + ) + if not m: + m = re.search( + r"(?:concurrent viewers|watching now|同时观看人数)\s*[::]?\s*([\d,.]+)", + text, + re.I, + ) + if m: + try: + viewers = int(float(m.group(1).replace(",", ""))) + except Exception: + viewers = None + + # Analytics cumulative Views (Studio Analytics tab) + total_views = None + m = re.search(r"(?:^|\n)\s*Views\s*\n\s*([\d,.]+)", text, re.I) + if not m: + m = re.search(r"\bViews\b(?!\s*per)(?![^\n]{0,12}concurrent)\s*[::]?\s*([\d,.]+)", text, re.I) + if not m: + m = re.search(r"(?:总观看|观看次数|观看量)\s*[::]?\s*([\d,.]+)", text) + if m: + try: + total_views = int(float(m.group(1).replace(",", ""))) + except Exception: + total_views = None + + # LIVE pill duration e.g. "LIVE 37:06" / "LIVE 1:19:36" + live_duration = "" + live_duration_sec = None + m = re.search(r"\bLIVE\b\s*(\d{1,2}:\d{2}(?::\d{2})?)", text, re.I) + if not m: + m = re.search(r"(?:直播时长|已直播)\s*[::]?\s*(\d{1,2}:\d{2}(?::\d{2})?)", text) + if m: + live_duration = m.group(1) + try: + parts = [int(x) for x in live_duration.split(":")] + if len(parts) == 3: + live_duration_sec = parts[0] * 3600 + parts[1] * 60 + parts[2] + elif len(parts) == 2: + live_duration_sec = parts[0] * 60 + parts[1] + except Exception: + live_duration_sec = None + + on_air = status == "live" or health in {"excellent", "good"} or ( + viewers is not None and status != "ended" and status != "waiting" + ) or bool(live_duration and status != "ended" and status != "waiting") + print( + json.dumps( + { + "ok": True, + "url": url[:200], + "live_status": status, + "health": health, + "viewer_count": viewers, + "total_views": total_views, + "live_duration": live_duration, + "live_duration_sec": live_duration_sec, + "on_air": on_air, + "text": text[:500], + }, + ensure_ascii=False, + ) + ) + + +if __name__ == "__main__": + main() diff --git a/backend/neko/chromium.conf b/backend/neko/chromium.conf new file mode 100644 index 0000000..694ff3a --- /dev/null +++ b/backend/neko/chromium.conf @@ -0,0 +1,32 @@ +[program:chromium] +environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s" +command=/etc/neko/browser-launch.sh chromium +stopsignal=INT +autorestart=true +priority=800 +user=%(ENV_USER)s +stdout_logfile=/var/log/neko/chromium.log +stdout_logfile_maxbytes=100MB +stdout_logfile_backups=10 +redirect_stderr=true + +[program:tampermonkey-provisioning] +command=/bin/sh -c 'cd /var/www/provisioning && if command -v python3 >/dev/null 2>&1; then exec python3 -m http.server 18080 --bind 127.0.0.1; fi; if command -v busybox >/dev/null 2>&1; then exec busybox httpd -f -p 127.0.0.1:18080 -h /var/www/provisioning; fi; echo "no static file server for Tampermonkey provisioning"; sleep 3600' +autorestart=true +priority=250 +user=%(ENV_USER)s +stdout_logfile=/var/log/neko/tampermonkey-provisioning.log +stdout_logfile_maxbytes=10MB +stdout_logfile_backups=3 +redirect_stderr=true + +[program:openbox] +environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s" +command=/usr/bin/openbox --config-file /etc/neko/openbox.xml +autorestart=true +priority=300 +user=%(ENV_USER)s +stdout_logfile=/var/log/neko/openbox.log +stdout_logfile_maxbytes=100MB +stdout_logfile_backups=10 +redirect_stderr=true diff --git a/backend/neko/google-chrome.conf b/backend/neko/google-chrome.conf new file mode 100644 index 0000000..1337b75 --- /dev/null +++ b/backend/neko/google-chrome.conf @@ -0,0 +1,32 @@ +[program:google-chrome] +environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s" +command=/etc/neko/browser-launch.sh google-chrome +stopsignal=INT +autorestart=true +priority=800 +user=%(ENV_USER)s +stdout_logfile=/var/log/neko/google-chrome.log +stdout_logfile_maxbytes=100MB +stdout_logfile_backups=10 +redirect_stderr=true + +[program:tampermonkey-provisioning] +command=/bin/sh -c 'cd /var/www/provisioning && if command -v python3 >/dev/null 2>&1; then exec python3 -m http.server 18080 --bind 127.0.0.1; fi; if command -v busybox >/dev/null 2>&1; then exec busybox httpd -f -p 127.0.0.1:18080 -h /var/www/provisioning; fi; echo "no static file server for Tampermonkey provisioning"; sleep 3600' +autorestart=true +priority=250 +user=%(ENV_USER)s +stdout_logfile=/var/log/neko/tampermonkey-provisioning.log +stdout_logfile_maxbytes=10MB +stdout_logfile_backups=3 +redirect_stderr=true + +[program:openbox] +environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s" +command=/usr/bin/openbox --config-file /etc/neko/openbox.xml +autorestart=true +priority=300 +user=%(ENV_USER)s +stdout_logfile=/var/log/neko/openbox.log +stdout_logfile_maxbytes=100MB +stdout_logfile_backups=10 +redirect_stderr=true diff --git a/backend/neko/live-ops-extension/background.js b/backend/neko/live-ops-extension/background.js new file mode 100644 index 0000000..b046f1b --- /dev/null +++ b/backend/neko/live-ops-extension/background.js @@ -0,0 +1,186 @@ +const API_BASES = [ + // Physical / Docker: hit host API first — public HTTPS often hangs and blocks all telemetry. + "http://host.docker.internal:8014", + "http://172.17.0.1:8014", + "https://dy.nomadro.com", + "https://dy.nomadro.cn", + "https://dy.nomadro.live", + "http://127.0.0.1:8014", +]; + +const JUNK_TAB_RE = /tampermonkey\.net\/(changelog|installed)\.php/i; +const LIVE_STUDIO_RE = /studio\.youtube\.com\/.*\/livestreaming/i; +const AUTH_JUNK_RE = + /accounts\.google\.com\/(?:ServiceLogin|signin|v3\/signin|accountchooser|RotateCookiesPage)/i; +const YOUTUBE_HOME_RE = /^https:\/\/www\.youtube\.com\/?(?:\?|$)/; + +let cachedNekoInstanceId = 0; + +function sleep(ms) { + return new Promise((resolve) => setTimeout(resolve, ms)); +} + +function tabUrl(tab) { + return tab?.pendingUrl || tab?.url || ""; +} + +async function loadNekoInstanceId() { + if (cachedNekoInstanceId > 0) return cachedNekoInstanceId; + try { + const stored = await chrome.storage.local.get(["nekoInstanceId"]); + const fromStore = Number(stored.nekoInstanceId || 0); + if (fromStore > 0) { + cachedNekoInstanceId = fromStore; + return cachedNekoInstanceId; + } + } catch {} + try { + const res = await fetch(chrome.runtime.getURL("instance_id.txt"), { cache: "no-store" }); + if (res.ok) { + const text = (await res.text()).trim(); + const nid = Number(text); + if (Number.isFinite(nid) && nid > 0) { + cachedNekoInstanceId = nid; + await chrome.storage.local.set({ nekoInstanceId: nid }); + return nid; + } + } + } catch {} + return 0; +} + +loadNekoInstanceId().catch(() => {}); + +async function focusYoutubeLiveTab(tabs) { + const liveTabs = tabs.filter((tab) => LIVE_STUDIO_RE.test(tabUrl(tab)) && tab.id); + if (liveTabs.length) { + const target = liveTabs.find((tab) => tab.active) || liveTabs[0]; + await chrome.tabs.update(target.id, { active: true }); + await chrome.tabs.reload(target.id); + if (LIVE_STUDIO_RE.test(tabUrl(target))) { + await chrome.storage.local.set({ lastLiveStudioUrl: tabUrl(target) }); + } + return target.id; + } + + const stored = await chrome.storage.local.get(["lastLiveStudioUrl"]); + const saved = (stored.lastLiveStudioUrl || "").trim(); + if (saved && LIVE_STUDIO_RE.test(saved)) { + const created = await chrome.tabs.create({ url: saved, active: true }); + return created?.id || null; + } + return null; +} + +async function normalizeTabsAfterRestore(attempt = 0) { + const delayMs = attempt === 0 ? 5000 : 2500; + if (attempt > 12) return; + await sleep(delayMs); + + let tabs = []; + try { + tabs = await chrome.tabs.query({}); + } catch { + return; + } + + for (const tab of tabs) { + const url = tabUrl(tab); + if (!tab.id) continue; + if (JUNK_TAB_RE.test(url)) { + try { + await chrome.tabs.remove(tab.id); + } catch {} + } + } + + tabs = await chrome.tabs.query({}); + const liveTabId = await focusYoutubeLiveTab(tabs); + + if (liveTabId) { + const refreshed = await chrome.tabs.query({}); + for (const tab of refreshed) { + const url = tabUrl(tab); + if (!tab.id || tab.id === liveTabId) continue; + if (JUNK_TAB_RE.test(url) || AUTH_JUNK_RE.test(url) || YOUTUBE_HOME_RE.test(url)) { + try { + await chrome.tabs.remove(tab.id); + } catch {} + } + } + } + + const remainingJunk = (await chrome.tabs.query({})).some((tab) => JUNK_TAB_RE.test(tabUrl(tab))); + if (remainingJunk) { + normalizeTabsAfterRestore(attempt + 1); + } +} + +function scheduleTabHygiene() { + normalizeTabsAfterRestore(0).catch(() => {}); +} + +chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => { + const url = changeInfo.url || tabUrl(tab); + if (!url || !JUNK_TAB_RE.test(url)) return; + chrome.tabs.remove(tabId).catch(() => {}); +}); + +chrome.tabs.onCreated.addListener((tab) => { + const url = tabUrl(tab); + if (!url || !JUNK_TAB_RE.test(url)) return; + if (tab.id) chrome.tabs.remove(tab.id).catch(() => {}); +}); + +chrome.runtime.onStartup.addListener(scheduleTabHygiene); +chrome.runtime.onInstalled.addListener(scheduleTabHygiene); +scheduleTabHygiene(); + +async function postTelemetry(payload) { + const stored = await chrome.storage.local.get(["liveHubIngestToken"]); + const ingestToken = (stored.liveHubIngestToken || "").trim(); + const nekoInstanceId = (await loadNekoInstanceId()) || Number(payload?.neko_instance_id || 0) || 0; + const body = JSON.stringify({ + ...payload, + source: payload.source || "chrome_extension", + received_at: Date.now() / 1000, + ...(nekoInstanceId > 0 ? { neko_instance_id: nekoInstanceId } : {}), + ...(ingestToken ? { ingest_token: ingestToken } : {}), + }); + let lastError = ""; + for (const base of API_BASES) { + try { + const ctrl = new AbortController(); + const timer = setTimeout(() => ctrl.abort(), 3500); + const res = await fetch(`${base}/hub/youtube/live/ingest`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body, + cache: "no-store", + signal: ctrl.signal, + }); + clearTimeout(timer); + if (res.ok) { + const data = await res.json().catch(() => ({})); + await chrome.storage.local.set({ + liveHubLastOk: Date.now(), + liveHubLastBase: base, + liveHubLastEvent: data?.event?.id || null, + liveHubLastNekoId: data?.event?.neko_instance_id || nekoInstanceId || null, + }); + return { ok: true, base, eventId: data?.event?.id || null }; + } + lastError = `${base} HTTP ${res.status}`; + } catch (err) { + lastError = `${base} ${err?.message || String(err)}`; + } + } + await chrome.storage.local.set({ liveHubLastError: lastError, liveHubLastErrorAt: Date.now() }); + return { ok: false, error: lastError }; +} + +chrome.runtime.onMessage.addListener((message, _sender, sendResponse) => { + if (!message || message.type !== "live-hub-youtube-telemetry") return false; + postTelemetry(message.payload || {}).then(sendResponse); + return true; +}); diff --git a/backend/neko/live-ops-extension/content.js b/backend/neko/live-ops-extension/content.js new file mode 100644 index 0000000..ccd83af --- /dev/null +++ b/backend/neko/live-ops-extension/content.js @@ -0,0 +1,220 @@ +const LIVE_HUB_MIN_INTERVAL_MS = 1800; +let lastSentAt = 0; +let lastSignature = ""; + +function cleanText(value, max = 260) { + return String(value || "") + .replace(/\s+/g, " ") + .trim() + .slice(0, max); +} + +function pageText() { + return cleanText(document.body?.innerText || "", 6000); +} + +function parseCompactNumber(raw) { + const text = cleanText(raw, 40).replace(/,/g, ""); + const match = text.match(/(\d+(?:\.\d+)?)([kKmMwW万]*)/); + if (!match) return null; + let value = Number(match[1]); + const unit = match[2].toLowerCase(); + if (unit === "k") value *= 1000; + if (unit === "m") value *= 1000000; + if (unit === "w" || unit === "万") value *= 10000; + return Number.isFinite(value) ? Math.round(value) : null; +} + +function firstNumberByPatterns(text, patterns) { + for (const pattern of patterns) { + const match = text.match(pattern); + if (match) { + const parsed = parseCompactNumber(match[1]); + if (parsed != null) return parsed; + } + } + return null; +} + +function detectLiveStatus(text) { + const lower = text.toLowerCase(); + if (/stream ended|not live|offline|直播已结束|未在直播/.test(lower)) return "ended"; + if (/connect your encoder|no data|stream offline|not streaming|waiting for you to start/.test(lower)) { + return "waiting"; + } + if ( + /you'?re live|you are live|excellent connection|stream is healthy|end stream|stop streaming|concurrent viewers|watching now|直播中|正在直播|已开始直播|结束直播/.test( + lower + ) + ) { + return "live"; + } + // Studio shows a LIVE pill + duration while on-air + if (/\blive\b[\s\S]{0,40}\d+:\d{2}(?::\d{2})?/.test(lower) && /end stream|stop streaming/.test(lower)) { + return "live"; + } + if (/waiting|preview|scheduled|等待|预定|未开始/.test(lower)) return "waiting"; + if (/error|failed|copyright|policy|异常|错误|受限|违规/.test(lower)) return "attention"; + return ""; +} + +function detectHealth(text) { + const lower = text.toLowerCase(); + if (/excellent connection|stream is healthy|health excellent|连接状况极佳|状况良好/.test(lower)) return "excellent"; + if (/good connection|healthy|良好/.test(lower)) return "good"; + if (/unstable|poor|buffer|warning|警告|不稳定|不佳|卡顿/.test(lower)) return "warning"; + if (/error|failed|disconnect|异常|错误|断开/.test(lower)) return "error"; + return ""; +} + +/** LIVE pill duration e.g. "37:06" or "1:19:36" → seconds */ +function parseLiveDuration(text) { + const match = + text.match(/\bLIVE\b\s*(\d{1,2}:\d{2}(?::\d{2})?)/i) || + text.match(/(?:直播时长|已直播)\s*[::]?\s*(\d{1,2}:\d{2}(?::\d{2})?)/i); + if (!match) return { live_duration: "", live_duration_sec: null }; + const raw = match[1]; + const parts = raw.split(":").map((x) => Number(x)); + let sec = null; + if (parts.length === 3 && parts.every((n) => Number.isFinite(n))) { + sec = parts[0] * 3600 + parts[1] * 60 + parts[2]; + } else if (parts.length === 2 && parts.every((n) => Number.isFinite(n))) { + sec = parts[0] * 60 + parts[1]; + } + return { live_duration: raw, live_duration_sec: sec }; +} + +/** Analytics tab cumulative Views (not concurrent). */ +function parseTotalViews(text) { + // Prefer labeled "Views" / 观看次数, avoid "Concurrent viewers" + const patterns = [ + /(?:^|\n)\s*Views\s*\n\s*([\d,.]+[kKmMwW万]?)/i, + /\bViews\b(?!\s*per)\s*[::]?\s*([\d,.]+[kKmMwW万]?)/i, + /(?:总观看|观看次数|观看量)\s*[::]?\s*([\d,.]+[kKmMwW万]?)/, + ]; + for (const pattern of patterns) { + const match = text.match(pattern); + if (!match) continue; + // Reject if this is clearly the concurrent line + const around = text.slice(Math.max(0, (match.index || 0) - 24), (match.index || 0) + 40).toLowerCase(); + if (/concurrent/.test(around)) continue; + const parsed = parseCompactNumber(match[1]); + if (parsed != null) return parsed; + } + return null; +} + +function collectPopupTexts() { + const selectors = [ + "[role='dialog']", + "[aria-live='assertive']", + "[aria-live='polite']", + "ytcp-toast", + "tp-yt-paper-toast", + "paper-dialog", + "ytcp-alert", + "ytcp-ve", + ]; + const out = []; + for (const node of document.querySelectorAll(selectors.join(","))) { + const rect = node.getBoundingClientRect?.(); + if (rect && rect.width === 0 && rect.height === 0) continue; + const text = cleanText(node.innerText || node.textContent || "", 500); + if (text && !out.includes(text)) out.push(text); + if (out.length >= 8) break; + } + return out; +} + +function collectStreamTitle() { + const selectors = [ + "input[aria-label*='Title']", + "textarea[aria-label*='Title']", + "ytcp-social-suggestions-textbox", + "ytcp-video-title", + "h1", + ]; + for (const selector of selectors) { + const node = document.querySelector(selector); + const value = node?.value || node?.innerText || node?.textContent; + const text = cleanText(value, 180); + if (text) return text; + } + return cleanText(document.title, 180); +} + +function collectTelemetry() { + const text = pageText(); + const viewerCount = firstNumberByPatterns(text, [ + /([\d,.]+[kKmMwW万]?)\s*(?:watching|concurrent viewers)/i, + /(?:concurrent viewers|watching now|同时观看)\s*[::]?\s*([\d,.]+[kKmMwW万]?)/i, + /([\d,.]+[kKmMwW万]?)\s*(?:人正在观看|正在观看)/, + ]); + const likeCount = firstNumberByPatterns(text, [ + /([\d,.]+[kKmMwW万]?)\s*(?:likes|like count)/i, + /([\d,.]+[kKmMwW万]?)\s*(?:点赞|赞)/, + ]); + const dur = parseLiveDuration(text); + const totalViews = parseTotalViews(text); + const popups = collectPopupTexts(); + const payload = { + captured_at: Date.now() / 1000, + source: "chrome_extension", + url: location.href, + page_title: document.title, + stream_title: collectStreamTitle(), + live_status: detectLiveStatus(text), + health: detectHealth(text), + viewer_count: viewerCount, + like_count: likeCount, + total_views: totalViews, + live_duration: dur.live_duration, + live_duration_sec: dur.live_duration_sec, + popups, + text: text.slice(0, 2200), + signals: { + has_dialog: popups.length > 0, + visibility: document.visibilityState, + focused: document.hasFocus(), + path: location.pathname, + }, + }; + return payload; +} + +function signatureOf(payload) { + return JSON.stringify([ + payload.url, + payload.live_status, + payload.health, + payload.viewer_count, + payload.like_count, + payload.total_views, + payload.live_duration, + payload.popups, + payload.stream_title, + ]); +} + +function sendTelemetry(force = false) { + const now = Date.now(); + if (!force && now - lastSentAt < LIVE_HUB_MIN_INTERVAL_MS) return; + const payload = collectTelemetry(); + const sig = signatureOf(payload); + if (!force && sig === lastSignature && now - lastSentAt < 10000) return; + lastSentAt = now; + lastSignature = sig; + if (/studio\.youtube\.com\/.*\/livestreaming/.test(location.href)) { + chrome.storage.local.set({ lastLiveStudioUrl: location.href }); + } + chrome.runtime.sendMessage({ type: "live-hub-youtube-telemetry", payload }, () => { + void chrome.runtime.lastError; + }); +} + +const observer = new MutationObserver(() => sendTelemetry(false)); +observer.observe(document.documentElement, { subtree: true, childList: true, characterData: true }); +window.addEventListener("focus", () => sendTelemetry(true)); +document.addEventListener("visibilitychange", () => sendTelemetry(true)); +setInterval(() => sendTelemetry(false), 3000); +sendTelemetry(true); diff --git a/backend/neko/live-ops-extension/instance_id.txt b/backend/neko/live-ops-extension/instance_id.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/backend/neko/live-ops-extension/instance_id.txt @@ -0,0 +1 @@ +0 diff --git a/backend/neko/live-ops-extension/manifest.json b/backend/neko/live-ops-extension/manifest.json new file mode 100644 index 0000000..64d2ecd --- /dev/null +++ b/backend/neko/live-ops-extension/manifest.json @@ -0,0 +1,31 @@ +{ + "manifest_version": 3, + "name": "Live Hub YouTube Studio Telemetry", + "version": "1.3.0", + "description": "Captures YouTube Studio live status, viewer signals, stream health, and popups for the LAN Live Hub.", + "permissions": ["storage", "tabs"], + "host_permissions": [ + "https://studio.youtube.com/*", + "https://www.youtube.com/*", + "https://dy.nomadro.live/*", + "https://dy.nomadro.com/*", + "https://dy.nomadro.cn/*", + "http://host.docker.internal:8014/*", + "http://172.17.0.1:8014/*", + "http://127.0.0.1:8014/*" + ], + "background": { + "service_worker": "background.js" + }, + "content_scripts": [ + { + "matches": [ + "https://studio.youtube.com/*", + "https://www.youtube.com/live_dashboard*", + "https://www.youtube.com/watch*" + ], + "js": ["content.js"], + "run_at": "document_idle" + } + ] +} diff --git a/backend/neko/no-managed-policies/.gitkeep b/backend/neko/no-managed-policies/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/backend/neko/no-managed-policies/.gitkeep @@ -0,0 +1 @@ + diff --git a/backend/neko/policies/policies.json b/backend/neko/policies/policies.json new file mode 100644 index 0000000..850abb9 --- /dev/null +++ b/backend/neko/policies/policies.json @@ -0,0 +1,42 @@ +{ + "ExtensionInstallForcelist": [ + "dhdgffkkebhmkfjojejmpbldmpobfkfo;https://clients2.google.com/service/update2/crx" + ], + "ExtensionInstallBlocklist": [], + "DownloadRestrictions": 0, + "AllowFileSelectionDialogs": true, + "URLAllowlist": [ + "file:///home/neko/Downloads/*" + ], + "DefaultCookiesSetting": 1, + "RestoreOnStartup": 1, + "AutoplayAllowed": true, + "DefaultPopupsSetting": 1, + "DefaultNotificationsSetting": 1, + "VideoCaptureAllowed": true, + "AudioCaptureAllowed": true, + "VideoCaptureAllowedUrls": [ + "https://*.google.com/*", + "https://*.youtube.com/*" + ], + "AudioCaptureAllowedUrls": [ + "https://*.google.com/*", + "https://*.youtube.com/*" + ], + "DeveloperToolsAvailability": 1, + "DefaultGeolocationSetting": 1, + "3rdparty": { + "extensions": { + "dhdgffkkebhmkfjojejmpbldmpobfkfo": { + "jsonImport": [ + { + "hash": "1:b75c2df29e515233fce1ca146ab62fff6bcbbaa20f5d5a8c16aa8f8993b77b15", + "url": "http://127.0.0.1:18080/tampermonkey-provisioning.json", + "haltOnError": false, + "installAsSystemScripts": false + } + ] + } + } + } +} diff --git a/backend/neko/provisioning/tampermonkey-provisioning.json b/backend/neko/provisioning/tampermonkey-provisioning.json new file mode 100644 index 0000000..80193f8 --- /dev/null +++ b/backend/neko/provisioning/tampermonkey-provisioning.json @@ -0,0 +1,16 @@ +{ + "version": "1", + "scripts": [ + { + "name": "YouTube Studio Auto Dismiss", + "file_url": "https://greasyfork.org/scripts/557378-youtube-studio-auto-dismiss/code/YouTube%20Studio%20Auto%20Dismiss.user.js", + "source": "Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICBZb3VUdWJlIFN0dWRpbyBBdXRvIERpc21pc3MKLy8gQG5hbWVzcGFjZSAgICBodHRwOi8vdGFtcGVybW9ua2V5Lm5ldC8KLy8gQHZlcnNpb24gICAgICAyLjIuMAovLyBAZGVzY3JpcHRpb24gIOebtOaSree7k+adnyBlbmRzY3JlZW4g6Ieq5Yqo56a75byA77ya6K+7IGEjZGlzbWlzcy1saW5rIOW5tiBsb2NhdGlvbi5hc3NpZ27vvIzpgb/lhY0gTW91c2VFdmVudCDpo47mjqcKLy8gQGF1dGhvciAgICAgICBZb3UKLy8gQG1hdGNoICAgICAgICBodHRwczovL3N0dWRpby55b3V0dWJlLmNvbS8qCi8vIEBydW4tYXQgICAgICAgZG9jdW1lbnQtaWRsZQovLyBAbGljZW5zZSBNSVQKLy8gQGdyYW50ICAgICAgICBub25lCi8vIEBkb3dubG9hZFVSTCAgaHR0cHM6Ly91cGRhdGUuZ3JlYXN5Zm9yay5vcmcvc2NyaXB0cy81NTczNzgvWW91VHViZSUyMFN0dWRpbyUyMEF1dG8lMjBEaXNtaXNzLnVzZXIuanMKLy8gQHVwZGF0ZVVSTCAgICBodHRwczovL3VwZGF0ZS5ncmVhc3lmb3JrLm9yZy9zY3JpcHRzLzU1NzM3OC9Zb3VUdWJlJTIwU3R1ZGlvJTIwQXV0byUyMERpc21pc3MubWV0YS5qcwovLyA9PS9Vc2VyU2NyaXB0PT0KCihmdW5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ICAgIGNsZWFyVGltZW91dCh0aWNrLl90KTsKICAgIHRpY2suX3QgPSBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHsKICAgICAgdGljaygibXV0YXRpb24iKTsKICAgIH0sIDIwMCk7CiAgfSk7CgogIHRyeSB7CiAgICBvYnNlcnZlci5vYnNlcnZlKGRvY3VtZW50LmRvY3VtZW50RWxlbWVudCwgewogICAgICBjaGlsZExpc3Q6IHRydWUsCiAgICAgIHN1YnRyZWU6IHRydWUsCiAgICAgIGF0dHJpYnV0ZXM6IHRydWUsCiAgICAgIGF0dHJpYnV0ZUZpbHRlcjogWyJzdHlsZSIsICJjbGFzcyIsICJoaWRkZW4iLCAiaHJlZiJdLAogICAgfSk7CiAgfSBjYXRjaCAoXykge30KCiAgLy8gU1BB77ya5LuOIGRhc2hib2FyZCDov5vnm7Tmkq3pobXml7YgdXNlcnNjcmlwdCDkuI3kuIDlrprph43ot5HvvIzpnaDova7or6LlhZzlupUKICBzZXRJbnRlcnZhbChmdW5jdGlvbiAoKSB7CiAgICB0aWNrKCJwb2xsIik7CiAgfSwgUE9MTF9NUyk7CgogIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCJ5dC1uYXZpZ2F0ZS1maW5pc2giLCBmdW5jdGlvbiAoKSB7CiAgICB0aWNrKCJ5dC1uYXZpZ2F0ZS1maW5pc2giKTsKICB9KTsKICB3aW5kb3cuYWRkRXZlbnRMaXN0ZW5lcigicG9wc3RhdGUiLCBmdW5jdGlvbiAoKSB7CiAgICB0aWNrKCJwb3BzdGF0ZSIpOwogIH0pOwoKICBsb2coImluc3RhbGxlZCIsIGxvY2F0aW9uLmhyZWYpOwogIHRpY2soImJvb3QiKTsKfSkoKTsK", + "enabled": true, + "position": 1, + "options": {} + } + ], + "settings": { + "runtime_content_mode": "userscripts" + } +} diff --git a/backend/neko/provisioning/youtube-studio-auto-dismiss.user.js b/backend/neko/provisioning/youtube-studio-auto-dismiss.user.js new file mode 100644 index 0000000..aaac918 --- /dev/null +++ b/backend/neko/provisioning/youtube-studio-auto-dismiss.user.js @@ -0,0 +1,231 @@ +// ==UserScript== +// @name YouTube Studio Auto Dismiss +// @namespace http://tampermonkey.net/ +// @version 2.2.0 +// @description 直播结束 endscreen 自动离开:读 a#dismiss-link 并 location.assign,避免 MouseEvent 风控 +// @author You +// @match https://studio.youtube.com/* +// @run-at document-idle +// @license MIT +// @grant none +// @downloadURL https://update.greasyfork.org/scripts/557378/YouTube%20Studio%20Auto%20Dismiss.user.js +// @updateURL https://update.greasyfork.org/scripts/557378/YouTube%20Studio%20Auto%20Dismiss.meta.js +// ==/UserScript== + +(function () { + "use strict"; + + // 不要用 + + + diff --git a/backend/neko/tampermonkey-seed/Default/Extensions/dhdgffkkebhmkfjojejmpbldmpobfkfo/5.5.0_0/ask.html b/backend/neko/tampermonkey-seed/Default/Extensions/dhdgffkkebhmkfjojejmpbldmpobfkfo/5.5.0_0/ask.html new file mode 100644 index 0000000..15151dc --- /dev/null +++ b/backend/neko/tampermonkey-seed/Default/Extensions/dhdgffkkebhmkfjojejmpbldmpobfkfo/5.5.0_0/ask.html @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/backend/neko/tampermonkey-seed/Default/Extensions/dhdgffkkebhmkfjojejmpbldmpobfkfo/5.5.0_0/background.html b/backend/neko/tampermonkey-seed/Default/Extensions/dhdgffkkebhmkfjojejmpbldmpobfkfo/5.5.0_0/background.html new file mode 100644 index 0000000..b5b7c72 --- /dev/null +++ b/backend/neko/tampermonkey-seed/Default/Extensions/dhdgffkkebhmkfjojejmpbldmpobfkfo/5.5.0_0/background.html @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/backend/neko/tampermonkey-seed/Default/Extensions/dhdgffkkebhmkfjojejmpbldmpobfkfo/5.5.0_0/background.js b/backend/neko/tampermonkey-seed/Default/Extensions/dhdgffkkebhmkfjojejmpbldmpobfkfo/5.5.0_0/background.js new file mode 100644 index 0000000..c1554c1 --- /dev/null +++ b/backend/neko/tampermonkey-seed/Default/Extensions/dhdgffkkebhmkfjojejmpbldmpobfkfo/5.5.0_0/background.js @@ -0,0 +1,1107 @@ +(()=>{function e(r){var s=n[r];if(void 0!==s)return s.exports;var i=n[r]={exports:{}};return t[r](i,i.exports,e),i.exports}var t={462:(e,t,n)=>{e.exports=function e(t,n,r){function s(o){if(!n[o]){if(!t[o]){if(i)return i(o,!0);var a=new Error("Cannot find module '"+o+"'");throw a.code="MODULE_NOT_FOUND",a}var c=n[o]={exports:{}};t[o][0].call(c.exports,(function(e){return s(t[o][1][e]||e)}),c,c.exports,e,t,n,r)}return n[o].exports}for(var i=void 0,o=0;o>2,a=(3&t)<<4|n>>4,c=p>1?(15&n)<<2|s>>6:64,l=p>2?63&s:64,u.push(i.charAt(o)+i.charAt(a)+i.charAt(c)+i.charAt(l)) +;return u.join("")},n.decode=function(e){var t,n,r,o,a,c,l=0,u=0;if("data:"===e.substr(0,5))throw new Error("Invalid base64 input, it looks like a data url.");var d,A=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(e.charAt(e.length-1)===i.charAt(64)&&A--,e.charAt(e.length-2)===i.charAt(64)&&A--,A%1!=0)throw new Error("Invalid base64 input, bad content length.");for(d=s.uint8array?new Uint8Array(0|A):new Array(0|A);l>4, +n=(15&o)<<4|(a=i.indexOf(e.charAt(l++)))>>2,r=(3&a)<<6|(c=i.indexOf(e.charAt(l++))),d[u++]=t,64!==a&&(d[u++]=n),64!==c&&(d[u++]=r);return d}},{"./support":30,"./utils":32}],2:[function(e,t){"use strict";function n(e,t,n,r,s){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=s}var r=e("./external"),s=e("./stream/DataWorker"),i=e("./stream/DataLengthProbe"),o=e("./stream/Crc32Probe");i=e("./stream/DataLengthProbe"),n.prototype={ +getContentWorker:function(){var e=new s(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new i("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){ +return new s(r.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},n.createWorkerFrom=function(e,t,n){return e.pipe(new o).pipe(new i("uncompressedSize")).pipe(t.compressWorker(n)).pipe(new i("compressedSize")).withStreamInfo("compression",t)},t.exports=n},{"./external":6,"./stream/Crc32Probe":25, +"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){"use strict";var r=e("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(){return new r("STORE compression")},uncompressWorker:function(){return new r("STORE decompression")}},n.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t){"use strict";var n=e("./utils"),r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t +}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==n.getTypeOf(e)?function(e,t,n){var s=r,i=0+n;e^=-1;for(var o=0;o>>8^s[255&(e^t[o])];return-1^e}(0|t,e,e.length):function(e,t,n){var s=r,i=0+n;e^=-1;for(var o=0;o>>8^s[255&(e^t.charCodeAt(o))];return-1^e}(0|t,e,e.length):0}},{"./utils":32}],5:[function(e,t,n){"use strict";n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null, +n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t){"use strict";var n;n="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:n}},{lie:37}],7:[function(e,t,n){"use strict";function r(e,t){a.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}var s="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=e("pako"),o=e("./utils"),a=e("./stream/GenericWorker"),c=s?"uint8array":"array" +;n.magic="\b\0",o.inherits(r,a),r.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(c,e.data),!1)},r.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},r.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},r.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this +;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new r("Deflate",e)},n.uncompressWorker=function(){return new r("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t){"use strict";function n(e,t,n,r){s.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0, +this.entriesCount=0,this.currentFile=null,this._sources=[]}var r=e("../utils"),s=e("../stream/GenericWorker"),i=e("../utf8"),o=e("../crc32"),a=e("../signature"),c=function(e,t){var n,r="";for(n=0;n>>=8;return r},l=function(e,t,n,s,l,u){ +var d,A,p=e.file,h=e.compression,f=u!==i.utf8encode,m=r.transformTo("string",u(p.name)),g=r.transformTo("string",i.utf8encode(p.name)),v=p.comment,w=r.transformTo("string",u(v)),b=r.transformTo("string",i.utf8encode(v)),_=g.length!==p.name.length,y=b.length!==v.length,k="",R="",x="",E=p.dir,S=p.date,C={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(C.crc32=e.crc32,C.compressedSize=e.compressedSize,C.uncompressedSize=e.uncompressedSize);var M=0;t&&(M|=8),f||!_&&!y||(M|=2048);var I,U,G=0,Z=0 +;E&&(G|=16),"UNIX"===l?(Z=798,G|=(U=I=p.unixPermissions,I||(U=E?16893:33204),(65535&U)<<16)):(Z=20,G|=63&(p.dosPermissions||0)),d=S.getUTCHours(),d<<=6,d|=S.getUTCMinutes(),d<<=5,d|=S.getUTCSeconds()/2,A=S.getUTCFullYear()-1980,A<<=4,A|=S.getUTCMonth()+1,A<<=5,A|=S.getUTCDate(),_&&(R=c(1,1)+c(o(m),4)+g,k+="up"+c(R.length,2)+R),y&&(x=c(1,1)+c(o(w),4)+b,k+="uc"+c(x.length,2)+x);var T="";return T+="\n\0",T+=c(M,2),T+=h.magic,T+=c(d,2),T+=c(A,2),T+=c(C.crc32,4),T+=c(C.compressedSize,4), +T+=c(C.uncompressedSize,4),T+=c(m.length,2),T+=c(k.length,2),{fileRecord:a.LOCAL_FILE_HEADER+T+m+k,dirRecord:a.CENTRAL_FILE_HEADER+c(Z,2)+T+c(w.length,2)+"\0\0\0\0"+c(G,4)+c(s,4)+m+k+w}},u=function(e){return a.DATA_DESCRIPTOR+c(e.crc32,4)+c(e.compressedSize,4)+c(e.uncompressedSize,4)};r.inherits(n,s),n.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length, +s.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},n.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=l(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},n.prototype.closedSource=function(e){this.accumulate=!1 +;var t=this.streamFiles&&!e.file.dir,n=l(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:u(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},n.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t0?e.substring(0,t):""},f=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},m=function(e,t){ +return t=void 0!==t?t:a.createFolders,e=f(e),this.files[e]||p.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]},g={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,n,r;for(t in this.files)this.files.hasOwnProperty(t)&&(r=this.files[t],(n=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(n,r))},filter:function(e){var t=[];return this.forEach((function(n,r){ +e(n,r)&&t.push(r)})),t},file:function(e,t,r){if(1===arguments.length){if(n(e)){var s=e;return this.filter((function(e,t){return!t.dir&&s.test(e)}))}var i=this.files[this.root+e];return i&&!i.dir?i:null}return e=this.root+e,p.call(this,e,t,r),this},folder:function(e){if(!e)return this;if(n(e))return this.filter((function(t,n){return n.dir&&e.test(t)}));var t=this.root+e,r=m.call(this,t),s=this.clone();return s.root=r.name,s},remove:function(e){e=this.root+e;var t=this.files[e] +;if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var n=this.filter((function(t,n){return n.name.slice(0,e.length)===e})),r=0;r=0;--i)if(this.data[i]===t&&this.data[i+1]===n&&this.data[i+2]===r&&this.data[i+3]===s)return i-this.zero;return-1},n.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),s=e.charCodeAt(3),i=this.readData(4);return t===i[0]&&n===i[1]&&r===i[2]&&s===i[3]},n.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[] +;var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=n},{"../utils":32,"./DataReader":18}],18:[function(e,t){"use strict";function n(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}var r=e("../utils");n.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return r.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4) +;return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=n},{"../utils":32}],19:[function(e,t){"use strict";function n(e){r.call(this,e)}var r=e("./Uint8ArrayReader");e("../utils").inherits(n,r),n.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=n},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t){"use strict";function n(e){ +r.call(this,e)}var r=e("./DataReader");e("../utils").inherits(n,r),n.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},n.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},n.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},n.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=n},{"../utils":32,"./DataReader":18}], +21:[function(e,t){"use strict";function n(e){r.call(this,e)}var r=e("./ArrayReader");e("../utils").inherits(n,r),n.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=n},{"../utils":32,"./ArrayReader":17}],22:[function(e,t){"use strict" +;var n=e("../utils"),r=e("../support"),s=e("./ArrayReader"),i=e("./StringReader"),o=e("./NodeBufferReader"),a=e("./Uint8ArrayReader");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),"string"!==t||r.uint8array?"nodebuffer"===t?new o(e):r.uint8array?new a(n.transformTo("uint8array",e)):new s(n.transformTo("array",e)):new i(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){"use strict" +;n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t){"use strict";function n(e){r.call(this,"ConvertWorker to "+e),this.destType=e}var r=e("./GenericWorker"),s=e("../utils");s.inherits(n,r),n.prototype.processChunk=function(e){this.push({data:s.transformTo(this.destType,e.data),meta:e.meta})},t.exports=n},{"../utils":32, +"./GenericWorker":28}],25:[function(e,t){"use strict";function n(){r.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}var r=e("./GenericWorker"),s=e("../crc32");e("../utils").inherits(n,r),n.prototype.processChunk=function(e){this.streamInfo.crc32=s(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=n},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t){"use strict";function n(e){s.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)} +var r=e("../utils"),s=e("./GenericWorker");r.inherits(n,s),n.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}s.prototype.processChunk.call(this,e)},t.exports=n},{"../utils":32,"./GenericWorker":28}],27:[function(e,t){"use strict";function n(e){s.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0, +t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}var r=e("../utils"),s=e("./GenericWorker");r.inherits(n,s),n.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},n.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},n.prototype._tickAndRepeat=function(){this._tickScheduled=!1, +this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},n.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)} +return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=n},{"../utils":32,"./GenericWorker":28}],28:[function(e,t){"use strict";function n(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush() +;try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){ +if(this._listeners[e])for(var n=0;n "+e:e}},t.exports=n},{}],29:[function(e,t){"use strict";function n(e,t,n){var o=t;switch(t){case"blob":case"arraybuffer":o="uint8array";break +;case"base64":o="string"}try{this._internalType=o,this._outputType=t,this._mimeType=n,r.checkSupport(o),this._worker=e.pipe(new s(o)),e.lock()}catch(e){this._worker=new i("error"),this._worker.error(e)}}var r=e("../utils"),s=e("./ConvertWorker"),i=e("./GenericWorker"),o=e("../base64"),a=e("../support"),c=e("../external"),l=null;if(a.nodestream)try{l=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}n.prototype={accumulate:function(e){return t=this,n=e,new c.Promise((function(e,s){ +var i=[],a=t._internalType,c=t._outputType,l=t._mimeType;t.on("data",(function(e,t){i.push(e),n&&n(t)})).on("error",(function(e){i=[],s(e)})).on("end",(function(){try{var t=function(e,t,n){switch(e){case"blob":return r.newBlob(r.transformTo("arraybuffer",t),n);case"base64":return o.encode(t);default:return r.transformTo(e,t)}}(c,function(e,t){var n,r=0,s=null,i=0;for(n=0;n=252?6:u>=248?5:u>=240?4:u>=224?3:u>=192?2:1;l[254]=l[254]=1,n.utf8encode=function(e){ +return o.nodebuffer?a.newBufferFrom(e,"utf-8"):function(e){var t,n,r,s,i,a=e.length,c=0;for(s=0;s>>6, +t[i++]=128|63&n):n<65536?(t[i++]=224|n>>>12,t[i++]=128|n>>>6&63,t[i++]=128|63&n):(t[i++]=240|n>>>18,t[i++]=128|n>>>12&63,t[i++]=128|n>>>6&63,t[i++]=128|63&n);return t}(e)},n.utf8decode=function(e){return o.nodebuffer?i.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,n,r,s,o=e.length,a=new Array(2*o);for(n=0,t=0;t4)a[n++]=65533,t+=s-1;else{for(r&=2===s?31:3===s?15:7;s>1&&t1?a[n++]=65533:r<65536?a[n++]=r:(r-=65536,a[n++]=55296|r>>10&1023,a[n++]=56320|1023&r)}return a.length!==n&&(a.subarray?a=a.subarray(0,n):a.length=n),i.applyFromCharCode(a)}(e=i.transformTo(o.uint8array?"uint8array":"array",e))},i.inherits(r,c),r.prototype.processChunk=function(e){var t=i.transformTo(o.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var r=t;(t=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0), +t.set(r,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var s=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+l[e[n]]>t?n:t}(t),a=t;s!==t.length&&(o.uint8array?(a=t.subarray(0,s),this.leftOver=t.subarray(s,t.length)):(a=t.slice(0,s),this.leftOver=t.slice(s,t.length))),this.push({data:n.utf8decode(a),meta:e.meta})},r.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({ +data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=r,i.inherits(s,c),s.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=s},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){"use strict";function r(e){return e}function s(e,t){for(var n=0;n1;)try{return A.stringifyByChunk(e,r,t)}catch(e){t=Math.floor(t/2)}return A.stringifyByChar(e)}function o(e,t){for(var n=0;n1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e0)this.isSignature(t,i.CENTRAL_FILE_HEADER)||(this.reader.zero=r);else if(r<0)throw new Error("Corrupted zip: missing "+Math.abs(r)+" bytes.")},prepareReader:function(e){this.reader=r(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}}, +t.exports=n},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(e,t){"use strict";function n(e,t){this.options=e,this.loadOptions=t}var r=e("./reader/readerFor"),s=e("./utils"),i=e("./compressedObject"),o=e("./crc32"),a=e("./utf8"),c=e("./compressions"),l=e("./support");n.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,n;if(e.skip(22), +this.fileNameLength=e.readInt(2),n=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(n),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in c)if(c.hasOwnProperty(t)&&c[t].magic===e)return c[t];return null +}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new i(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4), +this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)}, +processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===e&&(this.dosPermissions=63&this.externalFileAttributes),3===e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=r(this.extraFields[1].value) +;this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,n,r,s=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+40?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var n=i.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==d)throw new Error(c[n]);if(t.header&&i.deflateSetHeader(this.strm,t.header),t.dictionary){var s +;if(s="string"==typeof t.dictionary?a.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(n=i.deflateSetDictionary(this.strm,s))!==d)throw new Error(c[n]);this._dict_set=!0}}function s(e,t){var n=new r(t);if(n.push(e,!0),n.err)throw n.msg||c[n.err];return n.result}var i=e("./zlib/deflate"),o=e("./utils/common"),a=e("./utils/strings"),c=e("./zlib/messages"),l=e("./zlib/zstream"),u={}.toString,d=0,A=-1,p=0,h=8 +;r.prototype.push=function(e,t){var n,r,s=this.strm,c=this.options.chunkSize;if(this.ended)return!1;r=t===~~t?t:!0===t?4:0,"string"==typeof e?s.input=a.string2buf(e):"[object ArrayBuffer]"===u.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new o.Buf8(c),s.next_out=0,s.avail_out=c),1!==(n=i.deflate(s,r))&&n!==d)return this.onEnd(n),this.ended=!0,!1 +;0!==s.avail_out&&(0!==s.avail_in||4!==r&&2!==r)||("string"===this.options.to?this.onData(a.buf2binstring(o.shrinkBuf(s.output,s.next_out))):this.onData(o.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==n);return 4===r?(n=i.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===d):2!==r||(this.onEnd(d),s.avail_out=0,!0)},r.prototype.onData=function(e){this.chunks.push(e)},r.prototype.onEnd=function(e){ +e===d&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Deflate=r,n.deflate=s,n.deflateRaw=function(e,t){return(t=t||{}).raw=!0,s(e,t)},n.gzip=function(e,t){return(t=t||{}).gzip=!0,s(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,n){"use strict";function r(e){if(!(this instanceof r))return new r(e) +;this.options=o.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var n=i.inflateInit2(this.strm,t.windowBits) +;if(n!==c.Z_OK)throw new Error(l[n]);this.header=new d,i.inflateGetHeader(this.strm,this.header)}function s(e,t){var n=new r(t);if(n.push(e,!0),n.err)throw n.msg||l[n.err];return n.result}var i=e("./zlib/inflate"),o=e("./utils/common"),a=e("./utils/strings"),c=e("./zlib/constants"),l=e("./zlib/messages"),u=e("./zlib/zstream"),d=e("./zlib/gzheader"),A={}.toString;r.prototype.push=function(e,t){var n,r,s,l,u,d,p=this.strm,h=this.options.chunkSize,f=this.options.dictionary,m=!1 +;if(this.ended)return!1;r=t===~~t?t:!0===t?c.Z_FINISH:c.Z_NO_FLUSH,"string"==typeof e?p.input=a.binstring2buf(e):"[object ArrayBuffer]"===A.call(e)?p.input=new Uint8Array(e):p.input=e,p.next_in=0,p.avail_in=p.input.length;do{if(0===p.avail_out&&(p.output=new o.Buf8(h),p.next_out=0,p.avail_out=h),(n=i.inflate(p,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&f&&(d="string"==typeof f?a.string2buf(f):"[object ArrayBuffer]"===A.call(f)?new Uint8Array(f):f,n=i.inflateSetDictionary(this.strm,d)), +n===c.Z_BUF_ERROR&&!0===m&&(n=c.Z_OK,m=!1),n!==c.Z_STREAM_END&&n!==c.Z_OK)return this.onEnd(n),this.ended=!0,!1;p.next_out&&(0!==p.avail_out&&n!==c.Z_STREAM_END&&(0!==p.avail_in||r!==c.Z_FINISH&&r!==c.Z_SYNC_FLUSH)||("string"===this.options.to?(s=a.utf8border(p.output,p.next_out),l=p.next_out-s,u=a.buf2string(p.output,s),p.next_out=l,p.avail_out=h-l,l&&o.arraySet(p.output,p.output,s,l,0),this.onData(u)):this.onData(o.shrinkBuf(p.output,p.next_out)))),0===p.avail_in&&0===p.avail_out&&(m=!0) +}while((p.avail_in>0||0===p.avail_out)&&n!==c.Z_STREAM_END);return n===c.Z_STREAM_END&&(r=c.Z_FINISH),r===c.Z_FINISH?(n=i.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===c.Z_OK):r!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),p.avail_out=0,!0)},r.prototype.onData=function(e){this.chunks.push(e)},r.prototype.onEnd=function(e){e===c.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}, +n.Inflate=r,n.inflate=s,n.inflateRaw=function(e,t){return(t=t||{}).raw=!0,s(e,t)},n.ungzip=s},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(e){for(var t=[].slice.call(arguments,1);t.length;){var n=t.shift();if(n){ +if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}}return e},n.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var s={arraySet:function(e,t,n,r,s){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),s);else for(var i=0;i=252?6:c>=248?5:c>=240?4:c>=224?3:c>=192?2:1;a[254]=a[254]=1,n.string2buf=function(e){var t,n,r,i,o,a=e.length,c=0 +;for(i=0;i>>6,t[o++]=128|63&n):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|63&n):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63, +t[o++]=128|n>>>6&63,t[o++]=128|63&n);return t},n.buf2binstring=function(e){return r(e,e.length)},n.binstring2buf=function(e){for(var t=new s.Buf8(e.length),n=0,r=t.length;n4)l[s++]=65533,n+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&n1?l[s++]=65533:i<65536?l[s++]=i:(i-=65536,l[s++]=55296|i>>10&1023, +l[s++]=56320|1023&i)}return r(l,s)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+a[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t){"use strict";t.exports=function(e,t,n,r){for(var s=65535&e|0,i=e>>>16&65535|0,o=0;0!==n;){n-=o=n>2e3?2e3:n;do{i=i+(s=s+t[r++]|0)|0}while(--o);s%=65521,i%=65521}return s|i<<16|0}},{}],44:[function(e,t){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2, +Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t){"use strict";var n=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}() +;t.exports=function(e,t,r,s){var i=n,o=s+r;e^=-1;for(var a=s;a>>8^i[255&(e^t[a])];return-1^e}},{}],46:[function(e,t,n){"use strict";function r(e,t){return e.msg=R[t],t}function s(e){return(e<<1)-(e>4?9:0)}function i(e){for(var t=e.length;--t>=0;)e[t]=0}function o(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(b.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n, +0===t.pending&&(t.pending_out=0))}function a(e,t){_._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,o(e.strm)}function c(e,t){e.pending_buf[e.pending++]=t}function l(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function u(e,t){ +var n,r,s=e.max_chain_length,i=e.strstart,o=e.prev_length,a=e.nice_match,c=e.strstart>e.w_size-N?e.strstart-(e.w_size-N):0,l=e.window,u=e.w_mask,d=e.prev,A=e.strstart+P,p=l[i+o-1],h=l[i+o];e.prev_length>=e.good_match&&(s>>=2),a>e.lookahead&&(a=e.lookahead);do{if(l[(n=t)+o]===h&&l[n+o-1]===p&&l[n]===l[i]&&l[++n]===l[i+1]){i+=2,n++;do{}while(l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&io){if(e.match_start=t,o=r,r>=a)break;p=l[i+o-1],h=l[i+o]}}}while((t=d[t&u])>c&&0!=--s);return o<=e.lookahead?o:e.lookahead}function d(e){var t,n,r,s,i,o,a,c,l,u,d=e.w_size;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=d+(d-N)){b.arraySet(e.window,e.window,d,d,0),e.match_start-=d,e.strstart-=d,e.block_start-=d,t=n=e.hash_size;do{r=e.head[--t],e.head[t]=r>=d?r-d:0}while(--n);t=n=d;do{r=e.prev[--t],e.prev[t]=r>=d?r-d:0}while(--n);s+=d}if(0===e.strm.avail_in)break;if(o=e.strm, +a=e.window,c=e.strstart+e.lookahead,l=s,u=void 0,(u=o.avail_in)>l&&(u=l),n=0===u?0:(o.avail_in-=u,b.arraySet(a,o.input,o.next_in,u,c),1===o.state.wrap?o.adler=y(o.adler,a,u,c):2===o.state.wrap&&(o.adler=k(o.adler,a,u,c)),o.next_in+=u,o.total_in+=u,u),e.lookahead+=n,e.lookahead+e.insert>=L)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=(e.ins_h<=L&&(e.ins_h=(e.ins_h<=L)if(r=_._tr_tally(e,e.strstart-e.match_start,e.match_length-L),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=L){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=L&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=L-1)),e.prev_length>=L&&e.match_length<=e.prev_length){ +s=e.strstart+e.lookahead-L,r=_._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-L),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=s&&(e.ins_h=(e.ins_h<15&&(a=2,s-=16),i<1||i>T||n!==Z||s<8||s>15||t<0||t>9||o<0||o>U)return r(e,C);8===s&&(s=9);var c=new f;return e.state=c,c.strm=e,c.wrap=a,c.gzhead=null, +c.w_bits=s,c.w_size=1<e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(d(e),0===e.lookahead&&t===x)return Q;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n +;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,a(e,!1),0===e.strm.avail_out))return Q;if(e.strstart-e.block_start>=e.w_size-N&&(a(e,!1),0===e.strm.avail_out))return Q}return e.insert=0,t===E?(a(e,!0),0===e.strm.avail_out?X:Y):(e.strstart>e.block_start&&(a(e,!1),e.strm.avail_out),Q) +})),new h(4,4,8,4,A),new h(4,5,16,8,A),new h(4,6,32,32,A),new h(4,4,16,16,p),new h(8,16,32,32,p),new h(8,16,128,128,p),new h(8,32,128,256,p),new h(32,128,258,1024,p),new h(32,258,258,4096,p)],n.deflateInit=function(e,t){return v(e,t,Z,15,8,0)},n.deflateInit2=v,n.deflateReset=g,n.deflateResetKeep=m,n.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?C:(e.state.gzhead=t,S):C},n.deflate=function(e,t){var n,u,A,p;if(!e||!e.state||t>5||t<0)return e?r(e,C):C;if(u=e.state, +!e.output||!e.input&&0!==e.avail_in||u.status===H&&t!==E)return r(e,0===e.avail_out?-5:C);if(u.strm=e,n=u.last_flush,u.last_flush=t,u.status===V)if(2===u.wrap)e.adler=0,c(u,31),c(u,139),c(u,8),u.gzhead?(c(u,(u.gzhead.text?1:0)+(u.gzhead.hcrc?2:0)+(u.gzhead.extra?4:0)+(u.gzhead.name?8:0)+(u.gzhead.comment?16:0)),c(u,255&u.gzhead.time),c(u,u.gzhead.time>>8&255),c(u,u.gzhead.time>>16&255),c(u,u.gzhead.time>>24&255),c(u,9===u.level?2:u.strategy>=2||u.level<2?4:0),c(u,255&u.gzhead.os), +u.gzhead.extra&&u.gzhead.extra.length&&(c(u,255&u.gzhead.extra.length),c(u,u.gzhead.extra.length>>8&255)),u.gzhead.hcrc&&(e.adler=k(e.adler,u.pending_buf,u.pending,0)),u.gzindex=0,u.status=69):(c(u,0),c(u,0),c(u,0),c(u,0),c(u,0),c(u,9===u.level?2:u.strategy>=2||u.level<2?4:0),c(u,3),u.status=q);else{var h=Z+(u.w_bits-8<<4)<<8;h|=(u.strategy>=2||u.level<2?0:u.level<6?1:6===u.level?2:3)<<6,0!==u.strstart&&(h|=32),h+=31-h%31,u.status=q,l(u,h),0!==u.strstart&&(l(u,e.adler>>>16),l(u,65535&e.adler)), +e.adler=1}if(69===u.status)if(u.gzhead.extra){for(A=u.pending;u.gzindex<(65535&u.gzhead.extra.length)&&(u.pending!==u.pending_buf_size||(u.gzhead.hcrc&&u.pending>A&&(e.adler=k(e.adler,u.pending_buf,u.pending-A,A)),o(e),A=u.pending,u.pending!==u.pending_buf_size));)c(u,255&u.gzhead.extra[u.gzindex]),u.gzindex++;u.gzhead.hcrc&&u.pending>A&&(e.adler=k(e.adler,u.pending_buf,u.pending-A,A)),u.gzindex===u.gzhead.extra.length&&(u.gzindex=0,u.status=73)}else u.status=73 +;if(73===u.status)if(u.gzhead.name){A=u.pending;do{if(u.pending===u.pending_buf_size&&(u.gzhead.hcrc&&u.pending>A&&(e.adler=k(e.adler,u.pending_buf,u.pending-A,A)),o(e),A=u.pending,u.pending===u.pending_buf_size)){p=1;break}p=u.gzindexA&&(e.adler=k(e.adler,u.pending_buf,u.pending-A,A)),0===p&&(u.gzindex=0,u.status=91)}else u.status=91;if(91===u.status)if(u.gzhead.comment){A=u.pending +;do{if(u.pending===u.pending_buf_size&&(u.gzhead.hcrc&&u.pending>A&&(e.adler=k(e.adler,u.pending_buf,u.pending-A,A)),o(e),A=u.pending,u.pending===u.pending_buf_size)){p=1;break}p=u.gzindexA&&(e.adler=k(e.adler,u.pending_buf,u.pending-A,A)),0===p&&(u.status=z)}else u.status=z;if(u.status===z&&(u.gzhead.hcrc?(u.pending+2>u.pending_buf_size&&o(e), +u.pending+2<=u.pending_buf_size&&(c(u,255&e.adler),c(u,e.adler>>8&255),e.adler=0,u.status=q)):u.status=q),0!==u.pending){if(o(e),0===e.avail_out)return u.last_flush=-1,S}else if(0===e.avail_in&&s(t)<=s(n)&&t!==E)return r(e,-5);if(u.status===H&&0!==e.avail_in)return r(e,-5);if(0!==e.avail_in||0!==u.lookahead||t!==x&&u.status!==H){var f=2===u.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(d(e),0===e.lookahead)){if(t===x)return Q;break}if(e.match_length=0, +n=_._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(a(e,!1),0===e.strm.avail_out))return Q}return e.insert=0,t===E?(a(e,!0),0===e.strm.avail_out?X:Y):e.last_lit&&(a(e,!1),0===e.strm.avail_out)?Q:W}(u,t):3===u.strategy?function(e,t){for(var n,r,s,i,o=e.window;;){if(e.lookahead<=P){if(d(e),e.lookahead<=P&&t===x)return Q;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=L&&e.strstart>0&&(r=o[s=e.strstart-1])===o[++s]&&r===o[++s]&&r===o[++s]){i=e.strstart+P +;do{}while(r===o[++s]&&r===o[++s]&&r===o[++s]&&r===o[++s]&&r===o[++s]&&r===o[++s]&&r===o[++s]&&r===o[++s]&&se.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=L?(n=_._tr_tally(e,1,e.match_length-L),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=_._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(a(e,!1),0===e.strm.avail_out))return Q}return e.insert=0,t===E?(a(e,!0), +0===e.strm.avail_out?X:Y):e.last_lit&&(a(e,!1),0===e.strm.avail_out)?Q:W}(u,t):w[u.level].func(u,t);if(f!==X&&f!==Y||(u.status=H),f===Q||f===X)return 0===e.avail_out&&(u.last_flush=-1),S;if(f===W&&(1===t?_._tr_align(u):5!==t&&(_._tr_stored_block(u,0,0,!1),3===t&&(i(u.head),0===u.lookahead&&(u.strstart=0,u.block_start=0,u.insert=0))),o(e),0===e.avail_out))return u.last_flush=-1,S}return t!==E?S:u.wrap<=0?1:(2===u.wrap?(c(u,255&e.adler),c(u,e.adler>>8&255),c(u,e.adler>>16&255), +c(u,e.adler>>24&255),c(u,255&e.total_in),c(u,e.total_in>>8&255),c(u,e.total_in>>16&255),c(u,e.total_in>>24&255)):(l(u,e.adler>>>16),l(u,65535&e.adler)),o(e),u.wrap>0&&(u.wrap=-u.wrap),0!==u.pending?S:1)},n.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==V&&69!==t&&73!==t&&91!==t&&t!==z&&t!==q&&t!==H?r(e,C):(e.state=null,t===q?r(e,-3):S):C},n.deflateSetDictionary=function(e,t){var n,r,s,o,a,c,l,u,A=t.length;if(!e||!e.state)return C +;if(2===(o=(n=e.state).wrap)||1===o&&n.status!==V||n.lookahead)return C;for(1===o&&(e.adler=y(e.adler,t,A,0)),n.wrap=0,A>=n.w_size&&(0===o&&(i(n.head),n.strstart=0,n.block_start=0,n.insert=0),u=new b.Buf8(n.w_size),b.arraySet(u,t,A-n.w_size,n.w_size,0),t=u,A=n.w_size),a=e.avail_in,c=e.next_in,l=e.input,e.avail_in=A,e.next_in=0,e.input=t,d(n);n.lookahead>=L;){r=n.strstart,s=n.lookahead-(L-1);do{n.ins_h=(n.ins_h<>>=b=w>>>24,h-=b,0==(b=w>>>16&255))E[i++]=65535&w;else{if(!(16&b)){if(0==(64&b)){w=f[(65535&w)+(p&(1<>>=b,h-=b),h<15&&(p+=x[r++]<>>=b=w>>>24,h-=b,!(16&(b=w>>>16&255))){if(0==(64&b)){w=m[(65535&w)+(p&(1<c){e.msg="invalid distance too far back",n.mode=30;break e}if(p>>>=b,h-=b,y>(b=i-o)){if((b=y-b)>u&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(k=0,R=A,0===d){if(k+=l-b,b<_){_-=b;do{E[i++]=A[k++]}while(--b);k=i-y,R=E}}else if(d2;)E[i++]=R[k++],E[i++]=R[k++],E[i++]=R[k++],_-=3;_&&(E[i++]=R[k++],_>1&&(E[i++]=R[k++]))}else{k=i-y;do{E[i++]=E[k++],E[i++]=E[k++],E[i++]=E[k++],_-=3}while(_>2);_&&(E[i++]=E[k++],_>1&&(E[i++]=E[k++]))}break}}break}}while(r>3,p&=(1<<(h-=_<<3))-1,e.next_in=r,e.next_out=i,e.avail_in=r>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function s(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new p.Buf16(320), +this.work=new p.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function i(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=y,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new p.Buf32(x),t.distcode=t.distdyn=new p.Buf32(E),t.sane=1,t.back=-1,b):_}function o(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,i(e)):_}function a(e,t){var n,r +;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?_:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,o(e))):_}function c(e,t){var n,r;return e?(r=new s,e.state=r,r.window=null,(n=a(e,t))!==b&&(e.state=null),n):_}function l(e){if(S){var t;for(d=new p.Buf32(512),A=new p.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(g(v,e.lens,0,288,d,0,e.work,{bits:9}), +t=0;t<32;)e.lens[t++]=5;g(w,e.lens,0,32,A,0,e.work,{bits:5}),S=!1}e.lencode=d,e.lenbits=9,e.distcode=A,e.distbits=5}function u(e,t,n,r){var s,i=e.state;return null===i.window&&(i.wsize=1<=i.wsize?(p.arraySet(i.window,t,n-i.wsize,i.wsize,0),i.wnext=0,i.whave=i.wsize):((s=i.wsize-i.wnext)>r&&(s=r),p.arraySet(i.window,t,n-r,s,i.wnext),(r-=s)?(p.arraySet(i.window,t,n-r,r,0),i.wnext=r,i.whave=i.wsize):(i.wnext+=s, +i.wnext===i.wsize&&(i.wnext=0),i.whave>>8&255,n.check=f(n.check,N,2,0),A=0,x=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&A)<<8)+(A>>8))%31){ +e.msg="incorrect header check",n.mode=R;break}if(8!=(15&A)){e.msg="unknown compression method",n.mode=R;break}if(x-=4,j=8+(15&(A>>>=4)),0===n.wbits)n.wbits=j;else if(j>n.wbits){e.msg="invalid window size",n.mode=R;break}n.dmax=1<>8&1),512&n.flags&&(N[0]=255&A,N[1]=A>>>8&255,n.check=f(n.check,N,2,0)),A=0,x=0,n.mode=3;case 3:for(;x<32;){if(0===c)break e;c--,A+=s[o++]<>>8&255,N[2]=A>>>16&255,N[3]=A>>>24&255,n.check=f(n.check,N,4,0)),A=0,x=0,n.mode=4;case 4:for(;x<16;){if(0===c)break e;c--,A+=s[o++]<>8),512&n.flags&&(N[0]=255&A,N[1]=A>>>8&255,n.check=f(n.check,N,2,0)),A=0,x=0,n.mode=5 +;case 5:if(1024&n.flags){for(;x<16;){if(0===c)break e;c--,A+=s[o++]<>>8&255,n.check=f(n.check,N,2,0)),A=0,x=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((C=n.length)>c&&(C=c),C&&(n.head&&(j=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),p.arraySet(n.head.extra,s,o,C,j)),512&n.flags&&(n.check=f(n.check,s,C,o)),c-=C,o+=C,n.length-=C),n.length))break e +;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===c)break e;C=0;do{j=s[o+C++],n.head&&j&&n.length<65536&&(n.head.name+=String.fromCharCode(j))}while(j&&C>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=k;break;case 10:for(;x<32;){if(0===c)break e;c--,A+=s[o++]<>>=7&x,x-=7&x,n.mode=27;break}for(;x<3;){if(0===c)break e;c--,A+=s[o++]<>>=1)){case 0:n.mode=14;break;case 1:if(l(n),n.mode=20,6===t){A>>>=2,x-=2;break e}break;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=R}A>>>=2,x-=2;break;case 14:for(A>>>=7&x,x-=7&x;x<32;){if(0===c)break e;c--,A+=s[o++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=R;break} +if(n.length=65535&A,A=0,x=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(C=n.length){if(C>c&&(C=c),C>d&&(C=d),0===C)break e;p.arraySet(i,s,o,C,a),c-=C,o+=C,d-=C,a+=C,n.length-=C;break}n.mode=k;break;case 17:for(;x<14;){if(0===c)break e;c--,A+=s[o++]<>>=5,x-=5,n.ndist=1+(31&A),A>>>=5,x-=5,n.ncode=4+(15&A),A>>>=4,x-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=R;break}n.have=0,n.mode=18;case 18:for(;n.have>>=3,x-=3}for(;n.have<19;)n.lens[V[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,F={bits:n.lenbits},D=g(0,n.lens,0,19,n.lencode,0,n.work,F),n.lenbits=F.bits,D){e.msg="invalid code lengths set",n.mode=R;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,Z=65535&P,!((U=P>>>24)<=x);){if(0===c)break e;c--,A+=s[o++]<>>=U,x-=U,n.lens[n.have++]=Z;else{ +if(16===Z){for(L=U+2;x>>=U,x-=U,0===n.have){e.msg="invalid bit length repeat",n.mode=R;break}j=n.lens[n.have-1],C=3+(3&A),A>>>=2,x-=2}else if(17===Z){for(L=U+3;x>>=U)),A>>>=3,x-=3}else{for(L=U+7;x>>=U)),A>>>=7,x-=7}if(n.have+C>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=R;break}for(;C--;)n.lens[n.have++]=j}} +if(n.mode===R)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=R;break}if(n.lenbits=9,F={bits:n.lenbits},D=g(v,n.lens,0,n.nlen,n.lencode,0,n.work,F),n.lenbits=F.bits,D){e.msg="invalid literal/lengths set",n.mode=R;break}if(n.distbits=6,n.distcode=n.distdyn,F={bits:n.distbits},D=g(w,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,F),n.distbits=F.bits,D){e.msg="invalid distances set",n.mode=R;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(c>=6&&d>=258){ +e.next_out=a,e.avail_out=d,e.next_in=o,e.avail_in=c,n.hold=A,n.bits=x,m(e,S),a=e.next_out,i=e.output,d=e.avail_out,o=e.next_in,s=e.input,c=e.avail_in,A=n.hold,x=n.bits,n.mode===k&&(n.back=-1);break}for(n.back=0;G=(P=n.lencode[A&(1<>>16&255,Z=65535&P,!((U=P>>>24)<=x);){if(0===c)break e;c--,A+=s[o++]<>T)])>>>16&255,Z=65535&P,!(T+(U=P>>>24)<=x);){if(0===c)break e;c--,A+=s[o++]<>>=T,x-=T,n.back+=T} +if(A>>>=U,x-=U,n.back+=U,n.length=Z,0===G){n.mode=26;break}if(32&G){n.back=-1,n.mode=k;break}if(64&G){e.msg="invalid literal/length code",n.mode=R;break}n.extra=15&G,n.mode=22;case 22:if(n.extra){for(L=n.extra;x>>=n.extra,x-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;G=(P=n.distcode[A&(1<>>16&255,Z=65535&P,!((U=P>>>24)<=x);){if(0===c)break e;c--,A+=s[o++]<>T)])>>>16&255,Z=65535&P,!(T+(U=P>>>24)<=x);){if(0===c)break e;c--,A+=s[o++]<>>=T,x-=T,n.back+=T}if(A>>>=U,x-=U,n.back+=U,64&G){e.msg="invalid distance code",n.mode=R;break}n.offset=Z,n.extra=15&G,n.mode=24;case 24:if(n.extra){for(L=n.extra;x>>=n.extra,x-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=R;break}n.mode=25;case 25: +if(0===d)break e;if(C=S-d,n.offset>C){if((C=n.offset-C)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=R;break}C>n.wnext?(C-=n.wnext,M=n.wsize-C):M=n.wnext-C,C>n.length&&(C=n.length),I=n.window}else I=i,M=a-n.offset,C=n.length;C>d&&(C=d),d-=C,n.length-=C;do{i[a++]=I[M++]}while(--C);0===n.length&&(n.mode=21);break;case 26:if(0===d)break e;i[a++]=n.length,d--,n.mode=21;break;case 27:if(n.wrap){for(;x<32;){if(0===c)break e;c--,A|=s[o++]<=1&&0===B[E];E--);if(S>E&&(S=E),0===E)return l[u++]=20971520,l[u++]=20971520,A.bits=1,0;for(x=1;x0&&(0===e||1!==E))return-1;for(O[1]=0,k=1;k<15;k++)O[k+1]=O[k]+B[k];for(R=0;R852||2===e&&U>592)return 1;for(;;){w=k-M,d[R]v?(b=j[D+d[R]],_=Z[T+d[R]]):(b=96,_=0),p=1<>M)+(h-=p)]=w<<24|b<<16|_|0}while(0!==h);for(p=1<>=1;if(0!==p?(G&=p-1,G+=p):G=0,R++,0==--B[k]){if(k===E)break;k=t[a+d[R]]}if(k>S&&(G&m)!==f){for(0===M&&(M=S),g+=x,I=1<<(C=k-M);C+M852||2===e&&U>592)return 1;l[f=G&m]=S<<24|C<<16|g-u|0}}return 0!==G&&(l[g+G]=k-M<<24|64<<16|0),A.bits=S,0}},{"../utils/common":41}],51:[function(e,t){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,t,n){"use strict";function r(e){for(var t=e.length;--t>=0;)e[t]=0}function s(e,t,n,r,s){this.static_tree=e,this.extra_bits=t, +this.extra_base=n,this.elems=r,this.max_length=s,this.has_stree=e&&e.length}function i(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function o(e){return e<256?L[e]:L[256+(e>>>7)]}function a(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function c(e,t,n){e.bi_valid>M-n?(e.bi_buf|=t<>M-e.bi_valid,e.bi_valid+=n-M):(e.bi_buf|=t<>>=1,n<<=1}while(--t>0);return n>>>1}function d(e,t,n){var r,s,i=new Array(C+1),o=0;for(r=1;r<=C;r++)i[r]=o=o+n[r-1]<<1;for(s=0;s<=t;s++){var a=e[2*s+1];0!==a&&(e[2*s]=u(i[a]++,a))}}function A(e){var t;for(t=0;t8?a(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0, +e.bi_valid=0}function h(e,t,n,r){var s=2*t,i=2*n;return e[s]>1;n>=1;n--)f(e,i,n);s=c;do{n=e.heap[1], +e.heap[1]=e.heap[e.heap_len--],f(e,i,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,i[2*s]=i[2*n]+i[2*r],e.depth[s]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,i[2*n+1]=i[2*r+1]=s,e.heap[1]=s++,f(e,i,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,s,i,o,a,c=t.dyn_tree,l=t.max_code,u=t.stat_desc.static_tree,d=t.stat_desc.has_stree,A=t.stat_desc.extra_bits,p=t.stat_desc.extra_base,h=t.stat_desc.max_length,f=0;for(i=0;i<=C;i++)e.bl_count[i]=0 +;for(c[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;nh&&(i=h,f++),c[2*r+1]=i,r>l||(e.bl_count[i]++,o=0,r>=p&&(o=A[r-p]),a=c[2*r],e.opt_len+=a*(i+o),d&&(e.static_len+=a*(u[2*r+1]+o)));if(0!==f){do{for(i=h-1;0===e.bl_count[i];)i--;e.bl_count[i]--,e.bl_count[i+1]+=2,e.bl_count[h]--,f-=2}while(f>0);for(i=h;0!==i;i--)for(r=e.bl_count[i];0!==r;)(s=e.heap[--n])>l||(c[2*s+1]!==i&&(e.opt_len+=(i-c[2*s+1])*c[2*s],c[2*s+1]=i),r--)}}(e,t),d(i,l,e.bl_count)} +function v(e,t,n){var r,s,i=-1,o=t[1],a=0,c=7,l=4;for(0===o&&(c=138,l=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)s=o,o=t[2*(r+1)+1],++a>=7;r0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1 +;for(t=32;t=3&&0===e.bl_tree[2*j[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),s=e.opt_len+3+7>>>3,(i=e.static_len+3+7>>>3)<=s&&(s=i)):s=i=n+5,n+4<=s&&-1!==t?b(e,t,n,r):4===e.strategy||i===s?(c(e,2+(r?1:0),3),m(e,D,F)):(c(e,4+(r?1:0),3),function(e,t,n,r){var s;for(c(e,t-257,5),c(e,n-1,5), +c(e,r-4,4),s=0;s>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(P[n]+k+1)]++,e.dyn_dtree[2*o(t)]++),e.last_lit===e.lit_bufsize-1}, +n._tr_align=function(e){c(e,2,3),l(e,I,D),function(e){16===e.bi_valid?(a(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t){"use strict" +;t.exports="function"==typeof setImmediate?setImmediate:function(){var e=[].slice.apply(arguments);e.splice(1,0,0),setTimeout.apply(null,e)}},{}]},{},[10])(10)}},n={};e.n=t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},e.d=(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){ +if("object"==typeof window)return window}}(),e.o=(e,t)=>({}.hasOwnProperty.call(e,t)),(()=>{"use strict";function t(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(Zo.isArrayBuffer(e)||Zo.isArrayBufferView(e)){var n=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,n)}catch(e){for(var r=0;r=64;){for(a=0;a<16;++a)t[a]=n.getInt32();for(;a<64;++a)r=((r=t[a-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10,s=((s=t[a-15])>>>7|s<<25)^(s>>>18|s<<14)^s>>>3,t[a]=r+t[a-7]+s+t[a-16]|0;for(c=e.h0,l=e.h1,u=e.h2,d=e.h3,A=e.h4,p=e.h5,h=e.h6,f=e.h7,a=0;a<64;++a)i=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),o=c&l|u&(c^l),r=f+((A>>>6|A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7))+(h^A&(p^h))+jo[a]+t[a],f=h,h=p,p=A, +A=d+r|0,d=u,u=l,l=c,c=r+(s=i+o)|0;e.h0=e.h0+c|0,e.h1=e.h1+l|0,e.h2=e.h2+u|0,e.h3=e.h3+d|0,e.h4=e.h4+A|0,e.h5=e.h5+p|0,e.h6=e.h6+h|0,e.h7=e.h7+f|0,m-=64}}function r(e,t){return e.toLowerCase()===t.toLowerCase()}function s(e){let t="";const n=e=>a(e)?parseInt(e,10):e>="A"&&e<="F"?e.charCodeAt(0)-"A".charCodeAt(0)+10:e.charCodeAt(0)-"a".charCodeAt(0)+10;let r=0;for(;r=e.length||!c(s)||!c(i)?(t+="%", +r++):(t+=String.fromCharCode((n(s)<<4)+n(i)),r+=3)}return t}function i(e){return e.replace(/([^\x20-\x7E]|[,;])/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))}function o(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}function a(e){return e>="0"&&e<="9"}function c(e){return void 0!==e&&(a(e)||e>="A"&&e<="F"||e>="a"&&e<="f")}function l(e){if(e.endsWith("=")&&(e=e.substring(0,e.length-1)),e.endsWith("=")&&(e=e.substring(0,e.length-1)),0===e.length)return!1 +;for(const t of e)if(!o(t)&&!a(t)&&"+"!==t&&t!==yd&&t!==kd&&"_"!==t)return!1;return!0}function u(e,t){const n=e.GetCspNonce();if(!n)return!1;for(const e of t)if(e.isNonce()&&e.getNonce()===n)return!0;return!1}function d(e,t){return e.toLowerCase()===t}function A(e,t,n,r,s){const i=t.scheme;if(!e)return!0;if(e===i)return!0;if("http"===e){if("https"===i)return!0;if(("ws"===i||"wss"===i)&&s)return!0} +return!("https"!==e||"wss"!==i||!s)||"ws"===e&&"wss"===i||r&&!n&&("http"===i&&"https"===e||"ws"===i&&"wss"===e)}let p;Object.fromEntries?p=Object.fromEntries:(p=e=>[...e].reduce(((e,[t,n])=>(e[t]=n,e)),{}),Object.fromEntries=p),Object.defineProperties(Promise.prototype,{done:{value:function(e){return this.then(((...t)=>e.apply(this,t)))},configurable:!0,enumerable:!0,writable:!1},fail:{value:function(e){return this.then((()=>{}),((...t)=>e.apply(this,t)))},configurable:!0,enumerable:!0, +writable:!1},always:{value:function(e){return this.then(((...t)=>e.apply(this,t)),((...t)=>e.apply(this,t)))},configurable:!0,enumerable:!0,writable:!1}});const h=Promise;let f=0;const m=[],g=()=>{const e=["debug"],t=["log"],n=["warn","info"],r=["error"],s=[...e,...t,...n,...r],i=r;f>=80&&i.push(...e),f>=60&&i.push(...t),f>=30&&i.push(...n),s.forEach((e=>v[e]=i.includes(e)?console[e].bind(console):()=>{}))},v={set:e=>{f=e,m.forEach((e=>{e(v,f)})),g()},get:()=>f,get verbose(){ +return(v.debug||(()=>{})).bind(console)},debug:()=>{},log:()=>{},warn:()=>{},info:()=>{},error:()=>{},addChangeListener:e=>{m.push(e)}};g();let w=[];const b={late:!1,init:()=>{},registerLateCallback:e=>{v.debug("toea: register callback"),w.push(e)},ensureLate:e=>{b.late?e():b.registerLateCallback(e)},setReady:()=>{v.debug("toea: run "+w.length+" callbacks"),b.late=!0;for(let e=0;e{const t=(()=>{let e,t;const n=[],r=[],s=e=>{r.push(e),i()},i=()=>{ +if(void 0!==e){let n;for(;r.length;)n=r.shift(),void 0!==n.state&&n.state!==e||"function"==typeof n.f&&n.f.call(o,t)}},o={promise:()=>o,done:e=>(s({state:!0,f:e}),o),fail:e=>(s({state:!1,f:e}),o),always:e=>(s({f:e}),o),progress:e=>(e&&n.push(e),o),then:(e,n,r)=>y((s=>{const i=(e,n)=>(...r)=>{const i=e?e(t):void 0,o=i&&"function"==typeof i.promise?i.promise():null,a=i&&"function"==typeof i.then?i:null +;if(o)o.done((e=>s.resolve(e))).fail(((...e)=>s.reject(e[0]))).progress(((...e)=>s.notify(...e)));else if(a)a.then(((...e)=>s.resolve(...e)),(e=>s.reject(e)));else{const t=e?[i]:r;s[n](t[0])}};o.done(i(e,"resolve")),o.fail(i(n,"reject")),o.progress(i(r,"notify"))})).promise(),each:e=>{const t=y();return o.then((n=>{const r=Array.isArray(n)?n:[n];y.when(r.map((t=>e(t)))).then(t.resolve)})),t.promise()},iterate:e=>{const t=y();return o.then((n=>{const r=(Array.isArray(n)?n:[n]).map((t=>()=>e(t))) +;y.onebyone(r,!0).done((e=>{t.resolve(e)})).fail(t.reject)})),t.promise()}};return{get:()=>o,try_resolve:n=>(void 0===e&&(e=!0,t=n),i(),o),try_reject:n=>(void 0===e&&(e=!1,t=n),i(),o),do_notify:e=>((e=>{n.forEach((t=>t(e)))})(e),o)}})(),n={promise:()=>t.get(),resolve:e=>t.try_resolve(e),reject:e=>t.try_reject(e),notify:e=>t.do_notify(e), +consume:e=>(e&&e.promise?e.promise().done((e=>n.resolve(e))).fail(((...e)=>n.reject(e[0]))).progress((e=>n.notify(e))):e&&e.then?e.then((e=>n.resolve(e)),((...e)=>n.reject(e[0]))):v.warn("promise: incompatible object given to consume()",e),n.promise())};return e&&e(n),n};y.Pledge=(...e)=>{const t=y();return t.resolve(...e),t.promise()},y.Breach=(...e)=>{const t=y();return t.reject(e[0]),t.promise()},y.onebyone=(e,t=!0)=>{const n=[],r=y();let s=0;const i=()=>{if(s{n.push(e),i()})).fail((()=>{if(n.push(null),t)return r.reject();i()})):o&&o.then?o.then((e=>{n.push(e),i()}),(()=>{if(n.push(null),t)return r.reject();i()})):(n.push(o),i())}else r.resolve(n)};return i(),r.promise()},y.or=e=>{let t;const n=y(),r=()=>{e.length?(t=e.shift(),t&&y.Pledge().then(t).done(n.resolve).fail(r)):n.reject()};return r(),n.promise()},y.sidebyside=e=>{e=Array.isArray(e)?e:[e];const t=y();let n=e.length;return n?e.forEach((e=>{ +e&&e.promise&&e.promise().always((()=>{0==--n&&t.resolve()}))})):t.resolve(),t.promise()},y.when=e=>{e=Array.isArray(e)?e:[e];const t=y();let n=e.length;const r=[];return n?e.forEach((e=>{let s;if(e&&e.promise)s=e.promise();else{if(!e.then)return void v.warn("promise: incompatible object given to when()",e);s=e}s.fail((()=>{t.reject(),n=-1})).done((e=>{r.push(e),0==--n&&t.resolve(r)}))})):t.resolve(r),t.promise()},y.all=e=>y.when(e).then((()=>{})),y.from=e=>{const t=y() +;return e.then(t.resolve,t.reject),t.promise()},y.heal=e=>e instanceof Array?y.all(e.map((e=>y.from(e).then((()=>{}),(()=>y.Pledge()))))):y.from(e).then((()=>{}),(()=>{}));const k=globalThis;let R,x,E,S,{chrome:C,browser:M}=k;E=()=>{if(void 0!==R)return R;try{const e=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);e&&(R=parseInt(e[2]))}catch(e){}return R},S=()=>{if(void 0!==x)return x;try{x=-1!=navigator.userAgent.search(/Android|Mobile/)}catch(e){}return x};const I={STORAGE:{ +SCHEMA:"#schema",TYPE:"#storage",CONFIG:"#config",SESSION:"#session",VERSION:"#version",LAST_START:"#laststart",UPDATE:"#update",BEGGING:"#begging",LEGACY_VERSION:"TM_version",STATE_DB:"!state",MISC_DB:"!misc",EXT_DB:"!extdb"},PREFIX:{SCRIPT_UID:"@uid#",COND:"@re#",STORE:"@st#",SCRIPT:"@source#",EXTERNAL:"@ext#",META:"@meta#"}},U=E()>=58,G={DEFAULT:"storage.local",SECURE:!1,NO_WARNING:!1},Z={RETRIES:0,PARTIAL_SIZE:1<<23,COOKIE_PASSTHROUGH:!1},T={HAS_SENDER_ID:!0, +INTERNAL_PAGE_PROTOCOLS:["chrome-extension:"],SENDS_ORIGIN:!0};[].concat(["chrome"]);const B=(()=>{const e={getInternalPathRegexp:function(e,t){const n=new RegExp("(\\"+["/",".","+","?","|","(",")","[","]","{","}","\\"].join("|\\")+")","g"),r=T.INTERNAL_PAGE_PROTOCOLS[0]+"//"+B.id+"/";return new RegExp(r.replace(n,"\\$1")+"([a-zA-Z"+(e?"\\/":"")+"]*)"+(t||"").replace(n,"\\$1"))},getInternalPageRegexp:function(){return B.getInternalPathRegexp(!1,".html")}, +getPlatformInfo:e=>C.runtime.getPlatformInfo(e),getBrowserInfo:e=>{e({name:"Chrome",version:`${E()}`,vendor:"unknown"})}};return Object.defineProperty(e,"lastError",{get:()=>C.runtime.lastError,enumerable:!0}),Object.defineProperty(e,"id",{get:()=>C.runtime.id,enumerable:!0}),Object.defineProperty(e,"short_id",{get:()=>e.id.replace(/[^0-9a-zA-Z]/g,"").substr(0,4),enumerable:!0}),e})(),O=(()=>{let e;return Object.defineProperties({},{inIncognitoContext:{ +get:()=>(void 0===e&&(e=C.extension.inIncognitoContext),e),set:t=>{e=t},enumerable:!0},...Object.getOwnPropertyDescriptors({getURL:function(e){return C.runtime.getURL(e)},sendMessage:(e,t)=>C.runtime.sendMessage(e,t),onMessage:{addListener:e=>C.runtime.onMessage.addListener(e)},connect:e=>C.runtime.connect({name:e}),urls:{prepareForReport:function(e){return e}}})})})(),j={isDefaultStoreId:e=>!(void 0!==e),getIdFromStoreId:()=>{}},D={supported:!0,createDocument:async(e,t)=>{ +await C.offscreen.createDocument({url:"offscreen.html",...e}),t&&t()},closeDocument:async e=>{await C.offscreen.closeDocument(),e&&e()}},F=e=>new h((t=>N(t,e)));let L=0;const P=async function(e,...t){await(()=>{const e=Date.now();if(L+1e3se((()=>{L=Date.now(),e()}),0)))})(),e.apply(this,t)},N=function(e,t){return t?se.apply(this,[e,t]):(P.apply(this,[e]),0)},V=e=>{const t=[],n=[],r=()=>{let s;if(n.length{let e;(e=n.indexOf(t))>-1&&n.splice(e,1),r()})),s.p.consume(t)}},s={add:function(e){const n=y();return t.push({fn:e,p:n}),r(),n.promise()}};return s},z=e=>{const t={},{retimeout_on_get:n,timeout:r,check_interval:s,auto_remove_mutex:i}=Object.assign({retimeout_on_get:!1,timeout:300,check_interval:120},e||{});let o;const a=()=>{c(),o=se(u,1e3*s)},c=()=>{o&&J(o),o=null},l=e=>{ +const n=t[e];if(delete t[e],n){const{d:t,value:r}=n;return t.resolve([e,r]),r}},u=()=>{o=null;const e=Date.now()-1e3*r,n=Object.entries(t).filter((([t,n])=>n.ts{n.forEach((([e,t])=>{const n=t&&t.d;n&&n.resolve([e,t.value]),l(e)})),i&&i.release(),a()})):a()};r&&a();const d={set:(e,n)=>{const r=y();return t[e]={value:n,ts:Date.now(),d:r},r.promise()},get:(e,r)=>{const s=t[e];return s?(n&&(s.ts=Date.now()),s.value):r},remove:l,removeAll:()=>{ +Object.keys(t).map((e=>l(e)))}};return d},{AbortController:q,FileReader:H,TextDecoder:Q,atob:W,btoa:X,clearInterval:Y,clearTimeout:J,crypto:K,decodeURIComponent:$,encodeURIComponent:ee,escape:te,location:ne,setInterval:re,setTimeout:se,unescape:ie}=self;let{fetch:oe}=self +;const ae=self,ce=ne.origin,le=ne.host,{addEventListener:ue,removeEventListener:de}=self,Ae=ue,{DOMParser:pe,Notification:he,Image:fe,Worker:me,alert:ge,confirm:ve,document:we,screen:be,webkitNotifications:_e,navigation:ye,showOpenFilePicker:ke}=self;let Re;try{Re=self.localStorage}catch(e){}const xe=Re;let{XMLHttpRequest:Ee}=self;const{clients:Se}=self,Ce=e=>[...new Set(e)],Me=(e,t,n)=>{const r=e.indexOf(t);if(-1==r)return"";if(!n)return e.substr(r+t.length) +;const s=e.substr(r+t.length).indexOf(n);return-1==s?"":e.substr(r+t.length,s)},Ie=(e,t)=>{null==t&&(t=[]);const n=new RegExp("(\\"+["/",".","+","?","|","(",")","[","]","{","}","\\"].concat(t).join("|\\")+")","g");return e.replace(n,"\\$1")},Ue=e=>Ie(e,["*"]),Ge=e=>(({}.toString.apply(e).match(/\s([a-z|A-Z]+)/)||[])[1]),Ze=(e,t)=>{const n=Ge(e);if("Array"===n||"NodeList"===n){for(let n=0;ne.slice(0,t)+r+e.slice(t+Math.abs(n)),Be=(e,t,n,r)=>{let s;if(Array.isArray(n)){const e={};n.forEach((t=>{e[t]=!0})),s=e}else s=n;return Ze(s||e,((n,i)=>{if(!s||s.hasOwnProperty(i)){let n;const o=e[i],a=Ge(o);if("Undefined"==a)return;if(s&&r&&(n=Ge(s[i]))&&n!==a&&("Array"===n||"Object"===n))return;"Object"==a?(t[i]={},Be(o,t[i],s?s[i]:null)):"Array"==a?(t[i]=[], +Be(o,t[i])):t[i]=o}})),t},Oe=(e,t)=>{let n=!0;if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return e===t;for(const[r,s]of Object.entries(t))if(void 0!==s&&(n=void 0!==e[r]&&(null===s?null===e[r]:s instanceof RegExp?!!`${e[r]}`.match(s):"object"==typeof s?Oe(e[r],s):e[r]===s),!n))break;return n},je=e=>(()=>{let t={};const n=e||1e3,r={clear:()=>{Ze(t,(e=>J(e))),t={}},is:(e,n)=>{const s=void 0!==t[e];return n&&r.add(e),s},add:(e,s)=>{r.is(e)&&J(t[e]),t[e]=se((()=>{delete t[e] +}),s||n)}};return r})(),De=e=>Array.isArray(e)?e:[e],Fe=(e,t,n="both")=>"notinfirst"==n?t.filter((t=>!e.includes(t))):e.concat(t).filter((n=>!e.includes(n)||!t.includes(n))),Le=(e,t,n)=>{void 0===n&&(n="-");const r=t?/[:<>|~?*\x00-\x1F\uFDD0-\uFDEF"]/g:/[:<>|~?*\x00-\x1F\uFDD0-\uFDEF"\/\\]|^[.]|[.]$/g;return!t&&/^((CON|PRN|AUX|NUL|CLOCK\$|COM[1-9]|LPT[1-9])(\..*)?|device(\..*)?|desktop.ini|thumbs.db)$/i.test(e)?(n||"_")+e.replace(r,n):e.replace(r,n) +},Pe=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})),Ne=(e,t)=>{const n=[];for(let r=0,s=e.length;rthis.off(e,t)}once(e,t,n){const r=void 0===n||Array.isArray(n)?n:[n],s=this.on(e,((...e)=>(s(), +t.bind(this)(...e))),r);return s}off(e,t){const n=this.events[e];n&&(this.events[e]=n.filter((e=>e.listener!==t)))}has(e,t){const n=this.events[e];return!!n&&n.some((e=>e.listener===t))}emit(e,...t){const n=this.events[e];if(n)for(const e of n){const{listener:n,filter:r}=e;if((!r||Oe(t,r))&&!0===n(...t))return!0}return!1}listening(e,t){const n=this.events[e];if(n){if(t){const e=Array.isArray(t)?t:[t];return n.filter((t=>!t.filter||Oe(t.filter,e))).length}return n.length}return 0}}class ze{ +constructor(e){this.storage={},this.prefix=e}supported(){return y.Pledge(!0)}keys(){return y((({resolve:e})=>{const t=Object.keys(this.storage).filter((e=>e.startsWith(this.prefix)));e(t)})).promise()}list(){return y((({resolve:e})=>{const t=Object.keys(this.storage).filter((e=>e.startsWith(this.prefix))).map((e=>({key:e.substr(this.prefix.length),value:this.storage[e]})));e(t)})).promise()}set(e,t){return y((({resolve:n})=>{this.storage[`${this.prefix}${e}`]=t,n()})).promise()}get(e){ +return y((({resolve:t})=>{const n=`${this.prefix}${e}`;n in this.storage?t(this.storage[n]):t(null)})).promise()}delete(e){return y((({resolve:t})=>{delete this.storage[`${this.prefix}${e}`],t()})).promise()}clear(){return y((({resolve:e})=>{this.storage={},e()})).promise()}}class qe{constructor(e,t){this.db=null,this.dbName=e,this.storeName=t}open(){const e=y();if(this.db)return e.resolve(this.db),e.promise();const t=indexedDB.open(this.dbName,1);return t.onerror=()=>{ +e.reject(new Error("Error opening database."))},t.onupgradeneeded=e=>{const t=e.target.result;t.objectStoreNames.contains(this.storeName)||t.createObjectStore(this.storeName)},t.onsuccess=t=>{this.db=t.target.result,e.resolve(this.db)},e.promise()}supported(){return y((async({resolve:e})=>{"undefined"!=typeof indexedDB?this.list().done((()=>e(!0))).fail((()=>e(!1))):e(!1)})).promise()}keys(){return this.open().then((e=>{ +const t=y(),n=e.transaction(this.storeName,"readonly").objectStore(this.storeName).openCursor(),r=[];return n.onerror=()=>{t.reject(new Error("Error getting keys values."))},n.onsuccess=e=>{const n=e.target.result;n?(r.push(n.key),n.continue()):t.resolve(r)},t.promise()}))}list(){return this.open().then((e=>{const t=y(),n=e.transaction(this.storeName,"readonly").objectStore(this.storeName).openCursor(),r=[];return n.onerror=()=>{t.reject(new Error("Error listing values."))},n.onsuccess=e=>{ +const n=e.target.result;n?(r.push({key:n.key,value:n.value}),n.continue()):t.resolve(r)},t.promise()}))}set(e,t){return this.open().then((n=>{const r=y(),s=n.transaction(this.storeName,"readwrite").objectStore(this.storeName).put(t,e);return s.onerror=()=>{r.reject(new Error("Error setting value."))},s.onsuccess=()=>{r.resolve()},r.promise()}))}get(e){return this.open().then((t=>{const n=y(),r=t.transaction(this.storeName,"readonly").objectStore(this.storeName).get(e);return r.onerror=()=>{ +n.reject(new Error("Error getting value."))},r.onsuccess=()=>{n.resolve(r.result)},n.promise()}))}delete(e){return this.open().then((t=>{const n=y(),r=t.transaction(this.storeName,"readwrite").objectStore(this.storeName).delete(e);return r.onerror=()=>{n.reject(new Error("Error deleting value."))},r.onsuccess=()=>{n.resolve()},n.promise()}))}clear(){return this.open().then((e=>{const t=y(),n=e.transaction(this.storeName,"readwrite").objectStore(this.storeName).clear();return n.onerror=()=>{ +t.reject(new Error("Error clearing the store."))},n.onsuccess=()=>{t.resolve()},t.promise()}))}}const He=e=>ie(ee(e)),Qe=e=>$(te(e)),We=e=>{let t="";for(let n=0;nW(e),Ye=(e,t)=>{try{let n,r;if("object"==typeof t?(n=t.encoding,r=t.array):n=t,!r&&n)return new Q(n).decode(e);{let t=0;const r=[],s=e.byteLength;for(;t{try{let n;n="object"==typeof t?t.encoding:t,n&&"utf-8"==n.toLowerCase()&&(e=He(e));const r=new Uint8Array(e.length);for(let t=0;tnew Promise(((n,r)=>{const s=t&&t.encoding?"text/plain":"binary/octet-stream",i=new Blob([e],{type:s}),o=new H;o.onload=e=>{ +e.target?n(e.target.result):r(new Error("Could not convert array to string!"))},t&&t.encoding?o.readAsText(i,t.encoding):o.readAsBinaryString(i)})),$e=(e,t)=>{const n=(e,t)=>e<>>32-t,r=(e,t)=>{const n=2147483648&e,r=2147483648&t,s=1073741824&e,i=1073741824&t,o=(1073741823&e)+(1073741823&t);return s&i?2147483648^o^n^r:s|i?1073741824&o?3221225472^o^n^r:1073741824^o^n^r:o^n^r},s=(e,t,s,i,o,a,c)=>(e=r(e,r(r(((e,t,n)=>e&t|~e&n)(t,s,i),o),c)), +r(n(e,a),t)),i=(e,t,s,i,o,a,c)=>(e=r(e,r(r(((e,t,n)=>e&n|t&~n)(t,s,i),o),c)),r(n(e,a),t)),o=(e,t,s,i,o,a,c)=>(e=r(e,r(r(((e,t,n)=>e^t^n)(t,s,i),o),c)),r(n(e,a),t)),a=(e,t,s,i,o,a,c)=>(e=r(e,r(r(((e,t,n)=>t^(e|~n))(t,s,i),o),c)),r(n(e,a),t)),c=e=>{let t,n,r="",s="";for(n=0;n<=3;n++)t=e>>>8*n&255,s="0"+t.toString(16),r+=s.substr(s.length-2,2);return r};let l,u,d,A,p,h,f,m,g,v=[];for(t&&"utf-8"==t.toLowerCase()&&(e=He(e)),v=(e=>{let t;const n=e.length,r=n+8,s=16*((r-r%64)/64+1),i=Array(s-1) +;let o=0,a=0;for(;a>>29,i})(e),h=1732584193,f=4023233417,m=2562383102,g=271733878,l=0;l{let t;t=e.split(",")[0].includes("base64")?W(e.split(",")[1]):ie(e.split(",")[1]);const n=e.split(",")[0].split(":")[1].split(";")[0];return new Blob([Je(t)],{type:n})},tt=e=>new Promise((t=>{const n=new H;n.onload=e=>{var n;t((null===(n=e.target)||void 0===n?void 0:n.result)||void 0)},n.readAsDataURL(e)})),nt=async(e,t)=>new Promise((n=>{const r=new H;r.onload=()=>{ +n(r.result||"")},r.onerror=e=>{v.warn(`unable to decode data ${e}`),n(void 0)},t?r.readAsText(e,t):r.readAsBinaryString(e)}));class rt{constructor(e=1){if(this.waiting=[],e<0)throw new Error("Count must not be negative");this._count=e}acquire(){if(this._count>0)return this._count--,y.Pledge();{const e=y();return this.waiting.push(e.resolve),e.promise()}}release(){if(this.waiting.length>0){const e=this.waiting.shift();e&&e(void 0)}else this._count++}get count(){return this._count}} +const st=new rt(1),it=new Ve,ot={};let at=[];it.on("download",(({id:e,url:t,error:n})=>{const r=ot[e];r?(r.state=n?"interrupted":"complete",at.forEach((t=>{t({id:e,state:{current:r.state}})})),se((()=>{delete ot[e]}),6e4)):console.warn("download event for unknown id",e,t)}));const ct={notDetermined:void 0,denied:"denied",authorized:"granted",provisional:"granted"};let lt=[],ut=[],dt=[],At=ct.notDetermined;it.on("notification",(({id:e,clicked:t,error:n})=>{ +n?console.warn("notifications: error",e,n):(t&<.forEach((function(t){t(e)})),ut.forEach((function(t){t(e)})))})),it.on("permission",(({permission:e})=>{At=ct[e],dt.forEach((function(e){e(At)}))}));let pt=!0;(async()=>{await null,pt=!1})();const ht=Object.defineProperties({},{...Object.getOwnPropertyDescriptors(O),...Object.getOwnPropertyDescriptors({onConnect:{addListener:function(e){ +if(!pt)throw new Error("extension.onConnect listener can only be registered during startup in non-persistent background pages!");return C.runtime.onUserScriptConnect?C.runtime.onUserScriptConnect.addListener(e):console.error("chrome.runtime.onUserScriptConnect is not available!"),C.runtime.onConnect.addListener(e)}},onConnectExternal:{addListener:function(e){if(!pt)throw new Error("extension.onConnectExternal listener can only be registered during startup in non-persistent background pages!") +;return C.runtime.onConnectExternal.addListener(e)}},onMessageExternal:{addListener:function(e){if(!pt)throw new Error("extension.onMessageExternal listener can only be registered during startup in non-persistent background pages!");return C.runtime.onMessageExternal.addListener(e)}},onMessage:{...O.onMessage,addDynamicListener:e=>{const t=(t,n,r)=>e(t,n,r) +;C.runtime.onUserScriptMessage?C.runtime.onUserScriptMessage.addListener(t):console.error("chrome.runtime.onUserScriptMessage is not available!"),O.onMessage.addListener(t)},addListener:e=>{if(!pt)throw new Error("extension.onMessage listener can only be registered during startup in non-persistent background pages!");return ht.onMessage.addDynamicListener(e)}}}),inIncognitoContext:{get:function(){return O.inIncognitoContext}},manifest:{get:function(){return C.runtime.getManifest()}} +}),ft=Object.defineProperties({},{...Object.getOwnPropertyDescriptors(B),...Object.getOwnPropertyDescriptors({onInstalled:{addListener:function(e){if(!pt)throw new Error("runtime.onInstalled listener can only be registered during startup in non-persistent background pages!");C.runtime.onInstalled&&C.runtime.onInstalled.addListener(e)}},onUpdateAvailable:{addListener:function(e){ +if(!pt)throw new Error("runtime.onUpdateAvailable listener can only be registered during startup in non-persistent background pages!");C.runtime.onUpdateAvailable&&C.runtime.onUpdateAvailable.addListener(e)}},setUninstallURL:e=>{C.runtime.setUninstallURL&&C.runtime.setUninstallURL(e)},getContexts:async e=>{if("getContexts"in C.runtime)return await C.runtime.getContexts(e)}})}),mt={onActivated:{addListener:function(e){ +if(!pt)throw new Error("tabs.onActivated listener can only be registered during startup in non-persistent background pages!");return C.tabs.onActivated.addListener(e)},addDynamicListener:function(e){return C.tabs.onActivated.addListener(e)},removeListener:function(e){return C.tabs.onActivated.removeListener(e)}},onUpdated:{addListener:function(e){if(!pt)throw new Error("tabs.onUpdated listener can only be registered during startup in non-persistent background pages!") +;return C.tabs.onUpdated.addListener(e)},addDynamicListener:function(e){return C.tabs.onUpdated.addListener(e)},removeListener:function(e){return C.tabs.onUpdated.removeListener(e)}},onReplaced:{addListener:function(e){if(!pt)throw new Error("tabs.onReplaced listener can only be registered during startup in non-persistent background pages!");if(C.tabs.onReplaced)return C.tabs.onReplaced.addListener(e)},addDynamicListener:function(e){if(C.tabs.onReplaced)return C.tabs.onReplaced.addListener(e)}, +removeListener:function(e){return C.tabs.onReplaced.removeListener(e)}},onRemoved:{addListener:function(e){if(!pt)throw new Error("tabs.onRemoved listener can only be registered during startup in non-persistent background pages!");return C.tabs.onRemoved.addListener(e)},addDynamicListener:function(e){return C.tabs.onRemoved.addListener(e)},removeListener:function(e){return C.tabs.onRemoved.removeListener(e)}},executeScript:function(e,t,n){return C.tabs.executeScript(e,t,n)},create:function(e,t){ +let{url:n,active:r,index:s,openerTabId:i,windowId:o,parent:a,incognito:c}=e;const l={url:n,active:r,index:s,openerTabId:i,windowId:o};a&&(void 0!==(i=a.id)&&(i<0?console.warn(`tabs.create: openerTabId lower than 0 is not supported -> ${i}!`):l.openerTabId=i),void 0!==(o=a.windowId)&&(l.windowId=o)),c&>.supported?gt.getAll({windowTypes:["normal"]},(e=>{let n;return e.some((e=>e.incognito?n=e.id:null)),void 0===n?C.windows.create({url:l.url,incognito:!0},t):(l.windowId=n,C.tabs.create(l,t)) +})):C.tabs.create(l,t)},update:function(e,t,n){return C.tabs.update(e,t,n)},remove:function(e,t){return C.tabs.remove(e,t)},highlight:function(e,t){if(!e||!e.tabs)return void(t&&t());const n=e.tabs instanceof Array?e.tabs:[e.tabs];if(!C.tabs.highlight){const e=n.pop();return C.tabs.update(e,{active:!0},(()=>{t&&t()}))}{const e=[];let r;const s=()=>{if(!n.length)return C.tabs.highlight({windowId:r,tabs:e},(()=>{C.windows.update(r,{focused:!0},(()=>{t&&t()}))}));{const t=n.pop();C.tabs.get(t,(t=>{ +void 0===r&&(r=t.windowId),t.windowId===r&&e.push(t.index),s()}))}};s()}},getSelected:function(e,t){let n=1;const r=()=>mt.query({active:!0,lastFocusedWindow:!0,...e?{windowId:e}:{}},(e=>{C.runtime.lastError&&n-- >0?se(r,1):t&&t(e[0])}));return r()},get:function(e,t){return C.tabs.get(e,t)},query:function(e,t){return C.tabs.query(e,(e=>t(e||[])))},sendMessage:function(e,t,n,r){return"function"==typeof n&&(r=n,n={}),C.tabs.sendMessage(e,t,n,r)}},gt=C&&C.windows&&C.windows.getAll?{supported:!0, +getAll:function(e,t){C.windows.getAll?C.windows.getAll(e,(e=>t(e||[]))):t([])},update:function(e,t,n){return C.windows.update(e,t,n)},get:function(e,t,n){return C.windows.get(e,t,n)}}:{supported:!1},vt={headerModificationSupported:!0,extraHeaderNeeded:C&&C.webRequest&&C.webRequest.OnBeforeSendHeadersOptions&&C.webRequest.OnBeforeSendHeadersOptions.hasOwnProperty("EXTRA_HEADERS"),onBeforeRequest:{addListener:(e,t,n)=>{ +if(!pt)throw new Error("webRequest.onBeforeRequest.addListener can only be registered during startup in non-persistent background pages!");return C.webRequest.onBeforeRequest.addListener(e,t,n)},addDynamicListener:(e,t,n)=>C.webRequest.onBeforeRequest.addListener(e,t,n),removeListener:e=>C.webRequest.onBeforeRequest.removeListener(e),hasListener:e=>C.webRequest.onBeforeRequest.hasListener(e)},onBeforeSendHeaders:{addListener:(e,t,n)=>{ +if(!pt)throw new Error("webRequest.onBeforeSendHeaders.addListener can only be registered during startup in non-persistent background pages!");return C.webRequest.onBeforeSendHeaders.addListener(e,t,n)},addDynamicListener:(e,t,n)=>C.webRequest.onBeforeSendHeaders.addListener(e,t,n),removeListener:e=>C.webRequest.onBeforeSendHeaders.removeListener(e),hasListener:e=>C.webRequest.onBeforeSendHeaders.hasListener(e)},onHeadersReceived:{addListener:(e,t,n)=>{ +if(!pt)throw new Error("webRequest.onHeadersReceived.addListener can only be registered during startup in non-persistent background pages!");return C.webRequest.onHeadersReceived.addListener(e,t,n)},addDynamicListener:(e,t,n)=>C.webRequest.onHeadersReceived.addListener(e,t,n),removeListener:e=>C.webRequest.onHeadersReceived.removeListener(e),hasListener:e=>C.webRequest.onHeadersReceived.hasListener(e)},onBeforeRedirect:{addListener:(e,t,n)=>{ +if(!pt)throw new Error("webRequest.onBeforeRedirect.addListener can only be registered during startup in non-persistent background pages!");return C.webRequest.onBeforeRedirect.addListener(e,t,n)},addDynamicListener:(e,t,n)=>C.webRequest.onBeforeRedirect.addListener(e,t,n),removeListener:e=>C.webRequest.onBeforeRedirect.removeListener(e),hasListener:e=>C.webRequest.onBeforeRedirect.hasListener(e)},onResponseStarted:{addListener:(e,t,n)=>{ +if(!pt)throw new Error("webRequest.onResponseStarted.addListener can only be registered during startup in non-persistent background pages!");return C.webRequest.onResponseStarted.addListener(e,t,n)},addDynamicListener:(e,t,n)=>C.webRequest.onResponseStarted.addListener(e,t,n),removeListener:e=>C.webRequest.onResponseStarted.removeListener(e),hasListener:e=>C.webRequest.onResponseStarted.hasListener(e)},onErrorOccurred:{addListener:(e,t)=>{ +if(!pt)throw new Error("webRequest.onErrorOccurred.addListener can only be registered during startup in non-persistent background pages!");return C.webRequest.onErrorOccurred.addListener(e,t)},addDynamicListener:(e,t)=>C.webRequest.onErrorOccurred.addListener(e,t),removeListener:e=>C.webRequest.onErrorOccurred.removeListener(e),hasListener:e=>C.webRequest.onErrorOccurred.hasListener(e)},handlerBehaviorChanged:()=>C.webRequest.handlerBehaviorChanged()},wt={supported:!(!C||!C.webNavigation), +onCommitted:{addListener:function(e){if(!pt)throw new Error("webNavigation.onCommitted listener can only be registered during startup in non-persistent background pages!");if(C.webNavigation.onCommitted)return C.webNavigation.onCommitted.addListener(e)},addDynamicListener:function(e){if(C.webNavigation.onCommitted)return C.webNavigation.onCommitted.addListener(e)}},onUrlUpdated:C&&C.webNavigation&&(C.webNavigation.onHistoryStateUpdated||C.webNavigation.onReferenceFragmentUpdated)?{ +addListener:function(e){if(!pt)throw new Error("webNavigation.onUrlUpdated listener can only be registered during startup in non-persistent background pages!");C.webNavigation.onHistoryStateUpdated&&C.webNavigation.onHistoryStateUpdated.addListener(e),C.webNavigation.onReferenceFragmentUpdated&&C.webNavigation.onReferenceFragmentUpdated.addListener(e)},addDynamicListener:function(e){C.webNavigation.onHistoryStateUpdated&&C.webNavigation.onHistoryStateUpdated.addListener(e), +C.webNavigation.onReferenceFragmentUpdated&&C.webNavigation.onReferenceFragmentUpdated.addListener(e)}}:void console.warn("webNavigation onReferenceFragmentUpdated or onHistoryStateUpdated not supported, onurlchange will not work!"),onBeforeNavigate:{addListener:function(e,t){if(!pt)throw new Error("webNavigation.onBeforeNavigate listener can only be registered during startup in non-persistent background pages!") +;if(C.webNavigation.onBeforeNavigate)return C.webNavigation.onBeforeNavigate.addListener(e,t)},addDynamicListener:function(e,t){if(C.webNavigation.onBeforeNavigate)return C.webNavigation.onBeforeNavigate.addListener(e,t)}},onErrorOccurred:{addListener:function(e){if(!pt)throw new Error("webNavigation.onErrorOccurred listener can only be registered during startup in non-persistent background pages!");if(C.webNavigation.onErrorOccurred)return C.webNavigation.onErrorOccurred.addListener(e)}, +addDynamicListener:function(e){if(C.webNavigation.onErrorOccurred)return C.webNavigation.onErrorOccurred.addListener(e)}}},bt=C&&C.action,_t=bt?{supported:!0,setIcon:function(e,t){const{path:n,...r}=e;let s={};return n&&(s=E()>=53?{19:n.replace(/\.png$/,"19.png"),38:n.replace(/\.png$/,"38.png"),16:n.replace(/\.png$/,"16.png"),24:n.replace(/\.png$/,"24.png"),32:n.replace(/\.png$/,"32.png")}:{19:n.replace(/\.png$/,"19.png"),38:n.replace(/\.png$/,"38.png")}),bt.setIcon({path:s,...r},t)}, +setTitle:function(e){if(bt.setTitle)return bt.setTitle(e)},setBadgeText:function(e){if(bt.setBadgeText)return bt.setBadgeText(e)},setBadgeBackgroundColor:function(e){if(bt.setBadgeBackgroundColor)return bt.setBadgeBackgroundColor(e)},setBadgeTextColor:function(e){return bt.setBadgeTextColor?bt.setBadgeTextColor(e):null},setPopup:function(e){if(bt.setPopup)return bt.setPopup(e)},openPopup:()=>bt.openPopup?bt.openPopup():null}:{supported:!1 +},yt=(C&&C.declarativeContent&&C.declarativeContent.onPageChanged&&(C.declarativeContent.PageStateMatcher,C.declarativeContent.RequestContentScript),M&&M.contentScripts&&M.contentScripts.register,M&&M.userScripts&&M.userScripts.register,{supported:!0,register:(...e)=>C.userScripts.register(...e),unregister:(...e)=>C.userScripts.unregister(...e),update:(...e)=>C.userScripts.update(...e),configureWorld:(...e)=>C.userScripts.configureWorld(...e),getScripts:(...e)=>C.userScripts.getScripts(...e), +available:()=>{try{return!!C.userScripts}catch{return!1}}}),kt=(()=>{const e=C;return e&&e.scripting&&e.scripting.executeScript?{supported:!0,executeScript:t=>e.scripting.executeScript(t),registerContentScripts:t=>e.scripting.registerContentScripts(t),getRegisteredContentScripts:t=>e.scripting.getRegisteredContentScripts(t),unregisterContentScripts:t=>e.scripting.unregisterContentScripts(t)}:{supported:!1} +})(),Rt=C&&C.declarativeNetRequest&&C.declarativeNetRequest.updateSessionRules&&C.declarativeNetRequest.getSessionRules?{supported:!0,getSessionRules:(...e)=>C.declarativeNetRequest.getSessionRules(...e),updateSessionRules:(e,t)=>new Promise(((n,r)=>{try{C.declarativeNetRequest.updateSessionRules(e,(()=>{const e=C.runtime.lastError;if(e){if(r(e),t)throw e}else t&&t(),n()}))}catch(e){if(r(e),t)throw e}}))}:{supported:!1},xt={onChanged:{addListener:function(e){ +return C.storage.onChanged.addListener(e)}},local:(()=>{let e={},t={},n=null,r=!1,s=[];const i=e=>{r?s.push(e):e()},o=(i,o)=>{n&&J(n);const a=()=>{r=!0;let i=1;const a=()=>{let n;if((n=C.runtime.lastError)&&console.warn(n),0==--i){r=!1;const n=s;s=[],e={},t={},n.forEach((e=>e())),o&&o()}},c=()=>{Object.keys(e).length&&(i++,C.storage.local.set(e,a))};let l;(l=Object.keys(t)).length?(i++,C.storage.local.remove(l,(()=>{c(),a()}))):c(),a(),n=null};i?a():n=se(a,100)},a=(t,n)=>{if(t instanceof Array){ +let e=1;const r={},s=()=>{0==--e&&n(r)};t.forEach((t=>{e++,a(t,(e=>{r[t]=e[t],s()}))})),s()}else if(void 0!==e[t]){const r={};r[t]=e[t],n(r)}else C.storage.local.get(t,n)},c=n=>{n instanceof Array?n.forEach((e=>c(e))):(t[n]=!0,delete e[n])},l={set:function(n,r){i((()=>{r&&s.push(r),Object.keys(n).forEach((r=>{var s,i;s=r,i=n[r],e[s]=i,delete t[s]})),o()}))},get:(e,t)=>{null===e?o(!0,(()=>{C.storage.local.get(null,t)})):i((()=>{const n="string"==typeof e||e instanceof Array?e:Object.keys(e) +;a(n,(e=>t(e)))}))},remove:function(e,t){i((()=>{t&&s.push(t),c(e),o()}))},clear:function(r){i((()=>{n&&J(n),s=[],e={},t={},C.storage.local.clear(r)}))}};return l})(),session:(()=>{const e=M||C;return{supported:e&&e.storage&&e.storage.session,set:t=>e.storage.session.set(t),get:t=>e.storage.session.get(t),remove:t=>e.storage.session.remove(t),clear:()=>e.storage.session.clear()}})(),managed:{supported:!!C&&!!C.storage.managed,set:function(e,t){return C.storage.managed.set(e,t)}, +get:function(e,t){return C.storage.managed.get(e,t)},remove:function(e,t){return C.storage.managed.remove(e,t)},clear:function(e){return C.storage.managed.clear(e)}},sync:{supported:!0,set:function(e,t){return C.storage.sync.set(e,t)},get:function(e,t){return C.storage.sync.get(e,t)},remove:function(e,t){return C.storage.sync.remove(e,t)},clear:function(e){return C.storage.sync.clear(e)}}},Et=(()=>{const e=()=>C.downloads;return{supported:!0,onChanged:{addListener:function(t){var n +;if(!pt)throw new Error("downloads.onChanged listener can only be registered during startup in non-persistent background pages!");return null===(n=e())||void 0===n?void 0:n.onChanged.addListener(t)},addDynamicListener:function(t){var n;return null===(n=e())||void 0===n?void 0:n.onChanged.addListener(t)}},search:function(t,n){var r;return null===(r=e())||void 0===r?void 0:r.search(t,n)},cancel:function(t,n){var r;return null===(r=e())||void 0===r?void 0:r.cancel(t,n)},download:function(t,n){var r +;try{return null===(r=e())||void 0===r?void 0:r.download(t,n)}catch(e){n(void 0,e.message)}}}})(),St=async function(e,t,n){try{const n=await oe(e),r=await n.blob();t(await new Response(r).arrayBuffer())}catch(e){n(e.message)}},Ct=Object.defineProperties({},{...Object.getOwnPropertyDescriptors(j),...Object.getOwnPropertyDescriptors({getAll:function(e,t){return C.cookies.getAll(e,t)},remove:function(e,t){return C.cookies.remove(e,t)},set:function(e,t){return C.cookies.set(e,t)}})}),Mt={ +supported:!1,set:()=>{}},It=!!(C&&C.commands&&C.commands.onCommand),Ut=(()=>{const e=C&&C.notifications;return e&&e.getPermissionLevel&&e.onPermissionLevelChanged&&e.onClicked?{supported:!0,onPermissionLevelChanged:{addListener:function(t){if(!pt)throw new Error("notifications.onPermissionLevelChanged listener can only be registered during startup in non-persistent background pages!");return e.onPermissionLevelChanged.addListener(t)},removeListener:function(t){ +return e.onPermissionLevelChanged.removeListener(t)}},onClicked:{addListener:function(t){if(!pt)throw new Error("notifications.onClicked listener can only be registered during startup in non-persistent background pages!");return e.onClicked.addListener(t)},removeListener:function(t){return e.onClicked.removeListener(t)}},onClosed:{addListener:function(t){if(!pt)throw new Error("notifications.onClosed listener can only be registered during startup in non-persistent background pages!") +;return e.onClosed.addListener(t)},removeListener:function(t){return e.onClosed.removeListener(t)}},getPermissionLevel:function(t){return e.getPermissionLevel(t)},create:function(t,n,r){return e.create(t,n,r)},clear:function(t,n){return e.clear(t,n)}}:{supported:!1}})(),Gt=C&&C.contextMenus&&C.contextMenus.create&&C.contextMenus.update&&C.contextMenus.remove?{supported:!0,create:function(e,t){return C.contextMenus.create(e,t)},update:function(e,t,n){return C.contextMenus.update(e,t,n)}, +remove:function(e,t){return C.contextMenus.remove(e,t)},removeAll:function(e){return C.contextMenus.removeAll(e)},onClicked:{addListener:function(e){if(!pt)throw new Error("contextMenus.onClicked listener can only be registered during startup in non-persistent background pages!");return C.contextMenus.onClicked.addListener(e)}}}:{supported:!1},Zt=(()=>{const e=C&&C.permissions&&!!C.permissions.getAll;return e?{supported:e,getAll:t=>{if(e)return C.permissions.getAll(t);t&&t({permissions:[], +origins:[]})},contains:(t,n)=>{if(e)return C.permissions.contains(t,n);n&&n(!1)},request:(t,n)=>{if(e)return C.permissions.request(t,n);n&&n(!1)},remove:(t,n)=>{if(e)return C.permissions.remove(t,n);n&&n(!1)},onAdded:{addListener:t=>{if(e&&C.permissions.onAdded)return C.permissions.onAdded.addListener(t)}},onRemoved:{addListener:t=>{if(e&&C.permissions.onRemoved)return C.permissions.onRemoved.addListener(t)}}}:{supported:!1}})(),Tt={native_support:!0,getMessage:function(...e){ +return C.i18n.getMessage(...e)},getUILanguage:function(){return C.i18n.getUILanguage?C.i18n.getUILanguage():navigator.language},getAcceptLanguages:function(e){return C.i18n.getAcceptLanguages?C.i18n.getAcceptLanguages(e):e([])}},Bt=function(e,t){return C.idle?C.idle.queryState(e,t):t("unknown")},Ot=(()=>{if(!C||!C.alarms||!C.alarms.create)return{supported:!1};const e={supported:!0,create:(e,t)=>new Promise((n=>{(C.alarms.create(e,t)||Promise.resolve()).then((()=>n()))})), +get:e=>new Promise((t=>C.alarms.get(e,(e=>t(e))))),getAll:()=>new Promise((e=>C.alarms.getAll((t=>e(t))))),clear:e=>new Promise((t=>C.alarms.clear(e,(e=>t(e))))),clearAll:()=>new Promise((e=>C.alarms.clearAll((t=>e(t))))),onAlarm:{addListener:e=>{if(!pt)throw new Error("alarms.onAlarm listener can only be registered during startup in non-persistent background pages!");return C.alarms.onAlarm.addListener(e)}}};return e})(),jt={supported:!1};let Dt=!1;(async()=>{try{ +xe&&(G.NO_WARNING="nowarning"===xe.getItem("#brokenprofile"))}catch(e){console.warn("prep: error at storage type detection",e)}var e;e=e=>{Dt=e},C.extension.isAllowedFileSchemeAccess?C.extension.isAllowedFileSchemeAccess(e):e(!1)})();const Ft=()=>Dt;class Lt{constructor(e){this.pack=e=>e,this.unpack=e=>e,this.origin=null,this.prefix=e,this.origin=O.inIncognitoContext?"incognito":"normal",this.pack=e=>({origin:this.origin,value:e}),this.unpack=e=>e.value}supported(){return y.Pledge(!!xt.local)} +keys(){return y((async({resolve:e})=>{xt.local.get(null,(t=>{const n=Object.keys(t).filter((e=>e.startsWith(this.prefix)));e(n)}))})).promise()}list(){return y((async({resolve:e})=>{xt.local.get(null,(t=>{const n=Object.entries(t).filter((([e,t])=>e.startsWith(this.prefix))).map((([e,t])=>({key:e.substr(this.prefix.length),value:this.unpack(t)})));e(n)}))})).promise()}set(e,t){return y((async({resolve:n})=>{xt.local.set({[`${this.prefix}${e}`]:this.pack(t)},(()=>n()))})).promise()}get(e){ +return y((async({resolve:t})=>{const n=`${this.prefix}${e}`;xt.local.get(n,(e=>{const r=e&&n in e?this.unpack(e[n]):null;t(r||null)}))})).promise()}delete(e){return y((async({resolve:t})=>{xt.local.remove(`${this.prefix}${e}`,(()=>t()))})).promise()}clear(){return y((async({resolve:e})=>{this.list().then((t=>{const n=t.map((e=>`${this.prefix}${e.key}`));xt.local.remove(n,(()=>e()))}))})).promise()}on(e,t){if(!["add","change","remove"].includes(e))throw new Error("Unknown event") +;if(!this.origin)throw new Error("No origin set");let n=this.events;if(!n){const e=n=this.events=new Ve;xt.onChanged.addListener(((t,n)=>{if("local"==n&&t)for(const[n,r]of Object.entries(t)){if(!n.startsWith(this.prefix))continue;const{newValue:t,oldValue:s}=r;let i;if(t?i=t:s&&(i=s),i&&"object"==typeof i&&"origin"in i&&i.origin===this.origin)continue;const o=n.substr(this.prefix.length),a=t&&"object"==typeof t&&"origin"in t?this.unpack(t):r,c=s&&"object"==typeof s&&"origin"in s?this.unpack(s):r +;if(t)s?e.emit("change",{key:o,value:a,old:c}):e.emit("add",{key:o,value:a});else{if(!s)throw new Error("Invalid change");e.emit("remove",{key:o,value:a})}}}))}n.on(e,t)}}const Pt=(e,t)=>{if(!e)return t;const n=e[0];switch(e=e.substring(1),n){case"b":return"true"==e;case"n":return Number(e);case"o":try{return JSON.parse(e)}catch(e){console.error("Storage: getValue ERROR: "+e.message)}return t;case"x":try{return Qe(Xe(e))}catch(t){return e}default:return e}},Nt=e=>{const t=(typeof e)[0] +;if("o"===t)try{e=t+JSON.stringify(e)}catch(n){console.error("Storage: setValue ERROR: "+n.message),e=t+JSON.stringify({})}else e=t+e;return e};class Vt{constructor(e){this.prefix=e,this.storage=xe}supported(){let e=!1;try{this.storage&&(this.storage.setItem("test","1"),this.storage.removeItem("test"),e=!0)}catch(e){}return y.Pledge(e)}keys(){return y((({resolve:e})=>{const t=[];for(let e=0;ee.map((e=>({key:e,value:this.storage[e]})))))}set(e,t){return y((({resolve:n})=>{const r=`${this.prefix}.${e}`;this.storage[r]=t,this.storage.setItem(r,Nt(t)),n()})).promise()}get(e){return y((({resolve:t})=>{const n=`${this.prefix}${e}`;t(Pt(this.storage.getItem(n)||null))})).promise()}delete(e){return y((({resolve:t})=>{const n=`${this.prefix}${e}`;this.storage.removeItem(n),t()})).promise()}clear(){return y((({resolve:e})=>{this.keys().then((e=>{e.forEach((e=>{ +this.storage.removeItem(e)}))})),e()})).promise()}}const{STORAGE:{EXT_DB:zt,VERSION:qt,TYPE:Ht,LEGACY_VERSION:Qt}}=I,Wt=[qt,Ht];let Xt;const Yt=[{type:"memory",init:()=>new ze("")},{type:"indexedDB",init:()=>new qe("ext","general"),persistent:!0},{type:"localStorage",init:()=>new Vt(""),persistent:!0},(()=>{const e=new Ve;return{type:"storage.local",init:()=>{const t=new Lt(`${zt}.`);return["change","add","remove"].forEach((n=>{t.on(n,(t=>{e.emit(n,t)}))})),t},events:e,persistent:!0}})()] +;let Jt=!1;const Kt=async(e,t,n)=>{const r=await e.list();await Promise.all(r.map((async({key:r,value:s})=>{n.drop&&await e.delete(r),await t.set(r,s)})))},$t=new Ve;let en=G.DEFAULT;const tn={setValue:async(e,t)=>{await h.all(Yt.map((({active:n,instance:r})=>{if(n)return r.set(e,t)})))},setValues:async e=>{await h.all(Object.keys(e).map((t=>{const n=e[t];return tn.setValue(t,n)})))},getValue:(e,t)=>{let n;return Yt[0].instance.get(e).then((e=>n=e)),null!=n?n:t},deleteAll:async()=>{ +const e=Yt[0].instance,t=await((e,t)=>{const n={};return y.all(t.map((t=>e.get(t).then((e=>{null!=e&&(n[t]=e)}))))).then((()=>n))})(e,Wt);await h.all(Yt.map((async({active:e,instance:n})=>{e&&(await n.clear(),await((e,t)=>{const n=y(),r=[];return Object.getOwnPropertyNames(t).forEach((n=>{void 0!==t[n]&&r.push(e.set(n,t[n]))})),y.when(r).done((()=>{n.resolve()})),n.promise()})(n,t))})))},deleteValue:async e=>{await h.all(Yt.map((({active:t,instance:n})=>{if(t)return n.delete(e)})))}, +listValues:()=>{const e=Yt[0].instance;let t=[];return e.keys().then((e=>t=e)),t},isWorking:async()=>{let e=!0;return await h.all(Yt.map((async({instance:t})=>{const n=await t.supported();e=e&&!!n}))),e},migrate:async(e,t,n)=>{const r=Yt.find((t=>t.type==e)),s=Yt.find((e=>e.type==t)),i=n||{};if(!r||!s)throw new Error(`Migration: unknown storage implementation(s): ${e} -> ${t}`);if(!(i.force||r.active&&s.active))throw new Error("Migration: inactive source or target") +;r.instance=r.instance||r.init(),s.instance=s.instance||s.init();const{instance:o}=r,{instance:a}=s;if(!await o.supported())throw new Error("Migration failed. Source storage is not supported.");if(!await a.supported())throw new Error("Migration failed. Target storage is not supported.");await Kt(o,a,i)},setTemporary:e=>{if(Jt!=e)return Jt=e,tn.init()},init:async()=>{let e,t;for(const n of[...Yt].reverse()){n.active=!1;const{persistent:r,init:s,type:i}=n;let o,a=n.instance +;if(a||(a=n.instance=s(),n.events&&(n.events.on("add",(async({key:e,value:t})=>{n.active&&(await h.all(Yt.map((({type:n,active:r,instance:s})=>{if(r&&i!=n)return s.set(e,t)}))),$t.emit("add",{key:e,value:t}))})),n.events.on("change",(async({key:e,value:t,old:r})=>{n.active&&(await h.all(Yt.map((({type:n,active:r,instance:s})=>{if(r&&i!=n)return s.set(e,t)}))),$t.emit("change",{key:e,value:t,old:r}))})),n.events.on("remove",(async({key:e,value:t})=>{ +n.active&&(await h.all(Yt.map((({type:t,active:n,instance:r})=>{if(n&&i!=t)return r.delete(e)}))),$t.emit("remove",{key:e,value:t}))})))),r){if(i!==en)continue;if(o=await a.supported(),!o)continue;const t=await a.get(Ht);if(t&&(en=t,i!==en))continue;e=n}("storage.session"!==i||Jt)&&(void 0===o&&(o=await a.supported()),o&&(t&&await Kt(t.instance,a,{drop:!1}),t=n,Xt&&(await Kt(Xt,a,{drop:!1}),Xt=void 0),Jt&&r||(console.debug("Storage: use "+n.type),n.active=!0)))} +e||console.error("No persistent storage found. Using memory only, but this will cause data loss on every background context restart!")},on:(e,t,n)=>{$t.on(e,(({key:e,value:n})=>{t(e,n)}),n)},factoryReset:()=>(xe&&xe.removeItem(Qt),tn.deleteAll()),get used(){return en}},nn=tn,rn=e=>({utm_source:"ext",utm_medium:e.substr(0,3),utm_campaign:B.short_id}),sn={protocol:"https:",www:"www",api:"api",domain:"userscript.zone"},{STORAGE:{MISC_DB:on}}=I,an=(e,t,n)=>{ +const r=new rt(1),s=`${e}.${t}`,i=new Lt(`${on}.`),o={get:e=>{let o={};const a=void 0===e||Array.isArray(e)?e:[e];return r.acquire().then((()=>i.get(s))).then((e=>{if(null===e&&n&&xe){const r=n[t];if(r){const{key:t,from:n}="string"==typeof r?{key:r,from:e=>e}:r;try{e=JSON.parse(n(xe.getItem(t))||"")}catch(e){}}}if(null!==e)if(a)for(const t of a)o[t]=e[t];else o=e;return o})).always((()=>r.release()))},set:e=>r.acquire().then((()=>i.get(s))).then((r=>{r||(r={}), +Object.entries(e).forEach((([e,t])=>{null===t?delete r[e]:void 0!==t&&(r[e]=t)}));const o=n?n[t]:null;if(o&&xe){const{key:e,to:t}="string"==typeof o?{key:o,to:e=>e}:o;try{xe.setItem(e,t(JSON.stringify(r)))}catch(e){}}return i.set(s,r)})).always((()=>r.release())),delete:e=>{const t=(Array.isArray(e)?e:[e]).reduce(((e,t)=>(e[t]=null,e)),{});return o.set(t)},clear:()=>r.acquire().then((()=>{const e=n?n[t]:null;if(e&&xe){const{key:t}="string"==typeof e?{key:e}:e;xe.removeItem(t)}return i.delete(s) +})).always((()=>r.release()))};return o},cn=[{name:"ECMAScript 5",value:["// ==UserScript==","// @name New Userscript","// @namespace http://tampermonkey.net/","// @version <$DATE$>","// @description try to take over the world!","// @author You","// @match <$URL$>","// @icon <$ICON$>","// @grant none","// ==/UserScript==","","(function() {"," 'use strict';",""," // Your code here...","})();"].join("\n")},{name:"ECMAScript 6", +value:["// ==UserScript==","// @name New ES6-Userscript","// @namespace http://tampermonkey.net/","// @version <$DATE$>","// @description shows how to use babel compiler","// @author You","// @require https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.18.2/babel.js","// @require https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.16.0/polyfill.js","// @match <$URL$>","// @icon <$ICON$>","// ==/UserScript==","","var inline_src = (<>).toString();",'var c = Babel.transform(inline_src, { presets: [ "es2015", "es2016" ] });',"eval(c.code);"].join("\n") +},{name:"CoffeeScript", +value:["// ==UserScript==","// @name New Coffee-Userscript","// @namespace http://tampermonkey.net/","// @version <$DATE$>","// @description shows how to use coffeescript compiler","// @author You","// @require http://coffeescript.org/browser-compiler/coffeescript.js","// @match <$URL$>","// @icon <$ICON$>","// ==/UserScript==","","var inline_src = (<>).toString();","var compiled = this.CoffeeScript.compile(inline_src);","eval(compiled);"].join("\n") +}],ln={},un={enabled:!0,configMode:0,debug:!1,logLevel:0,showFixedSrc:!1,webrequest_modHeaders:"yes",webrequest_fixCSP:"auto",webrequest_fixContentCSP:"no",notification_showUpdate:"changelog",notification_silentScriptUpdate:!0,script_templates:cn,scriptUpdateCheckPeriod:864e5,scriptUpdateHideNotificationAfter:6e4,scriptUpdateCheckDisabled:!1,scriptUpdateAutomaticInstall:!0,scriptUrlDetection:"auto",script_cookie_access:["iikm","dhdg","fire"].includes(ft.short_id)?"!httponly":"all", +script_file_access:"externals",trash_mode:"on",trash_cleanup_after:6048e5,runtime_strict_mode:"byscript",runtime_top_level_await:"default",runtime_run_in:[],runtime_inject_mode:"default",runtime_content_mode:"userscripts",autoReload:!1,appearance_badges:"alltime",appearance_badge_color:["gcal","fcmf","firb","heif"].includes(ft.short_id)?"#444":"#ee3131",appearance_badge_text_color:"#ffffff",context_menu_enabled:!0,context_menu_scripts:!0,context_menu_commands:!0,editor_enabled:!0, +editor_fontSize:100,editor_theme:"default",editor_keyMap:"windows",editor_indentUnit:4,editor_tabSize:4,editor_indentWithTabs:"spaces",editor_tabMode:"indent",editor_electricChars:!0,editor_autoSave:!1,editor_easySave:!0,editor_autoLint:!0,editor_autoLintMaxLen:1e6,editor_lineWrapping:!1,userscript_search_url:sn,userscript_search_mode:"off",editor_highlightTrailingWhitespace:!0,editor_trimTrailingSpacesFromModifiedLines:!0,editor_highlightSelectionMatches:"cursor",editor_linter_config:null, +favicon_service:"google",i18n:null,action_menu_columns:1,action_menu_scripts_hide_disabled:!1,action_menu_scripts_sort:"auto",incognito_mode:"temporary",layout:"default",layout_user_css:"",sync_enabled:!1,sync_type:2,statistics_enabled:!0,downloads_mode:"default", +downloads_extension_whitelist:["/^[^\\.]*$/","/\\.(mp[34a]|m4[ab]|m3u|wma|wav|aac|og[ag]|cda|flac)$/","/\\.(avi|mkv|flv|divx|mpe?g|webm)$/","/\\.(jpe?g|jpe|png|gif|bmp|tiff?|webp|hei[cf]|avif|jxl|svg|eps|ai|ico|dds|psd|xcf|raw|cr2|nef|arw)$/","/\\.(srt|sub|idx)$/","/\\.(ttf|otf|woff)$/","/\\.(txt|pdf|json|yml|xml|csv)$/",".iso","/\\.(zip|tgz|tar|bin)$/","/\\.r(ar|[0-9]{2,2})$/",".rss"],external_update_interval:0,external_connect:"all",require_timeout:2e4, +require_blacklist:["/^https?:\\/\\/example.com(:[0-9]{1,5})?\\/.*/"],require_sri_mode:"supported",sandbox_mode:"default",script_include_mode:"default",script_blacklist_server:[],script_blacklist_type:"server",script_blacklist_severity:4,tags_enabled:!0,tags:{"social media":{},utilities:{},games:{},productivity:{},news:{}},background_control:!1,connect_mode:"ask",page_filter_mode:"black",page_whitelist:["/https?:\\/\\/greasyfork\\.org\\/.*/","http://xkcd.com/970/"], +forbiddenPages:["*example.org/*","*paypal.tld/*","*stripe.com/*","https://*deutsche-bank-24.tld/*","https://*bankofamerica.tld/*","/^.*:\\/\\/apis\\.google\\.com\\/((?!render)([^\\/]+)\\/)+([^\\/]+)?$/","*://www.facebook.com/plugins/*","*://platform.twitter.com/widgets/*"]},dn={cloud_url:null,cloud_user:null,cloud_pass:null,missing_host_permissions:[]},An=e=>{let t,n=nn.getValue(I.STORAGE.CONFIG,{});return n instanceof Object||(n={}),void 0!==(t=n[e])?t:"function"==typeof(t=un[e])?t():t +},pn=(e,t)=>{let n=nn.getValue(I.STORAGE.CONFIG,{});n instanceof Object||(n={});const r=An(e);n[e]=t;const s=nn.setValue(I.STORAGE.CONFIG,n),i=ln[e];return i&&JSON.stringify(r)!=JSON.stringify(t)&&i.forEach((n=>{try{n(e,r,t,s)}catch(e){v.warn("config: changeListener error",e)}})),y.from(s)};let hn={};const fn=an("session","data",{data:{key:I.STORAGE.SESSION,from:e=>Xe(e),to:e=>We(e)}}),mn=e=>{let t;return void 0!==(t=hn[e])?t:dn[e]},gn=(e,t)=>{const n=mn(e) +;return void 0===t?delete hn[e]:hn[e]=t,fn.set(hn).then((()=>{const r=ln[e];r&&JSON.stringify(n)!=JSON.stringify(t)&&r.forEach((r=>{try{r(e,n,t)}catch(e){v.warn("config: changeListener error",e)}}))}))},vn={initialized:!1,values:{},snapshot:{},init:()=>fn.get().then((e=>{e&&(hn=e)})).then((()=>{const e={};Object.defineProperty(vn,"snapshot",{get:function(){return{...vn.values}},enumerable:!0}),Object.keys(un).forEach((t=>{Object.defineProperty(e,t,{get:function(){return An(t)},set:function(e){ +pn(t,e)},enumerable:!0})})),Object.keys(dn).forEach((t=>{Object.defineProperty(e,t,{get:function(){return mn(t)},set:function(e){gn(t,e)},enumerable:!0})})),vn.values=e,vn.initialized=!0})),getValue:e=>dn.hasOwnProperty(e)?mn(e):An(e),setValue:(e,t)=>dn.hasOwnProperty(e)?gn(e,t):pn(e,t),getDefaults:()=>un,addChangeListener:(e,t)=>{De(e).forEach((e=>{let n=ln[e];n||(n=ln[e]=[]),n.push(t)}))} +},wn=vn,bn=".tld",_n="aaa\naarp\nabb\nabbott\nabogado\nac\nacademy\naccenture\naccountant\naccountants\naco\nactive\nactor\nad\nadac\nads\nadult\nae\naeg\naero\naf\nafl\nag\nagency\nai\naig\nairforce\nairtel\nal\nalibaba\nalipay\nallfinanz\nalsace\nam\namica\namsterdam\nan\nanalytics\nandroid\nao\napartments\napp\napple\naq\naquarelle\nar\naramco\narchi\narmy\narpa\narte\nas\nasia\nassociates\nat\nattorney\nau\nauction\naudi\naudio\nauthor\nauto\nautos\naw\nax\naxa\naz\nazure\nba\nbaidu\nband\nbank\nbar\nbarcelona\nbarclaycard\nbarclays\nbargains\nbauhaus\nbayern\nbb\nbbc\nbbva\nbcn\nbd\nbe\nbeats\nbeer\nbentley\nberlin\nbest\nbet\nbf\nbg\nbh\nbharti\nbi\nbible\nbid\nbike\nbing\nbingo\nbio\nbiz\nbj\nbl\nblack\nblackfriday\nbloomberg\nblue\nbm\nbms\nbmw\nbn\nbnl\nbnpparibas\nbo\nboats\nboehringer\nbom\nbond\nboo\nbook\nboots\nbosch\nbostik\nbot\nboutique\nbq\nbr\nbradesco\nbridgestone\nbroadway\nbroker\nbrother\nbrussels\nbs\nbt\nbudapest\nbugatti\nbuild\nbuilders\nbusiness\nbuy\nbuzz\nbv\nbw\nby\nbz\nbzh\nca\ncab\ncafe\ncal\ncall\ncamera\ncamp\ncancerresearch\ncanon\ncapetown\ncapital\ncar\ncaravan\ncards\ncare\ncareer\ncareers\ncars\ncartier\ncasa\ncash\ncasino\ncat\ncatering\ncba\ncbn\ncc\ncd\nceb\ncenter\nceo\ncern\ncf\ncfa\ncfd\ncg\nch\nchanel\nchannel\nchat\ncheap\nchloe\nchristmas\nchrome\nchurch\nci\ncipriani\ncircle\ncisco\ncitic\ncity\ncityeats\nck\ncl\nclaims\ncleaning\nclick\nclinic\nclinique\nclothing\ncloud\nclub\nclubmed\ncm\ncn\nco\ncoach\ncodes\ncoffee\ncollege\ncologne\ncom\ncommbank\ncommunity\ncompany\ncompare\ncomputer\ncomsec\ncondos\nconstruction\nconsulting\ncontact\ncontractors\ncooking\ncool\ncoop\ncorsica\ncountry\ncoupons\ncourses\ncr\ncredit\ncreditcard\ncreditunion\ncricket\ncrown\ncrs\ncruises\ncsc\ncu\ncuisinella\ncv\ncw\ncx\ncy\ncymru\ncyou\ncz\ndabur\ndad\ndance\ndate\ndating\ndatsun\nday\ndclk\nde\ndealer\ndeals\ndegree\ndelivery\ndell\ndeloitte\ndelta\ndemocrat\ndental\ndentist\ndesi\ndesign\ndev\ndiamonds\ndiet\ndigital\ndirect\ndirectory\ndiscount\ndj\ndk\ndm\ndnp\ndo\ndocs\ndog\ndoha\ndomains\ndoosan\ndownload\ndrive\ndubai\ndurban\ndvag\ndz\nearth\neat\nec\nedeka\nedu\neducation\nee\neg\neh\nemail\nemerck\nenergy\nengineer\nengineering\nenterprises\nepson\nequipment\ner\nerni\nes\nesq\nestate\net\neu\neurovision\neus\nevents\neverbank\nexchange\nexpert\nexposed\nexpress\nfage\nfail\nfairwinds\nfaith\nfamily\nfan\nfans\nfarm\nfashion\nfast\nfeedback\nferrero\nfi\nfilm\nfinal\nfinance\nfinancial\nfirestone\nfirmdale\nfish\nfishing\nfit\nfitness\nfj\nfk\nflickr\nflights\nflorist\nflowers\nflsmidth\nfly\nfm\nfo\nfoo\nfootball\nford\nforex\nforsale\nforum\nfoundation\nfox\nfr\nfresenius\nfrl\nfrogans\nfrontier\nfund\nfurniture\nfutbol\nfyi\nga\ngal\ngallery\ngallup\ngame\ngarden\ngb\ngbiz\ngd\ngdn\nge\ngea\ngent\ngenting\ngf\ngg\nggee\ngh\ngi\ngift\ngifts\ngives\ngiving\ngl\nglass\ngle\nglobal\nglobo\ngm\ngmail\ngmo\ngmx\ngn\ngold\ngoldpoint\ngolf\ngoo\ngoog\ngoogle\ngop\ngot\ngov\ngp\ngq\ngr\ngrainger\ngraphics\ngratis\ngreen\ngripe\ngroup\ngs\ngt\ngu\ngucci\nguge\nguide\nguitars\nguru\ngw\ngy\nhamburg\nhangout\nhaus\nhdfcbank\nhealth\nhealthcare\nhelp\nhelsinki\nhere\nhermes\nhiphop\nhitachi\nhiv\nhk\nhm\nhn\nhockey\nholdings\nholiday\nhomedepot\nhomes\nhonda\nhorse\nhost\nhosting\nhoteles\nhotmail\nhouse\nhow\nhr\nhsbc\nht\nhu\nhyundai\nibm\nicbc\nice\nicu\nid\nie\nifm\niinet\nil\nim\nimmo\nimmobilien\nin\nindustries\ninfiniti\ninfo\ning\nink\ninstitute\ninsurance\ninsure\nint\ninternational\ninvestments\nio\nipiranga\niq\nir\nirish\nis\niselect\nist\nistanbul\nit\nitau\niwc\njaguar\njava\njcb\nje\njetzt\njewelry\njlc\njll\njm\njmp\njo\njobs\njoburg\njot\njoy\njp\njprs\njuegos\nkaufen\nkddi\nke\nkfh\nkg\nkh\nki\nkia\nkim\nkinder\nkitchen\nkiwi\nkm\nkn\nkoeln\nkomatsu\nkp\nkpn\nkr\nkrd\nkred\nkw\nky\nkyoto\nkz\nla\nlacaixa\nlamborghini\nlamer\nlancaster\nland\nlandrover\nlanxess\nlasalle\nlat\nlatrobe\nlaw\nlawyer\nlb\nlc\nlds\nlease\nleclerc\nlegal\nlexus\nlgbt\nli\nliaison\nlidl\nlife\nlifeinsurance\nlifestyle\nlighting\nlike\nlimited\nlimo\nlincoln\nlinde\nlink\nlive\nliving\nlixil\nlk\nloan\nloans\nlol\nlondon\nlotte\nlotto\nlove\nlr\nls\nlt\nltd\nltda\nlu\nlupin\nluxe\nluxury\nlv\nly\nma\nmadrid\nmaif\nmaison\nmakeup\nman\nmanagement\nmango\nmarket\nmarketing\nmarkets\nmarriott\nmba\nmc\nmd\nme\nmed\nmedia\nmeet\nmelbourne\nmeme\nmemorial\nmen\nmenu\nmeo\nmf\nmg\nmh\nmiami\nmicrosoft\nmil\nmini\nmk\nml\nmm\nmma\nmn\nmo\nmobi\nmobily\nmoda\nmoe\nmoi\nmom\nmonash\nmoney\nmontblanc\nmormon\nmortgage\nmoscow\nmotorcycles\nmov\nmovie\nmovistar\nmp\nmq\nmr\nms\nmt\nmtn\nmtpc\nmtr\nmu\nmuseum\nmutuelle\nmv\nmw\nmx\nmy\nmz\nna\nnadex\nnagoya\nname\nnatura\nnavy\nnc\nne\nnec\nnet\nnetbank\nnetwork\nneustar\nnew\nnews\nnexus\nnf\nng\nngo\nnhk\nni\nnico\nnikon\nninja\nnissan\nnl\nno\nnokia\nnorton\nnowruz\nnp\nnr\nnra\nnrw\nntt\nnu\nnyc\nnz\nobi\noffice\nokinawa\nom\nomega\none\nong\nonl\nonline\nooo\noracle\norange\norg\norganic\norigins\nosaka\notsuka\novh\npa\npage\npamperedchef\npanerai\nparis\npars\npartners\nparts\nparty\npe\npet\npf\npg\nph\npharmacy\nphilips\nphoto\nphotography\nphotos\nphysio\npiaget\npics\npictet\npictures\npid\npin\nping\npink\npizza\npk\npl\nplace\nplay\nplaystation\nplumbing\nplus\npm\npn\npohl\npoker\nporn\npost\npr\npraxi\npress\npro\nprod\nproductions\nprof\npromo\nproperties\nproperty\nprotection\nps\npt\npub\npw\npwc\npy\nqa\nqpon\nquebec\nquest\nracing\nre\nread\nrealtor\nrealty\nrecipes\nred\nredstone\nredumbrella\nrehab\nreise\nreisen\nreit\nren\nrent\nrentals\nrepair\nreport\nrepublican\nrest\nrestaurant\nreview\nreviews\nrexroth\nrich\nricoh\nrio\nrip\nro\nrocher\nrocks\nrodeo\nroom\nrs\nrsvp\nru\nruhr\nrun\nrw\nrwe\nryukyu\nsa\nsaarland\nsafe\nsafety\nsakura\nsale\nsalon\nsamsung\nsandvik\nsandvikcoromant\nsanofi\nsap\nsapo\nsarl\nsas\nsaxo\nsb\nsbs\nsc\nsca\nscb\nschaeffler\nschmidt\nscholarships\nschool\nschule\nschwarz\nscience\nscor\nscot\nsd\nse\nseat\nsecurity\nseek\nselect\nsener\nservices\nseven\nsew\nsex\nsexy\nsfr\nsg\nsh\nsharp\nshell\nshia\nshiksha\nshoes\nshow\nshriram\nsi\nsingles\nsite\nsj\nsk\nski\nskin\nsky\nskype\nsl\nsm\nsmile\nsn\nsncf\nso\nsoccer\nsocial\nsoftbank\nsoftware\nsohu\nsolar\nsolutions\nsony\nsoy\nspace\nspiegel\nspreadbetting\nsr\nsrl\nss\nst\nstada\nstar\nstarhub\nstatefarm\nstatoil\nstc\nstcgroup\nstockholm\nstorage\nstudio\nstudy\nstyle\nsu\nsucks\nsupplies\nsupply\nsupport\nsurf\nsurgery\nsuzuki\nsv\nswatch\nswiss\nsx\nsy\nsydney\nsymantec\nsystems\nsz\ntab\ntaipei\ntaobao\ntatamotors\ntatar\ntattoo\ntax\ntaxi\ntc\ntci\ntd\nteam\ntech\ntechnology\ntel\ntelefonica\ntemasek\ntennis\ntf\ntg\nth\nthd\ntheater\ntheatre\ntickets\ntienda\ntiffany\ntips\ntires\ntirol\ntj\ntk\ntl\ntm\ntmall\ntn\nto\ntoday\ntokyo\ntools\ntop\ntoray\ntoshiba\ntours\ntown\ntoyota\ntoys\ntp\ntr\ntrade\ntrading\ntraining\ntravel\ntravelers\ntravelersinsurance\ntrust\ntrv\ntt\ntube\ntui\ntushu\ntv\ntvs\ntw\ntz\nua\nubs\nug\nuk\num\nunicom\nuniversity\nuno\nuol\nus\nuy\nuz\nva\nvacations\nvana\nvc\nve\nvegas\nventures\nverisign\nversicherung\nvet\nvg\nvi\nviajes\nvideo\nvillas\nvin\nvip\nvirgin\nvision\nvista\nvistaprint\nviva\nvlaanderen\nvn\nvodka\nvolkswagen\nvote\nvoting\nvoto\nvoyage\nvu\nwales\nwalter\nwang\nwanggou\nwatch\nwatches\nweather\nweatherchannel\nwebcam\nweber\nwebsite\nwed\nwedding\nweir\nwf\nwhoswho\nwien\nwiki\nwilliamhill\nwin\nwindows\nwine\nwme\nwolterskluwer\nwork\nworks\nworld\nws\nwtc\nwtf\nxbox\nxerox\nxin\n测试\nकॉम\nपरीक्षा\n佛山\n慈善\n集团\n在线\n한국\n点看\nคอม\nভারত\n八卦\n‏موقع‎\nবাংলা\n公益\n公司\n移动\n我爱你\nмосква\nиспытание\nқаз\nонлайн\nсайт\n联通\nсрб\nбел\n‏קום‎\n时尚\n테스트\n淡马锡\nорг\nनेट\n삼성\nசிங்கப்பூர்\n商标\n商店\n商城\nдети\nмкд\n‏טעסט‎\nею\nポイント\n新闻\n工行\n‏كوم‎\n中文网\n中信\n中国\n中國\n娱乐\n谷歌\nభారత్\nලංකා\n购物\n測試\nભારત\nभारत\n‏آزمایشی‎\nபரிட்சை\n网店\nसंगठन\n餐厅\n网络\nком\nукр\n香港\n诺基亚\nδοκιμή\n飞利浦\n‏إختبار‎\n台湾\n台灣\n手表\n手机\nмон\n‏الجزائر‎\n‏عمان‎\n‏ارامكو‎\n‏ایران‎\n‏امارات‎\n‏بازار‎\n‏پاکستان‎\n‏الاردن‎\n‏موبايلي‎\n‏بھارت‎\n‏المغرب‎\n‏السعودية‎\n‏سودان‎\n‏همراه‎\n‏عراق‎\n‏مليسيا‎\n澳門\n닷컴\n政府\n‏شبكة‎\n‏بيتك‎\nგე\n机构\n组织机构\n健康\nไทย\n‏سورية‎\nрус\nрф\n珠宝\n‏تونس‎\n大拿\nみんな\nグーグル\nελ\n世界\nਭਾਰਤ\n网址\n닷넷\nコム\n游戏\nvermögensberater\nvermögensberatung\n企业\n信息\n‏مصر‎\n‏قطر‎\n广东\nஇலங்கை\nஇந்தியா\nհայ\n新加坡\n‏فلسطين‎\nテスト\n政务\nxperia\nxxx\nxyz\nyachts\nyahoo\nyamaxun\nyandex\nye\nyodobashi\nyoga\nyokohama\nyoutube\nyt\nza\nzara\nzero\nzip\nzm\nzone\nzuerich\nzw".split("\n").join("|"),yn="ac.cn\nac.jp\nac.uk\nad.jp\nah.cn\naichi.jp\nakita.jp\naomori.jp\nasn.au\nbj.cn\nchiba.jp\nco.cc\nco.ck\nco.fk\nco.gg\nco.im\nco.in\nco.ir\nco.je\nco.jp\nco.kr\nco.ma\ncom.ac\ncom.af\ncom.ag\ncom.ai\ncom.al\ncom.ar\ncom.au\ncom.aw\ncom.az\ncom.ba\ncom.bb\ncom.bh\ncom.bi\ncom.bm\ncom.bo\ncom.br\ncom.bs\ncom.bt\ncom.by\ncom.bz\ncom.ci\ncom.cm\ncom.cn\ncom.co\ncom.cu\ncom.cw\ncom.cy\ncom.de\ncom.dm\ncom.do\ncom.dz\ncom.ec\ncom.ee\ncom.eg\ncom.es\ncom.et\ncom.fr\ncom.ge\ncom.gh\ncom.gi\ncom.gl\ncom.gn\ncom.gp\ncom.gr\ncom.gt\ncom.gu\ncom.gy\ncom.hk\ncom.hn\ncom.hr\ncom.ht\ncom.im\ncom.io\ncom.iq\ncom.is\ncom.jo\ncom.kg\ncom.ki\ncom.km\ncom.kp\ncom.ky\ncom.kz\ncom.la\ncom.lb\ncom.lc\ncom.lk\ncom.lr\ncom.lv\ncom.ly\ncom.mg\ncom.mk\ncom.ml\ncom.mo\ncom.ms\ncom.mt\ncom.mu\ncom.mv\ncom.mw\ncom.mx\ncom.my\ncom.na\ncom.nf\ncom.ng\ncom.ni\ncom.nr\ncom.om\ncom.pa\ncom.pe\ncom.pf\ncom.ph\ncom.pk\ncom.pl\ncom.pr\ncom.ps\ncom.pt\ncom.py\ncom.qa\ncom.re\ncom.ro\ncom.ru\ncom.rw\ncom.sa\ncom.sb\ncom.sc\ncom.sd\ncom.se\ncom.sg\ncom.sh\ncom.sl\ncom.sn\ncom.so\ncom.st\ncom.sv\ncom.sy\ncom.tj\ncom.tm\ncom.tn\ncom.to\ncom.tr\ncom.tt\ncom.tw\nco.mu\ncom.ua\ncom.ug\ncom.uy\ncom.uz\ncom.vc\ncom.ve\ncom.vi\ncom.vn\ncom.vu\ncom.ws\ncom.zm\nconf.au\nco.nz\nco.rw\nco.th\nco.tj\nco.tt\nco.tv\nco.tz\nco.ug\nco.uk\nco.us\nco.ve\nco.yu\nco.za\nco.zm\nco.zw\ncq.cn\ncsiro.au\nde.net\ndk.org\ned.jp\nedu.au\nedu.cn\nedu.uk\nehime.jp\neu.org\nfukui.jp\nfukuoka.jp\nfukushima.jp\ngb.net\ngd.cn\ngifu.jp\ngo.jp\ngov.au\ngov.cn\ngov.jp\ngov.uk\ngr.jp\ngs.cn\ngunma.jp\ngx.cn\ngz.cn\nhb.cn\nhe.cn\nhi.cn\nhiroshima.jp\nhk.cn\nhl.cn\nhn.cn\nhokkaido.jp\nhyogo.jp\nibaraki.jp\nid.au\ninfo.au\nishikawa.jp\niwate.jp\njl.cn\njs.cn\nkagawa.jp\nkagoshima.jp\nkanagawa.jp\nkanazawa.jp\nkawasaki.jp\nkitakyushu.jp\nkobe.jp\nkochi.jp\nkumamoto.jp\nkyoto.jp\nlg.jp\nln.cn\nltd.uk\nmatsuyama.jp\nme.uk\nmie.jp\nmiyagi.jp\nmiyazaki.jp\nmo.cn\nmod.uk\nnagano.jp\nnagasaki.jp\nnagoya.jp\nnara.jp\nne.jp\nnet.au\nnet.cn\nnet.jp\nnet.uk\nnhs.uk\nnic.uk\nniigata.jp\nnm.cn\nnx.cn\noita.jp\nokayama.jp\nokinawa.jp\norg.au\norg.cn\norg.jp\norg.uk\nor.jp\nosaka.jp\notc.au\noz.au\nplc.uk\npolice.uk\nqh.cn\nsaga.jp\nsaitama.jp\nsapporo.jp\nsc.cn\nsch.uk\nsendai.jp\nsh.cn\nshiga.jp\nshimane.jp\nshizuoka.jp\nsn.cn\nsx.cn\ntakamatsu.jp\ntelememo.au\ntj.cn\ntochigi.jp\ntokushima.jp\ntokyo.jp\ntottori.jp\ntoyama.jp\ntw.cn\nuk.net\nutsunomiya.jp\nwakayama.jp\nxj.cn\nxz.cn\nyamagata.jp\nyamaguchi.jp\nyamanashi.jp\nyn.cn\nyokohama.jp\nzj.cn".split("\n").join("|"),kn=(".("+[_n,yn].join("|")+")").replace(/\./gi,"\\."),Rn=z({ +timeout:180,check_interval:120,retimeout_on_get:!0}),xn=/^([^:]+:\/\/)([^/]+)(.*)?/,En=e=>{const t=xn.exec(e);if(t){const[,e,n,r]=t;return{protocol:e,host:n,path:r}}},Sn=e=>e.split("").map((e=>{const t=e.toLowerCase(),n=e.toUpperCase();return t!=n?"["+t+n+"]":e})).join(""),Cn="://",Mn=e=>{let t,n,r,s;const i="/",o=e.replace(/\$$/,"").split(Cn);o.length<2?(t="",n=e):(t=o[0].replace(/^\^/,""),n=o.slice(1).join(Cn));const a=n.split(i);if(s=a.length<2?"/":i+a.slice(1).join(i),r=a[0], +"http*"===t||t.match(/\*|http|https|file|ftp/)||(v.warn('uri: override scheme "'+t+'" with "*"'),t="*"),"file"===t)r="";else{const e=r,t=r.match(/\*$|(\*\.)?[^/*]+/);r=(t?t[0]:"").replace(/:[0-9]*$/,""),r!==e&&v.warn('uri: override host "'+e+'" with "'+r+'"')}return s&&s.substr(0,1)===i||(v.warn('uri: prefix path "'+s+'" with "/"'),s=i+s),{scheme:t,host:r,path:s}},In=(e,t)=>{let{scheme:n,host:r,path:s}=Mn(e);return n="http*"===n?"https?":Ie(n).replace(/\*/gi,"[^:/#?]*"), +r=Ie(r).replace(/\*\\\./gi,"(*\\.)?").replace(/\*/gi,"[^#?/]*"),s=Ie(s).replace(/\*/gi,".*"),r=r.replace(new RegExp(Ie(bn)+"$"),kn),t?(n=n.toLowerCase(),r=r.toLowerCase()):(n=Sn(n),r=Sn(r)),r+="(:[0-9]{1,5})?","^"+n+Ie(Cn)+r+s+"$"},Un=["protocol","hostname","origin"],Gn=["port"],Zn=["pathname"],Tn=["search","hash"];let Bn;const On={protocol:"",scheme:"",origin:"",pathname:"",hostname:"",port:void 0,search:"",hash:""},jn=(e,t,n)=>{let r=Object.assign({},On) +;if(null==e);else if(["data:","view-source:"].some((t=>e.startsWith(t)))){r.origin="null";const t=e.indexOf(":");r.protocol=e.substr(0,t+1),r.pathname=e.substr(t+1)}else{let s,i;try{s=new URL(e)}catch(t){try{const t="http:";i=Pe(),s=new URL(e||"/",`${t}//${i}/${i}`)}catch(e){i=void 0}}if(s){let{protocol:o,origin:a,pathname:c,hostname:l,port:u,search:d,hash:A,username:p,password:h}=s;if(i&&(o=a="",l===i&&(l=""),c=c.replace(`/${i}`,"")),n){const t=e.indexOf("?"),n=e.indexOf("#") +;-1!==t&&""===d&&(-1===n||n>t)&&(d="?"),-1!==n&&""===A&&(A="#")}if(r={protocol:o,origin:a,pathname:c,hostname:l,port:parseInt(u)||void 0,search:d,hash:A,username:p,password:h},!t&&o){if(0!==e.toLowerCase().indexOf(o))if(e.startsWith("//"))r.origin="",r.protocol="";else{if(!["/","?","#"].includes(e[0]))return jn("/"+e);Bn=Bn||jn("",!0),[...Tn,...Zn].forEach((e=>{Bn[e]===r[e]&&(r[e]="")})),Un.forEach((e=>{r[e]=""})),Gn.forEach((e=>{r[e]=void 0}))} +["tampermonkey:"].includes(r.protocol)&&(r.pathname=((r.hostname?"/"+r.hostname:"")+(r.pathname||"")).replace(/^\/+/,"/"),r.hostname="")}}}return 0===r.port&&(r.port=void 0),Object.defineProperties(r,{domain:{get:function(){const e=r.hostname.split("."),t=e.pop();let n=`${e.pop()}.${t}`;return Nn(n)&&(n=`${e.pop()}.${n}`),n}},scheme:{get:function(){return r.protocol.replace(/:$/,"")}}}),r +},Dn=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,Fn=/((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9A-Fa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e).match(Dn)&&!t.match(Fn)&&e.includes("."));var t},Nn=e=>(Ln=Ln||new RegExp("^("+yn.replace(/\./g,"\\.")+")$"),!!e.match(Ln)),Vn=(e,t)=>{"string"==typeof t&&(t={base:t});const{base:n,schemes:r,enforce_path:s}=t||{};let i=!1;const o=zn(e);if(!o)return;s&&Hn(o,{nopath:!0})===e&&(e+="/");let a=e;return"tampermonkey:"==o.protocol?o.pathname.includes("..")?i=!0:a=O.getURL(e.replace(/^tampermonkey:\/\//,"")):o.protocol||n&&(a=qn(e,n,r||["http:","https:"]))||(i=!0), +i?null:a},zn=(e,t)=>{if(null==e)return;const n=`${e}+${!!t}`;let r=Rn.get(n);return r||(r=jn(e,!1,t),Rn.set(n,r),r)},qn=(e,t,n)=>{let r,s,i;if(e&&t&&(r=zn(e))&&(s="string"==typeof t?zn(t):t)&&s.protocol&&(!n||n.includes(s.protocol)||!e.includes(".."))){if(e.startsWith("//"))return s.protocol+"//"+r.hostname+(r.port?":"+r.port:"")+r.pathname+r.search;if("/"===e[0])i=r.pathname;else{if(t=Hn(s,{nosearch:!0,nofile:!0}),!(s=zn(t+("/"===t[t.length-1]?"":"/")+e)))return;i=s.pathname} +return s.protocol+"//"+s.hostname+(s.port?":"+s.port:"")+i+r.search+r.hash}},Hn=(e,t)=>((t=t||{}).noprotocol?"":["about:"].includes(e.protocol)?e.protocol:e.protocol+"//")+(t.auth&&(e.username||e.password)?((e,t)=>{const n=e=>e.replace(/[^A-Za-z0-9-._~!$&'()*+,;=]/g,(e=>"%"+e.charCodeAt(0).toString(16).toUpperCase()));return n(e)+(t?":"+n(t):"")+"@" +})(e.username||"",e.password)+"@":"")+e.hostname+(!t.noport&&e.port&&e.port>0?":"+e.port:"")+(t.nopath?"":t.nofile?e.pathname.replace(/\/[^/]*$/,"/"):e.pathname+(t.nosearch?"":e.search)),Qn=e=>{const t="string"==typeof e?zn(e):e;if(!t)throw new Error("invalid url");return Hn(t)},Wn=e=>{const t="string"==typeof e?zn(e):e;if(!t)throw new Error("invalid url");return Hn(t,{auth:!1}) +},Xn=e=>Object.entries(e).map((([e,t])=>void 0===t?null:ee(e)+"="+ee(t))).filter((e=>e)).join("&"),Yn="mtm_visitor",Jn="default",Kn="pageview",$n="script_update",er="script",tr="cloud",nr="deploy",rr="event",sr="pageview",ir="ping",or="https://a.tampermonkey.net/matomo.php",ar=xe;let cr,lr,ur,dr=null;const Ar=()=>({url:or,siteId:4,tracker:{[Jn]:{enabled:Rr(4,1)},[er]:{enabled:!0},[$n]:{enabled:Rr(4,10)},[tr]:{enabled:Rr(4,5e-4)},[nr]:{enabled:!0}}}),pr=()=>({url:or,siteId:5,tracker:{[Jn]:{ +enabled:Rr(5,10)},[er]:{enabled:!0},[$n]:{enabled:Rr(5,10)},[tr]:{enabled:Rr(5,.001)},[nr]:{enabled:!0}}}),hr=()=>({url:or,siteId:6,tracker:{[Jn]:{enabled:Rr(6,50)},[er]:{enabled:!0},[$n]:{enabled:Rr(6,10)},[tr]:{enabled:Rr(6,.01)},[nr]:{enabled:!0}}}),fr=()=>({url:or,siteId:7,tracker:{[Jn]:{enabled:!0},[er]:{enabled:!0},[$n]:{enabled:Rr(7,10)},[tr]:{enabled:Rr(7,.01)},[nr]:{enabled:!0}}}),mr={default:pr,gcal:pr,iikm:Ar,fcmf:Ar,saap:fr,swgx:fr,fire:hr,firb:hr,dhdg:()=>({url:or,siteId:3,tracker:{ +[Jn]:{enabled:Rr(3,1)},[er]:{enabled:!0},[$n]:{enabled:Rr(3,10)},[tr]:{enabled:Rr(3,5e-4)},[nr]:{enabled:!0}}}),mfdh:pr,heif:()=>({url:"http://a.userscript.grobilan:8081/matomo.php",siteId:2,tracker:{[Jn]:{enabled:!0}}})};let gr;const vr=[{msg:"a disconnected port"},{msg:"Function.prototype.apply: Arguments list has wrong type",url:"event_bindings"},{msg:"Script error."}],wr=e=>[...Array(e)].map((()=>Math.floor(16*Math.random()).toString(16))).join(""),br=e=>{if(!ar)return +;const t=[e.uuid,e.createTs,e.visitCount,e.currentVisitTs,e.lastVisitTs].join(".");ar.setItem(Yn,t)},_r=e=>{const t=e||Jn,n=gr.tracker[t]||gr.tracker[Jn];return n.enabled?{url:gr.url,siteId:gr.siteId,options:n}:null},yr=wr(6),kr=async(e,t,n)=>{if(!e)return;const r=(()=>{if(!ar)return;const e=ar.getItem(Yn);if(!e)return;const t=e.split(".");if(t.length>=5){t.unshift("0");const[e,n,r,s,i,o]=t;return{createdNow:!1,newVisitor:e,uuid:n,createTs:r,visitCount:s,currentVisitTs:i,lastVisitTs:o}} +})()||(()=>{const e=Math.floor(Date.now()/1e3).toString(),t={createdNow:!0,newVisitor:"1",uuid:wr(16),createTs:e,visitCount:"0",currentVisitTs:e,lastVisitTs:""};return br(t),t})();let s;const i=new Date,o={idsite:e.siteId,rec:1,action_name:we?we.title:ne.href||B.short_id,url:ne.href,_id:r.uuid,rand:wr(4),apiv:1,h:i.getHours(),m:i.getMinutes(),s:i.getSeconds(),cookie:1,pv_id:yr},a={...o,_idts:Number(r.createTs),_idvc:Number(r.visitCount),_viewts:Number(r.lastVisitTs), +res:be?`${be.width}x${be.height}`:"0x0"};if(t==sr){const e=lr?{gt_ms:lr}:{},t={...o,...a,...e,new_visit:1};br((e=>{const t=Math.floor(Date.now()/1e3).toString();return e.newVisitor="0",e.visitCount=(Number(e.visitCount)+1).toString(),e.lastVisitTs=e.currentVisitTs,e.currentVisitTs=t,e})(r)),s=t}else if(t==rr){if(!n)return;s={...o,ca:1,e_c:n.category,e_a:n.action,e_n:n.name,e_v:n.value}}else{if(t!=ir)return;s={...o,...a,ping:1}}s=Object.assign(o,s);const c=`${e.url}?${Xn(s)}`;if(we){ +const e=we.createElement("img");e.src=c,e.onload=()=>{var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)},e.onerror=()=>{var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)},(we.body||we.head||we.documentElement).appendChild(e)}else try{await oe(c)}catch(e){v.warn("stats:",e)}},Rr=(e,t)=>{let n=100*Math.random()null===dr&&xr?xr.promise():y.Pledge(!!dr);let Sr;const Cr=e=>{dr=e,xr&&(xr.resolve(dr),xr=void 0),dr?Mr():ur&&(Y(ur),ur=void 0)},Mr=()=>{cr&&(kr(_r(Kn),sr),cr=!1),ur=re((()=>kr(_r(Kn),ir)),864e5)},Ir=async(e,t,n)=>{if(!await Er())return;const r=`${e}${n?` <${n}> `:""}`;let s="",i=null;if("i"===t)s="Installed";else if("u"===t)s="Updated",i=_r($n);else if("m"===t)s="Revealed";else{if("r"!==t)return;s="Removed"} +kr(i||_r(er),rr,{category:"Script",action:s,name:r})},Ur=async(e,t,n)=>{if(!await Er())return;let r="",s="";"init"===t?(s="Initialized",r=e):"error"===t&&(s="Error",r=e+" -> "+n),kr(_r(tr),rr,{category:"Cloud",action:s,name:r})},Gr=async(e,t,n)=>{if(!await Er())return;let r="",s="";"installed"===e?(s="Installed",r=t):"error"===e&&(s="Error",r=t+" -> "+n),kr(_r(nr),rr,{category:"Deployment",action:s,name:r})},Zr=async(e,t,n)=>{if(!await Er())return;void 0===n&&(t+=" "+ne.href,n="");let r=!1 +;for(const n of vr){if(!n.msg&&!n.url)return;n.msg&&-1==e.indexOf(n.msg)||n.url&&-1==t.indexOf(n.url)||(r=!0)}r||kr(_r("error"),rr,{category:"Error",action:e,name:t+":"+n})},Tr=async(e,t,n)=>{if(!await Er())return;let r="",s="";"clicked"===e?(s="Click",r=t+":"+n):"button"===e?(s="Button",r=t||"?"):"dialog"===e&&(s="Dialog"),kr(_r("begging"),rr,{category:"Begging",action:s,name:r})},Br="en";let Or={},jr={},Dr=null;const Fr=[],Lr=async e=>{const t=`_locales/${e}/messages.json`,n=await(e=>{let t +;const n=O.getURL(e);return y((async({resolve:r})=>{try{if(Ee){const s=new Ee;Ee.onlyasync?(s.open("GET",n),s.onload=()=>{r(s.responseText)},s.onerror=()=>{r()},s.send(null)):(s.open("GET",n,!1),s.send(null),t=s.responseText,t||v.warn("registry: content of "+e+" is null!"),r(t))}else r(await oe(n).then((e=>e.text())))}catch(e){v.log("getRaw:"+e),r()}})).promise()})(t);try{if(n)return JSON.parse(n)}catch(e){}v.warn("i18n: parsing locale "+e+" failed!")},Pr=async e=>{e=e.concat(Br);let t=-1,n=null +;const r=async()=>{if(t++,te?e.replace(/-/g,"_").split("_").map(((e,t)=>t?e.toUpperCase():e.toLowerCase())).join("_"):e,Vr=(e,t)=>{let n,r;return t=t||(Dr?[Dr,Dr.split("_")[0]].concat(Fr).filter((e=>e)):Fr),Ze(t,((t,s)=>{const i=Number(s) +;if(Ze(e,((e,s)=>{const o=Number(s),a=Nr(e),c=a.split(/_/)[0];if(a==t)return r=o,!1;c==t&&(void 0===n||ie.value)),Hr=!(void 0===Tt)&&Tt.native_support,Qr={init:async()=>{const e=async()=>{Dr||Hr||(Dr=await Pr(Fr))},t=Nr(Hr?Tt.getUILanguage():navigator.language);if(t){const e=[t],n=t.split(/_/);n[0]!==t&&e.push(n[0]),e.forEach((e=>{Fr.unshift(e)}))}await e(),Hr&&(await new Promise((e=>{Tt.getAcceptLanguages((t=>{t?(t.forEach((e=>{Fr.push(Nr(e))})),e()):v.error("getAcceptLanguages returned undefined")}))})),await e())},getMessage:(e,...t)=>{let n +;return Dr&&(n=Or[e]||jr[e])?((e,t)=>{let n,r=e.message;return n=1==t.length&&Array.isArray(t[0])?t[0]:t,e.placeholders&&Object.entries(e.placeholders).forEach((([e,t])=>{try{const s=Number(t.content.replace(/^\$/,""))-1;let i;s{const n=[],r=e=>{ +for(let t=0;t{let n;const r=e[t];if(e){let s=e[t+"_i18n"]||{};r&&(s={en:r,...s});const i=Vr(Object.keys(s));void 0!==i&&(n=s[i])}return n||r},setLocale:async e=>{let t=e;if("null"===e&&(t=null),t&&(t=Nr(t)),!t&&Hr)Dr=t;else if(t!==Dr)return Pr([t,...Fr,Dr].filter((e=>e))).then((t=>{Dr=t,Dr!=e&&v.log("i18n: retrieving locale "+t+" failed!")}))},getLocale:()=>Dr,getUiLocale:()=>Nr(Dr||Hr?Tt.getUILanguage():Fr[0]||navigator.language||Br),getBestLocale:Vr,supported:zr};let Wr +;const Xr=["DOM","JavaScript","raw"],Yr={},Jr=e=>{const t=null==e?void 0:e.keys,n={keys:t,default:()=>[],set:(e,t)=>(e.push(t),e)};return(null==t?void 0:t.length)&&t.forEach((e=>Yr[e]=n)),n},Kr=e=>{const t=null==e?void 0:e.keys,n={keys:t,default:()=>null,set:(t,n,r)=>{const s=(null==e?void 0:e.convert)?e.convert(n,r):n;return null===t?s:t}};return(null==t?void 0:t.length)&&t.forEach((e=>Yr[e]=n)),n},$r=e=>{const t=null==e?void 0:e.keys,n={default:()=>null,set:()=>!0} +;return(null==t?void 0:t.length)&&t.forEach((e=>Yr[e]=n)),n},es=e=>{const t=null==e?void 0:e.keys,n={keys:t,default:()=>({}),set:(t,n,r,s)=>{s=s?Nr(s):"default";const i=(null==e?void 0:e.convert)?e.convert(n,r):n;return t[s]=t[s]||i,t}};return(null==t?void 0:t.length)&&t.forEach((e=>Yr[e]=n)),n},ts={name:es({convert:e=>null==e?void 0:e.replace(/\s\s+/g," ")}),version:Kr({convert:e=>(null==e?void 0:e.replace(/\s/g,""))||e}),grants:Jr({keys:["grant"]}),icon:Kr({ +keys:["icon","iconURL","iconUrl","defaulticon"]}),icon64:Kr({keys:["icon64","iconURL64"]}),supportURL:Kr({keys:["supportURL","supportUrl"]}),fileURL:Kr(),downloadURL:Kr({keys:["downloadURL","downloadUrl"]}),updateURL:Kr({keys:["updateURL","updateUrl"]}),namespace:Kr({convert:e=>""===e?null:e}),author:Kr(),copyright:Kr(),homepage:Kr({keys:["homepage","homepageURL","homepageUrl","website","source"]}),description:es(),includes:Jr({keys:["include"]}),excludes:Jr({keys:["exclude"]}),matches:Jr({ +keys:["match"]}),requires:Jr({keys:["require"]}),resources:(e=>{const t=null==e?void 0:e.keys,n={keys:t,default:()=>({}),set:(t,n,r)=>{const s=n.match(/^(\S*)\s+(.*)/);if(s&&void 0===t[s[1]]){const n=(null==e?void 0:e.convert)?e.convert(s[2],r):s[2];t[s[1]]=n}return t}};return(null==t?void 0:t.length)&&t.forEach((e=>Yr[e]=n)),n})({keys:["resource"]}),sandbox:Kr({keys:["sandbox","inject-into"],convert:(e,t)=>null!==e&&"inject-into"===t?{auto:"DOM",content:"DOM",page:null}[e]||null:e}),tags:Jr({ +keys:["tag"]}),noframes:$r(),unwrap:$r(),connects:Jr({keys:["connect","connect-src","domain"]}),webRequest:Jr(),"run-at":Kr(),"run-in":Jr(),antifeatures:(e=>{const t=null==e?void 0:e.keys,n={keys:t,default:()=>({}),set:(t,n,r,s)=>{var i;s=s?Nr(s):"default";const o=n.match(/^(\S*)\s+(.*)/);if(o){const n=t[i=o[1]]||(t[i]={}),a=(null==e?void 0:e.convert)?e.convert(o[2],r):o[2];n[s]=a}return t}};return(null==t?void 0:t.length)&&t.forEach((e=>Yr[e]=n)),n})({keys:["antifeature"]})},ns={} +;Object.entries(ts).forEach((([e,t])=>{t.keys?t.keys.forEach((t=>{ns[t]=e})):ns[e]=e}));const rs="==UserScript==",ss="==/UserScript==",is=/(?:^|\n)\s*\/\/\x20*==UserScript==([\s\S]*?\n)\s*\/\/\x20*==\/UserScript==|$/,os=()=>{const e={...Object.fromEntries(Object.keys(ts).map((e=>[e,ts[e].default()])))};return{...e}},as=e=>{const t=e.match(is),n=(t?t[1]:"")||"",r={};return n.replace(/(?:^|\n)\s*\/\/\s*(@\S+)(.*)/g,((e,t,n)=>{const[s,i]=t.slice(1).split(":"),o=ns[s];let a +;if(o&&(a=Yr[o]||ts[o]||void 0)){const e=n.trim();let t=r[o];void 0===t&&(t=a.default()),r[o]=a.set(t,e,s,i)}return""})),{...os(),...r}},cs=e=>{const{name:t,description:n,version:r,grants:s,tags:i,fileURL:o,requires:a,resources:c,webRequest:l,namespace:u,sandbox:d,noframes:A,unwrap:p,author:h,copyright:f,antifeatures:m}=e;let{icon:g,icon64:v,updateURL:w,downloadURL:b,supportURL:_,homepage:y,includes:k,matches:R,excludes:x,connects:E}=e +;const S=e["run-at"]||null,C=e["run-in"]||[],M=(e,{[e]:t,...n})=>n,I=s.includes("none")?["none"]:s.filter((e=>e)),U=d&&Xr.includes(d)?d:null;g=g||null,v=v||null,w=w||null,b=b||null,_=_||null,y=y||null;const G=t.default,Z=n.default||"",T=M("default",t),B=M("default",n);k=k.filter((e=>e)),R=R.filter((e=>e)),x=x.filter((e=>e)),E=E.filter((e=>e));const O=Object.entries(c).map((([e,t])=>({name:e,url:t,loaded:!1}))).filter((e=>e.url)),j=a.filter((e=>e)).map((e=>({url:e,loaded:!1,textContent:"" +}))),D=l.length?l.map((e=>{const t=JSON.parse(e);return Array.isArray(t)?t:[t]})).reduce(((e,t)=>e.concat(t)),[]):null;return{name:G,description:Z,version:r||"0.0",grant:I,icon:g,icon64:v,supportURL:_,fileURL:o,downloadURL:b,updateURL:w,namespace:u,requires:j,includes:k,matches:R,excludes:x,homepage:y,resources:O,connects:E,webRequest:D,author:h,copyright:f,antifeatures:m,name_i18n:T,description_i18n:B,uuid:null,system:!1,enabled:!0,position:0,blockers:[],lastModified:0,sync:{},options:{ +check_for_updates:!0,user_modified:null,comment:null,compatopts_for_requires:!0,compat_wrappedjsobject:!1,compat_metadata:!1,compat_foreach:!1,compat_powerful_this:null,sandbox:U,noframes:A,unwrap:p,run_at:S,run_in:C,tags:i,override:{use_includes:[],orig_includes:[],merge_includes:!0,use_matches:[],orig_matches:[],merge_matches:!0,use_excludes:[],orig_excludes:[],merge_excludes:!0,use_connects:[],orig_connects:[],merge_connects:!0,use_blockers:[],orig_run_at:null,orig_run_in:[], +orig_noframes:null,orig_tags:void 0}},textContent:null,header:null}},ls=(()=>{const e=e=>{const t=e.split(".");return t.slice(0,3).concat([t.slice(3).join(".")]).concat([0,0,0,0]).slice(0,4).map((e=>{const t=e.toString().match(/((?:-?[0-9]+)?)([^0-9]*)((?:[0-9]+)?)(.*)/);return t?[Number(t[1]),t[2],Number(t[3]),t[4]]:[]})).reduce(((e,t)=>e.concat(t)))},t=(n,r)=>{const s=Array.isArray(n)?n:e(n),i=Array.isArray(r)?r:e(r);for(let e=0;e<16;e++){const n=s[e],r=i[e];if(e%2==1){if(!n&&r)return t.eNEWER +;if(n&&!r)return t.eOLDER;const e=n.match(/\w/g)||[],s=r.match(/\w/g)||[];for(let n=0;ns[n].charCodeAt(0))return t.eNEWER;if(e[n].charCodeAt(0)s.length)return t.eNEWER;if(e.lengthNumber(r))return t.eNEWER;if(Number(n){const t=(e=>{ +const t=Me(e,rs,ss);if(!t)return null;const n=e.indexOf(rs),r=e.indexOf("{const t=(e=>as(e))(e=(e=(e=(e=(e||"").replace(/(\r\n|\n|\r)/gm,"\n")).replace(/\t/g," ")).replace(/\n\n+/g,"\n")).replace(/[^|\n][ \t]+\/\//g,"//"));if(t)return cs(t) +},As=()=>cs(os()),ps="try to take over the world!",hs="This script was deleted from Greasy Fork, and due to its negative effects, it has been automatically removed from your browser.",fs={uso:new class{constructor(){this.regexps=["https?://userscripts\\.org/scripts/(source|version)/([0-9]{1,9})\\.user\\.js","https?://userscripts-mirror\\.org/scripts/(source|version)/([0-9]{1,9})\\.user\\.js"],this.domains=["userscripts.org","userscripts-mirror.org"]}test(e){ +const t=this.regexps.reduce(((t,n)=>t||e.match(new RegExp(n))),null);if(t&&3==t.length)return{id:t[2],token:"uso",meta_url:!0,url:"http://userscripts-mirror.org/scripts/show/"+t[2],code_url:"http://userscripts-mirror.org/scripts/review/"+t[2],issue_url:"http://contactbyweb.com/userscripts-mirror"}}updates(e){return!1}},gf:new class{constructor(){ +this.regexps=["https?://greasyfork\\.org/(?:[^/]+/)?scripts/([^/-]+).*/code.*\\.user\\.js","https?://update.greasyfork\\.org/(?:[^/]+/)?scripts/([^/-]+).*/.*\\.user\\.js"],this.domains=["greasyfork.org","update.greasyfork.org"]}test(e){const t=this.regexps.reduce(((t,n)=>t||e.match(new RegExp(n))),null);if(t&&2==t.length){const e=t[1];return{id:e,token:"gf",meta_url:!0,url:"https://greasyfork.org/scripts/"+e,issue_url:"https://greasyfork.org/scripts/"+e+"/feedback", +code_url:"https://greasyfork.org/scripts/"+e+"/code"}}}async converts(e){let t,n=e;if(n){const e=n.description.trim();e===ps?n.description="":e===hs&&(n=null,t="deleted by hoster")}return{script:n,warning:t}}updates(e){const t=new RegExp("https?://greasyfork\\.org/scripts/[^/]+/code/.*\\.user\\.js.*version=[0-9]+.*"),n=new RegExp("https?://update\\.greasyfork\\.org/scripts/[^/]+/[^/]+/[^/]+\\.user\\.js");return!e.match(n)&&!e.match(t)}},sf:new class{constructor(){ +this.regexps=["https?://sleazyfork\\.org/(?:[^/]+/)?scripts/([^/-]+).*/code.*\\.user\\.js","https?://update.sleazyfork\\.org/(?:[^/]+/)?scripts/([^/-]+).*/.*\\.user\\.js"],this.domains=["sleazyfork.org","update.sleazyfork.org"]}test(e){const t=this.regexps.reduce(((t,n)=>t||e.match(new RegExp(n))),null);if(t&&2==t.length){const e=t[1];return{id:e,token:"sf",meta_url:!0,url:"https://sleazyfork.org/scripts/"+e,issue_url:"https://sleazyfork.org/scripts/"+e+"/feedback", +code_url:"https://sleazyfork.org/scripts/"+e+"/code"}}}async converts(e){let t,n=e;if(n){const e=n.description.trim();e===ps?n.description="":e===hs&&(n=null,t="deleted by hoster")}return{script:n,warning:t}}updates(e){const t=new RegExp("https?://sleazyfork\\.org/scripts/([^/]+)/code/.*\\.user\\.js.*version=[0-9]+.*"),n=new RegExp("https?://update\\.sleazyfork\\.org/scripts/[^/]+/[^/]+/[^/]+\\.user\\.js");return!e.match(n)&&!e.match(t)}},ouj:new class{constructor(){ +this.regexps=["https?://openuserjs\\.org/install/([^/]+)+/(.+?)(?:\\.min)?\\.user\\.js"],this.domains=["openuserjs.org"]}test(e){const t=this.regexps.reduce(((t,n)=>t||e.match(new RegExp(n))),null);if(t&&3==t.length)return t.shift(),{id:t.join("/"),token:"ouj",meta_header:!0,url:"https://openuserjs.org/scripts/"+t[0]+"/"+t[1],issue_url:"https://openuserjs.org/scripts/"+t[0]+"/"+t[1]+"/issues",code_url:"https://openuserjs.org/scripts/"+t[0]+"/"+t[1]+"/source"}}async converts(e){const t=e +;return t&&t.description.trim()===ps&&(t.description=""),{script:t,warning:void 0}}updates(e){return!0}},gh:new class{constructor(){ +this.regexps=["https?://raw\\.githubusercontent\\.com/([^/]+)/([^/]+)/[^/]+/(.*)\\.user\\.js","https?://github\\.com/([^/]+)/([^/]+)/raw/[^/]+/(.*)\\.user\\.js","https?://raw.github\\.com/([^/]+)/([^/]+)/[^/]+/(.*)\\.user\\.js","https?://github\\.com/([^/]+)/([^/]+)/releases/latest/download/(.*)\\.user\\.js","https?://github\\.com/([^/]+)/([^/]+)/releases/download/[^/]+/(.*)\\.user\\.js","https?://(([^\\.]+).github\\.io)/(.*)\\.user\\.js"], +this.domains=["github.com","githubusercontent.com","github.io"]}test(e){let t;const n=this.regexps.slice(0,-1).reduce(((t,n)=>t||e.match(new RegExp(n))),null),r=this.regexps.slice(-1).reduce(((t,n)=>t||e.match(new RegExp(n))),null);if(n&&4==n.length||r&&4==r.length){let e;if(n){n.shift();const[r,s,i]=n;e=[r,s].join("/"),t=[r,s].concat(s==i?[]:i).join("/")}else{if(!r)throw new Error("Should never happen!");{r.shift();const[n,s,i]=r;e=[s,n].join("/"),t=[s,n].concat(n==i?[]:i).join("/")}}return{ +id:t,token:"gh",url:"https://github.com/"+e,issue_url:"https://github.com/"+e+"/issues"}}}updates(e){return!0}},gst:new class{constructor(){this.regexps=["https?://gist\\.github\\.com/([^/]+)/([^/]+)/raw/(.*/)?.*\\.user\\.js","https?://gist\\.githubusercontent\\.com/([^/]+)/([^/]+)/raw/(.*/)?.*\\.user\\.js"],this.domains=["gist.github.com","gist.githubusercontent.com"]}test(e){const t=this.regexps.reduce(((t,n)=>t||e.match(new RegExp(n))),null);if(t&&4==t.length){ +const e=t[1],n=t[2],r=`${e}/${n}`;if(n&&r)return{id:r,token:"gst",url:`https://gist.github.com/${r}`,issue_url:`https://gist.github.com/${r}#new_comment_field`,code_url:`https://gist.github.com/${r}`}}}updates(e){const t=this.regexps.reduce(((t,n)=>t||e.match(new RegExp(n))),null);return!(!t||null!=t[3])}},gl:new class{constructor(){this.regexps=["https?://gitlab\\.com/([^/]+)(?:/([^/]+))?/([^/-]{1,1}[^/]+)/?(?:-/)?(snippets/[^/]+/)?(raw|wikis)/(?:[^/]+/)?(.*?)\\.user\\.js"], +this.domains=["gitlab.com"]}test(e){const t=this.regexps.reduce(((t,n)=>t||e.match(new RegExp(n))),null);if(t&&7==t.length){const[,e,n,r,,,s]=t,i=[e].concat([n,r].filter((e=>e))).join("/");return{id:[i].concat(r==s?[]:s).join("/"),token:"gl",url:"https://gitlab.com/"+i,issue_url:"https://gitlab.com/"+i+"/issues"}}}updates(e){return!0}},bb:new class{constructor(){ +this.regexps=["https?://bitbucket\\.org/([^/]+)/([^/]+)/raw/[^/]+/(.*)\\.user\\.js","https?://bitbucket\\.org/([^/]+)/([^/]+)/downloads/(.*)\\.user\\.js"],this.domains=["bitbucket.org"]}test(e){const t=this.regexps.reduce(((t,n)=>t||e.match(new RegExp(n))),null);if(t&&4==t.length){t.shift();const[e,n,r]=t,s=[e,n].concat(n==r?[]:r).join("/"),i=[e,n].join("/");return{id:s,token:"bb",url:"https://bitbucket.org/"+i,issue_url:"https://bitbucket.org/"+i+"/issues"}}}updates(e){return!0}}, +usty:new class{constructor(){this.regexps=["https?://userstyles\\.org/styles/userjs/([^/]+)/.*\\.user\\.js"],this.domains=["userstyles.org"]}test(e){const t=this.regexps.reduce(((t,n)=>t||e.match(new RegExp(n))),null);if(t&&2==t.length)return t.shift(),{id:t[0],token:"usty",url:"https://userstyles.org/styles/"+t[0],issue_url:"https://forum.userstyles.org/post/discussion?Discussion/StyleID="+t[0]}}async converts(e){let t,n,r,s;const i=[{tag:"includes", +re:/(?: \|\| \(new RegExp\("\^)([^$]+)(?:\$"\)\)\.test\(document\.location\.href\))/g,idx:1,value:e=>"/^"+e.replace(/\\\\(.)/g,"\\$1")+"$/"},{tag:"includes",re:/(?: \|\| \(document\.location\.href\.indexOf\(")([^"]+)"(?:\) == 0\))/g,idx:1,value:e=>e+"*"},{tag:"matches",re:/(?: \|\| \(document\.domain == ")([^"]+)"(?: \|\| document\.domain\.substring\(document\.domain\.indexOf\("[^"]+"\) \+ 1\) == "[^"]+"\))/g,idx:1,value:e=>"*."+e +}],o=new RegExp("(?:if \\(false)("+i.map((e=>"(?:"+e.re.source+")")).join("|")+")+","g");return e.textContent&&0===e.includes.length&&0===e.matches.length&&0===e.excludes.length&&e.options&&e.options.override&&e.options.override.orig_includes&&0===e.options.override.orig_includes.length&&e.options.override.orig_matches&&0===e.options.override.orig_matches.length&&(n=e.textContent.match(o))&&(n.forEach((t=>{i.forEach((n=>{for(;r=n.re.exec(t);)if(r.length>n.idx){const t=n.value(r[n.idx]) +;e.options.override["orig_"+n.tag].push(t),e[n.tag].push(t),s=!0}}))})),s&&(t="includes added")),0===e.grant.length&&(e.grant.push("GM_addStyle"),t="includes added"),{script:e,info:t}}updates(e){return!0}},web:new class{constructor(){this.regexps=["https://static\\.iitc\\.me/build/release/(plugins/)?(.*)\\.user\\.js","https://iitc\\.app/build/release/(plugins/)?(.*)\\.user\\.js","https?://socialfixer\\.com/socialfixer\\.user\\.js","https?://www\\.fbpurity\\.com/.*\\.user\\.js"], +this.domains=["static.iitc.me","iitc.app","socialfixer.com","fbpurity.com"]}test(e){const[t,n,r,s]=this.regexps,i=e.match(new RegExp(t));if(i&&3===i.length){i.shift();const[e,t]=i,n="iitc-project/ingress-intel-total-conversion";return{id:[n].concat(e?[e,t]:[]).join("/").replace(/\/\//g,"/"),token:"gh",url:"https://github.com/"+n,issue_url:"https://github.com/"+n+"/issues"}}const o=e.match(new RegExp(n));if(o&&3===o.length){o.shift();const[e,t]=o,n="IITC-CE/ingress-intel-total-conversion";return{ +id:[n].concat(e?[e,t]:[]).join("/").replace(/\/\//g,"/"),token:"gh",url:"https://github.com/"+n,issue_url:"https://github.com/"+n+"/issues"}}return e.match(new RegExp(r))?{id:"socialfixer",token:"web",url:"http://socialfixer.com",issue_url:"https://www.facebook.com/groups/SocialFixerUsersSupport/"}:e.match(new RegExp(s))?{id:"fbpurity",token:"web",url:"https://www.fbpurity.com/",issue_url:"https://www.facebook.com/fluffbustingpurity"}:void 0}updates(e){return!0}}},ms=e=>{ +if(e)for(const t of Object.values(fs)){const n=t.test(e);if(n)return n}},gs=[],vs=[{name:Qr.getMessage("Default"),layout:"default",value:"default"},{name:Qr.getMessage("Default_Light"),layout:"default",theme:"light",value:"default#light"},{name:Qr.getMessage("Default_Dark"),layout:"default",theme:"dark",value:"default#dark"},{name:Qr.getMessage("Default_Darker"),layout:"default",theme:"darker", +footer:'Theme by narcolepticinsomniac from the Stylus project.',value:"default#darker"}],ws={default:Qr.getMessage("Default"),monokai:"Monokai",solarized:"Solarized","mdn-like":"MDN-like",eclipse:"Eclipse",railscasts:"RailsCasts",zenburn:"ZenBurn",claude:"Claude"},bs={ +unknown:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wKDBcWHLi+jYAAACAASURBVHja7X13nBRV9v15r6p7egIgElUkioCCIqBgxEVEBRMyiJJBUbKAuKvwVUQJKoqooCAGoiKiElVkBRPq7sqKGUHSkNOQplOFd39/vNDVQxB/MiO49n5mB3uqq6vq3ffeveeeey7w1+uv11+vv15/vf5HX+x4nEQIwT3PywGQDSCbMWYTkQAgjtd3/GkHgDEIIcAYO9rfmHqOHoAYgKht2wWcc/F7v98+Hjfh+35OIpGoK4SoZ1lWXcZYaSKKA3D/MgD5IqLf83GLMZYhhMgXQvxkWdb3kUjkewAHTggDEEKEPc+rLIS4gHN+Kef8dAAFRPSHGMDhZtMfOHjHdE2/8h02gAwA2z3PixDRASJaczzuzT5Oz8gmolKc87LhcLhsKBQ6VQhRAoD/19z/fYZGRGCM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wMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PHRpdGxlPjlDMzAwNDI3LTg4Q0QtNDI2RC05QkZELUFEMUU2RUI2RjRDNjwvdGl0bGU+PGRlZnM+PHBhdGggZD0iTTAgNS42MjNBNS42MjMgNS42MjMgMCAwIDEgNS42MjMgMGgxMi43NTRBNS42MjMgNS42MjMgMCAwIDEgMjQgNS42MjN2MTIuNzU0QTUuNjIzIDUuNjIzIDAgMCAxIDE4LjM3NyAyNEg1LjYyM0E1LjYyMyA1LjYyMyAwIDAgMSAwIDE4LjM3N1Y1LjYyM3oiIGlkPSJhIi8+PC9kZWZzPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PG1hc2sgaWQ9ImIiIGZpbGw9IiNmZmYiPjx1c2UgeGxpbms6aHJlZj0iI2EiLz48L21hc2s+PHVzZSBmaWxsLW9wYWNpdHk9IjAiIGZpbGw9IiNGRkYiIHhsaW5rOmhyZWY9IiNhIi8+PHBhdGggZmlsbD0iIzJFQ0M3MSIgbWFzaz0idXJsKCNiKSIgZD0iTTExLjI1IDB2MTQuNjI1SDBWMHoiLz48cGF0aCBmaWxsPSIjRTc0QzNDIiBtYXNrPSJ1cmwoI2IpIiBkPSJNMjQgMHY3Ljg3NUgxMi43NVYweiIvPjxwYXRoIGZpbGw9IiNGMzlDMTIiIG1hc2s9InVybCgjYikiIGQ9Ik0xMS4yNSAxNi4xMjVWMjRIMHYtNy44NzV6Ii8+PHBhdGggZmlsbD0iIzM0OThEQiIgbWFzaz0idXJsKCNiKSIgZD0iTTI0IDkuNTYzdjE0LjYyNEgxMi43NVY5LjU2M3oiLz48L2c+PC9zdmc+" +},_s='',ys=[[100,56,22,"#272727"],[120,48,6,"#272727"],[76,48,22,"#272727"],[48,56,22,"#272727"],[84,28,11,"#272727"],[56,36,11,"#272727"],[100,32,11,"#272727"],[132,44,22,"#272727"],[152,132,22,"#1a1a1a",.5902],[116,32,11,"#272727"],[36,44,11,"#272727"],[128,144,22,"#1a1a1a",.2601],[132,36,6,"#272727"],[8,144,22,"#1a1a1a",.5728],[12,112,22,"#1a1a1a",.3512],[4,116,6,"#1a1a1a",.2],[108,24,6,"#272727"],[84,40,6,"#272727"],[64,116,22,"#1a1a1a",.0345],[56,28,6,"#272727"],[96,128,22,"#1a1a1a",.0749],[32,156,22,"#1a1a1a",.5441],[60,156,22,"#1b1b1b",.6994],[148,112,11,"#1a1a1a",.0029],[44,20,11,"#262626"],[124,60,6,"#272727"],[0,124,11,"#1a1a1a",.1999],[28,56,11,"#272727"],[72,144,11,"#1b1b1b",.4494],[76,72,22,"#272727"],[96,120,6,"#1a1a1a",.0066],[84,108,6,"#1d1d1d"],[12,104,6,"#1c1c1c"],[148,104,6,"#1a1a1a",.0687],[76,20,6,"#252525"],[68,104,11,"#1b1b1b",.0739],[0,96,11,"#1a1a1a",.2],[20,44,11,"#262626"],[144,92,11,"#1e1e1e",.9215],[160,124,6,"#1a1a1a",.6605],[0,80,11,"#1b1b1b",.2],[8,4,22,"#1d1d1d",.2362],[16,72,22,"#232323"],[92,160,21,"#1c1c1c",.6],[144,32,11,"#262626"],[12,44,6,"#202020"],[4,72,6,"#1b1b1b",.2],[52,12,6,"#202020"],[0,48,11,"#1b1b1b",.2],[44,0,11,"#1b1b1b",.1986],[144,24,6,"#242424"],[120,84,22,"#202020",.5576],[144,8,11,"#1c1c1c",.6423],[156,36,22,"#202020",.7486],[68,84,6,"#252525"],[156,64,22,"#202020",.7619],[0,60,11,"#1b1b1b",.2],[112,88,6,"#212121"],[52,84,11,"#212121"],[44,92,6,"#1c1c1c",.7096],[148,68,6,"#272727"],[100,88,11,"#222222"],[136,8,6,"#1c1c1c",.9155],[84,4,22,"#212121",.8095],[108,4,11,"#1d1d1d",.6],[76,8,6,"#1c1c1c"],[164,96,16,"#1b1b1b",.5],[148,168,13,"#1a1a1a",.0081],[168,20,12,"#1b1b1b",.0081],[64,28,6,"#272727"],[72,40,6,"#272727"],[44,32,11,"#272727"],[56,20,6,"#252525"],[40,60,6,"#272727"],[84,156,6,"#1d1d1d"],[156,100,6,"#1d1d1d"],[28,104,6,"#1a1a1a",.0182],[136,68,11,"#272727"],[40,72,6,"#272727"],[160,16,6,"#1a1a1a",.091],[120,12,11,"#222222"],[32,4,11,"#1c1c1c",.4571],[140,168,7,"#1a1a1a",.4414],[28,32,11,"#272727"],[4,136,6,"#1a1a1a",.1155],[108,44,11,"#272727"],[116,156,11,"#1a1a1a",.5235],[100,108,11,"#1a1a1a",.0313],[20,36,6,"#232323"],[92,104,6,"#1e1e1e"],[88,140,6,"#1b1b1b"],[12,36,6,"#1e1e1e"],[64,4,11,"#1d1d1d",.6],[88,128,6,"#1b1b1b"],[36,16,6,"#212121"],[16,56,11,"#242424"],[124,76,6,"#272727"],[68,92,6,"#202020"],[164,112,9,"#1a1a1a"],[4,40,6,"#1a1a1a",.1416],[48,48,6,"#272727"],[68,20,6,"#252525"],[128,28,6,"#272727"],[136,28,6,"#272727"],[152,160,6,"#1a1a1a",.9558],[128,68,6,"#272727"],[136,20,6,"#242424"],[144,84,6,"#242424"],[124,4,6,"#1a1a1a",.2],[164,88,9,"#1c1c1c"],[128,168,13,"#1a1a1a",.3226],[112,168,13,"#1a1a1a",.3333],[36,96,6,"#1b1b1b",.3675],[96,152,6,"#1c1c1c"],[24,96,6,"#1e1e1e"],[156,88,6,"#212121"],[104,80,6,"#272727"],[24,168,7,"#1b1b1b",.001],[100,48,6,"#272727"],[112,96,6,"#1b1b1b",.4376],[164,156,16,"#1a1a1a",7e-4],[52,96,11,"#1b1b1b",.0114],[44,12,6,"#1f1f1f"],[44,80,6,"#252525"],[76,28,6,"#272727"],[64,48,6,"#272727"],[116,24,6,"#272727"],[8,28,6,"#1a1a1a",.2598],[168,124,7,"#1a1a1a",.6667],[108,152,6,"#1a1a1a",.1464],[100,100,6,"#1d1d1d",.9972],[88,120,6,"#1a1a1a"],[20,104,6,"#1b1b1b",.992],[16,96,6,"#1e1e1e"],[16,28,6,"#1f1f1f"],[76,96,6,"#202020"],[156,24,11,"#1e1e1e",.9831],[4,108,6,"#1a1a1a",.2],[84,96,6,"#232323"],[92,112,6,"#1b1b1b"],[92,96,6,"#222222"],[108,16,6,"#232323"],[148,76,6,"#262626"],[92,40,6,"#272727"],[88,148,6,"#1d1d1d"],[56,48,6,"#272727"],[12,136,6,"#1a1a1a"],[32,24,6,"#242424"],[20,136,6,"#1a1a1a",.0281],[56,4,6,"#1a1a1a",.2],[156,0,17,"#1a1a1a",7e-4],[32,148,9,"#1a1a1a",.0045],[84,168,9,"#1b1b1b",.5],[112,80,9,"#252525"],[130,5,6,"#1b1b1b",.398],[130,10,6,"#1e1e1e"],[155,10,6,"#1a1a1a",.0019],[30,15,6,"#1f1f1f"],[60,15,6,"#222222"],[65,15,6,"#232323"],[70,15,6,"#232323"],[75,15,6,"#222222"],[115,15,6,"#232323"],[130,15,6,"#222222"],[135,15,6,"#212121"],[155,15,6,"#1b1b1b",.6529],[130,20,6,"#252525"],[150,20,6,"#202020"],[25,25,6,"#222222"],[70,25,6,"#272727"],[95,25,6,"#272727"],[100,25,6,"#272727"],[150,25,6,"#222222"],[70,30,6,"#272727"],[95,30,6,"#272727"],[110,30,6,"#272727"],[5,35,6,"#1a1a1a",.1598],[70,35,6,"#272727"],[75,35,6,"#272727"],[95,35,6,"#272727"],[110,35,6,"#272727"],[30,45,6,"#272727"],[70,45,6,"#272727"],[125,45,6,"#272727"],[10,50,6,"#1e1e1e"],[15,50,6,"#222222"],[30,50,6,"#272727"],[70,50,6,"#272727"],[125,50,6,"#272727"],[10,55,6,"#1e1e1e"],[40,55,6,"#272727"],[70,55,6,"#272727"],[125,55,6,"#272727"],[10,60,6,"#1e1e1e"],[70,60,6,"#272727"],[10,65,6,"#1e1e1e"],[40,65,6,"#272727"],[70,65,6,"#272727"],[10,70,6,"#1e1e1e"],[70,70,6,"#272727"],[10,75,6,"#1e1e1e"],[70,75,6,"#272727"],[130,75,6,"#272727"],[10,80,6,"#1e1e1e"],[110,80,6,"#262626"],[115,80,6,"#262626"],[10,85,6,"#1d1d1d"],[40,85,6,"#222222"],[45,85,6,"#222222"],[150,85,6,"#232323"],[5,90,6,"#1b1b1b",.4],[10,90,6,"#1d1d1d"],[10,95,6,"#1c1c1c"],[30,95,6,"#1c1c1c",.9914],[155,95,6,"#1f1f1f"],[105,100,6,"#1b1b1b",.5139],[155,105,6,"#1b1b1b",.9544],[85,115,6,"#1b1b1b"],[85,135,6,"#1b1b1b"],[90,135,6,"#1b1b1b"],[30,150,6,"#1a1a1a",.0362],[90,155,6,"#1e1e1e"],[150,155,6,"#1a1a1a"],[155,155,6,"#1a1a1a"],[55,160,6,"#1a1a1a",.7636],[55,165,6,"#1b1b1b"],[85,165,6,"#1c1c1c"],[55,170,6,"#1a1a1a",.4],[85,170,6,"#1b1b1b",.4]],ks=e=>bs["gst"==e?"gh":e]||bs.unknown,Rs=e=>"data:image/svg+xml,"+encodeURI({ +tampermonkey:`${_s}`,tampermonkey2:`\n\n ${_s}\n ${ys.map((e=>{const[t,n,r,s,i]=e;return``}))}\n`, +monkey:"\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n", +webdav:"", +yandex:"", +firefox:"", +chrome:"", +onedrive:"Artboard 1", +gdrive:"", +dropbox:"", +instagram:"", +facebook:"", +edge:'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', +android:'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', +safari:'\n', +apple:'\n\n' +}[e]).replace(/#|%20|%0A/g,(e=>"#"==e?"%23":" "));var xs;!function(e){e[e.OBJ_URL=1]="OBJ_URL",e[e.BLOB=2]="BLOB",e[e.BINARY=4]="BINARY",e[e.DATA_URI=8]="DATA_URI"}(xs||(xs={}));const Es=0+xs.BINARY+xs.DATA_URI,Ss=e=>void 0!==e.objUrl,Cs=e=>void 0!==e.blob,Ms=e=>void 0!==e.dataUri,Is=e=>void 0!==e.binary;class Us{constructor(e,t){if(Ss(e)){this.objUrl=e.objUrl.url,this.type=e.objUrl.type;const t=e.objUrl.revoke;t&&(Us.objUrlDisposers[this.objUrl]=t) +}else if(Cs(e))this.blob=e.blob;else if(Ms(e))this.dataUri=e.dataUri;else{if(!Is(e))throw new Error("incompatible TransferableData");this.binary=e.binary,this.type=e.type}this.kinds=t||Es}async dispose(){if(this.objUrl){const e=Us.objUrlDisposers,t=e[this.objUrl];t?(delete e[this.objUrl],await t()):console.error(`Unable to revoke object URL ${this.objUrl} in service worker`)}}async toTransferableData(){if(this.kinds&xs.OBJ_URL){ +if(!this.objUrl&&(!this.blob&&this.dataUri&&(this.blob=et(this.dataUri)),this.blob&&(this.objUrl=URL.createObjectURL(this.blob)),!this.objUrl))throw new Error("incomplete Transferable");return{objUrl:{url:this.objUrl,type:this.type}}}if(this.kinds&xs.BLOB){if(!this.blob&&(this.objUrl?this.blob=await oe(this.objUrl).then((e=>e.blob())):this.dataUri&&(this.blob=et(this.dataUri)),!this.blob))throw new Error("incomplete Transferable");return{blob:this.blob}}if(this.kinds&xs.BINARY){ +if(void 0===this.binary){let e=this.blob;if(!e&&this.objUrl&&(e=await oe(this.objUrl).then((e=>e.blob()))),e&&(this.binary=await nt(e),this.type=this.type||e.type),void 0===this.binary)throw new Error("incomplete Transferable")}return{binary:this.binary,type:this.type||"application/octet-stream"}}if(this.kinds&xs.DATA_URI){if(!this.dataUri){let e=this.blob;if(!e&&this.objUrl&&(e=await oe(this.objUrl).then((e=>e.blob()))),e&&(this.dataUri=await tt(e)), +!this.dataUri)throw new Error("incomplete Transferable")}return{dataUri:this.dataUri}}throw new Error("incompatible Transferable")}get tryObjectUrl(){return this.objUrl}get tryBlob(){return this.blob}get tryDataUri(){return this.dataUri}get tryBinary(){return this.binary}async toBlob(){if(this.blob)return this.blob;if(!this.objUrl){if(this.dataUri)return et(this.dataUri);if(this.binary)return new Blob([Je(this.binary)],{type:this.type||"application/octet-stream"}) +;throw new Error("incompatible Transferable")}try{return await(await oe(this.objUrl)).blob()}catch(e){return}}async toDataUri(){if(this.dataUri)return this.dataUri;{const e=await this.toBlob();if(!e)throw new Error("incompatible Transferable");return await tt(e)}}async toObjectUrl(){if(this.objUrl)return this.objUrl}static fromTransferableData(e){return e&&(Cs(e)||Ss(e)||Ms(e)||Is(e))?new Us(e):void 0}}Us.objUrlDisposers={};const Gs=z({timeout:10800,check_interval:300,retimeout_on_get:!0 +}),Zs=V({threads:5}),Ts={},Bs=async(e,t)=>{let n,r;const s=Ts[e];if(s)return await s;const i=Zs.add((async()=>{if(r=Gs.get(e),r&&(n=await r.toBlob()),n||(n=await Os(e)),n){if(!r){const t=r=new Us({blob:n});Gs.set(e,r).then((()=>t.dispose()))}}else if(!r&&t){const t=r=new Us({dataUri:"data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="},xs.DATA_URI);Gs.set(e,r).then((()=>t.dispose()))}return delete Ts[e],r}));return Ts[e]=i,await i},Os=async e=>{try{ +const t=await oe(e);if(t.ok&&200===t.status)return await t.blob()}catch(e){}};class js{constructor(e){this.prefix=e}supported(){return y.Pledge(!!xt.session.supported)}keys(){return y((async({resolve:e})=>{const t=await xt.session.get(null),n=Object.values(t).filter((e=>e.startsWith(this.prefix)));e(n)})).promise()}list(){return y((async({resolve:e})=>{const t=await xt.session.get(null),n=Object.entries(t).filter((([e,t])=>e.startsWith(this.prefix))).map((([e,t])=>({ +key:e.substr(this.prefix.length),value:t})));e(n)})).promise()}set(e,t){return y((async({resolve:n})=>{await xt.session.set({[`${this.prefix}${e}`]:t}),n()})).promise()}get(e){return y((async({resolve:t})=>{const n=`${this.prefix}${e}`;t((await xt.session.get(n))[n]||null)})).promise()}delete(e){return y((async({resolve:t})=>{await xt.session.remove(`${this.prefix}${e}`),t()})).promise()}clear(){return y((async({resolve:e})=>{ +const t=await this.list().then((e=>e.map((e=>`${this.prefix}${e.key}`))));await xt.session.remove(t),e()})).promise()}}const{STORAGE:{STATE_DB:Ds}}=I,Fs=[{type:"storage.session",storage:(e,t)=>new js(`${e}.${t}.`)},{type:"indexedDB",storage:(e,t)=>new qe(e,t)},{type:"storage.local",storage:(e,t)=>new Lt(`${Ds}.${e}.${t}.`)},{type:"memory",storage:(e,t)=>new ze(`${e}.${t}.`)}],Ls={};class Ps{constructor(e){this.dbName=e}init(){if(!this.storage_promise){let e=0 +;this.storage_promise=y((({resolve:t})=>{const n=()=>{if(e>=Fs.length)throw new Error("No supported storage found.");const{type:r,storage:s}=Fs[e++],i=s(this.dbName,"stateStorage");i.supported().then((e=>{if(!e)return n();"memory"===r&&console.warn("InMemoryStorage is not persistent!"),this.storage_type=r,t(i)}))};n()})).promise()}return this.storage_promise}keys(){return this.init().then((e=>e.keys()))}list(){return this.init().then((e=>e.list()))}set(e,t){ +return this.init().then((n=>n.set(e,t)))}get(e){return this.init().then((t=>t.get(e)))}delete(e){return this.init().then((t=>t.delete(e)))}clear(){return this.init().then((e=>e.clear()))}type(){return this.init().then((()=>{if(!this.storage_type)throw new Error("internal error");return this.storage_type}))}}const Ns=e=>{let t=Ls[e];return t||(t=Ls[e]=new Ps(e)),t},Vs={},zs=[],qs=Ns("notify"),Hs=new rt(1);Hs.acquire().then((async()=>{for(const{key:e,value:t}of await qs.list())Vs[e]={cbs:[],o:t} +})).always((()=>Hs.release()));const Qs=async e=>{Vs[e]&&(delete Vs[e],await qs.delete(e))},Ws=async(e,t)=>{v.log("notify: click",e);const n=Vs[e];if(n){se((()=>Qs(e)),1e3);const r={...n.o,id:e};await h.all(n.cbs.map((async e=>{await e({clicked:t,notification:r})})));for(const e of zs)await e({clicked:t,notification:r})}else v.log("notify: click, notification not found",e)},Xs=async e=>{v.log("notify: close",e);const t=Vs[e];if(t){const n={...t.o,id:e};await Qs(e),t.cbs.forEach((e=>e({ +notification:n})));for(const e of zs)e({notification:n})}else v.log("notify: close, notification not found",e)},Ys=(()=>{let e,t=null;const n=()=>{if(e)return e;const n=y(),r=e=>{t=e||"unknown",v.log("notify: chronos level",e),n.resolve()};return Ut.supported?(Ut.getPermissionLevel(r),Ut.onPermissionLevelChanged.addListener(r),Ut.onClicked.addListener((e=>Ws(e,!0))),Ut.onClosed.addListener((e=>Xs(e)))):r("unsupported"),e=n.promise()};return n(),{cancel:e=>new h((t=>{ +Ut.supported?Ut.clear(e,(()=>{ft.lastError?t(!1):(Xs(e),t(!0))})):t(!1)})),create:(e,r,s,i,o)=>n().then((async()=>{const n=y();let a=10;const c=async()=>{if(t)if("granted"==t){const{silent:t}=o,a={type:"basic",title:s||"",message:i||""},c=()=>new h((t=>{Ut.supported?Ut.create(e,a,(()=>{ft.lastError?t(!1):(v.log("notify: chronos created",e),t(!0))})):t(!1)}));E()>=70&&void 0!==t&&(a.silent=t),E()>=50&&(a.requireInteraction=!0);const l=Vs[e] +;l&&(v.log("notify: chronos notification already exists",e),await h.all([Ys.cancel(e),Qs(e)])),a.iconUrl=r;let u=await c();if(u||(v.log("notify: chronos creating failed, retry...",ft.lastError),a.iconUrl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",u=await c()),!u)return v.log("notify: chronos creating finally failed",ft.lastError),void n.reject();l&&(Vs[e]=l),n.resolve({type:"chronos",id:e})}else n.resolve();else{const e=()=>{ +t?c():a--?se(e,200):n.resolve()};e()}};return c(),n.promise()}))}})(),Js=(()=>{const e={};let t,n=null;const r=he,s={cancel:t=>e[t]?(e[t].close(),delete e[t],Xs(t),h.resolve(!0)):h.resolve(!1),create:(s,i,o,a,c)=>{return(t||(l=r?r.permission:"unsupported",n=l||"unknown",v.log("notify: notification level",l),t=y.Pledge())).then((async()=>{const t=y(),l=async()=>{if("granted"==n||"default"==n){const{silent:n}=c,l={body:a||"",icon:i};E()>=43&&void 0!==n&&(l.silent=n),l.requireInteraction=!0 +;const u=e[s];Vs[s]&&(v.log("notify: notification already exists",s),delete e[s],u&&u.close());const d=new r(o||"",l);d.onclick=()=>{v.log("notify: notification click",s);const t=e[s];t&&t.onClick.forEach((e=>e(s,!0)))},d.onclose=d.onerror=t=>{v.log("notify: notification close",s,t);const n=e[s];n&&n.onClose.forEach((e=>e(s)))},e[s]={close:()=>d.close(),onClose:(u?u.onClose:[]).concat([Xs]),onClick:(u?u.onClick:[]).concat([Ws])},t.resolve({type:"native",id:s}) +}else if("denied"==n)t.resolve();else if("unsupported"==n)t.resolve();else{const e=e=>{n="granted"==e?"granted":"denied",l()};r.requestPermission().then(e)}};return l(),t.promise()}));var l}};return s})(),Ks=(()=>{const e={};return{cancel:t=>e[t]?(e[t].close(),delete e[t],Xs(t),h.resolve(!0)):h.resolve(!1),create:(t,n,r,s)=>{if(_e){const i=e[t];Vs[t]&&(v.log("notify: notification already exists",t),delete e[t],i&&i.close());try{const o=_e.createNotification(n,r||"",s||"");return o.onclick=()=>{ +v.log("notify: webkit click",t);const n=e[t];n&&n.onClick.forEach((e=>e(t,!0)))},o.onclose=()=>{v.log("notify: webkit close",t);const n=e[t];n&&n.onClose.forEach((e=>e(t)))},e[t]={close:()=>o.cancel(),onClose:(i?i.onClose:[]).concat([Xs]),onClick:(i?i.onClick:[]).concat([Ws])},o.show(),y.Pledge({type:"webkit",id:t})}catch(e){v.warn("notify: webkitNotifications creation failed with: "+e.message)}}return y.Pledge()}}})(),$s=(()=>{const e=ve,t={};return{cancel:e=>t[e]?(t[e](),delete t[e],Xs(e), +h.resolve(!0)):h.resolve(!1),create:(t,n,r,s,i)=>{const{informational:o}=i,a=y();return!e||o?(a.resolve(),se((()=>{Xs(t)}),1)):(a.resolve({type:"conf",id:t}),se((()=>{const n=e((r?r+"\n\n":"")+s);Ws(t,!!n),se((()=>Xs(t)),1)}),1)),a.promise()}}})(),ei=(e,t,n,r,s,i)=>{s=s||{};const{timeout:o}=s;let a;const c=o;let l,u=!1,d=null;const A=e=>{switch(e){case"webkit":return Ks;case"native":return Js;case"chronos":return Ys;case"conf":return $s}},p=()=>{d&&J(d),!u&&i&&i({})},h=()=>{if(u=!0,i&&i({ +clicked:u}),a){const e=A(a.type);e&&e.cancel(a.id)}};return r=r||ht.getURL("images/icon128.png"),Bs(r,!1).then((e=>null==e?void 0:e.toDataUri())).then((e=>l=e||r)).then((()=>Hs.acquire())).then((()=>Ys.create(e,l,t,n,s))).then((r=>r||Ks.create(e,l,t,n,s))).then((r=>r||Js.create(e,l,t,n,s))).then((r=>r||$s.create(e,l,t,n,{informational:!i,notificationId:e}))).then((e=>{if(!e)return;const{id:i,type:o}=a=e,l=Vs[i]=Vs[i]||((e,t)=>{const n=Vs[e]={cbs:[],o:t};return qs.set(e,t),n})(i,s) +;l.cbs.push((e=>{"clicked"in e&&h&&h(),p&&p()})),d=se((()=>{d=null;const e=A(o);e&&e.cancel(i)}),c||6e5),v.log("notify:",t,n,r,c)})).always((()=>Hs.release())),{cancel:()=>{if(a){const e=A(a.type);e&&e.cancel(a.id)}}}},ti=(e,t,n,r,s)=>ei(r.notificationId||Pe(),e,t,n,r,s),ni={},ri={},si=(e,t)=>{let n;const r=t.id||t.key||"general";if("deleted"in t)return void delete e[r];const s=t.timeout;let i,o;s&&(i=se((()=>{delete e[r]}),s),o=Date.now()+s),(n=e[r])&&n.to&&J(n.to),e[r]={options:t,...s?{ts:o, +to:i}:{}}},ii=e=>{const t=Date.now();return Object.keys(e).map((n=>{const r=e[n],s=r.options;let i;if(!r.ts||(i=Math.max(0,r.ts-t)))return s.timeout=i,s})).filter((e=>e))},oi=new Ve,ai={all:e=>{ai.actionPage(e),e&&ai.optionsPage(e)},updateActionPage:()=>{oi.emit("actions",{method:"update"})},actionPage:e=>{oi.emit("actions",{options:e}),si(ri,e)},optionsPage:e=>{oi.emit("options",{options:e}),si(ni,e)},actionStatus:()=>ii(ri),optionsStatus:()=>ii(ni)},ci=ai;let li;const ui={ +newV:ht.manifest.version,oldV:void 0,first_run:!1,active:!1},di=()=>{if(!_.late)return void _.registerLateCallback(di);let e,t="version="+ui.newV+"&ext="+ft.short_id+"&updated=true";if(ui.first_run?(e="https://www.tampermonkey.net/installed.php?"+t,ui.active=!0):(t+="&old="+ui.oldV,e="https://www.tampermonkey.net/changelog.php?"+t),"off"==wn.values.notification_showUpdate);else if("notification"==wn.values.notification_showUpdate)n=Qr.getMessage("Updated_to__0version0",ui.newV), +r=Qr.getMessage("Click_here_to_see_the_recent_changes"),s=Rs("tampermonkey"),i=t=>{if(t.clicked){const t={url:e};mt.create(t,(()=>{}))}},ei(Pe(),n,r,s,{timeout:3e5},i);else if("changelog"==wn.values.notification_showUpdate){ui.active||(e+="&intr=true"),ui.active=!0;const t={url:e,active:ui.active};mt.create(t,(()=>{}))}var n,r,s,i},Ai=(()=>{const e=y(),t=()=>{const t=Date.now(),n=nn.getValue(I.STORAGE.LAST_START,0),r=Math.round((t-n)/1e3),s=r<=60;v.log("upd: restart?",s,"(",r,"seconds ago)"), +e.resolve(s)};return _.late?t():_.registerLateCallback(t),e.promise()})(),pi=()=>{let e=!1,t=!1;(()=>{let e,t;const n=y(),r=()=>{t&&(t=void 0,n.resolve(!!e))};return t=se(r,300),Bt(15,(t=>{e="active"==t,r()})),n.promise()})().then((e=>(t=e,Ai))).then((t=>{e=t})).always((()=>{ui.active=!t||e,di(),fi=!0}))};let hi,fi,mi=!1;const gi={scheduleNotification:(e,t)=>{fi||(ui.oldV=e||void 0,ui.first_run||(ui.first_run=t),hi&&J(hi),hi=se(pi,1e3))},updateAvailable:()=>li,onInstalled:()=>{ +gi.scheduleNotification(void 0,!0)},onUpdated:e=>{gi.scheduleNotification(e,!1)},onUpdateAvailable:e=>{mi||(v.info("An update to version",e.version,"is available"),li=e.version,ci.all({domain:"status",key:"extension_update_available",class:"information",text:Qr.getMessage("0name0_0version0_is_available__Please_re_start_your_browser_to_update_",ht.manifest.name,e.version),timeout:864e5}),mi=!0)}};_.registerLateCallback((()=>{nn.setValue(I.STORAGE.LAST_START,Date.now())})) +;const vi=gi,wi=new Ve,bi=new Ve,_i=new Ve,yi=new Ve,ki=new Ve;let Ri={},xi=null;const Ei=()=>{const e=Date.now(),t={},n=Object.keys(Ri);n.forEach((n=>{const r=Ri[n];r?e-r.ts{r.com.reject({error:"timeout",please_close:!0})}),1),Si(n)):v.error("cleanup: e is undefined",n)})),Ri=t,null!==xi&&0===n.length&&(Y(xi),xi=null)},Si=e=>{const t=Ri[e];if(t){delete Ri[e];const n=t.preparat;if((e=>{const t=e;return void 0!==t.script&&"tfd"in t.script})(n)){const{script:e,oldscript:t}=n +;new Us(e.tfd).dispose(),t&&new Us(t.tfd).dispose()}}},Ci=15e3;let Mi=!1;const Ii=(e,t)=>{Mi||Ui.init(),null===xi&&(xi=re(Ei,5e3));const n=y();return((e,t)=>{const n=y();return void 0===t&&(t=!0),mt.getSelected(null,(r=>{const s=r?r.index+1:void 0;mt.create({url:ht.getURL("ask.html")+"?aid="+e,active:t,index:s,parent:r},(e=>{if(!e){const e="tabs.create failed -> giving up now!";return v.error(e),void n.reject({error:e})}n.resolve({id:e.id,close:()=>mt.remove(e.id)})}))})),n.promise()})((e=>{ +const t=Pe();return Ri[t]=e,t})({ts:Date.now(),com:n,preparat:t,type:e}),t.active).then((e=>n.promise().done((t=>{(t.ok||t.aborted)&&e.close()}))))},Ui={init:()=>{Mi||(Mi=!0)},onMessage:e=>{const t=y(),n=e.aid,r=Ri[n];if(r){if(r.aborter&&(J(r.aborter),delete r.aborter),"ping"==e.method)Ri[n].ts=Date.now(),t.resolve({pong:!0});else if("preparat"==e.method)t.resolve({preparat:r.preparat,type:r.type});else if("install"==e.method){const s=e.message;r.com.resolve({ok:!0,message:s||{}}),t.resolve({}), +Si(n)}else if("import"==e.method){const s=e.message;r.com.resolve({ok:!0,message:s}),t.resolve({}),Si(n)}else if("permission"==e.method){const s=e.message;r.com.resolve({ok:!0,message:s}),t.resolve({}),Si(n)}else if("unload"==e.method||"abort"==e.method){const s=e.message;t.resolve({});const i=()=>{r.com.resolve({ok:!1,aborted:!0,message:s||{}}),Si(n)};"abort"==e.method?i():r.aborter=se(i,3e3)}else if("connect"==e.method){const s=e.message;r.com.resolve({ok:!0,message:s}),t.resolve({}),Si(n)} +}else t.reject({error:"unknown_id",please_close:!0});return t.promise()},install:e=>Ii("install",e),import:e=>Ii("import",e),askForPermission:(e,t,n)=>{const r={permissions:e.permissions,origins:e.origins,title:t,message:n};return Ii("permission",r)},installError:e=>Ii("install_error",e),askForConnect:e=>Ii("connect",e)},Gi=Ui;let Zi,Ti,Bi;(()=>{const e=y();Zi=e.promise();const t=Ns("general");t.type().then((n=>{"storage.session"===n?t.get("session_start").then((n=>{n?(Bi=!1, +Ti=parseInt(n)):(Bi=!0,Ti=(new Date).getTime(),t.set("session_start",`${Ti}`)),e.resolve()})):(Bi=void 0,Ti=void 0,e.resolve())}))})();const Oi=()=>Zi.then((()=>Bi)),ji=()=>Zi.then((()=>Ti));let Di,Fi,Li;const Pi=()=>Di||y.Pledge(),Ni=e=>{Zt.supported&&(Zt.onAdded.addListener((t=>{e({added:t})})),Zt.onRemoved.addListener((t=>{e({removed:t})})))},Vi=()=>{const e=y(),t=Fi={},n=Li={};return Di=e.promise(),Zt.supported?Zt.getAll((r=>{r.permissions&&Object.values(r.permissions).forEach((e=>t[e]=!0)), +r.origins&&Object.values(r.origins).forEach((e=>n[e]=!0)),Di=void 0,e.resolve()})):e.resolve(),e.promise()},zi=Ns("general"),qi=async(e,t,n,r)=>{let s=await Xi.has(e);if(!s){const i=await ji(),o=`asked_for_permission_${e}`,a=void 0===i?void 0:i.toString(),c=await zi.get(o);void 0!==a&&c===a||(s=await Xi.ask(e,t,n),r&&r(s),a&&zi.set(o,a))}return s},Hi=an("runtime_host_permissions","denied");let Qi;const Wi=()=>y((({resolve:e})=>{if(void 0!==Qi)e(Qi);else{if(Zt.supported)return(0, +Xi.hasOrigin)("*://*/*").then((t=>{Qi=t,e(Qi)}),(()=>{Qi=!0,e(Qi)}));Qi=!0,e(Qi)}})).promise();Ni((()=>{Qi=void 0}));const Xi={permDownloads:"downloads",permProxy:"proxy",has:e=>Pi().then((()=>!Zt.supported||(Fi&&Li?!!Fi[e]||!!Li[e]:(Ni((()=>{Pi().then((()=>Vi()))})),Vi().then((()=>Xi.has(e))))))),hasOrigin:e=>{const t=De(e);return Pi().then((()=>{const e=y();return Zt.supported?Zt.contains({origins:t},(t=>{e.resolve(t)})):e.resolve(!0),e.promise()}))},ask:(e,t,n)=>{const r=De(e),s=y() +;return Zt.supported?Gi.askForPermission({permissions:r},t,n).done((({message:e})=>{const t=!!(null==e?void 0:e.granted);if(t){Fi||(Fi={});for(const e of r)Fi[e]=!0}s.resolve(t)})):s.resolve(!1),s.promise()},askOrigin:(e,t,n)=>{const r=De(e),s=y();return Zt.supported?Gi.askForPermission({origins:r},t,n).done((({message:e})=>{const t=!!(null==e?void 0:e.granted);if(t){Li||(Li={});for(const e of r)Li[e]=!0}s.resolve(t)})):s.resolve(!1),s.promise()},remove:e=>Pi().then((()=>{const t=y() +;return Zt.supported?(Di=t.promise(),Zt.remove({permissions:[e]},(n=>{Di=void 0,Fi&&(Fi[e]=!1),t.resolve(n)}))):t.resolve(!0),t.promise()})),addListener:Ni},Yi=Xi,Ji={};it.on("xhr",(function(e){let t,n;void 0!==(t=e.id)&&void 0!==(n=Ji[t])&&n.handle(e)&&delete Ji[t]}));class Ki{constructor(e){this.readyState=Ki.UNSENT,this.status=0,this.statusText="",this.responseType="",this.async=!0,this.timeout=-1,this.canceled=!1,this.loaded=0,this.headers={},this.onreadystatechange=null, +this.onredirect=null,this.onopen=null,this.onload=null,this.onloadstart=null,this.onprogress=null,this.onabort=null,this.onerror=null,this.ontimeout=null,this.upload={onprogress:null,loaded:0,total:void 0},this.open=function(e,t,n=!0,r,s){if(this.method=e,this.url=t,this.async=n,this.user=r,this.password=s,this.responseURL=t,!this.async)throw new Error("Synchronous requests are not supported");this.onopen&&this.onopen(this)},this.send=async function(e){ +this.mime_type&&(this.request_headers||(this.request_headers={}),this.request_headers["content-type"]||(this.request_headers["content-type"]=this.mime_type)),(this.user||this.password)&&(this.request_headers||(this.request_headers={}),this.request_headers.Authorization="Basic "+X((this.user||"")+":"+(this.password||"")));const t=this.method||"GET",n=this.url;if(!n)throw new Error("No URL specified");const r={method:t,url:n,headers:this.request_headers,timeout:this.timeout>0?this.timeout:void 0, +anonymous:"withCredentials"in this?!this.withCredentials:this.options&&!!this.options.anonymous},s=e=>{this.method&&"POST"==this.method.toUpperCase()&&(this.request_headers||(this.request_headers={}),this.request_headers["content-type"]||(this.request_headers["content-type"]=e))};if(e){let t,n="";if(e instanceof Blob){t=e.size;const i=await nt(e);i?(r.data=We(i),s(n)):(this.readyState=0,this.statusText="data read error",this.onerror&&this.onerror(this))}else t=e.length,n="text/plain", +r.data=We(He(e));s(n),this.upload&&(this.upload.loaded=0,this.upload.total=t)}(async e=>{await st.acquire();try{let t;const n=await Promise.race([new Promise(((n,r)=>{t=se((()=>{t=void 0,r(`timeout: ${e.method}`)}),15e3)})),M.runtime.sendNativeMessage("application",e)]);return void 0!==t&&J(t),n}catch(e){throw console.error("sendNativeMessage",e),e}finally{st.release()}})({method:"xhr",id:this.id,details:r}),e&&this.upload&&this.upload.onprogress&&this.upload.onprogress.apply(this,[this.upload]) +},this.abort=function(){this.canceled=!0,delete Ji[this.id],this.onabort&&this.onabort(this)},this.overrideMimeType=function(e){this.mime_type=e},this.getAllResponseHeaders=function(){const e=this.headers;return Object.keys(e).map((function(t){const n=e[t];return n&&n.includes(",")?n.split(",").map((function(e){return t+":"+e.trimStart()})).join("\r\n"):t+":"+n})).join("\r\n")},this.getResponseHeader=function(e){return this.headers[e]},this.setRequestHeader=function(e,t){ +null!==t&&(this.request_headers||(this.request_headers={}),this.request_headers[e.trim().toLowerCase()]=t.trim())},this.toString=function(){return"[object XMLHttpRequest]"},this.handle=function(e){const t=e.data,n=()=>{this.onprogress&&this.onprogress(this)};if(t.timeout)this.ontimeout&&this.ontimeout.apply(this,[this]);else if(1==t.readyState&&"loaded"in t)this.upload&&this.upload.onprogress&&(this.upload.loaded=t.loaded||0,this.upload.total=t.total, +this.upload.onprogress.apply(this,[this.upload]));else if(2==t.readyState&&301==t.status)Object.assign(this,t),this.onredirect&&this.onredirect(this);else if(t.readyState!=this.readyState){if(Object.assign(this,t),this.onreadystatechange&&this.onreadystatechange(this),4==t.readyState){const e=t.status;return e>=400?this.onload&&this.onload.apply(this,[this]):e>=300||(e>=200?this.onload&&this.onload.apply(this,[this]):e>=100||0===e&&this.onerror&&this.onerror.apply(this,[this])),!0} +t.readyState>1?n():1==t.readyState&&this.onloadstart&&this.onloadstart.apply(this,[this])}else 3==t.readyState&&(Object.assign(this,t),n())},this.id=Date.now()+(Math.random()+1).toString(36).substring(7),this.options=e,Ji[this.id]=this}get lengthComputable(){return null!=this.total}get target(){return this}get response(){const e=eo(this.responseData);if(null==e)return null +;const t=this.responseType?this.responseType.toLowerCase():"",n=(this.headers?this.headers["content-type"]:null)||"binary/octet-stream";return $i(e,t,n)}get responseText(){const e=eo(this.responseData);return null==e?null:$i(e,this.mime_type?"binary":"text")}get responseXML(){const e=eo(this.responseData);if(null==e)return null;const t=(this.headers?this.headers["content-type"]:null)||"";return $i(e,"document",t.split(";")[0])}}Ki.UNSENT=0,Ki.OPENED=1,Ki.HEADERS_RECEIVED=2,Ki.LOADING=3, +Ki.DONE=4,Ki.toString=function(){return"[XMLHttpRequest]"};const $i=function(e,t,n){let r;if("arraybuffer"==t)r=Je(e);else if("blob"==t)r=new Blob([Je(e)],{type:n});else if("json"==t)r=JSON.parse(Qe(e));else{if("document"==t)return"text/xml"==n&&pe?(new pe).parseFromString(e,n):null;if("text"==t||n&&(n.match(/charset=(utf[-_]?8)/i)||"text/html"==n))try{r=Qe(e)}catch(t){r=e}else r=e}return r},eo=e=>{try{if(void 0===e)return;return Xe(e)}catch(e){return void console.warn("XmlHttpRequest:",e)}} +;var to;!function(e){e.TESTING="TESTING",e.AUDIO_PLAYBACK="AUDIO_PLAYBACK",e.IFRAME_SCRIPTING="IFRAME_SCRIPTING",e.DOM_SCRAPING="DOM_SCRAPING",e.BLOBS="BLOBS",e.DOM_PARSER="DOM_PARSER",e.USER_MEDIA="USER_MEDIA",e.DISPLAY_MEDIA="DISPLAY_MEDIA",e.WEB_RTC="WEB_RTC",e.CLIPBOARD="CLIPBOARD",e.LOCAL_STORAGE="LOCAL_STORAGE",e.WORKERS="WORKERS",e.BATTERY_STATUS="BATTERY_STATUS",e.MATCH_MEDIA="MATCH_MEDIA",e.GEOLOCATION="GEOLOCATION"}(to||(to={}));const no=async(e,t)=>{{let n;try{const r=n=await(e=>e({ +justification:"create an object URL",reasons:[to.BLOBS]}))(t),s=(await r.sendBinary({action:"objectURL",blob:e})).url;if(s)return new Us({objUrl:{url:s,revoke:async()=>{r&&(await r.send({action:"objectURL",url:s}),r.release())}}},Es+xs.OBJ_URL);n&&n.release()}catch(e){n&&n.release(),console.warn("offscreen: failed to create object URL",e)}}return new Us({blob:e})},ro=[301,302,303,307,308],so=["arraybuffer","blob","document","json","xml","headers","stream"];let io,oo={},ao=()=>h.resolve({ +done:()=>{}}),co=()=>h.resolve({done:()=>{}}),lo=()=>Promise.resolve(!0);const uo=["internal","user-agent","accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],Ao={"cache-control":"max-age=0, must-revalidate"},po=e=>{const t={},n={};return Object.keys(e).forEach((r=>{let s=r,i=e[r];var o +;o=r.toLowerCase(),uo.includes(o)||0===o.indexOf("proxy-")||0===o.indexOf("sec-")?n[s]=i:t[s]=i})),{...Object.keys(n).length?{forbidden:n}:{},...Object.keys(t).length?{regular:t}:{}}},ho=e=>({responseText:"",response:null,readyState:4,responseHeaders:"",status:0,statusText:"",error:e=e||"Forbidden"}),fo=e=>e&&"object"==typeof e&&"type"in e&&"value"in e,mo=e=>{if("Blob"===e.type)return new Blob([Je(e.value)]);if("File"===e.type){if(!e.name)return;return new File([Je(e.value)],e.name,{type:e.meta, +lastModified:e.lastModified||Date.now()})}if("FormData"==e.type){const t=new FormData;return e.value.forEach((({name:e,value:n})=>{const r=mo(n);void 0!==r?t.append(e,r):v.warn("Unable to un-typify value for FormData field",n)})),t}if("URLSearchParams"===e.type)return new URLSearchParams(e.value);if("Array"===e.type||"Object"===e.type){let t,n,r;"Object"===e.type?(r=Object.keys(e.value),n=e=>et{const t={};return e&&e.split("\n").forEach((e=>{const n=e.match(/^([^:]+): ?(.*)/);if(n){const e=n[1].toLowerCase();t[e]=(void 0!==t[e]?t[e]+",":"")+(n[2]||"").replace(/,/g,"%2C")}})),t},vo=(e,t,n)=>{const r={...t||{}},s=async(e,t)=>{const n=r[e];n&&n("function"==typeof t?await t():t)},i=async(e,t)=>{r[e]&&(await s(e,t),r[e]=void 0)};if(!(n=n||{}).internal&&(o=e.url, +!["https:","http:","data:","blob"].some((e=>o.startsWith(e))))){v.warn("xhr: invalid scheme of url:",e.url);const t=ho("Invalid scheme");return i("onerror",t),void i("ondone",t)}var o;const a=void 0!==e.responseType?e.responseType.toLowerCase():void 0,c=e.redirect&&"follow"!==e.redirect,l=(e.proxy&&e.proxy.type,!oo.mozAnon&&e.anonymous||"stream"==a||c||!e.partialSize&&a||"typified"===e.data_type),u=e.fetch||!1;return l||u?_o(e,r,n,e.retries||0,i,s):yo(e,r,n,e.retries||0,i,s) +},wo="tm-finalurl"+B.short_id.toLowerCase(),bo="tm-setcookie"+B.short_id.toLowerCase(),_o=(e,t,n,r,s,i)=>{const o=pe,a=!e.redirect||"follow"===e.redirect;let c,l,u,d,A;const p=(t,n,r)=>{const s=[];let i;const o=r||t.headers;if(o){const n=[],r=[];o.forEach(((e,t)=>{const o=t.toLowerCase();o.startsWith(bo)?n.push(e):"set-cookie"===o?r.push(e):o===wo?i=e:s.push(o+":"+e)})),i=a?i||t.url:e.url,(n.length?n:r).forEach((e=>s.push("set-cookie:"+e)))}const c=void 0===n?4:n,l=t.status||0,u=t.statusText||"" +;return{readyState:c,responseHeaders:s.join("\r\n"),finalUrl:i,status:l,statusText:u}},h=(e,t,n)=>Object.assign(n||{},{lengthComputable:void 0!==e,loaded:e,done:e,position:e,total:t,totalSize:t}),f=e=>{let t;d&&d(),l||(u?(t=p({status:408,statusText:"Request Timeout"}),s("ontimeout")):"AbortError"==(null==e?void 0:e.name)?(t=ho("aborted"),s("onabort",t)):(t=p({status:408,statusText:(null==e?void 0:e.message)||"Request Timeout"}),s("onerror",t)),l=!0,s("ondone",t)) +},m=e.responseType?e.responseType.toLowerCase():"";if("document"==m&&!o)return void f({name:"Error",message:"response type not supported"});const g=async(e,t,r)=>{let s;if(r)s=e;else{const t=e;if(!n.no_blob&&!n.foreign_context){let e;if(!io)throw new Error("Offscreen document not available");return e=await no(t,io),i("onpartial",{tfd:await e.toTransferableData()}),void se((()=>e.dispose()),2e4)}{const e=await nt(t);if(!e)return void v.warn("xhr: failed to convert blob to binary text");s=e}} +const o=Ne(s,t);o.forEach(((e,t)=>{i("onpartial",{partial:e,index:t,length:o.length})}))};let w=!1;const b=e=>{e&&(u=!0),_?_.abort():u?f():f({name:"AbortError",message:"Aborted by user"})};let _;return(async()=>{try{const u={};u.method=e.method||"GET";const y=zn(e.url);let k,R;if(y){let t=!1;y.username&&(e.user=e.user||y.username,t=!0),y.password&&(e.password=e.password||y.password,t=!0),k=t?Hn(y):e.url}else k=e.url;if(e.headers){let{forbidden:t,regular:n}=po(e.headers);if(R=n,t){ +const{responseHeaders:n,done:r}=await ao(k,u.method,e.proxy,!a,t);d=()=>{r(),d=void 0},n&&(A=n)}}if(!a&&(u.redirect=e.redirect,!d)){const{responseHeaders:t,done:n}=await ao(k,u.method,e.proxy,!a);d=()=>{n(),d=void 0},t&&(A=t)}if((!await lo()||(e.proxy,0))&&!d){const{responseHeaders:t,done:n}=await ao(k,u.method,e.proxy,!1);d=()=>{n(),d=void 0},t&&(A=t)}if(!d){const{done:e}=await co(k,u.method);d=()=>{e(),d=void 0}}e.nocache?u.cache="reload":e.revalidate&&(u.cache="default",R=R||{},R={...R,...Ao +}),e.anonymous?u.credentials="omit":u.credentials="include",e.user&&e.password&&(R=R||{},R.Authorization="Basic "+X(e.user+":"+e.password)),R&&(u.headers=new Headers(R)),void 0!==e.data&&null!==e.data&&(fo(e.data)&&"typified"===e.data_type?u.body=mo(e.data):"string"==typeof e.data?u.body=e.data:u.body=JSON.stringify(e.data)),_=q?new q:void 0,_&&(u.signal=_.signal),s("onloadstart",p({status:0,statusText:""},1)),oe(k,u).then((async a=>{var u,f,b;let _;if(c&&(J(c),c=null),A){ +const e=await Promise.race([A,F(5e3)]);if(e){_=(e=>{const t=new Headers;for(const[n,r]of e.entries())t.append(n,r);return t})(a.headers);for(const t of e)if(void 0!==t.value)try{_.set(t.name,t.value)}catch(e){try{_.set(t.name,He(t.value))}catch(e){v.warn("xhr: failed to set header",t.name,t.value)}}}}if(d&&d(),l)return;let y=p(a,void 0,_);if(y.status>0&&(y.status<200||y.status>=399)&&r>0)return void _o(e,t,n,r-1,s,i);const{partialSize:k,overrideMimeType:R,responseType:x}=e +;if(a.ok)if(i("onreadystatechange",p(a,2,_)),"stream"==m){const t=null===(u=a.body)||void 0===u?void 0:u.getReader();if(t)for(;;){const{done:n,value:r}=await t.read();if(r){const t=new Blob([r]);await g(t,parseInt(e.partialSize),!1)}if(n)break}}else{const t=await(async(e,t)=>{var n;const r=null===(n=e.body)||void 0===n?void 0:n.getReader();if(r){const n=[];let s=0;const o=parseInt(e.headers.get("Content-Length")||"-1");for(;;){const{done:a,value:c}=await r.read();if(c&&(n.push(c),s+=c.length, +await i("onprogress",(async()=>{const n=p(e,3,t);return h(s,o,n)}))),a)break}const a=new Uint8Array(s);let c=0;for(const e of n)a.set(e,c),c+=e.length;return a}{const n=await e.arrayBuffer();return await i("onprogress",(async()=>{const r=p(e,3,t);return h(n.byteLength,n.byteLength,r)})),new Uint8Array(n)}})(a,_),n=null===(f=a.headers)||void 0===f?void 0:f.get("Content-Type"),r=((null===(b=R||n)||void 0===b?void 0:b.toLowerCase().match(/charset=([^;]+)/))||[])[1],s=()=>new Blob([t],{ +type:R||n||"binary/octet-stream"});if(k){let t;["arraybuffer","blob"].includes(m)||void 0!==R?(y.response=s(),t=!1):(y.response=await nt(s(),r||"utf-8"),t=!0),y=await(async(t,n)=>{if(e.partialSize){const r=t.response;["response","responseText","responseXML"].forEach((e=>{delete t[e]})),!w&&r&&(w=!0,await g(r,parseInt(e.partialSize),n))}return t})(y,t)}else if(void 0!==x){let e;if("arraybuffer"==m)y.response=t.buffer;else if("blob"==m)y.response=s();else if("document"==m){ +e=(n||"text/xml").toString().split(";")[0];const t=new o,i=await nt(s(),r||"utf-8");y.response=t.parseFromString(i||"",e)}else if("json"==m){const e=await nt(s(),r||"utf-8");y.response=JSON.parse(e||"")}else v.warn("xhr: responseType",m," is not implemented!"),y.responseText=y.response=await nt(s(),r||"utf-8")}else{const e=await nt(s(),r||"utf-8");y.responseText=y.response=e}}else if(y.responseXML=void 0,"follow"!==e.redirect&&"opaqueredirect"==a.type){const e=p(a,2,_) +;e.responseText=e.response=y.responseText=y.response=void 0,e.status=y.status=301,i("onreadystatechange",e)}else{i("onreadystatechange",p(a,2,_));try{if("stream"==m){const t=await a.text(),n=new Blob([t]);await g(n,parseInt(e.partialSize),!1)}else y.responseText=y.response=await a.text()}catch(e){}}s("onreadystatechange",y),s("onload",y),s("ondone",y)})).catch((async e=>{A&&await Promise.race([A,F(500)]),f(e)})),void 0!==e.timeout&&null!==e.data&&(c=se((()=>{c=null,b(!0)}),e.timeout))}catch(e){ +d&&d();const t=e;v.error(t.message,t.stack);const n=ho(t.message);s("onerror",n),s("ondone",n)}})(),{abort:()=>b()}},yo=(e,t,n,r,s,i)=>{let o,a,c=!1;const l=(()=>{if(!io)throw new Error("Offscreen document not available");return io({justification:"make a XMLHttpRequest and forward BLOB data",reasons:[to.BLOBS]})})().then((async({connect:l})=>{if(o=await l("xhr",6e4),c){const e=ho("aborted");return await s("onabort"),await s("ondone",e),void o.disconnect()}const u=new rt(1);let d,A,p +;if(e.method=e.method||"GET",e.headers){let t;const{forbidden:n,regular:r}=po(e.headers);t=r;{const{responseHeaders:t,done:r}=await ao(e.url,e.method,e.proxy,!1,n);a=()=>{r(),a=void 0},t&&(d=t)}e.headers=t}if(!a){const{done:t}=await co(e.url,e.method);a=()=>{t(),a=void 0}}o.onMessage.addListener((async e=>{await u.acquire();try{let t;if(e.data&&"responseHeaders"in e.data&&(t=e.data.responseHeaders)){if(d){let e;const n=await Promise.race([d,F(5e3)]);if(n){e=new Headers(go(t)) +;for(const t of n)if(void 0!==t.value)try{e.set(t.name,t.value)}catch(n){try{e.set(t.name,He(t.value))}catch(e){v.warn("xhr: failed to set header",t.name,t.value)}}const{rh:r,fu:s}=(e=>{const t=[],n=[],r=[];let s;return e.forEach(((e,i)=>{const o=i.toLowerCase();o.startsWith(bo)?n.push(e):"set-cookie"===o?r.push(e):o===wo?s=e:t.push(o+":"+e)})),(n.length?n:r).forEach((e=>t.push("set-cookie:"+e))),{rh:t.join("\r\n"),fu:s}})(e);A=r,p=s}d=void 0}a&&a(),A&&(e.data.responseHeaders=A), +p&&(e.data.finalUrl=p)}"ondone"===e.type&&a&&a(),await i(e.type,e.data)}finally{u.release()}})),o.onDisconnect.addListener((()=>{o=void 0}));const h=Object.keys(t).reduce(((e,n)=>{const r=n;return t[r]&&(e[r]=!0),e}),{}),{data_type:f,data:m}=e;if(fo(m)&&"typified"===f)throw new Error("unsupported data type");o.postMessage({action:"xhr",details:e,retries:r,callbacks:h,options:n})}));return{abort:async()=>{c||(c=!0,await l,o&&o.postMessage({action:"xhr",abort:!0}))}}};let ko,Ro,xo={} +;const Eo="runtime_host_permissions";let So;const Co=(e,t)=>{if(So||(So=se((()=>{So=void 0,(()=>{let e;y.Pledge().then((()=>Wi())).then((t=>{e=t,e?ci.all({domain:"status",key:Eo,deleted:!0}):ci.all({domain:"status",key:Eo,class:"warning",text:Qr.getMessage("Limited_runtime_host_permissions_might_break_some_Tampermonkey_features_"),timeout:31536e6}),e||void 0!==Ro?e&&Ro&&(wi.off("onRequestRedirect",Ro),Ro=void 0):(Ro=({url:e})=>{Co(e,1e3)},wi.on("onRequestRedirect",Ro)) +})).then((()=>ko)).then((()=>{const t=Object.values(xo);if(xo={},e)return t;{const e={},n=ko=y.Pledge().then((async()=>{const n=await Hi.get(),r=[];await h.all(t.map((async t=>{const s=zn(t.url);if(!s||!s.protocol||!s.hostname||["data:","blob:"].includes(s.protocol))return;const i=(e=>{const t="string"==typeof e?zn(e):e;if(!t)throw new Error("invalid url");return Hn(t,{nopath:!0})})(s)+"/";await Yi.hasOrigin(i)?r.push(i):n[i]||(e[i]=Date.now())})));const s=Object.keys(e) +;return s.length&&await Hi.set(e),r.length&&await Hi.delete(r),s})).then((e=>e.length?(v.info("pcx: need to ask for some permissions",e),Yi.askOrigin(e,Qr.getMessage("Cross_Origin_Request_Permission"),Qr.getMessage("Click_here_to_allow_TM_to_access_the_following_hosts_0hostlist0",e.join("\n"))).then((()=>(ko=void 0,t)))):t)).always((()=>{ko=void 0}));return n}})).always((t=>{t&&t.forEach((t=>t.deferred.resolve(e))),Object.keys(xo).length&&Co()}))})()}),t||100)),!e)return y.Pledge() +;if(xo[e])return xo[e].deferred.promise();const n=y(),r={url:e,deferred:n};return xo[e]=r,n.promise()},Mo=(e,t,n,r)=>{let s,i;const o=t||{};return Co(e.url).then((()=>{if(i){const e=ho("aborted");return o.onabort&&o.onabort(e),void(o.ondone&&o.ondone(e))}(n=n||{}).internal=r,s=vo(e,o,n)})),{abort:function(){if(s)return s.abort();i=!0}}},Io={init:()=>{},internal:(e,t,n)=>Mo(e,t,n,!0),external:(e,t,n)=>Mo(e,t,n,!1)},Uo=Io;var Go={},Zo=Go.util=Go.util||{};Zo.isArrayBuffer=function(e){ +return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},Zo.isArrayBufferView=function(e){return e&&Zo.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},Zo.ByteBuffer=t,Zo.ByteStringBuffer=t,Zo.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},Zo.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read}, +Zo.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},Zo.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},Zo.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var n=this.data;t>0;)1&t&&(n+=e),(t>>>=1)>0&&(e+=e);return this.data=n,this._optimizeConstructedString(t),this},Zo.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this}, +Zo.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(Zo.encodeUtf8(e))},Zo.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},Zo.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},Zo.ByteStringBuffer.prototype.putInt32=function(e){ +return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},Zo.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},Zo.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},Zo.ByteStringBuffer.prototype.putInt32Le=function(e){ +return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},Zo.ByteStringBuffer.prototype.putInt=function(e,t){var n="";do{t-=8,n+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(n)},Zo.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<0);return t},Zo.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),n=2<=n&&(t-=n<<1),t}, +Zo.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},Zo.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},Zo.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)}, +Zo.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},Zo.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},Zo.ByteStringBuffer.prototype.copy=function(){var e=Zo.createBuffer(this.data);return e.read=this.read,e},Zo.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this}, +Zo.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},Zo.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},Zo.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t0;)1&t&&(n+=e),(t>>>=1)>0&&(e+=e);return n},Zo.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},Zo.decodeUtf8=function(e){return decodeURIComponent(escape(e))};var To=Go.sha256=Go.sha256||{};Go.md=Go.md||{},Go.md.algorithms=Go.md.algorithms||{},Go.md.sha256=Go.md.algorithms.sha256=To,To.create=function(){ +Oo||(Bo=String.fromCharCode(128),Bo+=Go.util.fillString(String.fromCharCode(0),64), +jo=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298], +Oo=!0);var e=null,t=Go.util.createBuffer(),r=new Array(64),s={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,messageLength64:[0,0],start:function(){return s.messageLength=0,s.messageLength64=[0,0],t=Go.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},s}};return s.start(),s.update=function(i,o){return"utf8"===o&&(i=Go.util.encodeUtf8(i)),s.messageLength+=i.length, +s.messageLength64[0]+=i.length/4294967296>>>0,s.messageLength64[1]+=i.length>>>0,t.putBytes(i),n(e,r,t),(t.read>2048||0===t.length())&&t.compact(),s},s.digest=function(){var i=Go.util.createBuffer();i.putBytes(t.bytes()),i.putBytes(Bo.substr(0,64-(s.messageLength64[1]+8&63))),i.putInt32(s.messageLength64[0]<<3|s.messageLength64[0]>>>28),i.putInt32(s.messageLength64[1]<<3);var o={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};n(o,r,i);var a=Go.util.createBuffer() +;return a.putInt32(o.h0),a.putInt32(o.h1),a.putInt32(o.h2),a.putInt32(o.h3),a.putInt32(o.h4),a.putInt32(o.h5),a.putInt32(o.h6),a.putInt32(o.h7),a},s};var Bo=null,Oo=!1,jo=null;Zo.hasWideChar=function(e){for(var t=0;t>>8)return!0;return!1};const Do=function(e,t){var n=Go.md.sha256.create();return n.update(e,"UTF-8"==t||void 0===t&&Zo.hasWideChar(e)?"utf8":void 0),n.digest().toHex() +},Fo=e=>!!O.inIncognitoContext||(e?e.incognito||!j.isDefaultStoreId(e.cookieStoreId):void 0),Lo=({frameType:e,frameId:t})=>void 0!==e?"outermost_frame"===e:void 0===t||0===t,Po=(e,t)=>{const{frameId:n,documentId:r,frameType:s}=e,{topframe:i}=t||{},o=void 0!==n?n:i?0:void 0;if(r||void 0!==o)return{frameId:o,frameType:s||(i?"outermost_frame":void 0),documentId:r,get id(){return r||`${o}`}}},No=async e=>{const t=async(e,n)=>{const r=e,s=typeof r;if("object"==s){if(null===r)return Do(`${s}:${r}`);{ +const s=[];if(n){if(n.includes(r))throw"Found circular structure";n.push(r)}else n=[r];if(Array.isArray(r))for(const e of r)s.push(await t(e,n));else{const i=Object.keys(e).sort();for(const e of i)s.push(await t(r[e],n))}return n.pop(),Do(s.join(""))}}if("function"===s)throw"Functions are not supported";return Do(`${s}:${r}`)};return await t(e)},Vo=(e,t)=>{ +if(!e||-1!=e.search(/#bypass=true/)||-1!=e.search(ft.getInternalPageRegexp())||!["https:","http:","file:","ftp:"].some((t=>e.startsWith(t))))return!1;const n=t?e:e.split(/[?#$]/)[0],r=-1!=n.search(/[^/]{1}\.user\.(js#|js\?|js$)/)||-1!=n.search(/[^/]{1}\.tamper\.(js#|js\?|js$)/);return r?!(-1!=n.search(/^htt[ps]{1,2}:\/\/code\.google\.com/)||-1!=n.search(/^htt[ps]{1,2}:\/\/(github|gitlab)\.com/)&&!ms(n)||-1!=n.search(/^htt[ps]{1,2}:\/\/bitbucket\.org/)&&!ms(n)):r},zo=(e,t)=>{const n=y(),r=zn(e) +;if(r&&["file:"].concat(T.INTERNAL_PAGE_PROTOCOLS).includes(r.protocol))St(e,(e=>{n.resolve(e)}),(e=>{n.reject(e)}));else{const r={method:"GET",retries:Z.RETRIES,timeout:6e4,revalidate:!0,headers:null==t?void 0:t.headers,responseType:"arraybuffer",url:e};Uo.internal(r,{onload:t=>{4!=t.readyState||200!=t.status&&0!=t.status||t.error?(v.verbose("getScriptFromUrl: "+e+" req.status = "+t.status),n.reject(t.responseText||"request error")):n.resolve(t.response)}, +onerror:e=>n.reject(e.responseText||"request error"),ontimeout:()=>n.reject("timeout")})}return n.promise()},qo=e=>{const t=y();return zo(e,{headers:{Accept:"text/x-userscript, */*"}}).then((e=>{Ke(e,{encoding:"UTF-8"}).then((e=>{t.resolve(e)}),(e=>{t.reject(e.message||"charset issue")}))}),(e=>{t.reject(e)})),t.promise()},Ho=()=>{const e=y();return mt.getSelected(null,(t=>{t?e.resolve(t):e.reject()})),e.promise()},Qo=(e,t)=>{let n,r;try{t||"/"!=e.substr(0,1)?t?(r=In(e),n=new RegExp(r)):(r=(e=>{ +let t;if("*"==e)t="^(https?|file)://.*";else{t=e;const n=En(t);if(n){let{protocol:e,host:r,path:s}=n;e=e?Ie(e).replace(/\*/gi,"[^:]*"):"",r=r?Ie(s?r.replace(/\.\*$/,bn):r).replace(/\*+/g,((e,t)=>1==e.length&&(s||!t&&r.length>1&&(r.match(/\*/g)||[]).length>1&&r.replace(/\*\./g,"").length>0)?"[^/]*":".*")):r||"",s=s?Ie(s).replace(/\*/gi,".*"):"",t="^"+[e,r,s].join("")+"$"}else t="^"+Ie(t)+"$",t=t.replace(/\*/gi,".*"),t=t.replace(/(\^|:\/\/)\.\*/,"$1([^?#])*");t=t.replace(Ie(bn+"/"),kn+"/")} +return t})(e),n=new RegExp(r,"i")):(r=("^"==e.substr(1,1)?"":".*")+e.replace(/^\//g,"").replace(/\/$/g,"")+("$"==e.substr(-2,1)?"":".*"),r=r.replace(/(\.\*){1,}/g,".*"),n=new RegExp(r,"i"))}catch(t){return void v.warn("scriptman: invalid regexp ",e)}return n},Wo=(e,t)=>""===e.replace(t,""),Xo=(e,t)=>{let n=[],r=[];const s=(e,t)=>e&&e.length?e.map((e=>Qo(e,t))).filter((e=>void 0!==e)):[],{inc:i,match:o,exc:a}=e;return n=s(i).concat(s(o,!0)),r=s(a),{rinc:n.length||t?n:void 0, +rexc:r.length||t?r:void 0}},Yo=e=>({source:e.source,flags:e.flags}),Jo=(e,t,n)=>{let r=!1;if(t.rinc){if(t.rinc.every((t=>!Wo(e,t)||(v.debug('scriptman: @include "'+t+'" matched'+(n?" ("+n+")":'"')),r=!0,!1))),!r)return r}else r=!0;return t.rexc&&t.rexc.every((t=>!Wo(e,t)||(v.debug('scriptman: @exclude "'+t+'" matched'+(n?" ("+n+")":'"')),r=!1,!1))),r},Ko=z({timeout:5,check_interval:10,retimeout_on_get:!0}),$o=z({timeout:300,check_interval:120,retimeout_on_get:!0}),ea={ePASTEBIN:1,eCHROMESYNC:2, +eSYNCFS:3,eGDRIVE:4,eDROPBOX:5,eWEBDAV:6,eYANDEX:7,eONEDRIVE:8,eUNKNOWN:9},ta={ts:0,data:{}},na={init:()=>{const e=(e,t)=>{const n=e.substr(I.PREFIX.STORE.length),r=t||void 0;if(r)for(const[e,t]of Object.entries(r.data)){const s={},i={uuid:n,storage:s,ts:r.ts};void 0===t?i.removed=e:s[e]=t,wi.emit("scriptStorage",i)}};nn.on("add",e,{key:new RegExp("^"+Ue(I.PREFIX.STORE))}),nn.on("change",e,{key:new RegExp("^"+Ue(I.PREFIX.STORE))})},getUidList:()=>{const e=[];return nn.listValues().forEach((t=>{ +t.startsWith(I.PREFIX.SCRIPT_UID)&&e.push(t.substr(I.PREFIX.SCRIPT_UID.length))})),e},getUidsByName:(e,t)=>{const n=[];return na.getUidList().forEach((r=>{const s=na.getMetaByUid(r);!s||s.name!=e||t&&t!=s.namespace||n.push(r)})),n},getUidByName:e=>na.getUidsByName(e)[0],getStorageByUid:e=>{const t=nn.getValue(I.PREFIX.STORE+e,{ts:0,data:{}});let{ts:n,data:r}=t||ta;return void 0===n&&(n=0),void 0===r&&(r={}),{ts:n,data:r}}, +setStorageByUid:(e,t)=>t?y.from(nn.setValue(I.PREFIX.STORE+e,t)):y.from(nn.deleteValue(I.PREFIX.STORE+e)),setStorageByUidAndNotify:(e,t,n,r,s,i)=>{v.verbose("sb: ("+e+"): set key "+r+' to "'+s+'"');const o=ra.getStorageByUid(e);i?delete o.data[r]:o.data[r]=s,o.ts=t=t||Date.now();const a=ra.setStorageByUid(e,o),c={storage:{[r]:s},ts:t,removed:i?r:void 0,uuid:e,id:n};return wi.emit("scriptStorage",c),a},getMetaByUid:e=>nn.getValue(I.PREFIX.META+e,null),getByUid:(e,t)=>{ +if(!e)return v.error("sb: no UUID set"),{};let n,r=nn.getValue(I.PREFIX.META+e,null);if(r){const{requires:s,resources:i}=r;let{sync:o}=r;r.requires=(s||[]).map((e=>{const{unsafe_url:t,abs_url:n}=e;return{unsafe_url:t,abs_url:n}})),r.resources=(i||[]).map((e=>{const{name:t,unsafe_url:n,abs_url:r}=e;return{name:t,unsafe_url:n,abs_url:r}})),r.uuid=e;const a=r.grant||[];r.grant=a.includes("none")?["none"]:a,r.options.override.use_connects||(r.connects=r.connects||[], +r.options.override.merge_connects=!0,r.options.override.use_connects=[]),void 0===r.options.check_for_updates&&(r.options.check_for_updates=!0),void 0===r.options.user_modified&&(r.options.user_modified=null),void 0===r.options.run_in&&(r.options.run_in=null),void 0===r.options.override.orig_run_in&&(r.options.override.orig_run_in=[]),void 0===r.options.tags&&(r.options.tags=[]),void 0===r.options.compat_powerful_this&&(r.options.compat_powerful_this=null),t&&(r=Be(r,{})),o&&!o.imported&&(o={ +imported:9});const c=r.textContent,l=nn.getValue(I.PREFIX.SCRIPT+e,c);l&&(n={...r,sync:o,textContent:l})}return{script:n,cond:nn.getValue(I.PREFIX.COND+e,null)}},setByUid:(e,t)=>{if(!e)throw v.error("sb: no UUID set",t),new Error("No UUID set!");if("string"!=typeof t.textContent)throw new Error("No script code set!");const{name:n,includes:r,matches:s,excludes:i}=t,{textContent:o,...a}=t,c={...a,uuid:e},l={};l[I.PREFIX.META+e]=c,l[I.PREFIX.SCRIPT_UID+e]=n,l[I.PREFIX.COND+e]={inc:r,match:s,exc:i}, +l[I.PREFIX.SCRIPT+e]=o;const u=nn.setValues(l);return Ko.removeAll(),$o.remove(e),y.from(u)},restoreByUid:e=>{const t=na.getByUid(e);if(!t.script||!t.cond)return y.Breach("invalid script");const{script:n}=t;return delete n.deleted,na.setByUid(e,n)},softRemoveByUid:e=>{const t=na.getByUid(e);if(!t.script||!t.cond)return y.Breach("invalid script");const{script:n}=t;n.deleted=Date.now();const r=na.setByUid(e,n);return Ko.removeAll(),$o.remove(e),r},removeByUid:e=>{const t=na.getByUid(e) +;if(!t)return y.Breach("not found");const n=y.when([nn.deleteValue(I.PREFIX.SCRIPT_UID+e),nn.deleteValue(I.PREFIX.COND+e),nn.deleteValue(I.PREFIX.SCRIPT+e),nn.deleteValue(I.PREFIX.META+e),nn.deleteValue(I.PREFIX.STORE+e)]).then((()=>{})),{script:r}=t;return wn.values&&r&&Ir(r.name,"r"),n}},ra=na,sa=ra,ia=(()=>{let e=!1,t={};const n={setValue:(e,n,r)=>{const s=y(),i=e,o=r?{origin:"normal",value:n}:n;t[i]=o;{let e=se((()=>{v.error(`migrate: storing key ${i} timed out after 30s!`),s.reject()}),3e4) +;const t={};t[i]=o;try{xt.local.set(t,(()=>{e&&J(e),e=void 0,s.resolve()}))}catch{s.reject()}}return s.promise()},getValue:(e,n)=>{let r=t[e];return n&&r&&"object"==typeof r&&"value"in r&&(r=r.value),r},deleteValue:e=>{const n=y(),r=e;delete t[r];{let e=se((()=>{v.error(`migrate: deleting key ${r} timed out after 30s!`),n.reject()}),3e4);try{xt.local.remove(r,(()=>{e&&J(e),e=void 0,n.resolve()}))}catch(e){n.reject()}}return n.promise()},listValues:()=>{const e=[] +;return Object.getOwnPropertyNames(t).forEach((t=>{e.push(t)})),e},init:()=>{const n=y();if(e)n.resolve();else{e=!0;const r=e=>{t={},e&&Object.keys(e).forEach((n=>{t[n]=e[n]})),n.resolve()};xt.local.get(null,r)}return n.promise()},clean:()=>{const n=y();return e=!1,t={},n.resolve(),n.promise()}};return n})(),oa="#schema",aa="#config",ca="#version",la="#update",ua="TM_version",da="@uid#",Aa="@re#",pa="@st#",ha="@source#",fa="@meta#",ma=new rt(1);let ga=0;const va=(()=>{ +const e=[],t=n=>new Promise(((r,s)=>{ht.sendMessage({target:"offscreen",method:"offscreen",request:n},(async n=>{let i=1e3;if(ft.lastError)s(ft.lastError),i=0;else if(n){const{result:t,poll:s}=n;i=s||0,t&&e.forEach((e=>{e(t)})),r(n)}else s(new Error("no response"));if(i){await F(i);const e=Math.random().toString(36).substring(2);await t({action:"port",details:{id:e}})}}))}));return{send:e=>{const n=Math.random().toString(36).substring(2);return t({action:"port",details:{id:n,message:e}})}, +onMessage:{addListener:t=>{e.push(t)}}}})(),wa=(e=>{const t={};let n;const r=n=>{let r=[],i=[];const o=()=>{r=[],i=[],a=null,delete t[n]};let a={postMessage:t=>{(t=>{if(!a)throw"port is disconnected";e.send({response_id:n,value:t})})(t)},onMessage:{addListener:e=>{r.push(e)}},onDisconnect:{addListener:e=>{i.push(e)}},disconnect:()=>{o(),s(n)}};return t[n]={message:e=>{r&&r.forEach((t=>t(e)))},disconnect:()=>{i.length&&i.forEach((e=>e())),o()}},a},s=t=>{e.send({response_id:t,disconnect:!0})} +;return e.onMessage.addListener((e=>{let s;if(e.connect){if(!e.destination||!e.response_id)throw"invalid message";n&&n(e.destination,r(e.response_id))}else{if(!e.response_id)throw"invalid message";if(!(s=t[e.response_id]))return void console.warn("ports: unknown id",e.response_id,e);if(e.disconnect)s.disconnect();else{const t=e.value;t&&s.message(t)}}})),{connect:function(t){const n=Math.random().toString(36).slice(2);return((t,n)=>{e.send({response_id:n,connect:!0,destination:t})})(t,n),r(n)}, +onConnect:{addListener:e=>{n=e}}}})(va),ba=async e=>{if(!D.supported)throw new Error("Offscreen documents not supported");const t=D;await ma.acquire();try{if(1==++ga){try{const n=await ft.getContexts({contextTypes:["OFFSCREEN_DOCUMENT"]});n&&n.length||await t.createDocument(e)}catch(e){console.warn("Failed to create offscreen document -> assume getContexts is not supported and we were restarted")}await new Promise(((e,t)=>{ht.sendMessage({target:"offscreen",method:"offscreen",request:{ +action:"config",version:ht.manifest.version,config:wn.snapshot}},(()=>{ft.lastError?t(ft.lastError):e()}))}))}}finally{ma.release()}const n=async e=>{await F(e||15e3),await ma.acquire();try{0==--ga&&await t.closeDocument()}finally{ma.release()}};return{send:e=>new Promise(((t,n)=>{ht.sendMessage({target:"offscreen",method:"offscreen",request:e},(e=>{ft.lastError?n(ft.lastError):e?e.error?n(new Error(e.error)):t(e.result):n(new Error("no response"))}))})),sendBinary:async e=>{ +if(!Se)throw new Error("Offscreen documents not supported");const t=ht.getURL("offscreen.html"),n=(await Se.matchAll({includeUncontrolled:!0})).find((e=>e.url===t));if(!n)throw new Error("No running offscreen document found");const r=new MessageChannel;n.postMessage(e,[r.port2]);const s=await new Promise((e=>r.port1.onmessage=e));if(!s||!s.data)throw new Error("Offscreen document sent no response");return s.data.result},connect:(e,t)=>{const r=wa.connect(e) +;return r.onDisconnect.addListener((()=>{n(t)})),r},release:n}},_a=e=>(delete e.firstPartyDomain,e),ya=async(e,t)=>{const{sender_domain:n,cookie_store_id:r,cookie_partition:s,anonymous:i,cookie:o}=t,a=[];if(!i){const t={url:e};n&&(t.firstPartyDomain=null),void 0!==r&&(t.storeId=r);let i=await ka.getAll(t);a.push(...i),void 0!==s&&(t.partitionKey=s,i=await ka.getAll(t),a.push(...i))}return a.map((e=>{ +const t=e.name.replace(/[^\x21\x23-\x27\x2A-\x2B\x2D-\x2E\x30-\x39\x41-\x5A\x5E-\x7A\x7C\x7E]/g,ee);let n=!1,r=e.value;return r.startsWith('"')&&r.endsWith('"')&&(r=r.slice(1,-1),n=!0),r=r.replace(/[^\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]/g,ee),t+"="+(n?'"'+r+'"':r)})).concat(o?[o]:[]).join("; ")},ka={getAll:e=>{const t=y();return Ct.getAll(_a(e),(e=>t.resolve(e))),t.promise()},remove:e=>{const t=y();try{Ct.remove(_a(e),(e=>{if(e)t.resolve();else{const e=ft.lastError +;t.reject(e?e.message:"unknown error")}}))}catch(e){t.reject(e?e.message:"unknown error")}return t.promise()},set:e=>{const t=y();try{Ct.set(_a(e),(e=>{if(e)t.resolve(e);else{const e=ft.lastError;t.reject(e?e.message:"unknown error")}}))}catch(e){t.reject(e?e.message:"unknown error")}return t.promise()},get fpi(){}},Ra=ka,xa={DEFAULT:"default",OFF:"off",NATIVE:"native",CHROME:"chrome",NOT_ENABLED:"not_enabled",NOT_WHITELISTED:"not_whitelisted",NOT_PERMITTED:"not_permitted", +NOT_SUPPORTED:"not_supported",NOT_SUCCEEDED:"not_succeeded"},Ea=new Ve;let Sa,Ca=xa.OFF,Ma=[],Ia=!1;const Ua={},Ga={},Za=Ns("downloads"),Ta=new rt(1),Ba=(V({threads:3}),V({threads:6})),Oa=async()=>{if(!Et.supported)return!1;const e=await qi(Yi.permDownloads,Qr.getMessage("Browser_API_Downloads"),Qr.getMessage("Click_here_to_allow_TM_to_start_downloads"),(e=>v.log("downs: permission to use downloads ->",e)));return Sa=e,e},ja=()=>ba({justification:"download a blob",reasons:[to.BLOBS] +}),Da=async e=>new h((t=>{Et.supported?Et.search({id:e},(n=>{const r=n&&n[0];r?t(r):(v.warn("downs: unable to query download ID",e),t(void 0))})):t(void 0)})),Fa=(e,t)=>{Et.supported&&Et.cancel(e,(()=>{Da(e).then((e=>{e&&Pa(e)})),t&&t()}))},La=(e,t)=>{const n=y();if(!Et.supported)return n.reject("not supported"),Ea.emit("error",{id:t.download_id,error:"not_supported"}),n.promise();let r;Na();let{name:s,url:i,method:o,saveAs:a,data:c,headers:l,conflictAction:u,cookieStoreId:d,anonymous:A}=e +;const{download_id:p}=t;u&&!{uniquify:!0,prompt:!0,overwrite:!0}[u]&&(u="uniquify"),r={filename:s,url:i,method:o,saveAs:a,...u?{conflictAction:u}:{},...void 0!==c?{body:c}:{}},l&&(Array.isArray(l)?v.warn("downs: invalid type of headers property",l):r.headers=Object.entries(l).map((([e,t])=>({name:e,value:t}))));const h=Ga[p],f=Ga[p]={...h,type:"chrome",download_id:p,url:i,name:s};if(Et.download(r,((e,t)=>{if(void 0===e)return n.reject(t),void Ea.emit("error",{id:p,error:t||"unknown"}) +;f.browser_download_id=e;const r=Ua[p]={deferred:n};!0===f.cancel?Fa(e):(r.cancel=t=>Fa(e,t),r.interval=re((async()=>{const t=await Da(e);t&&Pa(t)}),1e3))})),ft.lastError){const e=ft.lastError.message;n.reject(e),Ea.emit("error",{id:p,error:e})}return n.promise()},Pa=async e=>{const{item:t,key:n}=(e=>{let t,n;return Object.keys(Ga).every((r=>{const s=Ga[r];return!s||s.browser_download_id!=e||(n=r,t=s,!1)})),{item:t,key:n}})(e.id);if(t&&n){ +const{name:r,url:s,download_id:i}=t,{interval:o,deferred:a}=Ua[i]||{},c=()=>{o&&Y(o),delete Ga[n],delete Ua[n],a&&a.resolve()},{id:l,error:u,totalBytes:d,bytesReceived:A,state:p,endTime:h,estimatedEndTime:f}=e;if(u||"interrupted"==p)v.warn(`downs: download of ${r} (${s}) failed`,u),Ea.emit("error",{id:i,error:xa.NOT_SUCCEEDED,details:u}),c();else{const e=h||"complete"==p;let n=!1;if((void 0!==d&&t.total!==d||void 0!==A&&t.loaded!==A)&&(t.total=null!=d?d:t.total,t.loaded=null!=A?A:t.loaded,n=!0), +e&&(c(),-1===t.total||-1===t.loaded)){const e=await Da(l);e&&void 0!==e.totalBytes&&void 0!==e.bytesReceived&&(t.total=e.totalBytes,t.loaded=e.bytesReceived,n=!0)}if(n&&Ea.emit("progress",{id:i,info:{loaded:Math.max(t.loaded,0),total:t.total,estimatedEndTime:h||f}}),e){v.log(`downs: download of ${r} (${s}) finished`);const{total:e,loaded:n}=t;Ea.emit("load",{id:i,info:{total:e,loaded:n,mode:"browser"}})}}}},Na=()=>{if(Sa&&!Ia&&Et.supported){const e=["state","totalBytes","fileSize"] +;Et.onChanged.addDynamicListener((t=>{let n=!1;const r={id:t.id};for(const s of e){const e=t[s],i=e&&"string"!=typeof e&&"current"in e?e.current:void 0;i&&(r[s]=i,n=!0)}n&&Pa(r)})),Ia=!0}},Va=e=>{Ca=e,Ca==xa.CHROME&&Oa()},za=e=>{Ma=De(e)},qa=e=>{for(const t of Ma)if(t&&t.length)try{let n;if("/"===t[0]){let e=t.replace(/^\//g,"").replace(/\/$/g,"");"$"!==e[e.length-1]&&(v.log(`downs: patching $ into ${e}`),e+="$"),n=new RegExp(e,"i")}else if("."===t[0]){const e=[Ue(t),"$"].join("") +;n=new RegExp(e,"i")}else v.warn(`downs: invalid file extension: "${t}" starts neither with "." nor with "/"`);if(n&&-1!==e.search(n))return v.log(`downs: ${t} matched @${e}`),!0}catch(e){v.warn(`downs: can't process ${t}`,e)}return!1},Ha={init:()=>{const e=()=>{Va(wn.values.downloads_mode),za(wn.values.downloads_extension_whitelist)};e(),wn.addChangeListener(["downloads_extension_whitelist","downloads_mode"],e),Ta.acquire().then((async()=>{ +for(const{key:e,value:t}of await Za.list())"chrome"==t.type&&(Ga[e]=t,Ua[e]={cancel:t=>Fa(e,t),interval:re((async()=>{const t=await Da(e);t&&Pa(t)}),1e3)})})).always((()=>Ta.release()))},start:(e,t)=>{const n=t||{},r=Pe();let s,{from:{tfd:i,url:o},mode:a,...c}=e,{name:l}=c;if(v.log("downs: start",e),!n.internal){if(Ca==xa.OFF)return v.warn("downs: feature is not enabled"),F(1).then((()=>Ea.emit("error",{id:r,error:xa.NOT_ENABLED}))),r +;if(l&&!qa(l))return v.warn("downs:",`"${l}" is not whitelisted`),F(1).then((()=>Ea.emit("error",{id:r,error:xa.NOT_WHITELISTED}))),r;if(!Et.supported&&Ca==xa.CHROME)return v.warn("downs: this download mode is not supported"),F(1).then((()=>Ea.emit("error",{id:r,error:xa.NOT_SUPPORTED}))),r}const u=()=>{const e=Ga[r];if(e&&e.cancel)return Ea.emit("error",{id:r,error:"aborted"}),y.Breach("aborted")},d=l;let A;d&&(l=Le(d,!0),d!=l&&v.warn(`downs: changed file name from ${d} to ${l} for safety`)) +;const p=void 0!==a?"browser"===a:void 0;let h="native";const f=Ga[r]={type:"unknown",download_id:r,url:o,name:d,loaded:-1,total:-1};return(async()=>{if(i){if(s=Us.fromTransferableData(i),!s)return v.warn("downs: invalid transferable"),Ea.emit("error",{id:r,error:xa.NOT_SUPPORTED}),y.Breach("not_supported");if(o=s.tryObjectUrl||s.tryDataUri||o,o||(o=await s.toObjectUrl()),!o)return v.warn("downs: can't get URL from transferable"),Ea.emit("error",{id:r,error:xa.NOT_SUPPORTED}), +y.Breach("not_supported");f.url=o}})().then((()=>Ta.acquire())).then((()=>Za.set(r,f).always((()=>Ta.release())))).then((()=>{if(Et.supported&&(void 0===p||p)&&(n.internal||Ca==xa.CHROME||Ca==xa.DEFAULT))return Oa().then((e=>A=e)).then(u);A=!1})).then((()=>{if(p&&!A)return h="browser",Ea.emit("error",{id:r,error:xa.NOT_SUPPORTED}),y.Breach("not_supported");if(s&&s.tryBlob)return{blob:s.tryBlob};if(o){const e=zn(o);if(e&&"data:"==e.protocol)return{blob:et(o)} +;if(!A||!n.internal&&Ca==xa.DEFAULT)return((e,t)=>{const{internal:n,download_id:r}=t;return Ba.add((()=>y((async({resolve:t,reject:s})=>{const{anonymous:i}=e,o=()=>{s(),Ea.emit("error",{id:r,error:"aborted"})},a=Ga[r];if(a&&a.cancel)o();else{const c={...a,type:"xhr",name:e.name,url:e.url,download_id:r},l=n=>{if(4!=n.readyState||200!=n.status&&0!=n.status||n.error){const e=n.error||n.statusText||"xhr_failed";s(e),Ea.emit("error",{id:r,error:e})}else{let i +;const o=go(n.responseHeaders),a=o["content-type"];if(!e.name){const e=o["content-disposition"];if(e){const t=e.match(/filename="(.+)"/);if(t){let e=t[1];try{e=$(e)}catch(e){v.warn("downs:",e)}const n=Le(e,!0);if(n){if(!qa(n)){const e=`"${n}" is not whitelisted`;return v.warn("downs:",e),s(e),void Ea.emit("error",{id:r,error:xa.NOT_WHITELISTED})}i=n}}}}const l=new Blob([n.response],{type:e.overrideMimeType||a||"binary/octet-stream"});-1!==c.total&&-1!==c.loaded||(c.total=c.loaded=l.size, +Ea.emit("progress",{id:r,info:{loaded:c.loaded,total:c.total}})),t({name:i,blob:l})}},u=e.cookieStoreId;if(!i){let t;const n=await ya(e.url,{sender_domain:t,cookie_store_id:u});n&&(e.headers=e.headers||{},e.headers.cookie=n)}e.responseType="blob",e.method=e.method||"GET";const d=(n?Uo.internal:Uo.external)(e,{onload:l,onerror:e=>{s(),Ea.emit("error",{id:r,error:e.error||"failed",details:e.statusText})},onabort:o,ontimeout:()=>{s(),Ea.emit("error",{id:r,error:"timeout"})},onprogress:e=>{ +e.lengthComputable&&(c.total=e.total,c.loaded=e.loaded,Ea.emit("progress",{id:r,info:{loaded:e.loaded,total:e.total}}))}});Ga[r]=c,Ua[r]={cancel:d?d.abort:()=>{}}}})).promise()))})({url:o,...c},{internal:n.internal,download_id:r})}})).then((e=>{const{name:t,blob:i}=e||{};if(i&&A){let e;return h="browser",y.Pledge().then((()=>s&&s.tryObjectUrl?s.tryObjectUrl:ja().then((async t=>{const n=await t.sendBinary({action:"objectURL",blob:i});return n.error||!n.url?(Ea.emit("error",{id:r, +error:n.error||"unknown error"}),t.release(),y.Breach()):(e=async()=>{await t.send({action:"objectURL",url:o}),t.release()},n.url)})))).then((n=>{const{conflictAction:s,saveAs:i}=c;return La({url:n,conflictAction:s,saveAs:i,name:t||l},{download_id:r}).always((()=>{e&&e()}))}))}return i?no(i,ba).then((e=>ja().then((async n=>{try{const s=await n.send({action:"download",id:r,details:{name:t||l||"File.download",tfd:await e.toTransferableData()}});s.error?Ea.emit("error",{id:r,error:s.error +}):(f.total=f.loaded=i.size,Ea.emit("load",{id:r,info:{loaded:f.loaded,total:f.total,mode:s.mode}}))}finally{n.release(),se((()=>{e.dispose()}),1e3)}})))):o&&A?(h="browser",La({url:o,...c,name:t||l},{download_id:r})):void(o&&!n.internal&&Ca==xa.CHROME?(v.warn("downs: download permission is missing"),Ea.emit("error",{id:r,error:xa.NOT_PERMITTED})):(v.warn("downs: download failed"),Ea.emit("error",{id:r,error:"failed"})))})).always((()=>{Ta.acquire().then((()=>(delete Ga[r],delete Ua[r], +Za.delete(r)))).always((()=>{Ta.release(),Ea.emit("done",{id:r,info:{loaded:f.loaded,total:f.total,mode:h}})}))})),r},cancel:e=>{const t=Ga[e],n=Ua[e];return!!t&&(n&&n.cancel?n.cancel():t.cancel=!0,!0)},set_mode:Va,set_whitelist:za,is_whitelisted:qa,remove_permission:()=>Yi.remove(Yi.permDownloads),staticVars:xa},Qa=Ha,Wa={run:(e,t)=>{let n=1;const r=()=>{0==--n&&(t&&t(),C.runtime.reload?C.runtime.reload():location.reload())};if("config"==e){const e=nn.listValues();for(const t of e){ +if(-1!=t.indexOf(I.PREFIX.SCRIPT)||-1!=t.indexOf(I.PREFIX.COND)||-1!=t.indexOf(I.PREFIX.STORE)||-1!=t.indexOf(I.PREFIX.META))return;n++,nn.deleteValue(t).always(r)}}else"factory"==e&&(n++,Qa.remove_permission().done(r),n++,nn.factoryReset().always(r),n++,(async()=>{const e=new Lt(`${on}.`);await e.clear()})().always(r));r()},reset:e=>{Wa.run(void 0,e)},factoryReset:e=>{Wa.run("factory",e)}},Xa=Wa,Ya=["md5","sha256","sha1","sha384","sha512"],Ja=(()=>{const e=e=>{const t=[],n=new DataView(e) +;for(let e=0;e{try{return e(Je(Xe(t)))}catch(e){return null}},n={md5:(e,t)=>y.Pledge($e(e,t)),sha256:(e,t)=>y.Pledge(Do(e,t))},r={};["SHA-1","SHA-384","SHA-512"].forEach((t=>{const n=t.toLowerCase().replace("-","");r[n]=()=>{const n=(n,r)=>{const s=y();return K.subtle.digest(t,Je(n,{encoding:r})).then((t=>{s.resolve(e(t))}),(()=>{s.reject()})),s.promise()};try{ +return n("").then((e=>e&&e.substr(0,4).toLowerCase().match(/[0-9a-f]{4,4}/)?n:y.Breach()))}catch(e){return y.Breach()}}}));const s=e=>Object.keys(n).includes(e),i=e=>(...t)=>{if(!1!==o){const n=y();return o.push((()=>n.consume(e(...t)))),n.promise()}return e(...t)};let o=[];const a={init:()=>(v.get()>=60&&Object.keys(n).forEach((e=>v.log("sri:",e,"is supported"))),y.sidebyside(Object.keys(r).map((e=>r[e]().done((t=>{v.log("sri:",e,"is supported"),n[e]=t})).fail((()=>{ +v.log("sri:",e,"is unsupported")}))))).always((()=>{if(!1===o)return;const e=o;o=!1,e.forEach((e=>e()))}))),isSupported:i((e=>y.Pledge(s(e)))),getHash:i(((e,n)=>{const r=y(),i="string"==typeof e?zn(e):e;if(i&&i.hash){let e;const o=i.hash.replace(/^#/,"").split(/,|;/g);for(let n=0;nt&&e&&s(e.type)?n[e.type](t,r).then((t=>t===e.value?y.Pledge(!0):y.Breach({type:e.type,value:t}))):y.Breach()))};return a})(),Ka=Ja;let $a;const ec=()=>{if(!$a)throw new Error("Offscreen document not available");return $a({justification:"XML parsing",reasons:[to.DOM_PARSER]})},tc=async e=>{{const t=await ec();try{return await t.send({action:"xmlToWebdavResults",doc:e})}finally{t.release()}} +},nc=async e=>{{const t=await ec();try{return await t.send({action:"xmlToCursor",doc:e})}finally{t.release()}}};let rc;const sc=V({threads:1}),ic=(e,t)=>{const n=(e?e.split("/"):[]).concat(t?[t]:[]).join("/");return n?("/"==n.substr(0,1)?"":"/")+n:""};let oc=()=>({get:()=>y.Breach(),set:()=>y.Breach(),delete:()=>y.Breach(),clear:()=>y.Breach()});const ac=e=>{const t=(e.match(/[\dA-F]{2}/gi)||[]).map((e=>parseInt(e,16)));return new Uint8Array(t).buffer},cc=e=>{const t={type:e,request:e=>{ +const t=()=>{const t=y(),n=e=>{v.log("rest service: request failed",e),t.reject(e)},r=Object.assign({},e),s="headers"===r.responseType;return s&&delete r.responseType,vo(r,{onload:e=>{if([200,201,204,207].includes(e.status)){let n;n=s?go(e.responseHeaders):e.response,t.resolve({result:n})}else n(e)},onerror:n,ontimeout:()=>n("timed out"),onprogress:e=>t.notify(e),onuploadprogress:e=>t.notify(e)},{internal:!0}),t.promise()};return e.no_queue?t():sc.add(t)},error:t=>{const n=t;let r +;if(void 0!==n.status){r=n.status.toString();try{r=r+" | "+n.responseText}catch(e){}}else r=t;Ur(e,"error","request: "+r)},wait:e=>(...t)=>e(...t).then((e=>e),(e=>(e=>y.Breach(e?e.responseText||e.statusText:void 0))(e))),changes:(()=>{let e;return{listen:()=>(e||(e=y(),t.watch&&t.watch.start()),e.promise()),notify:t=>{e.notify(t)},stop:()=>(t.watch&&t.watch.stop(),y.Pledge())}})()};return t},lc=e=>{const t=Object.assign({},e),n=t.type;if(void 0===n)throw new Error("Internal error");let r,s,i=[] +;const o=e=>{const t={client_id:u.config.client_id,redirect_uri:u.config.redirect_uri,state:s,scope:u.config.scope,refresh_token:e};return u.config.redirect_uri+"?"+Xn(t)},a=e=>{let t,n;if(e&&0===e.indexOf(u.config.redirect_uri)&&(n=zn(e))&&("string"!=typeof(r=n)&&(r=r.search?r.search.substring(1):r.hash?r.hash.substring(1):""),t=r.split("&").reduce(((e,t)=>{const n=t.split("=");return e[$(n[0])]=$(n[1]),e}),{}))&&(t.access_token||t.error)&&t.state===s)return{uid:t.uid, +access_token:t.access_token,refresh_token:t.refresh_token,error:t.error};var r};let c;const l={};Object.defineProperty(l,"credentials",{get:()=>(c||(c=oc(e.type)),c),enumerable:!1});const u=Object.assign(l,e,{...t,config:{...t.config,auth_prefix:"Bearer"},request:e=>y((async({resolve:t,reject:n})=>{if(!e.no_auth){const t=(await u.credentials.get()).access_token;if(!t)return void n("Authentication failed");e.headers=e.headers||{},e.headers.Authorization=u.config.auth_prefix+" "+t}t() +})).promise().then((()=>t.request(e))),oauth:(()=>{const e={run:()=>{if(r)return r;let e=y();const t=r=e.promise();s="!!"+n+"-"+Pe();const{redirect_uri:i,refresh_supported:c}=u.config,l=void 0,d=async(t,n)=>{const r=e;e=void 0,await u.credentials.set(n),null==r||r.resolve(),t&&t.close()},A=e=>y((({resolve:t})=>{vo({url:e,responseType:"json"},{ondone:e=>t(e)},{internal:!0})})).promise();return u.credentials.get().then((async e=>{const t=e.refresh_token;if(c&&t){let e,r=1e3,s=4 +;const i=[200,400,401,403,404,405,406,408,412],a=o(t);for(;!e;)e=await A(a),e&&i.includes(e.status)||!(--s>=0)||(await F(r),r=Math.min(3*r,36e5),e=void 0);if(200==e.status){const t=e.response;if(t){if(!t.error&&t.access_token){const{access_token:e,refresh_token:n,basic_auth:r,uid:s}=t;return void d(null,{access_token:e,refresh_token:n,basic_auth:r,uid:s})}Ur(n,"error","auth refresh token use: "+(t.error||"!access_token"))} +}else Ur(n,"error",`auth refresh token use failed with status ${e.status}`)}})).then((()=>{if(!e)return;if(!c)return y.Pledge();const t=y(),r=rc({url:o(),filter:l});return r.promise.progress((t=>{let s;e&&(s=a(t.url))&&(s.error||!s.access_token?(Ur(n,"error","auth refresh: "+(s.error||"!access_token")),u.config.refresh_supported=!1):d(r,s))})).always(t.resolve),t.promise()})).then((()=>{if(!e)return;const t=y(),r=rc({url:u.config.request_uri+"?"+Xn({response_type:u.config.response_type, +client_id:u.config.client_id,redirect_uri:u.config.redirect_uri,state:s,scope:u.config.scope}),filter:l});return r.promise.progress((t=>{let s;e&&(s=a(t.url))&&(s.error||!s.access_token?Ur(n,"error","auth: "+(s.error||"!access_token")):d(r,s))})).always(t.resolve),t.promise()})).done((()=>{r=void 0,e&&e.reject("auth_failed")})),t},revoke:()=>u.credentials.get().then((e=>{const r=e.access_token;return r?(s=s||"!!"+n+"-"+Pe(),t.request({method:"GET",retry_auth:!1,url:`${dc}/revoke?`+Xn({token:r, +state:s})}).then((()=>u.oauth.reset()),(()=>u.oauth.reset()))):y.Breach()})),reset:()=>u.credentials.clear()};return e})(),wait:e=>t.wait(((...t)=>u.credentials.get().then((n=>{if(n.access_token)return e(...t);{const n=y();return i.push((()=>n.consume(e(...t)))),u.oauth.run().done((()=>{i.forEach((e=>e())),i=[]})).fail((e=>{n.reject(e)})),n.promise()}}))))});return u},uc=e=>{let t,n,r,s;const i=y();let o,a,c,l,u,d=null,A=null +;const p=Object.assign({},e),h=e=>p.wait(((...t)=>g.init().then((()=>e(...t))))),f=(e,t)=>{const n=t||{};n.set_current_list&&(o={});const r=g.request({method:"PROPFIND",url:e,headers:{"Content-Type":"text/xml; charset=UTF-8",Depth:void 0!==n.depth?n.depth:1}}).then((async e=>{const t=e.result;if(null==t)return;const r=await tc(t);if(void 0===r)return;const s=m(r);if(n.set_current_list){const e=await nc(t);e&&(a=e),s.forEach((e=>{o[e.id]=e}))}return s +})).then((e=>void 0===e?y.Breach("not found"):e));return r},m=e=>e.map((e=>{const{id:s,...i}=e,o=s.replace(new RegExp("^("+[Ie(n+t)+"/?",Ie(r+t)+"/?"].join("|")+")"),"");let a;try{a=$(o)}catch(e){a=s}return{id:o,...i,name:a}})),g=Object.assign(e,{...e,config:{...e.config,watch_interval:36e5,root:void 0,path:void 0},request:e=>(e.fetch=!0,e.anonymous=!0,p.request(e).then((e=>e),(t=>{const n=(null==t?void 0:t.status)||-1;return!t||[429,500].includes(n)?(e.backoff=2*(e.backoff||1e3), +F(e.backoff).then((()=>g.request(e)))):404==n?y.Pledge(t):(g.error(t),y.Breach(t))}))),init:()=>{if(s)return s;t=ic(g.config.root,g.config.path),n=g.config.url||"","/"==n.slice(-1)&&(n=n.slice(0,-1));const e=zn(n);if(!e)return y.Breach("invalid url");r=e.pathname,"/"==r.slice(-1)&&(r=r.slice(0,-1));const o=y(),a=s=o.promise();return g.request({method:"OPTIONS",url:`${n}/`,responseType:"headers"}).done((e=>{const t=e.result;let n +;t&&(n=t["access-control-allow-methods"])&&n.includes("EDITOR")&&(u=!0)})).always((()=>{f(`${n}${t}/`,{depth:0}).done((()=>{o.resolve(),i.resolve()})).fail((()=>{const e=[];y.onebyone(t.split("/").filter((e=>e)).map((t=>{e.push(t);const r=e.join("/");return()=>g.request({method:"MKCOL",url:`${n}/${r}/`,headers:{"Content-Type":"text/xml; charset=UTF-8"}}).then((e=>e),(e=>{if(405==((null==e?void 0:e.status)||-1))return y.Pledge(e)}))}))).done((()=>{o.resolve(),i.resolve()})).fail((()=>{s=void 0, +o.reject()}))}))})),a},list:h((e=>{const r=f(`${n}${t}/`,{set_current_list:!0}).then((t=>{const n={};return t.map((t=>{if(!e){if(n[t.id])return;n[t.id]=!0}return{name:t.name,id:t.id,size:t.size||0,etag:t.etag,modified:t.modifiedTime,precision:1e3,removed:t.removed}})).filter((e=>e))}));return r})),get:h((e=>{const r=e.id||e;return g.request({method:"GET",url:n+ic(t,r),headers:{"Content-Type":"text/xml; charset=UTF-8"},responseType:"arraybuffer"}).then((e=>{const t=e.result;return new Blob([t]) +}))})),put:h(((e,r,s)=>{const i=e.id||e;let o,a,c;const l={"Content-Type":"application/octet-stream"};let u=!1;return s&&s.lastModified&&(u=null===A,o=s.lastModified,c=new Date(s.lastModified).toISOString(),a=s.lastModified/1e3,(A||u)&&(l["X-OC-Mtime"]=a)),g.request({method:"PUT",url:n+ic(t,i),headers:l,data_type:"typified",data:{type:"raw",value:r},responseType:"headers"}).then((e=>{const r=e.result;if(r&&u){let e +;A=!("accepted"!=r["x-oc-mtime"]&&(!r.date||!(e=new Date(r.date).getTime())||e!=o&&e!=Math.floor(a)))}if(!A&&!d&&c){const e=()=>{v.warn("WebDAV: no way to set file modification date! This might cause redundant up and downloads."),d=!0};return g.request({method:"PROPPATCH",url:n+ic(t,i),headers:{"Content-Type":"text/xml; charset=UTF-8"}, +data:['','',"","",`${c}`,"","",""].join("")}).then((async t=>{const n=t.result;if(null===n)return;const r=await(async e=>{{const t=await ec();try{return await t.send({action:"xmlToResponseCodes",doc:e})}finally{t.release()}}})(n);r&&403===r[0]&&e()}),(()=>(e(),y.Pledge())))}}))})),delete:h((e=>{const r=e.id||e;return g.request({method:"DELETE", +url:n+ic(t,r),headers:{"Content-Type":"text/xml; charset=UTF-8"}})})),watch:{start:()=>{if(c)return;let e=100;const r=c=Pe();let s=null;const u=()=>{if(l=void 0,c)if(!1===s){const e=o;f(`${n}${t}/`,{set_current_list:!0}).then((()=>{e&&(Object.keys(e).forEach((t=>{const n=o[t],r=e[t];n?r.modifiedTime!=n.modifiedTime&&p.changes.notify({time:n.modifiedTime,name:n.name,id:n.id}):p.changes.notify({time:Date.now(),name:r.name,id:r.id,removed:!0})})),Object.keys(o).forEach((t=>{if(!e[t]){const e=o[t] +;p.changes.notify({time:e.modifiedTime,name:e.name,id:e.id})}})))})).fail((e=>{v.warn("WebDAV: file changes check failed",e)})).always((()=>{l=se(u,g.config.watch_interval)}))}else((e,t)=>{const n={"Content-Type":"text/xml; charset=UTF-8",Depth:1,Timeout:90};return t&&(n.Cursor=t),g.request({method:"SUBSCRIBE",url:e,headers:n,no_queue:!0}).then((async e=>{const t=e.result;if(null===t)return y.Pledge({changes:[],cursor:a});const n=await tc(t);return void 0!==n?{changes:m(n),cursor:await nc(t) +}:void 0})).then((e=>void 0===e?y.Breach():e))})(`${n}${t}/`,a).then((t=>{s=!0;const n=t.changes;a=t.cursor,e=100,n.forEach((e=>{p.changes.notify({time:e.modifiedTime,name:e.name,id:e.id,removed:e.removed})}))}),(()=>{if(null!==s)return e*=2,F(e);s=!1})).always(u)},d=()=>!c||c!==r;i.promise().then((()=>{d()||h((()=>d()?y.Breach():(u(),y.Pledge())))()}))},stop:()=>{c=void 0,l&&(J(l),l=void 0)}},getRemoteUrl:e=>{if(u)return n+ic(t,e)+"?method=editor#bypass=true"},getRemoteDomains:()=>{var e +;return[((null===(e=zn(n))||void 0===e?void 0:e.origin)||"").replace(/^.*:\/\//,"")]}});return g},dc="https://accounts.tampermonkey.net/e/oauth2/v1",Ac={drive:()=>{let e;xe&&(e=parseInt(xe.getItem("gdrive_poll_interval")||""))||(e=18e5);const t=lc(cc("drive")),n=Object.assign({},t),r="appDataFolder";let s,i;const o=Object.assign(t,{...t,config:{...t.config,redirect_uri:`${dc}/auth`,refresh_supported:!0,request_uri:"https://accounts.google.com/o/oauth2/v2/auth", +client_id:"408438522028-3cgn3t3jas3fak7isbnfod1q4h15g2fv.apps.googleusercontent.com",scope:"https://www.googleapis.com/auth/drive.appdata",response_type:"token",watch_interval:e},request:e=>n.request(e).then((e=>e),(t=>{const n=(null==t?void 0:t.status)||-1;return!t||[403,429,500].includes(n)?(e.backoff=2*(e.backoff||1e3),F(e.backoff).then((()=>o.request(e)))):[400,401].includes(n)?(v.warn("Google Drive: authentication error",t),o.credentials.delete("access_token").then((()=>{ +if(!e.retry_auth)return e.retry_auth=!0,o.oauth.run().fail((e=>o.error(e))).then((()=>o.request(e)))}))):404==n?y.Pledge(t):(o.error(t),y.Breach(t))})),list:n.wait((e=>{let t=[];const n=y(),s=e=>"https://www.googleapis.com/drive/v3/files?"+Xn({spaces:r,pageToken:e,orderBy:"modifiedTime desc",fields:"nextPageToken, files(id, size, name, modifiedTime, md5Checksum)",pageSize:500}),i=e=>{o.request({method:"GET",url:e,headers:{"Content-Type":"application/json"}}).then((e=>{ +const r=e.result,o=r?JSON.parse(r):{files:[]};if(t=t.concat(o.files),o.nextPageToken)return i(s(o.nextPageToken));n.resolve(t)}))};return i(s()),n.promise().then((t=>{const n={};return t.map((t=>{if(!e){if(n[t.name])return;n[t.name]=!0}return{name:t.name,size:t.size||0,id:t.id,md5:t.md5Checksum,modified:new Date(t.modifiedTime).getTime()}})).filter((e=>e))}))})),get:n.wait((e=>{const t=e.id||e;return o.request({method:"GET",url:"https://www.googleapis.com/drive/v3/files/"+t+"?"+Xn({spaces:r, +alt:"media"}),responseType:"arraybuffer"}).then((e=>{const t=e.result;return new Blob([t])}))})),put:n.wait(((e,t,n)=>{const s=e,i=s.name||e,a=s.id,c=Pe();return y.Pledge().then((()=>{if(t)return nt(t)})).then((e=>{const t=n&&n.lastModified?new Date(n.lastModified).toISOString():void 0,s=[];return s.push("--"+c),s.push("Content-Type: application/json"),s.push(""),s.push(JSON.stringify({name:i,parents:a?void 0:[r],modifiedTime:t})),s.push("--"+c), +e&&(s.push("Content-Type: application/octet-stream"),s.push("Content-Transfer-Encoding: base64"),s.push(""),s.push(We(e)),s.push("--"+c+"--")),s.push(""),o.request({method:a||!e?"PATCH":"POST",url:"https://www.googleapis.com/"+(e?"upload/":"")+"drive/v3/files"+(a?"/"+a:"")+"?"+Xn({uploadType:"multipart"}),headers:{"Content-Type":"multipart/related; boundary="+c},data:s.join("\r\n")})}))})),delete:n.wait((e=>{const t=e.id||e;return o.request({method:"DELETE", +url:"https://www.googleapis.com/drive/v3/files/"+t+"?"+Xn({spaces:r}),headers:{"Content-Type":"application/json"}})})),revoke:()=>o.oauth.revoke(),compare:(e,t)=>{const n=y();let r;return(r=e.md5)&&r==$e(t,"utf-8")?n.resolve(!0):n.resolve(!1),n.promise()},watch:{start:()=>{if(s)return;let e;s=!0;const t=()=>{i=null,s&&o.request({method:"GET",url:"https://www.googleapis.com/drive/v3/changes/?"+Xn({pageToken:e,spaces:r,pageSize:1e3,includeRemoved:!0}),headers:{"Content-Type":"application/json"} +}).then((t=>{const n=t.result;if(!s)return y.Breach();const r=n?JSON.parse(n):{};if(!(e=r.newStartPageToken))return v.warn("Google Drive: watch token error",n),o.watch.stop();r.nextPageToken&&v.warn("Google Drive: too much changes",n),(r.changes||[]).forEach((e=>{let t;const n=e.file;"file"===e.type&&n&&(t=Date.parse(e.time),isNaN(t)&&(t=Date.now()),o.changes.notify({id:n.id,time:t,name:n.name,removed:e.removed}))}))})).fail((e=>{v.warn("Google Drive: file changes check failed",e) +})).always((()=>{i=se(t,o.config.watch_interval)}))};n.wait((()=>s?o.request({method:"GET",url:"https://www.googleapis.com/drive/v3/changes/startPageToken",headers:{"Content-Type":"application/json"}}).then((n=>{const r=n.result,s=r?JSON.parse(r):{};if(!(e=s.startPageToken))return v.warn("Google Drive: watch token error",r),o.watch.stop();t()})):y.Breach()))()},stop:()=>{s=!1,i&&(J(i),i=null)}},getRemoteUrl:void 0});return o},dropbox:e=>{const t=e.path||"";let n +;xe&&(n=parseInt(xe.getItem("dropbox_poll_interval")||""))||(n=18e5);const r=lc(cc("dropbox")),s=Object.assign({},r);let i,o,a,c,l=!0;const u=e=>{let n=[];const r=y(),s=e=>{d.request({method:"POST",url:"https://api.dropboxapi.com/2/files/list_folder"+(e?"/continue":""),headers:{"Content-Type":"application/json"},data:{path:e?void 0:ic(t),cursor:e}}).then((e=>{const t=e.result,i=t?JSON.parse(t):{entries:[]};if(n=n.concat(i.entries),i.has_more&&i.cursor)return s(i.cursor);r.resolve({list:n, +cursor:i.cursor})})).fail(r.reject)};return l?(l=!1,d.put(".version",new Blob([pc])).then((()=>{s(e)})).fail(r.reject)):s(e),r.promise()},d=Object.assign(r,{...r,config:{...r.config,redirect_uri:`${dc}/auth`,request_uri:"https://www.dropbox.com/oauth2/authorize",client_id:"gq3auc9yym0e21y",response_type:"token",watch_interval:n?Number(n):0},request:e=>s.request(e).then((e=>e),(t=>{const n=(null==t?void 0:t.status)||-1;return!t||[500,429].includes(n)?(e.backoff=2*(e.backoff||1e3), +F(e.backoff).then((()=>d.request(e)))):[401].includes(n)?(v.warn("Dropbox: authentication error",t),d.credentials.delete("access_token").then((()=>{if(!e.retry_auth)return e.retry_auth=!0,d.oauth.run().fail((e=>d.error(e))).then((()=>d.request(e)))}))):(d.error(t),y.Breach(t))})),list:s.wait((e=>u().then((t=>{const n={};return o=t.cursor,t.list.map((t=>{if(!e){if(n[t.name])return;n[t.name]=!0}return{name:t.name,size:t.size,dropbox_hash:t.content_hash, +modified:new Date(t.client_modified).getTime(),precision:1e3}})).filter((e=>e))})).always((()=>{i&&o&&(i(),i=null)})))),get:s.wait((e=>{const n=e.name||e;return d.request({method:"POST",url:"https://content.dropboxapi.com/2/files/download",headers:{"Dropbox-API-Arg":JSON.stringify({path:ic(t,n)})},responseType:"arraybuffer"}).then((e=>{const t=e.result;return new Blob([t])}))})),put:s.wait(((e,n,r)=>{ +const s=e.name||e,i=r&&r.lastModified?(new Date(r.lastModified).toISOString().match(/[^:]*:[^:]*:[^:.a-zA_Z]*/)||"")[0]+"Z":void 0;return d.request({method:"POST",url:"https://content.dropboxapi.com/2/files/upload",headers:{"Dropbox-API-Arg":JSON.stringify({path:ic(t,s),client_modified:i,mode:"overwrite"}),"Content-Type":"application/octet-stream"},data_type:"typified",data:{type:"raw",value:n}})})),delete:s.wait((e=>{const n=e.name||e;return d.request({method:"POST", +url:"https://api.dropboxapi.com/2/files/delete",headers:{"Content-Type":"application/json"},data:{path:ic(t,n)}})})),revoke:()=>d.credentials.get().then((e=>e.access_token?s.request({method:"POST",url:"https://api.dropboxapi.com/2/auth/token/revoke"}).always((()=>d.oauth.reset())):y.Breach())),compare:(e,t)=>{const n=y(),r=4194304,s=Je(t,{encoding:"utf-8"}),i=[],o=s.byteLength;let a=1;const c=async()=>{if(0==--a){let t=new ArrayBuffer(0);i.forEach((e=>{e&&(t=((e,t)=>{ +const n=new Uint8Array(e.byteLength+t.byteLength);return n.set(new Uint8Array(e),0),n.set(new Uint8Array(t),e.byteLength),n.buffer})(t,e))}));const r=await Ke(t),s=Do(r,"ASCII");n.resolve(s==e.dropbox_hash)}};for(let e=0,t=0;t{i.push(null),a++,Ke(s.slice(t,t+Math.min(r,o-t))).then((t=>{const n=Do(t,"ASCII");i[e]=ac(n),c()}),(()=>{v.warn("Dropbox: unable to calculate SHA-256 hashes"),n.reject()}))})(e);return c(),n.promise()},watch:{start:()=>{if(a)return;a=!0;let e=0 +;const t=()=>{if(c=null,e=0,a)return o?void d.request({method:"POST",url:"https://notify.dropboxapi.com/2/files/list_folder/longpoll",headers:{"Content-Type":"application/json"},no_auth:!0,no_queue:!0,data:{cursor:o,timeout:180}}).then((t=>{const n=t.result;if(!a)return y.Breach();const r=n?JSON.parse(n):{};return r.backoff&&(e=1e3*r.backoff),r.changes?F(6e4).then((()=>u(o))).then((e=>(o=e.cursor)?e.list:(v.warn("Dropbox: watch token error",n),d.watch.stop()))):null})).then((e=>{ +e&&e.forEach((e=>{let t;const n=e[".tag"];["file","deleted"].includes(n)&&(t=Date.parse(e.server_modified),d.changes.notify({id:e.id,time:t,name:e.name,removed:"deleted"==n}))}))})).fail((e=>{v.warn("Dropbox: file changes check failed",e)})).always((()=>{c=se(t,e+d.config.watch_interval)})):(v.warn("Dropbox: watch token error",o),d.watch.stop())};s.wait((()=>a?(o?t():i=t,y.Pledge()):y.Breach()))()},stop:()=>{a=!1,c&&(J(c),c=null)}},getRemoteDomains:()=>["dropbox.com","dropboxapi.com"], +getRemoteUrl:void 0});return d},onedrive:e=>{const t=e.path||"";let n,r;n=18e5;const s=lc(cc("onedrive")),i=Object.assign({},s);let o,a;const c=e=>{const n=y();let s=[];const i=o=>{l.request({method:"GET",url:o||"https://api.onedrive.com/v1.0/drive/special"+(t?"/approot:"+ic(t)+":/children":"/approot/children"),headers:{"Content-Type":"application/json"}}).then((t=>{const o=t.result,a=o?JSON.parse(o):{value:[]};if(s=s.concat(a.value.map((e=>{var t,n,r +;const s=(null===(t=null==e?void 0:e.fileSystemInfo)||void 0===t?void 0:t.lastModifiedDateTime)||0,i=(null===(r=null===(n=null==e?void 0:e.file)||void 0===n?void 0:n.hashes)||void 0===r?void 0:r.sha1Hash)||void 0;return{id:e.id,name:e.name,size:e.size,sha1:i,modified:new Date(s).getTime()}}))),a["@odata.nextLink"])return i(a["@odata.nextLink"]);e.set_current_list&&(r=s),n.resolve(s)})).fail((e=>n.reject(e)))};return i(),n.promise()},l=Object.assign(s,{...s,config:{...s.config, +redirect_uri:`${dc}/auth`,refresh_supported:!0,request_uri:"https://login.live.com/oauth20_authorize.srf",client_id:"000000004C1A3122",response_type:"token",scope:"onedrive.appfolder",watch_interval:18e5},request:e=>i.request(e).then((e=>e),(t=>{const n=(null==t?void 0:t.status)||-1;return!t||[429,500].includes(n)?(e.backoff=2*(e.backoff||1e3),F(e.backoff).then((()=>l.request(e)))):[401,403].includes(n)?(v.warn("OneDrive: authentication error",t),l.credentials.delete("access_token").then((()=>{ +if(!e.retry_auth)return e.retry_auth=!0,l.oauth.run().fail((e=>l.error(e))).then((()=>l.request(e)))}))):404==n?y.Pledge(t):(l.error(t),y.Breach(t))})),list:i.wait((()=>c({set_current_list:!0}))),get:i.wait((e=>{const n=e.name||e;return l.request({method:"GET",url:"https://api.onedrive.com/v1.0/drive/special/approot:"+ic(t,ee(n))+":/content",responseType:"arraybuffer"}).then((e=>{const t=e.result;return new Blob([t])}))})),put:i.wait(((e,n,r)=>{ +const s=e.name||e,i=ee(s.replace(/[#%<>:"|?*/\\]/g,"-"));return l.request({method:"PUT",url:"https://api.onedrive.com/v1.0/drive/special/approot:"+ic(t,i)+":/content",headers:{"Content-Type":"application/octet-stream"},data_type:"typified",data:{type:"raw",value:n}}).then((e=>{const t=r&&r.lastModified?new Date(r.lastModified).toISOString():void 0;if(!t)return e;const n=e.result,s=JSON.parse(n);return l.request({method:"PATCH",url:"https://api.onedrive.com/v1.0/drive/items/"+s.id,headers:{ +"Content-Type":"application/json"},data:JSON.stringify({fileSystemInfo:{lastModifiedDateTime:t}})})}))})),delete:i.wait((e=>{const n=e.name||e;return l.request({method:"DELETE",url:"https://api.onedrive.com/v1.0/drive/special/approot:"+ic(t,ee(n))})})),revoke:()=>l.oauth.revoke(),watch:{start:()=>{if(o)return;o=!0;const e=()=>{if(a=null,!o)return;const t=r;c({set_current_list:!0}).then((()=>{if(!t)return;const e={},n={};r.forEach((t=>{e[t.id]=t})),t.forEach((e=>{n[e.id]=e})), +Object.keys(n).forEach((t=>{const r=e[t],s=n[t];r?s.modified!=r.modified&&l.changes.notify({time:r.modified,name:r.name}):l.changes.notify({time:Date.now(),name:s.name,removed:!0})})),Object.keys(e).forEach((t=>{if(!n[t]){const n=e[t];l.changes.notify({time:n.modified,name:n.name})}}))})).fail((e=>{v.warn("OneDrive: file changes check failed",e)})).always((()=>{a=se(e,l.config.watch_interval)}))};i.wait((()=>o?(e(),y.Pledge()):y.Breach()))()},stop:()=>{o=!1,a&&(J(a),a=null)}}, +getRemoteDomains:()=>["onedrive.live.com"],getRemoteUrl:void 0});return l},yandex:()=>{let e;e=18e5;const t=lc(cc("yandex")),n=uc(t),r=Object.assign({},n);let s;const i=Object.assign(n,{...t,...n,config:{...n.config,root:"/Programs/Tampermonkey",url:"https://webdav.yandex.ru",redirect_uri:`${dc}/auth`,refresh_supported:!0,request_uri:"https://oauth.yandex.com/authorize",client_id:"a591fcd2ccd248f0baa84222898065f4",response_type:"token",auth_prefix:"OAuth",watch_interval:18e5},init:()=>{ +if(s)return s;const e=y();return s=e.promise(),i.request({method:"GET",url:"https://cloud-api.yandex.net/v1/disk/"}).done((e=>{const t=e.result,n=t?JSON.parse(t):{};n.total_space&&n.used_space&&(n.used_space+5e7>n.total_space?v.warn("Yandex: low disk space warning, only "+(n.total_space-n.used_space)+" bytes available"):v.log("Yandex: "+(n.total_space-n.used_space)+" bytes on disk available!"))})).always((()=>{e.consume(r.init())})),s},getRemoteDomains:()=>["disk.yandex.com"], +getRemoteUrl:void 0,list:e=>r.list(e).then((e=>e.map((e=>(e.md5=e.etag,e))))),request:e=>(()=>{const t=e.headers=e.headers||{};if(t["X-Requested-With"]="XMLHttpRequest","PUT"==e.method&&fo(e.data)&&"raw"==e.data.type&&e.data.value){const n=y();return nt(e.data.value).then((e=>{const n=e||"";t.Etag=$e(n),t.Sha256=Do(n,"ASCII")})).always(n.resolve),n.promise()}return y.Pledge()})().then((()=>r.request(e))).then((e=>e),(t=>{const n=(null==t?void 0:t.status)||-1 +;return[401].includes(n)?(v.warn("Yandex: authentication error",t),i.credentials.delete("access_token").then((()=>{if(!e.retry_auth)return e.retry_auth=!0,i.oauth.run().fail((e=>i.error(e))).then((()=>r.request(e)))}))):t})),compare:(e,t)=>{const n=y();let r;return(r=e.md5)&&r==$e(t,"utf-8")?n.resolve(!0):n.resolve(!1),n.promise()},revoke:()=>i.oauth.revoke()});return i},webdav:e=>{let t;t=18e5;const n=e.url;if(n){const t=n.toLowerCase() +;t.startsWith("webdav")?e.url=n.replace(/^webdav/i,"http"):t.startsWith("http")||(e.url=`http://${n}`)}const r=uc((e=>{const t=Object.assign({},e);if(void 0===t.type)throw new Error("Internal error");const n=Object.assign(e,{...t,config:{...t.config},credentials:{get:()=>y.Pledge({basic_auth:n.config.basic_auth}),set:()=>y.Breach(),delete:e=>y((({resolve:t,reject:r})=>{"basic_auth"===e?(delete n.config[e],t()):r()})).promise(),clear:()=>y.Breach()},request:e=>y((async({resolve:t,reject:r})=>{ +if(!e.no_auth){const t=(await n.credentials.get()).basic_auth;if(!t)return void r("Authentication failed");e.headers=e.headers||{},e.headers.Authorization="Basic "+t}t()})).promise().then((()=>t.request(e))).then((e=>e),(t=>{if(!e.no_auth){const e=(null==t?void 0:t.status)||-1;[401].includes(e)&&(v.warn("basic auth: authentication error",t),n.credentials.delete("basic_auth"))}return t})),wait:e=>t.wait(((...t)=>e(...t)))});return n})(cc("webdav")));return Object.assign(r,{...r,config:{ +...r.config,root:"Tampermonkey",watch_interval:18e5,...e}})}};let pc;const hc=Object.keys(Ac),fc=new Ve,mc={drive:"gd_config",dropbox:"db_config",onedrive:"od_config",yandex:"ya_config"},gc=()=>{const e=nn.getValue(I.STORAGE.UPDATE,{})||{};let{scripts:t,black:n}=e;return null==n&&(n=Object.assign({},{version:0,last:0})),null==t&&(t=0),{black:n,scripts:t}},vc=function(e){e&&nn.setValue(I.STORAGE.UPDATE,e)},wc=((e,t,n)=>{const r=new rt(1),s={},i={},o={},a={},c={} +;if(void 0===t)throw new Error("alarm: storage or setTimeout++ needs to be provided");const l=(e=>e&&"function"==typeof e.setTimeout)(t),u=l?t:void 0,d=l?void 0:t,A=n;let p=[];const f=async e=>{const t=e.name;if(console.debug(`alarm: onAlarm[${t}]`,e),t){await r.acquire(),console.debug(`alarm: onAlarm[${t}] mutex acquired`,a,c);const n=c[t],s=a[t];n&&s?(m(n.type,...n.args), +void 0===e.periodInMinutes&&await v([t])):(n?console.warn(`alarm: onAlarm[${t}|${n.type}] - no alarm for alarm`):console.warn(`alarm: onAlarm[${t}] - no data for alarm`),await v([t])),console.debug(`alarm: onAlarm[${t}] mutex release`),p=p.filter((e=>e.name!==t)),r.release()}},m=(t,...n)=>{e((()=>{console.debug(`alarm: emit[*|${t}]`,n);const e=s[t];if(e)for(const t of e)if(!0===t(...n))return}))},g=(e,t)=>{const{clearTimeout:n,clearInterval:r}=t;let s=!1;const a=i[e];a&&(n(a),delete i[e],s=!0) +;const c=o[e];return c&&(r(c),delete o[e],s=!0),s},v=async e=>{let t=!1;return console.debug("alarm: internalClear",e),d&&A?await h.all(e.map((e=>(delete a[e],delete c[e],h.all([A.delete(e),d.clear(e).then((e=>t=e||t))]))))):u&&e.forEach((e=>{delete a[e],delete c[e],t=g(e,u)||t})),console.debug("alarm: internalClear done",e,a,c),t},w=(e,t)=>{let n=s[e];return n||(n=[],s[e]=n),n.push(t),()=>b(e,t)},b=(e,t)=>{const n=s[e];if(n){const e=n.indexOf(t);e>=0&&n.splice(e,1)}},_=async e=>{ +const t=Array.isArray(e)?e:[e];if(console.debug("alarm: clear",t),d){await r.acquire();const e=await v(t);return r.release(),e}return v(t)};return d&&A&&(r.acquire().then((async()=>{const e=[],t=await A.list();for(const{key:e,value:n}of t)c[e]=n;const n=await d.getAll();p&&n.push(...p);for(const t of n){const n=t.name;c[n]?a[n]=t:(console.warn("alarm: no data for alarm "+n),e.push(n))}Object.keys(c).map((t=>a[t]?null:e.push(t))),e.length&&await v(e),console.debug("alarm: init done",a,c), +r.release()})),d.onAlarm.addListener((e=>{p.push(e),f(e)}))),{onAlarm:f,on:w,once:(e,t)=>{const n=w(e,((...e)=>(n(),t.bind(void 0)(...e))));return n},off:b,schedule:async(e,t,...n)=>{const s=e,{when:l,delayInMinutes:p,periodInMinutes:f,keepExistent:w}=t;return await r.acquire().then((async()=>{const e=(Object.entries(c).find((([e,t])=>t.type===s))||[])[0];if(console.debug(`alarm: schedule[?|${s}]`,t,n,e),e&&w)return e;const r=e||Math.random().toString(36).substr(2,10);if(d&&A){ +console.debug(`alarm: schedule[${r}|${s}] mutex acquired`),e&&await d.clear(r);const i=c[r]={type:s,args:n};await h.all([A.set(r,i),d.create(r,{when:l,delayInMinutes:p,periodInMinutes:f})]);const o=await d.get(r);o?a[r]=o:console.warn(`alarm: schedule[${r}|${s}] unable to create alarm`,t),console.debug(`alarm: schedule[${r}|${s}] mutex release`)}else if(u){const{setInterval:e,setTimeout:t,getCurrentTime:d}=u,A=d();let h;g(r,u);const w=f?60*f*1e3:void 0;if(h=l?l-A:p?60*p*1e3:w||0,w){ +if(w<0)return console.warn(`alarm: schedule[${r}|${s}] - period ${f} is too small`),r;for(;h<0;)h+=w}if(h<0)return console.warn(`alarm: schedule[${r}|${s}] - when ${l} is too small`),r;i[r]=t((()=>{m(s,...n),delete i[s],w?o[r]=e((()=>m(s,...n)),w):v([r])}),h),c[r]={type:s,args:n},a[r]={name:r,scheduledTime:A+h,periodInMinutes:f}}return r})).always((()=>r.release()))},get:e=>a[e],list:()=>d?Object.keys(a):Object.keys(i).concat(Object.keys(o)),clear:_, +clearAll:async()=>(console.debug("alarm: clearAll"),d?await _(Object.keys(a)):_(Object.keys(i).concat(Object.keys(o))))}})(_.ensureLate,Ot&&Ot.supported?Ot:{setInterval:re,setTimeout:se,clearInterval:Y,clearTimeout:J,getCurrentTime:()=>Date.now()},Ot&&Ot.supported?Ns("alarms"):void 0),bc="broadcast",_c="android_hint",yc=e=>{if("object"!=typeof e||null===e||!("text"in e))return!1;const t=Date.now(),{expires:n}=e;return!n||n>t},kc=an("global_hints","items"),Rc=e=>kc.set({[e]:Date.now() +}),xc=async(e,t)=>{const n=Date.now();let{timeout:r,id:s,...i}=e;const o=e.key||s||(s=Math.random().toString(36).substr(2,9)),a=await kc.get();if(!t&&Object.entries(a).some((([e,t])=>e===o&&!yc(t))))return;const c=r?n+r:void 0,l={...i,id:s,expires:c};return await kc.set({[o]:l}),{...i,id:s,key:o}},Ec=e=>{const{expires:t,...n}=e;return{...n,timeout:t?Math.max(t-Date.now(),1):void 0}},Sc=async e=>{const t=(await kc.get())[e];return"number"==typeof t?null:t&&yc(t)?Ec(t):void 0 +},Cc="https://blacklist.tampermonkey.net/get.php",Mc=(e,t)=>{let n=!1;if(t.length){if("/"==t.substr(0,1)){const r=Qo(t);if(!r)return;n=Wo(e,r)}else n=-1!=e.indexOf(t);return n&&v.log('black: entry "'+t+'" matched'),n}},Ic={SEVERITY_MAX:10,SEVERITY_MANUALLY_DEFINED:11,SEVERITY_FOISTED_SCRIPT:12,init:()=>{const e=y();wc.on("blu",(()=>{"server"===wn.values.script_blacklist_type&&Ic.checkUpdate()}));const t=()=>{wc.schedule("blu",{when:Date.now()+6e4,keepExistent:!0})};return t(), +wn.addChangeListener("script_blacklist_type",t),e.resolve(),e.promise()},getWarningsFor:e=>{const t=[];return e&&Ze(wn.values.script_blacklist_server,(n=>{if(!n)return;const{rules:r,reasons:s,reason:i,exclude:o}=n;if(o&&o.includes(B.short_id))return;let a=!1;if(Ze(r,(t=>(a=a||!!Mc(e,t),1!=a))),a)if(s){const e=Qr.getBestLocale(Object.keys(s));t.push(s[e||"en"])}else i&&t.push(i)})),t},getEvilnessOf:e=>{if("off"===wn.values.script_blacklist_type)return 0;if(!e)return 0;let t=!1,n=0 +;return Ze(wn.values.require_blacklist,(n=>(t=t||!!Mc(e,n),1!=t))),t?n=Ic.SEVERITY_MANUALLY_DEFINED:"server"===wn.values.script_blacklist_type&&Ze(wn.values.script_blacklist_server,(r=>{if(!r)return;const{rules:s,severity:i,exclude:o}=r;return o&&o.includes(B.short_id)?void 0:(Ze(s,(n=>(t=t||!!Mc(e,n),1!=t))),t?(n=i,!1):void 0)})),Number(n)},checkUpdate:e=>{const t=y();let n,r=gc();if(e||Date.now()-r.black.last>864e5){const s=(e,t)=>{const n=y(),r={method:"GET",url:e,nocache:t,retries:Z.RETRIES, +overrideMimeType:"text/plain; charset=x-user-defined"};return Uo.internal(r,{ondone:e=>n.resolve(e)}),n.promise()};s(Cc+"?version=get").then((t=>{if(4==t.readyState&&200==t.status){try{const e=JSON.parse(t.responseText);n=e.version}catch(e){v.warn("black: unable to parse version response! "+t.responseText)}if(v.info("black: local version: "+r.black.version+" remote: "+n),n>r.black.version||e)return s(Cc,!0)}})).then((e=>{if(e&&4==e.readyState&&200==e.status)try{const t=JSON.parse(e.responseText) +;t&&t.blacklist&&1==t.version&&(wn.values.script_blacklist_server=t.blacklist,(e=>{if(ci.all({domain:"status",key:bc,deleted:!0}),e&&e.description){let{name:t,name_i18n:n,description:r,description_i18n:s,expires:i,exclude:o,timeout:a,...c}=e;if(i){const e=Date.now();if(!(i>e))return;a=i-e}if(o&&o.includes(B.short_id))return;t=t||Qr.getMessage("Info"),a=a||864e5;const l={name:t,description:r,name_i18n:n||null,description_i18n:s||null,timeout:a,...c},u={key:bc,realm:"all", +class:l.class||"information",title:Qr.getTranslation(l,"name"),text:Qr.getTranslation(l,"description"),timeout:a};xc(u),ci.all({domain:"status",...u})}else Rc(bc)})(t.broadcast)),v.info("black: updated blacklist to ",t)}catch(t){v.warn("black: blacklist update failed! ",e.responseText)}})).always((()=>{r=gc(),r.black.last=Date.now(),r.black.version=n||r.black.version,vc(r),t.resolve()}))}else t.resolve();return t.promise()}},Uc=Ic,Gc={content:"",error:void 0,forbidden:void 0,sri:void 0, +determined:void 0,meta:void 0,name:void 0,blacklisted:void 0},Zc=(e,t)=>I.PREFIX.EXTERNAL+[e,t?$e(t):null].filter((e=>e)).join(":"),Tc={list:e=>{const t=new RegExp("^"+e);return nn.listValues().filter((e=>-1!=e.search(t)))},set:(e,t,n,r,s)=>{const i=Zc(e,t),{content:o,meta:a,name:c,forbidden:l,blacklisted:u,error:d,determined:A,sri:p}=n,h={base:(m=o,X(He(m))),meta:a,name:c,forbidden:l,blacklisted:u,error:d,determined:A,sri:p},f={ts:s||Date.now(),url:t,resource:h,modified:r};var m +;nn.setValue(i,f)},get:(e,t)=>{const n=Zc(e,t),r=nn.getValue(n);let s;if(r&&r.resource){const{resource:e,ts:t,url:n,modified:o}=r,{base:a,meta:c,name:l,forbidden:u,blacklisted:d,error:A,determined:p,sri:h}=e;s={ts:t,url:n,data:{content:(i=a,Qe(W(i))),meta:c,name:l,forbidden:u,blacklisted:d,error:A,determined:p,sri:h},modified:o}}var i;return s},clean:(e,t)=>{const n=Zc(e,t);nn.deleteValue(n)},cleanAll:(e,t)=>{let n;const r=Tc.list(Zc(e));if(t){const s={};Ze(t,(t=>{const n=Zc(e,t);s[n]=!0})), +n=[],Ze(r,(e=>{s[e]||n.push(e)}))}else n=r;n.forEach((e=>{nn.deleteValue(e)}))}},Bc=je(9e3),Oc=(e,t,n,r)=>{const s=y(),{encoding:i,refresh:o}=r,a=!1;let c;return((e,t)=>{const n=y(),r=r=>{let s,i="";if(4!=r.readyState||200!=r.status&&0!=r.status||r.error){const e={...Gc,content:i,meta:s};n.reject(e)}else{let o,a;const c=go(r.responseHeaders)["content-type"];c&&c.match(/^\s*(image\/|text\/)([+-.a-zA-Z0-9]+)\s*$/)&&(o=c.trim()), +o||((a=e.match(/.*\.(ico|jpg|jpeg)+($|\?|#).*/))?o="image/x-icon":(a=e.match(/.*\.(gif|png)+($|\?|#).*/))?o="image/"+a[1]:-1!=e.search(/.*\.(js)+($|\?|#).*/)?o="text/javascript":(a=e.match(/.*\.(css|html|xml)+($|\?|#).*/))?o="text/"+a[1]:(e=>{const t="background.js";let n=O.getURL(t);return n=n.replace(t,"")+"images/",e.length>=n.length&&n==e.substr(0,n.length)})(e)&&(o="image/x-icon")),s=o,i=Ye(r.response,t.encoding)||"";const l={...Gc,content:i,meta:s};n.resolve(l)}},s=({error:e})=>{n.reject({ +...Gc,error:e})},i=zn(e);if(i)if(["file:"].concat(T.INTERNAL_PAGE_PROTOCOLS).includes(i.protocol))if("file:"!=i.protocol||Ft()&&["externals","all"].includes(wn.values.script_file_access))St(e,(e=>{r({readyState:4,status:0,response:e,statusText:"",responseHeaders:""})}),(e=>{s({error:e})}));else{const t="Access to this or all local files is forbidden!";v.warn("externals:",t,"Loading the following @resource failed:",e,"-> more info:","https://www.tampermonkey.net/faq.php#Q204"),s({error:t})}else{ +const n={method:"GET",url:e,retries:Z.RETRIES,...t.refresh?{revalidate:!0}:{nocache:!1},responseType:"arraybuffer"};n.timeout=wn.values.require_timeout,Uo.internal(n,{onload:e=>r(e),onerror:e=>s({error:e.responseText||e.statusText||"unknown error"}),ontimeout:()=>s({error:"timed out"})})}else s({error:"unable to parse url"});return n.promise()})(t,{encoding:i,refresh:o}).done((i=>{n&&(i.sri=n);const o=n=>{const r=zn(t) +;r&&r.protocol&&!["file:"].concat(T.INTERNAL_PAGE_PROTOCOLS).includes(r.protocol)&&Tc.set(e,t,n)};n&&["supported","given"].includes(wn.values.require_sri_mode)?Ka.check(n,i.content,r.encoding).done((()=>{c=i,o(c),s.resolve({sync:a,resource:c})})).fail((e=>{c={...Gc,forbidden:!0,sri:{mode:wn.values.require_sri_mode,type:n.type,value:"invalid"},determined:e},o(c),s.reject({sync:a,resource:c})})):(c=i,o(c),s.resolve({sync:a,resource:c}))})).fail((n=>{v.log("externals: get.failed",e,t,n),c={...Gc, +error:n.error||"internal error"},s.reject({sync:a,resource:c})})),s.promise()},jc=e=>e.url||e.unsafe_url&&Vn(e.unsafe_url,e.abs_url)||"",Dc=(e,t,n)=>{const r=y(),s=zn(t),i=n.sync;let o,a;return t&&s?Uc.getEvilnessOf(t)>=wn.values.script_blacklist_severity?(o={...Gc,blacklisted:!0},r.reject({sync:i,resource:o})):Ka.getHash(s,"supported"==wn.values.require_sri_mode).done((c=>{if("enforce"!=wn.values.require_sri_mode||c)if("file:"!==s.protocol&&(a=Tc.get(e,t))){const s=Zc(e,t),l=Date.now() +;wn.values.external_update_interval>0&&l-a.ts>wn.values.external_update_interval&&(Bc.is(s)||(wn.values.external_update_interval>1&&Bc.add(s),a.modified?v.log("externals: resource is not updated due to user modifications",t,new Date(a.ts).toISOString(),new Date(l).toISOString()):(v.log("externals: resource needs update",t,new Date(a.ts).toISOString(),new Date(l).toISOString()),se((()=>{Oc(e,t,c,n)}),3e3)))),o=a.data,o.forbidden||o.blacklisted?r.reject({sync:i,resource:o}):r.resolve({sync:i, +resource:o})}else r.consume(Oc(e,t,c,n));else o={...Gc,forbidden:!0,sri:{mode:wn.values.require_sri_mode,type:"unsupported",value:""}},r.reject({sync:i,resource:o})})):(o={...Gc,forbidden:!0},r.reject({sync:i,resource:o})),r.promise()},Fc={setElement:(e,t,n,r)=>{const{lastModified:s,...i}=n;return Tc.set(e,t,i,r,s)},getElement:(e,t)=>Tc.get(e,t),updateRequire:(e,t)=>Dc(e,t,{refresh:!0,sync:!1,encoding:"UTF-8"}),updateResource:(e,t)=>Dc(e,t,{refresh:!0,sync:!1}),cleanElement:(e,t)=>Tc.clean(e,t), +dropAll:e=>(Tc.cleanAll(e),y.Pledge()),dropAllBut:(e,t)=>(Tc.cleanAll(e,t),y.Pledge()),loadResources:(e,t)=>{const n=y();return Fc.getResources(e,t).always((()=>{n.resolve()})),n.promise()},loadRequires:(e,t)=>{const n=y();return Fc.getRequires(e,t).always((()=>{n.resolve()})),n.promise()},getResources:(e,t)=>{const n=y(),r=[],s=[],i={sync:!0};return t.forEach((t=>{const n=jc(t),o=t.name;let a,c,l;const u=y();Dc(e,n,i).done((e=>{const t=e.resource;a=t.content,c=t.meta||"application" +})).fail((e=>{if(e.resource){const{forbidden:n,sri:r,blacklisted:s,error:i}=e.resource;n?l=r?`can't load @resource '${t.name}' from URL '${t.unsafe_url}' due to a SRI error`:`can't load @resource '${t.name}' from forbidden URL '${t.unsafe_url}'`:s?l=`can't load @resource '${t.name}' from blacklisted URL '${t.unsafe_url}'`:i&&(l=`can't load @resource '${t.name}' from URL '${t.unsafe_url}': ${i}`)}l||(l=`can't load @resource '${t.name}' from URL '${t.unsafe_url}'`),v.warn("externals: "+l) +})).always((e=>{i.sync=i.sync&&(!e||e.sync),r.push({name:o,url:n,error:l,content:a,meta:c}),u.resolve()})),s.push(u.promise())})),y.when(s).always((()=>{n.resolve({elements:r,sync:i.sync})})),n.promise()},getRequires:(e,t)=>{const n=[],r=y(),s=[],i={encoding:"UTF-8",sync:!0};return t.forEach(((t,r)=>{const o=jc(t);let a="";const c=y();Dc(e,o,i).done((e=>{a=e.resource.content||""})).fail((e=>{let n;if(e.resource){const{forbidden:r,sri:s,blacklisted:i,error:o}=e.resource +;r?n=s?`couldn't load @require from URL '${t.unsafe_url}' due to a SRI error`:`couldn't load @require from forbidden URL '${t.unsafe_url}'`:i?n=`couldn't load @require from blacklisted URL '${t.unsafe_url}'`:o&&(n=`couldn't load @require from URL '${t.unsafe_url}': ${o}`)}n||(n=`couldn't load @require from URL '${t.unsafe_url}'`),a=(e=>'console.warn("@require: " + decodeURIComponent("'+ee(e)+'"));')(n)+"\n",v.warn("externals: "+n)})).always((e=>{i.sync=i.sync&&(!e||e.sync),n[r]={textContent:a}, +c.resolve()})),s.push(c.promise())})),y.when(s).always((()=>{r.resolve({elements:n.filter((e=>e)),sync:i.sync})})),r.promise()}},Lc=Fc;let Pc,Nc;const Vc={},zc=e=>e&&e.includes("*"),qc=()=>{const e=e=>{for(let t=0;t{for(;!Hc&&(t=e(n.id));)t.fn()}))};let Hc,Qc=[];const Wc=(e,t,n,r)=>{const s=((e,t)=>{const n=e=>e?e.map((e=>{let n=e;if(n.match(/^'?self'?$/)){const e=zn(t.url) +;n=(null==e?void 0:e.hostname)||null}else if("'none'"==n)n="none";else{if(["none","localhost","*"].includes(n))return n;if(Pn(n))return n;if(0===n.indexOf("."))return null;if(1===(n.match(/\./g)||[]).length&&Nn(n))return null}return n})).filter((e=>e)):[];return{connects:e.options.override.merge_connects&&"paranoid"!=wn.values.connect_mode?n(e.connects):[],userconnects:n(e.options.override.use_connects),blockers:n(e.options.override.use_blockers)}})(e,t),i=(e=>{const t=y() +;return Gl.isAllowed(e)?t.resolve({allowed:!0}):t.resolve({allowed:!1}),t.promise()})(n).then((r=>{if(!0!==r.allowed)return y.Breach("URL is blacklisted");let i,o;return(i=zn(n))&&i.origin&&(o=zn(t.url))&&o.origin&&i.origin===o.origin?y.Pledge({permitted:!0}):((e,t,n)=>{const r=y(),s=()=>{r.resolve({permitted:!0})},i=e=>{r.resolve({permitted:!1,reason:e})},o=()=>{r.resolve({unknown:!0})};let a,c;const l=e=>zc(e)?s:null,u=(e,t)=>{let n=null;const r=Pn(e);return t.every((({a:t,blocker:o})=>{ +if(!t)return!0;for(const a of t)if(a&&(r||Pn(a)?a===e:-1!=e.search(new RegExp("(^|.+\\.)"+Ue(a)+"$"))))return n=o?i:s,!1;return!0})),n};return"off"==wn.values.connect_mode||n.startsWith("data:")||n.startsWith("blob:")?s():(a=zn(n))&&a.hostname?(c=u(a.hostname,[{a:Vc[e.uuid] +}]))||(c=l(Vc[e.uuid]))?c():0===t.connects.length&&0===t.userconnects.length&&0===t.blockers.length?"casual"==wn.values.connect_mode?s():"strict"==wn.values.connect_mode?i("No @connects given, but strict mode enabled"):o():t.connects.includes("none")?i("None value found"):("casual"==wn.values.connect_mode&&!zc(t.blockers)&&(c=l(t.connects))||(c=l(t.userconnects))||(c=u(a.hostname,[{a:t.blockers,blocker:!0},{a:t.connects},{a:t.userconnects}])||o),c()):i("URL can not be parsed"),r.promise() +})(e,s,n)})).then((i=>{var o;if(!1===i.permitted)return y.Breach("URL is not permitted"+(i.reason?": "+i.reason:""));if(!0===i.permitted)return y.Pledge();if(0===s.connects.length||zc(s.connects)){if(["ask","paranoid"].includes(wn.values.connect_mode)){if(zc(s.blockers))return y.Breach("URL was permanently blocked by the user");if(Hc){v.log('cor: queuing access permission check from "'+e.name+'" to',n,t);const s=y();return Qc.push({tabId:null===(o=null==t?void 0:t.tab)||void 0===o?void 0:o.id, +fn:()=>{s.consume(Wc.apply(void 0,[e,t,n,r]))}}),s.promise()}return((e,t,n,r,s)=>{const i=y(),o=()=>{i.resolve({approved:!0})},a=()=>{i.resolve({forbidden:!0})};v.log('cor: "'+e.name+'" is asking for permission to access',r,t);const c=zn(r);if(c&&c.hostname){const i=(e=>{if(Pn(e))return;const t=e.split(".");if(t.length<3)return e;const n=Nn(t.slice(-2).join("."))?-3:-2;return t.slice(n).join(".")})(c.hostname),l=t.tab?t.tab.id:null;Hc=!0,Ho().then((o=>Gi.askForConnect({src_url:t.url, +hostname:c.hostname,domain:i,all_domains:zc(n.connects),tabid:l,active:l===o.id,timeout:s,url:r,settings_url:ht.getURL("options.html")+"#nav="+e.uuid+"+settings",connect_url:"https://www.tampermonkey.net/documentation.php#_connect",script:{name:Qr.getTranslation(e,"name"),uuid:e.uuid,icon:e.icon64||e.icon||ks("unknown")}}))).done((({message:t,aborted:n})=>{let r;if(!t)return v.log("cor: unexpected response",t),void a();const s=t.whole_domain?i:c.hostname +;if(!s)return v.log("cor: internal error",t,i),void a();t.allow?t.once?(v.log('cor: allowing "'+e.name+'" to access',s,"once"),o()):t.temporary?(v.log('cor: allowing "'+e.name+'" to access',s,"temporarily"),void 0===Vc[e.uuid]&&(Vc[e.uuid]=[]),Vc[e.uuid].includes(s)||Vc[e.uuid].push(s),o()):(r=o,t.all_domains?(v.log('cor: allowing "'+e.name+'" to access all domains always'),e.options.override.use_connects.push("*")):(v.log('cor: allowing "'+e.name+'" to access',s,"always"), +e.options.override.use_connects.push(s),r=o)):t.once||n?(v.log('cor: denying "'+e.name+'" to access',s,"once"),a()):(e.options.override.use_blockers||(e.options.override.use_blockers=[]),r=a,t.all_domains?(v.log('cor: denying "'+e.name+'" to access any domains (additional) domain'),e.options.override.use_blockers.push("*")):(v.log('cor: denying "'+e.name+'" to access',s,"always"),e.options.override.use_blockers.push(s))),r&&Pc(e.uuid,e,!1).always(r)})).fail(a).always((()=>{Hc=!1, +Qc.length&&se(qc,1)}))}else a();return i.promise()})(e,t,s,n,r).then((e=>!0===e.approved?y.Pledge():y.Breach("Request was blocked by the user")))}return y.Breach()}return y.Breach("This domain is not a part of the @connect list")}));return i},Xc={getSessionConnects:e=>Vc[e]||[],setSessionConnects:(e,t)=>{Vc[e]=t||[]},purgeAppeals:e=>{Qc=Qc.filter((t=>t.tabId!==e))},exec:(e,t,n,r,s)=>{let i,o,a,c,l,u,d,A=e.url;const p=[],h=Math.max(Math.min(e.timeout||0,6e4),2e4),f=()=>{let e +;for(;!d&&(e=p.shift());)e()},m=(t,n)=>{const r='Refused to connect to "'+(n||e.url)+'": '+(t||"Blocked by @connect CORS check"),i=ho(r);["onerror","ondone"].forEach((e=>{const t=s[e];t&&t({response:i,exception:r})}))};if(n&&n.url&&n.tab&&e.url&&t&&(o=Nc(t))&&({script:a,cond:c}=o)&&a&&c&&!a.deleted)return Wc(a,n,e.url,h).done((()=>{if(u)return;const t={};for(const[e,r]of Object.entries(s)){if(!r)continue;const s=(e,...t)=>{if(l)return;if(d)return void p.push((()=>s(e,...t)));const o=e +;(o&&o.finalUrl&&A!==o.finalUrl?(d=!0,Wc(a,n,o.finalUrl,h).fail((()=>{u||l||(i&&i.abort(),l=!0,m("Request was redirected to a not whitelisted URL",o.finalUrl),v.warn("cor: request to",A,"was redirect to a not whitelisted URL",o.finalUrl))})).always((()=>{A=o.finalUrl,d=!1,p.length&&se(f,1)}))):y.Pledge()).always((()=>{l||r({response:o})}))};t[e]=s}i=Uo.external(e,t,r)})).fail((e=>{u||(m(e),v.warn("cor: access to",A,"was denied"))})).always((()=>{if(u){const e={response:ho("aborted"), +exception:"Aborted by user"};s.onabort&&s.onabort(e),s.ondone&&s.ondone(e)}})),{abort:()=>{i?i.abort():u=!0}};m()}},Yc=Xc,Jc=e=>(e.sort(((e,t)=>e.position-t.position)),e),Kc=e=>{let t;void 0===e.ask&&(e.ask=!0),e.url||(e.url=""),""===e.force_url&&delete e.force_url;const n={errors:[],info:[],warnings:[],flags:{}},r=y(),s=Date.now(),i=e.save&&!e.ask&&wn.values.editor_easySave;let o;const a=us(e.src)||void 0;let c;if(a&&(a.name||(c=Qr.getMessage("Invalid_UserScript_name__Sry_"))), +!a||c)return n.errors.push((c||Qr.getMessage("Invalid_UserScript__Sry_"))+"\n\n"),e.name&&n.errors.push(Qr.getMessage("Script_name_0name0",e.name)+"\n\n"),e.url&&n.errors.push(Qr.getMessage("Downloaded_from_0url0",e.url)),v.warn("scriptman: invalid userscript",n,a),y.Breach({messages:n});const{antifeatures:l,connects:u,name:d,namespace:A,textContent:p,version:h}=a +;let f,m,g,{downloadURL:w,enabled:b,excludes:_,fileURL:k,includes:R,lastModified:x,matches:E,options:S,sync:C,position:M,uuid:I,updateURL:U,system:G}=a;return y.Pledge().then((()=>{let n=e.uuid;if(e.replace&&!n&&(n=sa.getUidsByName(d,A)[0]),n){const e=sa.getByUid(n);e.cond&&e.script&&(t=e.script)}else if(I)n=I;else{if(!e.replace)return v.warn("scriptman: neither UUID, @uuid nor replace option set"),y.Breach();n=Pe()} +return n&&""===n.replace(/[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}/,"")?(I=n,y.Pledge(I)):(v.warn("scriptman: invalid UUID",n),y.Breach())})).then((()=>{if(!e.clean&&!e.defaultscript&&t&&t.system)return y.Breach()})).then((()=>{if(e.clean&&e.name&&e.name!=d||-1!=d.indexOf("\n"))return n.errors.push(Qr.getMessage("Invalid_UserScript_name__Sry_")),y.Breach()})).then((()=>{if(t){if(t.name!=d&&(n.flags.renamed=!0), +e.internal||t.evilness!=Uc.SEVERITY_FOISTED_SCRIPT||(n.warnings.push(Qr.getMessage("This_is_a_possibly_foisted_script_and_a_modification_will_enable_it_")),n.flags.forceAsk=!0),t.lastModified&&void 0!==e.lastModTime&&t.lastModified!==e.lastModTime){let e=Qr.getMessage("some_secs");try{const n=Math.max(1,Math.floor((s-t.lastModified)/1e3));isNaN(n)||(e=n)}catch(e){}n.warnings.push(Qr.getMessage("CONFLICT__This_script_was_modified_0t0_seconds_ago_",e)),n.flags.forceAsk=!0} +h==t.version&&(e.save?n.flags.modification=!0:n.flags.reset=!0),e.clean&&(n.flags.factory=!0),t.options.user_modified&&(n.flags.user_modified=!0),o=!e.internal}else n.flags.first_install=!0,o=!e.internal||e.save;R.length||E.length||i&&t||e.internal||n.warnings.push(Qr.getMessage("This_script_does_not_provide_any__include_information_")),l&&!e.internal&&Object.keys(l).forEach((e=>{const r=l[e];let s +;s=Qr.getMessage("ads"==e?"Antifeature_ads":"miner"==e?"Antifeature_miner":"tracking"==e?"Antifeature_tracking":"Antifeature_other");const o=r[Qr.getBestLocale(Object.keys(r))||"default"]||r.en||Qr.getMessage("Antifeature_no_details");let a,c;t&&t.antifeatures&&(c=t.antifeatures[e])&&(a=c[Qr.getBestLocale(Object.keys(c))||"default"]||c.en||Qr.getMessage("Antifeature_no_details")),i&&a&&o===a||n.warnings.push(Qr.getMessage("Antifeature__0name0__0description0",s,o))})),n.flags.sync=!!e.sync, +n.flags.internal=e.internal,n.flags.ask=e.ask,n.flags.save=e.save,n.flags.whitewash=e.whitewash})).then((()=>{if(G=e.defaultscript,M=nl.determineLastPosition()+1,x=s,e.force_meta){let t;(t=e.force_meta.fileURL)&&(k=t),(t=e.force_meta.lastModified)&&(x=t)}if(t&&(t.system&&(G=!0),n.flags.factory&&(x=t.lastModified)),!n.flags.factory&&!n.flags.reset&&(e.force_url&&(U=null,w=e.force_url),t)){S.override=Be(t.options.override,{}),S.comment=t.options.comment, +S.check_for_updates=t.options.check_for_updates;const r=t.options.override.orig_tags,s=r?S.tags.filter((e=>!r.includes(e))):S.tags;if(S.tags=t.options.tags.concat(s),p!=t.textContent){const r=t.options.user_modified;if(e.save&&!e.internal){S.user_modified=Date.now();const e=k||w;!wn.values.editor_easySave&&!r&&S.check_for_updates&&e&&"none"!=e&&n.warnings.push(Qr.getMessage("Modifying_a_script_will_disable_automatic_script_updates_")) +}else!0!==e.replace&&!0!==e.internal&&!0!==e.clean&&!0!==e.whitewash&&r&&n.warnings.push(Qr.getMessage("The_script_was_modified_locally_on_0date0__Updating_it_will_overwrite_your_changes_",new Date(r).toLocaleString()))}}S.override.orig_includes=R,S.override.orig_excludes=_,S.override.orig_matches=E,S.override.orig_connects=u,S.override.orig_noframes=S.noframes,S.override.orig_run_at=S.run_at||"document-idle",S.override.orig_run_in=S.run_in||[],S.override.orig_tags=S.tags,S.noframes=null, +S.run_at=null,S.run_in=null})).then((()=>{if(t&&(k=t.fileURL,t.deleted||(M=t.position),t.sync&&(C=t.sync),!n.flags.factory&&!n.flags.reset)){b=t.enabled,S.noframes=t.options.noframes,S.run_at=t.options.run_at,S.run_in=t.options.run_in;const{compatopts_for_requires:r,compat_wrappedjsobject:s,compat_metadata:o,compat_foreach:a,compat_powerful_this:c}=t.options;S={...S,compatopts_for_requires:r,compat_wrappedjsobject:s,compat_metadata:o,compat_foreach:a,compat_powerful_this:c}, +e.save&&!e.force_url&&(w=t.downloadURL||w);const l=nl.determineSourceURL(t),d=nl.determineSourceURL({fileURL:k,downloadURL:w,updateURL:U}),A=l?Qn(l):l||Qr.getMessage("_not_set_"),p=d?Qn(d):d||Qr.getMessage("_not_set_");if(A==p||i||e.internal||n.warnings.push(Qr.getMessage("The_update_url_has_changed_from_0oldurl0_to__0newurl0",[A,p])),!e.save){const e=t.options.override.orig_includes||t.includes,r=t.options.override.orig_matches||t.matches,s=t.options.override.orig_excludes||t.excludes +;Fe(e,R,"notinfirst").length+Fe(r,E,"notinfirst").length+Fe(_,s,"notinfirst").length&&n.warnings.push(Qr.getMessage("At_least_one_of_the_include_match_or_exclude_statements_was_changed_")),Fe(t.connects||[],u||[],"notinfirst").length&&n.warnings.push(Qr.getMessage("At_least_one_new_connect_statement_was_added_"))}}})).then((()=>{if(t&&!n.flags.factory&&h==t.version){if(e.defaultscript)return y.Breach();if(e.noreinstall)return y.Breach()}})).then((()=>{ +t?(n.flags.factory||n.flags.reset?(n.flags.reset?(n.heading=Qr.getMessage("You_are_about_to_reinstall_a_UserScript_"),n.flags.reinstall=!0):(n.heading=Qr.getMessage("You_are_about_to_install_a_UserScript_"),n.flags.install=!0),e.internal||n.warnings.splice(0,0,Qr.getMessage("All_script_settings_will_be_reset_"))):n.flags.modification?n.heading=Qr.getMessage("You_are_about_to_modify_a_UserScript_"):ls(h,t.version)==ls.eOLDER?(n.heading=Qr.getMessage("You_are_about_to_downgrade_a_UserScript"), +n.flags.downgrade=!0,i||e.internal||n.warnings.splice(0,0,Qr.getMessage("The_downgraded_script_might_have_problems_to_read_its_stored_data_"))):(n.heading=Qr.getMessage("You_are_about_to_update_a_UserScript_"),n.flags.update=!0),n.info.push({label:Qr.getMessage("Installed_Version_"),value:Qr.getMessage("v0version0",t.version)})):(n.heading=Qr.getMessage("You_are_about_to_install_a_UserScript_"),i||e.internal||n.info.splice(0,0,Qr.getMessage("Malicious_scripts_can_violate_your_privacy_")), +n.flags.install=!0),i||e.internal||Uc.getWarningsFor(nl.determineSourceURL({fileURL:k,downloadURL:w,updateURL:U})).forEach((e=>{n.warnings.splice(0,0,e)})), +n.flags.whitewash?n.action=Qr.getMessage("Enable"):n.flags.install?n.action=Qr.getMessage("Install"):n.flags.reinstall?n.action=Qr.getMessage("Reinstall"):n.flags.modification?n.action=Qr.getMessage("Modify"):n.flags.downgrade?n.action=Qr.getMessage("Downgrade"):n.flags.update&&(n.flags.user_modified?n.action=Qr.getMessage("Overwrite"):n.action=Qr.getMessage("Update"))})).then((()=>{if(e.url&&(k=e.url),e.sync&&(C=e.sync),e.force_options&&Be(e.force_options,S,As().options,!0),e.force_settings){ +const{enabled:t,position:n}=e.force_settings;void 0!==t&&(b=t),void 0!==n&&(M=n)}({options:S,includes:R,excludes:_,matches:E}=nl.mergeCludes({options:S,includes:R,excludes:_,matches:E}))})).then((()=>{const e=k?k.split("/").slice(0,-1).join("/")+"/":void 0;m=a.requires.map((({url:t})=>({unsafe_url:t,abs_url:e}))),g=a.resources.map((({name:t,url:n})=>({unsafe_url:n,abs_url:e,name:t})))})).then((async()=>{var t;const{compat_wrappedjsobject:r,compat_metadata:s,compat_foreach:i}=S +;(r||s||i)&&n.info.push({label:Qr.getMessage("Note"),value:Qr.getMessage("A_recheck_of_the_GreaseMonkey_FF_compatibility_options_may_be_required_in_order_to_run_this_script_")});let o,c,l={...a,downloadURL:w,enabled:b,excludes:_,fileURL:k,includes:R,lastModified:x,matches:E,options:S,sync:C,position:M,uuid:I,updateURL:U,system:G};if((o=nl.determineOrigin(l))&&(c=null===(t=fs[o.token])||void 0===t?void 0:t.convert)){const t=await c(l) +;if(t.info&&("includes added"===t.info?n.info.push(Qr.getMessage("Automatically_added_user_includes_for_compatibility_reasons_")):v.warn("scriptman: unknown script convert info",t.info)),t.warning){let r;"deleted by hoster"===t.warning&&(r=Qr.getMessage("This_script_was_deleted_by_the_hoster_")),r?e.internal?n.info.push(r):n.warnings.push(r):v.warn("scriptman: unknown script convert warning",t.warning)}l=t.script||l}return f=nl.getEvilness(l),{...l,uuid:I,textContent:p,evilness:f,requires:m, +resources:g}})).done((async e=>{const{textContent:s,...i}=e;let a;if(t){const{textContent:e,...n}=t||{},r=await no(new Blob([e],{type:"text/javascript"}),ba);a={...n,tfd:await r.toTransferableData()}}const c=await no(new Blob([s],{type:"text/javascript"}),ba),l={script:{...i,tfd:await c.toTransferableData()},oldscript:a,messages:n,trigger_sync:!!o,short_info:[{label:Qr.getMessage("Author"),prop:"author"},{label:Qr.getMessage("Description"),prop:"description",i18n:!0},{ +label:Qr.getMessage("Source"),prop:"fileURL"}],hints:[]};r.resolve(l)})).fail((()=>{r.reject({messages:n})})),r.promise()},$c=e=>{const t=y(),n=e.messages,r=e.script,s=n.warnings.length||n.flags.ask,i=e.trigger_sync,o=async()=>{const e=await new Us(r.tfd).toBlob(),s={...r,textContent:await new Response(e).text()};n.flags.modification||Lc.dropAll(s.uuid),t.notify();const o=nl.doModify(s.uuid,s,i)||{} +;return n.flags.save||!n.flags.install&&!n.flags.update||n.flags.factory||n.flags.reset||Ir(s.name,n.flags.install?"i":"u",s.fileURL||""),(n.flags.first_install||n.flags.factory)&&sa.setStorageByUid(s.uuid,{ts:Date.now(),data:{}}),o},a={uuid:r.uuid,lastModified:void 0,installed:!0,renamed:n.flags.renamed};return s?Gi.install(e).done((async({ok:e,aborted:n,message:r})=>{e&&await o(),t.resolve({installed:e,aborted:n,disable_update:"disable_update"in r?r.disable_update:void 0})})).fail((()=>{ +t.reject()})):se((async()=>{await o(),t.resolve(a)}),1),t.promise()},el=(e,t)=>{const n=t||{},r=Object.values(e).map((t=>{let r,s,i;t.evilness&&(t.evilness==Uc.SEVERITY_FOISTED_SCRIPT?r=Qr.getMessage("The_origin_of_this_script_cant_be_determined_"):t.evilness>=Math.min(Uc.SEVERITY_MAX,wn.values.script_blacklist_severity)&&(s=Qr.getMessage("This_script_is_blacklisted_"))),t.evilness&&(i=Uc.getWarningsFor(rl.determineSourceURL(t)));const o=n.options_page,a={userscript:!0,foisted:r,blacklisted:s, +warnings:i,icon:t.icon64||t.icon||void 0};if(o){const{textContent:r,requires:s,resources:i,...o}=t,c=(e,r)=>{const s=e.url||Vn(e.unsafe_url,e.abs_url),i=Lc.getElement(t.uuid,s);let o,a,c,l,u,d=0,A=null,p=null;return i&&i.data&&(i.data.content&&(u=i.data.content,d=u.length),p=i.data.sri,A=i.ts,o=i.modified,l=i.data.meta||"text/plain",c=r||/text\/.*|application\/(?:x-)?(?:java|ecma)script/.test(l),a=!0),{display_url:e.url||e.unsafe_url,abs_url:e.abs_url,unsafe_url:e.unsafe_url,url:s,data:{ +length:d,content:n.externals?u:void 0},sri:p||void 0,ts:A,mimetype:l,editable:a,viewable:c,modified:o}},l=s.map((e=>c(e,!0))),u=i.map((e=>c(e))),d=rl.determineOrigin(t),A=rl.isContexter(t),p=Yc.getSessionConnects(t.uuid),h=sa.getStorageByUid(t.uuid),f=Object.keys(h.data).length,m=Sl(t),g=t.deleted,v=t.lastUpdated,w=t.downloadURL||t.fileURL||void 0,b=e.length;return{...o,...a,requires:l,resources:u,...n.referrer?{referrer:n.referrer,length:r.length}:{code:r},origin:d,contexter:A,temp_connects:p, +...n.storage?{storage:h}:{},storage_key_count:f,remote_url:m,deleted:g,lastUpdated:v,file_url:w,positionof:b}}{const e=rl.determineOrigin(t),r=n.active_urls||{},s=n.active_counts||{},i=n.all_time_active_counts||{};return{...a,name:t.name,name_i18n:t.name_i18n,uuid:t.uuid,nnew:!1,system:t.system,support:!!t.supportURL||e&&!!e.issue_url,abuse:void 0,active_urls:r[t.uuid],active_count:s[t.uuid],all_time_active_count:i[t.uuid],referrer:n.referrer,contexter:rl.isContexter(t),enabled:t.enabled, +position:t.position,deleted:t.deleted,options:t.options}}}));return r},tl=je(1e3),nl={determineSourceURL:e=>{if(e)return[e.downloadURL,e.fileURL].filter((e=>{var t;if(!e||"file:"!==(null===(t=zn(e))||void 0===t?void 0:t.protocol))return e}))[0]||void 0},determineMetaURL:e=>{if(!e)return;let t;const n=nl.determineOrigin(e);return n&&n.meta_header?t=e.fileURL:!e.fileURL||n&&!n.meta_url||(t=e.fileURL.replace(".user.js",".meta.js"),e.fileURL==t&&(t=e.fileURL.replace(".tamper.js",".meta.js")), +e.fileURL==t&&(t=null)),[e.updateURL,e.downloadURL,t].filter((e=>{var t;if(!e||"file:"!==(null===(t=zn(e))||void 0===t?void 0:t.protocol))return e}))[0]||void 0},mergeCludes:e=>{let t,n;const r=e.options.override;if(["includes","excludes","matches"].forEach((t=>{const n=`merge_${t}`,s=`orig_${t}`;e[t]=r[n]&&r[s]?r[s].slice():[]})),r.use_includes)for(t=0;t=0&&e.excludes.splice(n,1),e.includes.push(r.use_includes[t]) +;if(r.use_matches)for(t=0;t=0&&e.excludes.splice(n,1),e.matches.push(r.use_matches[t]);if(r.use_excludes)for(t=0;tKc(e).then($c),doRemove:(e,t)=>{const n=sa.getByUid(e);if(!n.script||!n.cond)return y.Breach("invalid script");const r=n.script;if(t)sa.removeByUid(e),sa.setStorageByUid(e,void 0),Lc.dropAll(e);else if(sa.softRemoveByUid(e).then((()=>{ +wi.emit("scriptEvent",{type:"removed",name:r.name,script:r,sync:!0})})),"off"==wn.values.trash_mode)return nl.doRemove(e,!0);return y.Pledge()},restore:e=>{const t=sa.getByUid(e);if(!t.script||!t.cond)return y.Breach("invalid script");const n=t.script;return n.deleted?sa.restoreByUid(e).then((()=>{wi.emit("scriptEvent",{type:"added",name:n.name,script:n,sync:!0})})):y.Pledge()},doModify:(e,t,n)=>{void 0===n&&(n=!0);const r=!!nn.getValue(I.PREFIX.META+e) +;return sa.setByUid(e,t).then((()=>n?Lc.loadResources(e,t.resources).then((()=>Lc.loadRequires(e,t.requires))).then((()=>{const n=[].concat(t.resources).concat(t.requires).map((e=>Vn(e.unsafe_url,e.abs_url))).filter((e=>e));return Lc.dropAllBut(e,n)})):y.Pledge())).always((()=>{r?wi.emit("scriptEvent",{type:"changed",name:t.name,script:t,sync:n}):wi.emit("scriptEvent",{type:"added",name:t.name,script:t,sync:n})}))},exportToJson:(e,t)=>{const n=y();let r=nl.determineScriptsToRun({deleted:!1}) +;e&&(r=r.filter((t=>e[t.uuid])));const{storage:s,externals:i,global_settings:o}=t||{},a={scripts:el(r,{options_page:!0,storage:s,externals:i})};return o&&(a.global_settings=nn.getValue(I.STORAGE.CONFIG,{})),n.resolve(a),n.promise()},importFromJson:e=>{if(!e||!Array.isArray(e.scripts))return y.Breach("invalid json");const t={},n=[],r=[],s=[],i={},o={};for(const a of e.scripts)try{const e=y(),c=a.uuid||Pe();if("new-user-script"==c)continue;a.storage&&(i[c]=a.storage) +;for(const e of["resources","requires"]){const t=a[e];t&&t.length&&(o[c]=o[c]||{},o[c][e]=t)}const l=a.file_url||a.update_url;Kc({uuid:a.uuid,name:a.name,src:a.source,force_settings:{enabled:a.enabled,position:a.position},force_options:a.options,force_meta:{lastModified:a.lastModified},replace:!0,url:l,ask:!1}).done((n=>{const i=Pe();t[i]=n,a.storage&&a.storage.data&&Object.keys(a.storage.data).length&&r.push(i),o[c]&&s.push(i),e.resolve()})).fail((t=>{v.warn("import: Error @ script",a.name,t), +e.resolve()})),n.push(e.promise())}catch(e){v.warn("import: Error while importing script",a.name,e)}const a=(()=>{const e=y();return y.when(n).always((()=>{e.resolve()})),e.promise()})().then((()=>Gi.import({scripts:t,storage_ids:r,externals_ids:s,global_settings:!!e.global_settings}))).then((({message:e,ok:n,aborted:r})=>{const s=y(),a=[],c=[];if(r)return y.Breach(Qr.getMessage("Aborted_by_user"));if(!e)return y.Breach("invalid response");if(n)for(let n,r=0;n=e.import_ids[r];r++)(()=>{const r=n +;if(t[r]){t[r].messages.warnings=[];const n=t[r].script.uuid,s=$c(t[r]).progress((()=>{if(!e.externals_ids.includes(r))return;const t=o[n];["resources","requires"].forEach((e=>{let r;t&&(r=t[e])&&r.length&&r.forEach((e=>{Lc.setElement(n,e.url,{content:e.content||"",meta:e.mimetype||"text/javascript"},e.modified)}))}))})).done((()=>{let t;e.storage_ids.includes(r)&&i[n]&&(t=sa.setStorageByUid(n,{data:i[n].data||{},ts:Date.now()}),c.push(t))}));a.push(s)}})();return y.when(a).always((()=>{ +nl.reorderScripts(),y.when(c).always((()=>{s.resolve(e)}))})),s.promise()}),(e=>e.error)).then((t=>{if(e.global_settings&&t.global_settings){const t=nn.setValue(I.STORAGE.CONFIG,e.global_settings).then((()=>(a.done((()=>{se(Xa.reset,1)})),y.Pledge({global_settings:!0}))));return nn.setTemporary(!0),t}return y.Pledge({})}));return a},installFromUrl:(e,t,n)=>{const r=y(),s={messages:{info:[],errors:[Qr.getMessage("Unable_to_load_script_from_url_0url0",e)],warnings:[],flags:{}}};t=t||{} +;const i=n||{},o=["url",e,JSON.stringify(t)].join("_");if(tl.is(o))return v.debug("scriptman: de-bounced installFromUrl",e),y.Breach(s);tl.add(o);const a=zn(e);return a&&a.protocol.match(/(https?|file):/)?("file:"!=a.protocol||Ft()||v.warn("scriptman: Access to local files is forbidden! Loading the following script for installation may fail:",e,"-> more info:","https://www.tampermonkey.net/faq.php#Q204"),qo(e).then((n=>{const s={url:e,ask:!0,replace:!0,...t} +;r.consume(nl.installFromSource(n,s,i))})).fail((e=>{let t;e?(t=s,"file:"!=a.protocol||Ft()||t.messages.warnings.unshift(Qr.getMessage("Tampermonkey_has_no_file_access_permission_")),t.heading=Qr.getMessage("You_are_about_to_install_a_UserScript_"),i.silent_fail?r.reject(t):Gi.installError(t).always((e=>{r.reject(e)}))):r.reject()})),r.promise()):(v.warn("scriptman: can't install from ",e),y.Breach(s))},installFromSource:(e,t,n)=>{const r=y();t=t||{};const s=n||{},i={src:e,ask:!0,replace:!0,...t +};return nl.doSave(i).done((e=>{r.resolve(!!e.installed)})).fail((e=>{e?(e.heading=Qr.getMessage("You_are_about_to_install_a_UserScript_"),s.silent_fail?r.reject(e):Gi.installError(e).always((()=>r.reject()))):r.reject()})),r.promise()},determineLastPosition:()=>{let e=0;return sa.getUidList().forEach((t=>{const n=sa.getByUid(t) +;n.script&&n.cond?n.script.position&&n.script.position!=Number.MAX_SAFE_INTEGER&&n.script.position>e&&(e=n.script.position):v.warn("scriptman: inconsistent script entry",t)})),e},getEvilness:e=>{let t=0;return e.fileURL&&(t=Uc.getEvilnessOf(e.fileURL))||e.downloadURL&&(t=Uc.getEvilnessOf(e.downloadURL))||e.updateURL&&(t=Uc.getEvilnessOf(e.updateURL))?(v.debug("scriptman: found blacklisted script",e),t):0},blackCheckAll:()=>{const e=sa.getUidList().map((e=>{ +const t=sa.getByUid(e),{script:n,cond:r}=t;if(!n||!r)return;const s=nl.getEvilness(n);return s!==n.evilness?(n.evilness=s,nl.doModify(e,n,!1)):void 0})).filter((e=>e));return y.when(e).then((()=>{}))},reorderScripts:(e,t)=>{const n=t||0;let r=nl.determineScriptsToRun();const s=r.reduce(((e,t)=>(e[t.uuid]=t.position,e)),{});if(e)for(let t=0;t(e.deleted?e.position=Number.MAX_SAFE_INTEGER:e.position=i++,s[e.uuid]!==e.position?nl.doModify(e.uuid,e,!1):y.Pledge())));return y.when(o).then((()=>{}))},getUrlCondition:e=>{const t=nn.getValue(I.PREFIX.COND+e,null);if(!t)return;const{match:n,inc:r,exc:s}=t;let i;switch(wn.values.script_include_mode){case"off":i={match:n,exc:s};break;case"match":i={match:(n||[]).concat((r||[]).filter((e=>"/"!==e[0]))),exc:s};break;case"unsafe":case"default":i={match:n,inc:r,exc:s}}return i}, +scriptWillRun:(e,t)=>{if(!t||!e)return;let n=$o.get(e);if(!n){const t=nl.getUrlCondition(e);if(!t)return;n=Xo(t,!0),$o.set(e,n)}return!!Jo(t,n,e)},determineScriptsToRun:e=>{const{enabled:t,warn:n,url:r,deleted:s}=e||{},i=[];return v.log("scriptman: determineScriptsToRun @"+r),sa.getUidList().forEach((e=>{let o=!0,a=0;const c=sa.getByUid(e);if(!(void 0!==t&&c.script&&c.script.enabled!==t||void 0!==s&&c.script&&!!c.script.deleted!==s)){if(r){const t=Date.now();o=!!nl.scriptWillRun(e,r), +a=Date.now()-t}if(c.script&&c.cond){if(n&&a>1e3&&(v.warn("scriptman: checking "+c.script.name+"'s ("+e+") includes and excludes took "+a+"ms!"),ci.all({domain:"status",key:"slowdown",class:"warning",text:Qr.getMessage("Script_0name0_is_slowing_down_some_page_loads_",Qr.getTranslation(c.script,"name")),timeout:3e5})),!o)return;v.verbose("scriptman: determineScriptsToRun: found script ",c),i.push(c.script)}else v.warn("scriptman: inconsistent script entry",e,c)}})),Jc(i)}, +isContexter:e=>!!e.options&&("context-menu"===e.options.run_at||null===e.options.run_at&&"context-menu"===e.options.override.orig_run_at),determineOrigin:e=>{const t=e.fileURL||e.downloadURL||e.updateURL;return t?ms(t):void 0},clean:e=>{const t=Date.now();sa.getUidList().forEach((n=>{const r=sa.getByUid(n);if(r.script&&r.cond){if(!r.script.deleted)return;{const e="on"===wn.values.trash_mode,s=Math.floor((r.script.deleted+wn.values.trash_cleanup_after-t)/1e3) +;if(e&&s>=0)return void v.log(`scriptman: script entry in trash ${n} will be cleaned in ${s}s`,r);v.log(`scriptman: script entry in trash ${n} will be cleaned now`,r)}}else v.warn(`scriptman: inconsistent script entry ${n} will be cleaned now`,r);e||nl.doRemove(n,!0)}))}},rl=nl,sl=rl,il=[],ol={},al=Ns("closeableTabs"),cl=new rt(1);cl.acquire().then((async()=>{const e=await al.list();await h.all(e.map((({key:e})=>{return(t=+e,new Promise((e=>{try{mt.get(t,(t=>{const n=ft.lastError;return e(t),n +}))}catch(t){e(void 0),v.warn("getTab error",t)}}))).then((t=>{t?ol[+e]=!0:al.delete(e)}));var t})))})).always((()=>cl.release()));const ll=(xe?parseInt(xe.getItem("inactive_tab_done_timeout")||""):null)||1e3,ul=(e,...t)=>{_.late?bi.emit("active",e):se((()=>{ul(e,...t)}),100)},dl=(e,t,n)=>{if(!_.late)return void se((()=>{dl(e,t,n)}),100);const r=n.pendingUrl||n.url,s=Po({frameId:0},{topframe:!0}),{status:i,mutedInfo:o,audible:a}=t +;r?(("legacy"==wn.values.scriptUrlDetection||"manual"!=wn.values.scriptUrlDetection&&r.startsWith("file:"))&&Vo(r)&&sl.installFromUrl(r,{},{silent_fail:!0}),"loading"==i?bi.emit("loading",{tabId:e,sender:s,url:r,incognito:Fo(n)||!1,cookieStoreId:n.cookieStoreId}):"complete"==i&&bi.emit("complete",{tabId:e,sender:s,url:r})):v.warn("tu: no tab url set! ",n);const c={reason:"updated",status:i};o&&(c.muted=!!o.muted&&(o.extensionId?"extension":o.reason||"other")),"boolean"==typeof a&&(c.audible=a), +il.forEach((e=>{e(c,n)}))},Al=e=>{if(bi.emit("remove",{tabId:e}),ol[e])return cl.acquire().then((async()=>{delete ol[e],await al.delete(e.toString())})).always((()=>cl.release()));il.forEach((t=>{t({reason:"removed"},{id:e})}))},pl=(e,t)=>{Al(t),_h.setIcon(e),_h.setBadge(e),il.forEach((t=>{t({reason:"replaced"},{id:e})}))},hl=e=>{if(!_.late)return void se((()=>{hl(e)}),100);const{url:t,tabId:n}=e,r=Po(e);if(r&&(bi.emit("commited",{tabId:n,sender:r,url:t}),Lo(r)&&il.forEach((e=>{e({ +reason:"commited"},{url:t,id:n})})),n>=0)){const e=e=>{const t=y();return mt.get(e,(e=>{e?t.resolve(e):t.reject()})),t.promise()};e(n).then((e=>{vh(n,r,t,e)}))}},fl=e=>{const{tabId:t}=e,n=Po(e);n&&Lo(n)&&bi.emit("reset",{tabId:t,early:!0})},ml={init:()=>{mt.onUpdated.addListener(dl),mt.onRemoved.addListener(Al),mt.onReplaced.addListener(pl),mt.onActivated.addListener(ul),wt.supported&&(wt.onCommitted.addListener(hl),wt.onBeforeNavigate.addListener(fl,{url:[{schemes:["http","https"].concat([])}] +}))},openAndWatch:function(e,t){let n,r;const{filter:s,url:i,active:o,index:a,parent:c,openerTabId:l,windowId:u,incognito:d}=e,A=(e,i)=>{(void 0!==n&&i.id===n||s&&i.url&&s.exec(i.url))&&(["updated","commited"].includes(e.reason)?t(i):"removed"==e.reason&&(r&&(J(r),r=void 0),ml.removeListener(A),t()))},p={url:i,active:o,index:a,parent:c,openerTabId:l,windowId:u,incognito:d};return mt.create(p,(s=>{s?(n=s.id,!1===e.active&&(r=se((()=>{r=void 0,mt.update(s.id,{active:!0},(()=>null))}),ll)), +t(s)):v.warn("tab.create failed",e,s)})),ml.addListener(A),{cancel:()=>{ml.removeListener(A),void 0!==n&&mt.remove(n,(()=>{const e=ft.lastError;e?v.warn("tab.close",e.message):n=void 0}))}}},addListener:e=>{il.push(e)},removeListener:e=>{let t;il&&(t=il.indexOf(e))>-1&&il.splice(t,1)}},gl=ml;let vl=0,wl=[],bl=!1;const _l=(()=>{const e=e=>{const t=e.type,n=e.id,r=".meta.json",s=".user.js";let i,o;const a=e=>{let t;return y.Pledge().then((()=>{if(!o)return t=!0,c()})).then((()=>{ +if(o&&void 0===o[e]&&!t)return c()})).then((()=>o?(o[e]=o[e]||void 0,o[e]):(v.warn("si: unable to list remote list!"),y.Breach())))},c=e=>i.list(e).then((e=>{o={};const t={},n={};let i,a;const c=Date.now();return e.map((e=>{const{name:l,modified:u}=e;if(!o)return;o[l]=e;const d=new RegExp(r+"$"),A=new RegExp(s+"$");if(u>c)v.log("si: ignore future list item",c,e);else if((i=!!l.match(d))||(a=!!l.match(A))){let r;if(i){r=l.replace(d,"");const n=u,{precision:s}=e;t[r]={uuid:r,options:{},url:void 0, +precision:s,lastModified:n}}else a&&(r=l.replace(A,""),n[r]=!!e)}})),Object.keys(t).map((e=>{const r=t[e];return r&&(r.sourceAvailable=n[e]),r})).filter((e=>e))}));let l;const u={init:e=>{const o=l=Pe();return i=Ac[t]({...e,path:"sync"}),y.Pledge().then((()=>(i.changes.listen().progress((e=>{o===l&&((e,t)=>{if(t!=vl)return;const n=e.name;v.log("si: cloud file changed",n,e),(n.endsWith(r)||n.endsWith(s))&&wl.forEach((e=>{e(n)}))})(e,n)})),!0)))},disable:()=>{var e;return l=void 0, +(null===(e=null==i?void 0:i.changes)||void 0===e?void 0:e.stop())||y.Pledge()},list:c,setSource:(e,t)=>{const n=e+s;return a(n).then((e=>{let r;return y.Pledge(!1).then((()=>{if(e&&i.compare)return i.compare(e,t)})).then((s=>s?(v.log("si: remote source data matches, skip upload of",n),y.Pledge()):(r=new Blob([t],{type:"text/plain"}),o&&delete o[n],i.put(e||n,r))))}))},getSource:(e,t)=>{const n=e+s;return a(n).then((r=>r?y.Pledge(!1).then((()=>{if(t&&i.compare)return i.compare(r,t) +})).then((e=>e?(v.log("si: remote source data matches, skip download of",n),y.Pledge(t)):i.get(r).then((e=>nt(e,"utf-8"))).then((e=>e||(v.warn("si: remote source data is empty or broken, skip download of",n),y.Breach()))))):(v.warn("si: list cache does not contain this UUID",e),y.Breach())))},getMeta:e=>a(e+r).then((t=>t?i.get(t).then((e=>nt(e,"utf-8"))).then((n=>{let r;if(void 0!==n&&(r=(e=>{let t;try{t=JSON.parse(e)}catch(e){}if(t&&t.uuid)return t +;v.log("si: unable to parse extended info of "+void 0)})(n))&&(r.uuid=e)){let{options:n,url:s,precision:i,lastModified:o}=r;return o=t.modified||o||0,i=t.precision||i,n=n||{},{...r,uuid:e,url:s,options:n,precision:i,lastModified:o}}})):y.Breach())),setMeta:(e,t)=>{const n=new Blob([JSON.stringify(e)],{type:"text/plain"}),s=e.uuid+r;return a(s).then((e=>i.put(e||s,n,t)))},remove:e=>{const t=e.uuid+r;e.options.removed=Date.now();const n=new Blob([JSON.stringify(e)],{type:"text/plain"}) +;return i.put(t,n).then((()=>{const t=e.uuid+s;return a(t).then((e=>{if(e)return o&&delete o[t],i.delete(e)}))}))},reset:()=>i.list(!0).then((e=>e.filter((e=>{const t=new RegExp(r+"$"),n=new RegExp(s+"$");return e.name.match(t)||e.name.match(n)})))).then((e=>{const t=[];return e.forEach((e=>{t.push((()=>{const t=y();return i.delete(e).always((()=>{t.resolve()})),t.promise()})())})),y.when(t).always((()=>{o=void 0}))})).then((()=>{})),getRemoteUrl:function(e){ +if(i.getRemoteUrl)return i.getRemoteUrl(e.uuid+s)},getRemoteDomains:function(){if(i.getRemoteDomains)return i.getRemoteDomains()}};return u},t=e({type:"drive",id:ea.eGDRIVE}),n=e({type:"dropbox",id:ea.eDROPBOX}),r=e({type:"onedrive",id:ea.eONEDRIVE}),s=e({type:"webdav",id:ea.eWEBDAV}),i=e({type:"yandex",id:ea.eYANDEX}),o=(()=>{let e,t=!1;const n=(t,n)=>{vl==ea.eCHROMESYNC&&"sync"==n&&y.Pledge().then((()=>{const r=new RegExp(e+"$");t&&Object.keys(t).forEach((e=>{const s=t[e],o=s.newValue +;if(v.log('si: storage key "%s" in namespace "%s" changed. Old value was "%s", new value is "%s".',e,n,s.oldValue,s.newValue),-1!=e.search(r))for(let t=0;t{const t=y();let n=[];return e?s().done((r=>{n=r.filter((t=>t.item.uuid==e)),t.resolve(n)})).fail((e=>{t.reject(e)})):t.resolve(n),t.promise()},s=()=>kl((()=>{const t=y(),n=new RegExp(e+"$");return xt.sync.get(null,(e=>{const r=[];e&&Object.entries(e).forEach((([e,t])=>{ +if(-1==e.search(n))return;const s=i(t,e);s&&r.push({key:e,item:s})})),t.resolve(r)})),t.promise()})),i=(e,t)=>{let n;try{n=JSON.parse(e)}catch(e){}if(n&&(n.url||n.options))return n;v.log("si: unable to parse extended info of "+t)},o=e=>e.then((e=>{const t={};if((e=e.filter((e=>{if(!t[e.key])return t[e.key]=!0,!0}))).length>1){const t=y(),n=[],r=e.pop();return e.forEach((e=>{n.push(l(e.key))})),y.when(n).done((()=>{t.resolve(r)})),t.promise()}return y.Pledge(e[0])}));let a,c={};const l=e=>{ +const t=y();return xt.sync.remove(e,(()=>{const e=ft.lastError;e?t.reject(e):t.resolve()})),t.promise()},u=()=>{const e=y();return xt.sync.set(c,(()=>{const t=ft.lastError;t?e.reject(t):(c={},e.resolve())})),e.promise()},d=()=>y.Pledge().then((()=>s())).then((t=>{const n=new RegExp(e+"$"),r=[];return t.forEach((e=>{const t=e.key,s=e.item,o=t.replace(n,"");let a;if(a=c[t]?i(c[t],t):s,!a)return;const l=a.options||{};r.push({uuid:l.removed?o:a.uuid,lastModified:l.removed||a.lastModified,url:a.url, +options:l})})),y.Pledge(r)})),A={init:function(){let r=!0;if(!t)try{xt.onChanged.addListener(n),t=!0}catch(e){v.warn("si: error registering sync callback: "+e.message),r=!1}return e="@v2",y.Pledge(r)},disable:()=>y.Pledge(),list:d,setMeta:(t,n)=>{const s=y();return o(r(t.uuid)).done((r=>{let i;i=r?r.key:t.uuid+e;const{uuid:o,options:l,url:d}=t,A=(null==n?void 0:n.lastModified)||0,p={...(null==r?void 0:r.item)||{},url:d,options:l||{},uuid:o,lastModified:A};c[i]=JSON.stringify(p),a&&J(a), +a=se(u,3e3),s.resolve()})),s.promise()},getMeta:e=>d().then((t=>{let n;return t.some((t=>{if(t.uuid==e)return n=t,!0})),n})),remove:t=>{const n=y();return o(r(t.uuid)).done((r=>{let s;s=r?r.key:t.uuid+e;const{url:i,options:o,uuid:l,lastModified:d}=t,A={...(null==r?void 0:r.item)||{},url:i,options:o||{},uuid:l,lastModified:d};A.options.removed=Date.now(),c[s]=JSON.stringify(A),a&&(J(a),a=void 0),a=se(u,3e3),n.resolve()})),n.promise()},reset:()=>kl((()=>{const e=y();return xt.sync.clear((()=>{ +c={},e.resolve()})),e.promise()}))};return A})();return{[ea.eCHROMESYNC]:xt.sync.supported?o:void 0,[ea.eGDRIVE]:t,[ea.eDROPBOX]:n,[ea.eONEDRIVE]:r,[ea.eWEBDAV]:s,[ea.eYANDEX]:i}})();let yl;const kl=(e,t)=>{const n=y();let r=void 0!==t?t:3;const s=()=>{if(bl)se(s,500);else{bl=!0;try{e().always((()=>{bl=!1})).done((e=>n.resolve(e))).fail((()=>{--r>0?(v.log("si: some retries left, wait for 60000 ms"),se(s,6e4)):(v.warn("si: no retries left, skipping this sync request!"), +n.reject("no retries left"))}))}catch(e){v.warn(e),bl=!1,n.reject(("string"==typeof e?e:e.message)||"internal error")}}};return s(),n.promise()},Rl={init:(e,t)=>(wl=[],vl=e,yl=_l[e],(null==yl?void 0:yl.init(t))||y.Breach()),disable:e=>{const t=_l[e];return t&&t.disable()||y.Breach()},addChangeListener:e=>{wl.push(e)},getRemoteUrl:e=>{if(yl&&yl.getRemoteUrl)return yl.getRemoteUrl(e)},getRemoteDomains:()=>{if(yl&&yl.getRemoteDomains)return yl.getRemoteDomains()},caps:(()=>{const e={} +;return Object.defineProperties(e,{specialMeta:{get:function(){return yl&&!!yl.getMeta},enumerable:!0},syncsSource:{get:function(){return yl&&!!yl.getSource},enumerable:!0}}),e})(),types:ea,list:()=>(null==yl?void 0:yl.list())||y.Pledge([]),setMeta:(e,t)=>(null==yl?void 0:yl.setMeta(e,t))||y.Pledge(),getMeta:e=>(null==yl?void 0:yl.getMeta(e))||y.Pledge(),setSource:(e,t)=>(null==yl?void 0:yl.setSource)?yl.setSource(e,t):y.Pledge(), +getSource:(e,t)=>(null==yl?void 0:yl.getSource)?yl.getSource(e,t):y.Pledge(),reset:()=>(null==yl?void 0:yl.reset())||y.Pledge(),remove:e=>(null==yl?void 0:yl.remove(e))||y.Pledge()},xl=e=>{const{uuid:t,name:n,downloadURL:r,fileURL:s,lastModified:i,options:o}=e,a=r?r.split("#")[0]:void 0,c=s?s.split("#")[0]:void 0,l=[c,a].filter((e=>{const t=e?zn(e):void 0;if(!t||"file:"!==t.protocol)return e}))[0],{comment:u,user_modified:d}=o;return{uuid:t,name:n,options:{comment:u||void 0, +user_modified:d||void 0},durl:a,furl:c,url:l,lastModified:i||e.lastUpdated}},El=Rl.getRemoteDomains,Sl=Rl.getRemoteUrl,Cl="PageFilter",Ml=[];let Il;const Ul={init:async()=>{{Il=Ns("pageFilter");const e=await Il.get("forbiddenDomains");e&&e.length>0&&Ul.forbid(e)}const e=()=>{$o.remove(Cl)};wn.addChangeListener("forbiddenPages",e),wn.addChangeListener("page_whitelist",e),wn.addChangeListener("page_filter_mode",e)},isAllowed:e=>{const t=Ul.conditions;return!t||Jo(e,t)},get conditions(){ +let e=$o.get(Cl);if(!e){let t=!1,n=!1;const r=wn.values.forbiddenPages.concat((El()||[]).map((e=>`*://${e}/*`))).concat(Ml.map((e=>`*://${e}/*`))),s=r.length>0,i=wn.values.page_whitelist.length>0;switch(wn.values.page_filter_mode){case"black":n=s;break;case"off":break;case"white":t=i;break;default:t=i,n=s}e=Xo({inc:t?wn.values.page_whitelist:void 0,exc:n?r:void 0}),$o.set(Cl,e)}return e.rinc||e.rexc?e:void 0},forbid(e){for(const t of e)Ml.includes(t)||Ml.push(t) +;Il&&e.length>0&&Il.set("forbiddenDomains",Ml)}},Gl=Ul,Zl=z({timeout:600,check_interval:300,retimeout_on_get:!0});let Tl,Bl,Ol,jl,Dl,Fl;const Ll=e=>{const t=(e=>`${Tl}/api?`+Xn(Object.assign({l:Ol,q:e},rn(jl))))(e),n=Zl.get(t);if(n)return n;const r=y(),s=r.promise(),i=e=>{r.reject({error:e})};if(Fl&&Fl>Date.now())return i("rate limit or backoff"),s;if(!e.startsWith("http"))return i("unsupported url"),s;Fl=void 0;let o=1;const a=Dl({url:t,headers:{Accept:"application/json, */*"},fetch:!0, +responseType:"json"},{onload:e=>{if(200==e.status){const{count:t,url:n}=e.response,s=`${Tl}${n}`;o=1,r.resolve({count:Number(t||0),url:s})}else if(429===e.status){const t=go(e.responseHeaders),n=Number(t["retry-after"]||15);o=1,n&&(Fl=Date.now()+1e3*n,i("rate limit"))}else o=Math.min(2*o,300),Fl=Date.now()+1e3*o,i(e.responseText||"unknown error")},onerror:e=>{i(e.responseText||e.statusText)},onabort:()=>{i("aborted")},ontimeout:()=>{i("timed out")}},{internal:!0}) +;return s.abort=()=>null==a?void 0:a.abort(),Zl.set(t,s),s},Pl=e=>((e,t)=>{let n,r="",s="";return"click"==jl?(r="?"+Xn(Object.assign({l:Ol},rn(jl))),s="#"+Xn(Object.assign({q:t})),n=`${e}/`+r+s):(r="?"+Xn(Object.assign({l:Ol,q:t},rn(jl))),n=`${e}/search?`+r+s),n})(Bl,e),Nl=()=>{const e="?"+Xn(Object.assign({l:Ol},rn(jl)));return`${Tl}/privacy?`+e},Vl={mkCompat:(e,t,n,r)=>(t&&((t.options.compat_wrappedjsobject||r)&&(e=Vl.unWrappedJsObjectify(e)), +(t.options.compat_metadata||r)&&(e=Vl.unMetaDataify(e)),(t.options.compat_foreach||r)&&(e=Vl.unEachify(e))),n||(e=e.replace(/(['"])use strict(['"])/g,"$1use strict$2")),e),findPrototypes:e=>{if(e.includes(".toSource("))return!0;const t=["indexOf","lastIndexOf","filter","forEach","every","map","some","slice"];for(const n in t)if(e.includes(`Array.${t[n]}(`))return!0;return!1},unEachify:e=>{const t=(e=e.replace(/for each[ \t]*\(/gi,"for each(")).split("for each");for(let e=1;e{let t=e,n=e;const r="<>" +;let i=t.indexOf(r);for(;-1!=i;){const e=t.substr(0,i),o=e.lastIndexOf("\n");let a="";-1!=o&&(a=e.substr(o,e.length-o)),t=t.substr(i,t.length-i);const c=a.indexOf("/*"),l=a.indexOf("//");if(-1==c&&-1==l){const e=Me(t,r,s);let i=e;i=i.replace(/\\/g,"\\\\"),i=i.replace(/"/g,'\\"').replace(/\n/g,'\\n" + \n"'),i=i.replace(/^\n/g,"").replace(/\n$/g,""),i=i.replace(/\r/g,"");const o=r+e+s;n=n.replace(o,'(new CDATA("'+i+'"))')}t=t.substr(1,t.length-1),i=t.indexOf(r)}return n},unWrappedJsObjectify:e=>{ +const t=e.split("\n");for(let e=0;e{const[n,r]=t;return r.forEach((t=>e[t]=[...e[t]||Hl,n])),e}),{}),Wl=Object.keys({GM:!0,unsafeWindow:!0,...Ql +}).filter((e=>!e.includes("."))),Xl=new RegExp("[a-z0-9A-Z_$]\\s*(\\.\\s*|\\[\\s*[\"'`])("+Wl.join("\\b|")+"\\b)([\"'`]\\s*\\])?(\\s*)(?!=[^=])(\\S|$)"),Yl=2<<16,Jl=e=>(e.length>Yl?e.split("\n"):[e]).some((e=>!!Xl.test(e.length>Yl?e.substr(Yl):e))),Kl=e=>!!e&&void 0!==e.script,$l={},eu={bundle:e=>{let t,n=$l[e.uuid],r=!0;if(n)return n;let{includes:s,matches:i,requires:o,resources:a,excludes:c,connects:l,textContent:u,...d}=e;const A=JSON.parse(JSON.stringify(e.options));let p,h +;return A.run_at=A.run_at||e.options.override.orig_run_at||"document-idle",A.run_in=A.run_in||e.options.override.orig_run_in,d.options=A,n=Lc.getResources(d.uuid,e.resources).then((t=>(r&&!t.sync&&(v.log("ri: uncached @external detected -> fast script start disabled"),r=t.sync),p=t.elements,Lc.getRequires(d.uuid,e.requires)))).then((e=>{r&&!e.sync&&(v.log("ri: uncached @external detected -> fast script start disabled"),r=e.sync),h=e.elements;const t={resources:p,requires:h,...d} +;return null===A.compat_powerful_this&&(A.compat_powerful_this=Jl(u)||h.some((e=>Jl(e.textContent)))),((e,t,n)=>{const r=y(),s=[];n.forEach((t=>{let n=t.textContent||"";n=zl.mkCompat(n,e.options.compatopts_for_requires?e:void 0,"off"!=wn.values.runtime_strict_mode),s.push({textContent:n})}));const i=sa.getStorageByUid(e.uuid);let o=zl.mkCompat(t,e,"off"!=wn.values.runtime_strict_mode);if(wn.values.debug){const e=o.split("\n");let t,n=!1;for(let r=0;r{t=!0,delete $l[d.uuid]})),t||($l[d.uuid]=n),n}},tu=eu;let nu;const ru=()=>nu,su=new Ve,iu={};su.on("added",(e=>{iu[e.id]=e})),su.on("removed",(e=>{delete iu[e.id]}));let ou,au,cu=0;const lu={ts:0},uu={},du=V({threads:1}),Au={},pu={comment:!0,user_modified:!0},hu=!!ae.Tests,fu=(e,t)=>du.add((async()=>{if(!ou.caps.syncsSource){let t;if(!e.url||!(t=zn(e.url))||!t.protocol.match(/https?:/))return v.log("sync: skip export due to missing URL",e.name,e.url),!1} +v.log("sync: export",e.name,e.url),wi.emit("syncProgressEvent",{type:"export",text:Qr.getMessage("Export_script_0name0_0uuid0",e.name,e.uuid)});try{return ou.setSource&&t&&(wi.emit("syncProgressEvent",{type:"export",text:Qr.getMessage("Export_script_source_of_0name0",e.name,e.uuid)}),await ou.setSource(e.uuid,t)),wi.emit("syncProgressEvent",{type:"export",text:Qr.getMessage("Export_script_meta_data_of_0name0",e.name,e.uuid)}),await ou.setMeta(e,{lastModified:e.lastModified}),!0}catch(e){return!1 +}})),mu=()=>{const e=sa.getUidList().map((e=>{const t=sa.getByUid(e);if(t.script&&t.cond&&!t.script.deleted){const e=xl(t.script);return e.lastModified||hu?t.script.evilness&&t.script.evilness>=Math.min(Uc.SEVERITY_MAX,wn.values.script_blacklist_severity)?void v.warn("sync: ignore evil script",t.script):e:void v.warn("sync: script without updated/modified timestamps found",t.script)}})).filter((e=>e));return e},gu=(e,t,n)=>n?Math.floor(e/n)*n{ +au&&(v.verbose("sync: remoteChangeCb()"),bu(500,!0))},wu=()=>{const e=y();let t=!1;return y.Pledge().then((()=>{if(wn.values.sync_type){if(wn.values.sync_enabled){let e={};return wn.values.sync_type==ea.eWEBDAV&&(e={url:wn.values.cloud_url||void 0,basic_auth:We(wn.values.cloud_user+":"+wn.values.cloud_pass)}),ou.init(wn.values.sync_type,e).done((e=>{t=e,e?ou.addChangeListener(vu):v.warn("sync: init failed!")})).fail((()=>{v.warn("sync: init failed!")}))}return ou.disable(wn.values.sync_type)} +})).always((()=>{au=t,e.resolve(au)})),e.promise()},bu=(e,t)=>{const n=Date.now();e=e||500,t=lu.force||t,lu.to?(J(lu.to),lu.ts{(e=>{let t=[],n=[],r=0,s=0,i=!0,o=!1;const a=e=>{if(e)for(let t=0;t{if(void 0===au&&e)return yu() +})).then((()=>au?cu>0?(e&&wi.once("syncFinished",(t=>{t&&bu(50,e)})),y.Breach()):(cu++,o=!0,v.verbose("sync: start syncing = "+cu),void ci.all({domain:"status",key:"sync_status",class:"information",title:Qr.getMessage("Script_Sync"),text:Qr.getMessage("Sync_is_running"),timeout:9e5})):y.Breach())).then((()=>(t=mu(),(wi.emit("syncProgressEvent",{type:"lookup",text:Qr.getMessage("Lookup_remote_script_list")}),ou.list()).done((e=>{n=e})).fail((()=>{v.warn("sync: unable to get remotelist!") +}))))).then((()=>{const e=n.map((e=>{let n;const s=(e=>{if(e)for(let n=0;ny.Pledge().then((()=>ou.caps.specialMeta?(wi.emit("syncProgressEvent",{type:"lookup", +text:Qr.getMessage("Lookup_remote_script_0uuid0",e.uuid)}),ou.getMeta(e.uuid)):y.Pledge(e))).then((e=>{if(!e)return;const{uuid:t,url:a}=e;if(s){if(e.options.removed)r++,wi.emit("syncProgressEvent",{type:"import",text:Qr.getMessage("Remove_local_script_0name0_0uuid0",s.name,s.uuid)}),v.log(`sync: remove local script ${t}`,a),sl.doRemove(s.uuid);else if(i)return c=o,l=e.lastModified, +((u=e.precision)?Math.floor(c/u)*u!=Math.floor(l/u)*u:c!=l)&&(e.lastModified&&v.warn("sync: list and meta data lastModified differ, this will cause extra traffic!","file ts:",new Date(o),"meta ts:",new Date(e.lastModified),e),e.lastModified=o),r++,v.log(`sync: update local script ${t}`,a),wi.emit("syncProgressEvent",{type:"import",text:Qr.getMessage("Update_local_script_0name0_0uuid0",s.name,s.uuid)}),y.Pledge().then((()=>{if(ou.caps.syncsSource&&ou.getSource){const n=y() +;return ou.getSource(t,void 0).then((e=>e?sl.doSave({uuid:t,src:e,ask:!1,internal:!0,save:!0}):y.Breach())).fail((()=>{v.warn(`sync: getting source of ${t} failed`,e)})).always((()=>n.resolve())),n.promise()}})).then((()=>{const{script:n}=sa.getByUid(s.uuid);if(!n)return v.warn(`sync: getting entry ${t} failed`,e),y.Breach();for(const[t,r]of Object.entries(pu))!0===r&&(n.options[t]=e.options[t]||null);return n.lastModified=e.lastModified,sl.doModify(n.uuid,n,!1)})) +}else if(s||e.options.removed)!n&&e.options.removed&&(Au[t]=e);else{const n=y();if(!(a&&uu[a]||t&&uu[t]))return(e=>du.add((()=>{const{uuid:t,url:n,lastModified:r}=e;wi.emit("syncProgressEvent",{type:"import",text:Qr.getMessage("Import_remote_script_0uuid0",e.uuid)}),v.log("sync: import",t,n);const s={imported:wn.values.sync_type},i={};for(const[t,n]of Object.entries(pu))!0===n&&(i[t]=e.options[t]);const o={uuid:t,ask:!1,internal:!0,sync:s,force_meta:{lastModified:r,fileURL:n||void 0}, +force_options:i},a={silent_fail:!0};return(ou.caps.syncsSource&&ou.getSource?ou.getSource(t).then((e=>e?sl.installFromSource(e,o,a):(v.warn("sync: import export due to missing source",t,n),y.Breach())),(()=>{v.warn("sync: import export due to missing source",t,n)})):n?sl.installFromUrl(n,o,a):(v.log("sync: skip import due to missing URL and source",t),y.Breach())).done((()=>{Ko.removeAll()}))})))(e).done((n=>{n?r++:(v.warn("sync: unable to import",e),a&&(uu[a]=!0),uu[t]=!0)})).fail((()=>{ +v.warn("sync: unable to load",e),a&&(uu[a]=!0),uu[t]=!0})).always((()=>n.resolve())),n.promise();v.warn("sync: skip previously failed import",e)}var c,l,u}))})).filter((e=>e));return y.onebyone(e)})).then((()=>(r&&(sl.reorderScripts(),ci.all({domain:"status",key:"sync",class:"information",title:Qr.getMessage("Script_Sync"),text:Qr.getMessage("0count0_changes_imported",r),timeout:1e4})),t=mu(),y.Pledge()))).then((()=>{const e=[];for(let n=0;n{const e=t[n];let r,i +;if(!ou.caps.syncsSource&&!e.url)return y.Pledge();const o=a(e.uuid);var c,l,u;if(o?o.lastModified&&(c=e.lastModified,l=o.lastModified,!((u=o.precision)?Math.floor(c/u)*u>Math.floor(l/u)*u:c>l))||(r=!0,v.log("sync: exportable change detected!",e.name,"remote ts:",new Date(o.lastModified),"local ts:",new Date(e.lastModified),e)):v.log("sync: export because remotely missing!",e.name,"local ts:",new Date(e.lastModified),e),!o||r||ou.caps.syncsSource&&!o.sourceAvailable){if(ou.caps.syncsSource){ +const t=sa.getByUid(e.uuid);t.script&&t.cond&&(i=t.script.textContent)}return fu(e,i).then((e=>{e&&s++}))}return y.Pledge()})());return y.when(e)})).then((()=>{i=!0})).fail((()=>{i=!1})).always((()=>{if(v.log("sync: finished"),o&&0==--cu){let e=Qr.getMessage(i?"Sync_finished":"Sync_failed");if(ci.all({domain:"status",key:"sync_status",class:"information",title:Qr.getMessage("Script_Sync"),text:e,timeout:15e3}),s){const t=Qr.getMessage("0count0_changes_exported",s);ci.all({domain:"status", +key:"sync",class:"information",title:Qr.getMessage("Script_Sync"),text:t,timeout:5e3}),e=`${e}\n${t}`}wi.emit("syncProgressEvent",{type:"finished",success:i,text:e}),wi.emit("syncFinished",i)}}))})(lu.force),lu.to=lu.force=void 0}),e)};let _u=!0;const yu=()=>y.Pledge().then((()=>{if(_u)return _u=!1,wu()}));let ku;const Ru={get enabled(){return au},SYNCED:pu,init:async()=>{wc.on("sync",(()=>{yu().always((()=>{au&&Ru.sync()}))})),wc.schedule("sync",{delayInMinutes:1,periodInMinutes:10, +keepExistent:!0}),ou=(e=>(((e,t,n)=>{rc=e=>{let t=y();const n=gl.openAndWatch({url:e.url,filter:e.filter?new RegExp(e.filter):void 0,active:!1},(e=>{e?t&&t.notify(e):t&&(t.resolve(),t=void 0)}));return{promise:t.promise(),close:function(){n.cancel()}}},pc=n,oc=e=>an("cloud",e,mc)})(0,0,e),Rl))(ht.manifest.version),wn.addChangeListener(["sync_enabled","sync_type","cloud_url","cloud_user","cloud_pass"],((e,t,n)=>{"sync_type"==e&&t&&t!==n&&ou.disable(t),ku||(ku=se((()=>{ku=void 0,wu()}),3e3))})), +wi.on("scriptEvent",(({type:e,name:t,script:n,sync:r})=>{if(!au||!r)return;v.verbose(`sync: script ${e} event for ${t} (sync: ${r})`);const s=xl(n);switch(e){case"added":fu(s,n.textContent);break;case"changed":wc.schedule("sync",{periodInMinutes:10,delayInMinutes:1});break;case"removed":(e=>{du.add((()=>(wi.emit("syncProgressEvent",{type:"export",text:Qr.getMessage("Remove_remote_script_0name0_0uuid0",e.name,e.uuid)}),v.log("sync: remove",e.name,e.url),ou.remove(e))))})(s)}}))},sync:bu, +reset:()=>y.Pledge().then((()=>{if(void 0===au)return yu()})).then((()=>au?ou.reset():y.Breach()))};ae.sycl=Ru;const xu=Ru,Eu=new Ve,Su={},Cu=(e,{name:t,title:n,accessKey:r,uuid:s})=>$e(`${e}-${s}-${t}-${n}-${r}`),Mu=e=>{let t;const{uuid:n,...r}=e,s=sa.getByUid(n);return t=s.script&&s.cond?Qr.getTranslation(s.script,"name"):Qr.getMessage("This_script_was_deleted"),{uuid:n,scriptName:t,...r}},Iu=e=>{const t=Object.values(Su).sort(((e,t)=>e.createdAt-t.createdAt)),n={};for(const r of t){ +const{tabId:t,groupId:s}=r;n[s]||void 0!==e&&t!==e||(n[s]=Mu(r))}return Object.values(n)},Uu=e=>{var t;const{tabId:n,name:r,title:s,uuid:i,accessKey:o,autoClose:a,menuId:c,exec:l}=e,u=(null===(t=Su[c])||void 0===t?void 0:t.createdAt)||Date.now();Su[c]={tabId:n,createdAt:u,name:r,title:s,uuid:i,accessKey:o,autoClose:a,menuId:c,groupId:Cu(n,e),exec:l}},Gu=async(e,t)=>{let{frameId:n,url:r,tab:s}=t;const i=sa.getByUid(e);if(!i||!i.script)return void console.log("ctxm: unable to find script "+e) +;if(!s)return void console.log("ctxm: no tab found",t);const o=i.script;if(o.deleted)return;const a=await tu.bundle(o),c=y(),l={};let u;void 0!==n?n=l.frameId=n:r?r=Qn(r):u=!0;const d={method:"executeScript",url:r,frameId:n,topframe:u,info:Up({contexters:[],runners:[a]},r,s)};return mt.sendMessage(s.id,d,l,c.resolve),c.promise()},Zu=e=>Iu(e),Tu=(e,t,n)=>{const r=Object.values(Su).filter((t=>t.groupId==e));for(const s of r)s.exec?(Gu(s.uuid,t),delete Su[s.menuId],Eu.emit("run",{menuId:s.menuId, +target:t})):n?Eu.emit("run",{menuId:s.menuId,event:n,target:t}):console.warn(`mc: invalid event arg for ${e}`);r.length||console.warn(`mc: unable to find menu command group ${e}`)},Bu="root",Ou=["http://*/*","https://*/*","file://*/*"];let ju,Du,Fu,Lu={},Pu={};const Nu=(e,t)=>{const n=e.id;if(Lu[n]){const t=e;delete t.id,qu.update(n,t)}else qu.create(e);Pu[n]=!0,se(t,1)},Vu=()=>{const e=y();return qu.removeAll((()=>{ju=void 0,Lu={},e.resolve()})),e.promise()},zu=(e,t)=>y.Pledge().then((()=>{ +const n=y();return Nu({id:e,parentId:Bu,contexts:["all"],title:`🛠️ ${t}`,type:"normal",documentUrlPatterns:Ou},(()=>n.resolve())),n.promise()}));let qu;const Hu=e=>{if(!_.late)return _.registerLateCallback((()=>{Hu(e)})),!0;let{groupId:t,frameId:n,tab:r,url:s}=e;Tu(t,{url:s,tab:r,frameId:n},{keyCode:void 0,button:0,shiftKey:!1,metaKey:!1,altKey:!1,ctrlKey:!1})},Qu=({commands:e})=>{if(Du){Fu&&Fu.deferred.reject();const t=y();return Fu={commands:e,deferred:t},t.promise()}if(!e.length)return Vu() +;const t=Object.keys(Lu);return Pu={},Du=y.Pledge().then((()=>ju||(()=>{const e=y();return Vu().then((()=>{const t=ju=qu.create({id:Bu,contexts:["all"],title:"Tampermonkey",type:"normal",documentUrlPatterns:Ou},(()=>{e.resolve(t)}))})),e.promise()})())).then((async()=>{if(e.length)for(const t of e)t.exec||await zu(t.uuid,t.scriptName)})).then((()=>(e=>{const t=[];for(const n of e){const e=y();if(n.exec){if(!wn.values.context_menu_scripts)continue;Nu({id:n.groupId,contexts:["all"],parentId:Bu, +title:`▶ ${n.scriptName}`,type:"normal",documentUrlPatterns:Ou},(()=>e.resolve()))}else{if(!wn.values.context_menu_commands)continue;let t;try{const e=new RegExp("^"+Ue(n.scriptName)+"[ -:+/]*");t=n.name.replace(e,"")}catch(e){v.warn(e)}const r={id:n.groupId,contexts:["all"],parentId:n.uuid,title:`🔧 ${t||n.name}`,type:"normal",documentUrlPatterns:Ou};Nu(r,(()=>e.resolve()))}t.push(e.promise())}return y.when(t).then((()=>{}))})(e))).always((()=>{const e=Fe(Object.keys(Pu),t,"notinfirst") +;e.length&&Wu(e),Lu=Pu;const n=Fu;Du=Fu=void 0,n&&Qu(n).then(n.deferred.resolve)})),Du},Wu=e=>{if(!qu)return y.Pledge();const t=y();return e.forEach((e=>{qu.remove(e,(()=>{const e=ft.lastError;e&&v.warn(e.message),t.resolve()}))})),t.promise()},Xu={init:()=>!0===Gt.supported?(qu=Gt,qu.onClicked.addListener(((e,t)=>{v.debug(e,t),t&&e.menuItemId&&e.parentMenuItemId&&Hu&&Hu({groupId:e.menuItemId,tab:t,frameId:e.frameId||0,url:e.frameUrl||e.pageUrl})})),Eu.on("run",(e=>{const t=e.target.tab.id +;Xu.update(t)})),bi.on("active",(({tabId:e,windowId:t})=>{wn.values.context_menu_enabled&&mt.getSelected(t,(t=>{t&&t.id==e&&t.url&&Xu.update(e)}))})),bi.on("complete",(({tabId:e})=>{wn.values.context_menu_enabled&&mt.getSelected(null,(t=>{t&&t.id==e&&Xu.update(e)}))})),Vu()):y.Pledge(),clear:()=>Qu({commands:[]}),update:e=>{if(!qu)return y.Pledge();let t=[];return wn.values.context_menu_commands&&(t=Zu(e)),Qu({commands:t})}},Yu=Xu,Ju=an("scripts","update");ki.on("triggered",(async e=>{ +const t=(await Ju.get(e))[e];t?sl.doSave({url:t.url,uuid:e,replace:!e,src:t.code,ask:!wn.values.notification_silentScriptUpdate}).done((t=>{if(Ju.delete(e),ki.emit("result",e,t&&t.installed||!1),t&&t.disable_update){const t=sa.getByUid(e,!0).script;t&&(t.options.check_for_updates=!1,sl.doModify(e,t,!1))}})):v.warn(`Triggered update for script ${e} not found!`)})),ki.on("rejected",(e=>{Ju.delete(e)})),wi.on("scriptEvent",(({type:e,script:t})=>{"removed"===e&&Ju.delete(t.uuid)})) +;const Ku=async()=>Object.keys(await Ju.get()),$u=e=>ed(!0,e),ed=(e,t)=>{let n,r;return y.Pledge().then((()=>{const e=()=>{r=void 0;const e=Qr.getMessage("Script_Update"),t=Qr.getMessage("Waiting_for_sync_to_finish")+"...";r=ti(e,t,Rs("tampermonkey"),{timeout:6e4})};if(xu.enabled){const r=y();return wi.once("syncFinished",(()=>r.resolve())),xu.sync(50,!1),t||(n=se(e,500)),r.promise()}})).then((()=>{const s=y();n&&(J(n),n=void 0),r&&r.cancel(),((e,t)=>{let n,r=0,s=0 +;const i=Qr.getMessage("Script_Update"),o=Qr.getMessage("Check_for_userscripts_updates")+"...";!e&&t&&ti(i,o,Rs("tampermonkey"),{timeout:1e4}),ci.all({domain:"status",key:"script_update",class:"information",text:o,timeout:1e4});const a=(e?[e]:sa.getUidList()).map((i=>{let o,a;return Ju.get(i).then((n=>{const c=n[i];if(c&&Date.now()-c.ts=Math.min(Uc.SEVERITY_MAX,wn.values.script_blacklist_severity))return y.Breach();let p,h +;return(p=sl.determineOrigin(o))&&(h=fs[p.token])&&!h.updates(a)?y.Breach():(r++,v.info("update: check for script updates @",i),y.Pledge())})).then((()=>{const e=sl.determineMetaURL(o);if(!e)return y.Pledge(void 0);if("none"==e)return v.debug("update: ignore non-updatable script",o.name),y.Breach();const t=y(),n={method:"GET",retries:Z.RETRIES,timeout:6e4,revalidate:!0,headers:{Accept:"text/x-userscript-meta, */*"},url:e};return Uo.internal(n,{ondone:n=>{let r;var s +;4==n.readyState&&200==n.status&&n.responseText?(s=n.responseText,r=as(s)):v.warn("update: unable to find meta data @ "+e+" req.status = "+n.status),t.resolve(r)}}),t.promise()})).then((e=>e&&e.version&&o.version&&ls(e.version,o.version)!=ls.eNEWER?(v.verbose("update: version of script "+o.name+" has NOT changed."),y.Breach()):(v.verbose("update: version of script "+o.name+" has changed or doesn't exist -> running version check!"),y.Pledge()))).then((()=>{let e;if(a&&(e=zn(a))){ +if(e.protocol.match(/(https?|file):/))return qo(a).fail((()=>{v.warn("update: failed",o.name,a)}));v.warn("update: can't download URL",o.name,a)}else v.warn("update: can't parse URL",o.name,a)})).then((e=>{if(e&&((e,t)=>{const n=us(t);if(!n||!n.name||void 0===n.version)return ls.eERROR;let r;if(r=sa.getMetaByUid(e)){if(r.system)return;return n.version==r.version?ls.eEQUAL:ls(n.version,r.version)}return ls.eNEWER})(o.uuid,e)==ls.eNEWER){s++;const t={uuid:i,name:Qr.getTranslation(o,"name"),url:a, +code:e,ts:Date.now()};return y.Pledge(t)}return y.Breach()})).then((async t=>{let r;if(Ju.set({[i]:t}),ki.emit("scheduled",i),wn.values.scriptUpdateAutomaticInstall)e&&(r=h.race([new h((t=>ki.once("result",((e,r)=>{n=r?1:0,t(r)}),e))),new h((e=>se((()=>e(!1)),6e4)))])),se((()=>ki.emit("triggered",i)),1);else{ +const e=Qr.getMessage("There_is_an_update_for_0name0_avaiable_",t.name)+"\n"+Qr.getMessage("Click_here_to_install_it_"),n=Qr.getMessage("Just_another_service_provided_by_your_friendly_script_updater_")+":";ti(n,e,Rs("tampermonkey"),{timeout:wn.values.scriptUpdateHideNotificationAfter},(e=>{!0===e.clicked?ki.emit("triggered",i):!1===e.clicked&&ki.emit("rejected",i)}))}r&&await r}))}));return r&&ci.all({domain:"status",key:"script_update",class:"information",title:i,text:o,timeout:1e4}), +y.sidebyside(a).then((()=>(a.length&&0==s&&(v.debug("No update found"),!e&&t&&ti("Narf!",Qr.getMessage("No_update_found__sry_"),Rs("tampermonkey"),{timeout:1e4}),ci.all({domain:"status",key:"script_update",class:"information",text:Qr.getMessage("No_update_found__sry_"),timeout:1e4})),{found:s,installed:n})))})(t,e).done((e=>{s.resolve(e)})).fail((()=>{s.resolve({found:0,installed:void 0})}));const i=gc();return i.scripts=Date.now(),vc(i),s.promise()}))},td=()=>{wc.on("suc",(()=>{ +if(wn.values.scriptUpdateCheckPeriod<=0)return;const e=gc();Date.now()-e.scripts{const e=y();return Bt(15,(t=>{"active"==t?e.reject():(()=>{let t;gt.supported?gt.getAll({},(n=>{n.forEach((e=>{"fullscreen"===e.state&&(t=!0)})),t?e.reject():e.resolve()})):e.resolve()})()})),e.promise()})).done((()=>{ed()}))})),wc.schedule("suc",{periodInMinutes:60,keepExistent:!0}),Ku().then((e=>{for(const t of e){ +const{script:e,cond:n}=sa.getByUid(t);e&&n||(v.warn(`update: script ${t} not found! Removing update...`),Ju.delete(t))}}))};ae.trup={check:$u,init:td};const nd={},rd=(e,t)=>{const n=nd[e]=nd[e]||{};return n[t]=n[t]||{}},sd=e=>{const t={};for(const n of Object.keys(nd).map(Number))t[n]=nd[n][e];return t},id=12096e5,od=["contributed","later","hide"];let ad;const cd={init:()=>{let e;ad=nn.getValue(I.STORAGE.BEGGING);const t=Date.now() +;ad?(e=parseInt(nn.getValue(I.STORAGE.LAST_START,"0")))&&t-e>id&&(ad.later={type:"after_pause",ts:t},cd.save()):(ad={first_run:{type:"from_init",ts:t}},cd.save())},save:()=>{ad&&nn.setValue(I.STORAGE.BEGGING,ad)},needed:()=>{const e=Date.now(),t=!ad.first_run||ad.first_run.ts+id{Tr("clicked",e,t+n)},dialog:{shown:e=>{const t=Date.now();ad.dialog={ts:t,extra:e},cd.save(), +Tr("dialog")}},button:(()=>{const e={};for(const t of od)e[t]=(e,n)=>{const r=Date.now();ad[t]={ts:r,type:e,extra:n},cd.save(),Tr("button",t)};return e})()},ld=cd,ud={create:(e,t)=>{const n=e||"",r=t||{},s=e=>y.onebyone(e).fail((()=>{v.warn("tree: wait failed!")})).then((e=>e.filter((e=>e)).reduce(((e,t)=>e.concat(t)),[]))),i=(e,t)=>{const n=e.replace(/\.$/,"").split(".");let s=c;for(;n.length;){const i=n.shift();if(void 0===i)throw Error("invalid path segment");const o=s[i] +;if(!o)return v.warn("tree: unable to find",e,r),()=>y.Pledge([]);if("function"==typeof o)return()=>o(r,!t);s=o,n.length||n.unshift("root")}return v.warn("tree: unable to find",e,r),()=>y.Pledge([])},o={root:e=>{const t=y();return mt.getSelected(null,(n=>{n&&n.id>=0?r.tab=n:e&&e.tabId&&(r.tab={id:e.tabId,index:-1,url:"",windowId:-1});const o=s([i("actions.general"),i("actions.scripts"),i("actions.commands"),i("actions.tags")]);t.consume(o)})),t.promise()},general:async()=>{ +const e=r.tab,t=e?e.url:null,n=t&&t.length>4&&""==t.substr(0,4).replace(/file|http/,"")?t:"",s=[],i={name:"enabled",id:"enabled",sub_menu_item:!0,pos:"top",items:[],tabId:null==e?void 0:e.id};let o;i.items.push({name:Qr.getMessage("Enabled"),display:wn.values.enabled?void 0:"greyed",title:wn.values.enabled?Qr.getMessage("Enabled"):Qr.getMessage("Disabled"),id:"enabled",button:!0,reload:!0,enabler:!0}),s.push(i),!t||!Vo(t,!0)||(o=Vo(t))&&"manual"!=wn.values.scriptUrlDetection||i.items.push({ +name:Qr.getMessage(o?"Install_this_script":"Try_to_install_as_script"),image:"script_download",id:"installFromUrl",data:{url:t},button:!0,reload:!0});const a={name:"about",id:"about",sub_menu_item:!0,pos:"bottom",items:[]};a.items.push({name:Qr.getMessage("Dashboard"),image:"utilities",url:ht.getURL("options.html")+"#"+["url="+We(n),"nav=dashboard"].join("&"),url_alt:(null==e?void 0:e.url)?ht.getURL("options.html")+"#"+["filter="+ee(e.url),"url="+We(n),"nav=dashboard"].join("&"):void 0,newtab:!0 +});const c="version="+ht.manifest.version+"&ext="+ft.short_id,l=[{name:" "+Qr.getMessage("Help"),url:"https://www.tampermonkey.net/faq.php?"+c,newtab:!0},{name:" "+Qr.getMessage("Changelog"),url:"https://www.tampermonkey.net/changelog.php?"+c,newtab:!0},{social:!0,newtab:!0}];return null===await Sc(_c)&&l.push({button:!0,id:"reset_persistent_hint",image:"mobile",reload:!0,data:{key:_c},title:Qr.getMessage("Tampermonkey_is_available_on_mobile_platforms")}),a.items.push({image:"about",id:"about", +urls:l}),s.push(a),s},scripts:{root:async e=>{const t=r.tab,n=t?t.url:null,s=[],i=n?zn(n):null,o=i&&["http:","https:","file:"].includes(i.protocol)?Qn(i):"",a={name:"scripts",id:"scripts",sub_menu_item:!0,pos:"center",items:[]},c={},l={},u={},d={},A={},p=i?T.INTERNAL_PAGE_PROTOCOLS.includes(i.protocol):null,h=await Ku();let f,m;if(t){const e=ch(t,r.sender);Object.keys(e).forEach((t=>{const n=e[t];d[t]=n,A[t]="z"+n.name.toLowerCase()+n.position}));const n=ah(t);Object.keys(n).forEach((e=>{ +const t=n[e];c[e]=t.urls,l[e]=t.count,u[e]=t.all_time;let r=d[e];if(!r){const t=sa.getByUid(e);t.script&&t.cond&&!t.script.deleted?d[e]=r=t.script:d[e]=r={...As(),uuid:e,name:Qr.getMessage("This_script_was_deleted"),enabled:!0,deleted:Date.now(),textContent:"",resources:[],requires:[]}}A[e]="a"+r.name.toLowerCase()+r.position})),f=Ah(t.id)} +m="position"==wn.values.action_menu_scripts_sort?(e,t)=>e.position-t.position:"name"==wn.values.action_menu_scripts_sort?(e,t)=>e.name.toLowerCase()t.name.toLowerCase()?1:0:"enabled"==wn.values.action_menu_scripts_sort?(e,t)=>1e4*(e.enabled?0:1)+e.position-(1e4*(t.enabled?0:1)+t.position):(e,t)=>A[e.uuid].localeCompare(A[t.uuid]);const g=Object.values(d).sort(m);let v=el(g,{active_urls:c,active_counts:l,all_time_active_counts:u});const w=t?(e=>{ +const t={},n=null==e||null==e?Iu():Zu(e);for(const e of n){const{name:n,title:r,uuid:s,accessKey:i,autoClose:o,groupId:a,exec:c}=e,l={name:n,title:r,uuid:s,id:a,accessKey:i,autoClose:!1!==o,image:c?"ctx_exec":"menu_cmd",menucmd:!0};(t[e.uuid]=t[e.uuid]||[]).push(l)}return t})(t.id):{};let b;if(wn.values.action_menu_scripts_hide_disabled&&(v=v.filter((e=>e.enabled||l[e.uuid]))),v.forEach((e=>{const t=w[e.uuid];t&&(e.menu_cmds=t),e.updatable=h.includes(e.uuid)})), +!wn.values.action_menu_scripts_hide_disabled&&Math.min(wn.values.action_menu_columns,(e?e.available_columns:null)||99)>2?(b={name:"scripts_right",id:"scripts_right",sub_menu_item:!0,pos:"right",items:[]},v.forEach((e=>{e.enabled||l[e.uuid]?a.items.push(e):b.items.push(e)})),s.push(a),b.items.length&&s.push(b)):(b=a,a.items=a.items.concat(v),s.push(a)),wn.values.enabled){const e=!!v.length,t=!f&&n&&!Gl.isAllowed(n);p?e||a.items.push({name:Qr.getMessage("Tampermonkey_has_no_access_to_this_page"), +image:"no_script",class:"disabled"}):(t&&a.items.unshift({name:Qr.getMessage("Partially_restricted_by_settings"),image:"critical",class:"disabled",title:Qr.getMessage("Some_URLs_are_restricted_by_a_setting_")}),e||f||t?e||a.items.push({name:Qr.getMessage("No_script_is_running"),image:"no_script",class:"disabled"}):a.items.push({name:Qr.getMessage("Tampermonkey_has_no_access_to_this_page"),image:"no_script",class:"disabled"}))}const _=Qr.getLocale();if(wn.values.enabled){let e;v.length?(e={ +name:"scripts_new",id:"scripts_new",sub_menu_item:!0,pos:"center",items:[]},s.push(e)):e=a;const t=!!wn.values.userscript_search_url,n=wn.values.userscript_search_mode;t&&o&&"click"==n?e.items.push({name:Qr.getMessage("Search_for_userscripts_for_this_tab"),image:"script_search",data:{url:o},id:"script_search",button:!0}):t&&o&&["action_menu","badge"].includes(n)?e.items.push({name:Qr.getMessage("Searching_for_userscripts_for_this_tab"),image:"script_search",data:{url:o},id:"script_search", +class:"disabled",partial:!0,referrer:"actions.script_search"}):e.items.push({name:Qr.getMessage("Get_new_scripts___"),image:"script_search",url:"https://www.tampermonkey.net/scripts.php"+(_?"?locale="+_:""),newtab:!0}),e.items.push({name:Qr.getMessage("Add_new_script___"),image:"script_add",url:ht.getURL("options.html")+"#nav=new-user-script"+(p?"":"&url="+We(o)),newtab:!0})}return y.Pledge(s)}},script_search:{root:async e=>{let t;const n=null==e?void 0:e.url;let r,s;return t=n?await Ll(n):{ +count:0},t.error||!t.url?(r=Qr.getMessage("Search_for_userscripts_for_this_tab"),s={url:n}):(r=t.count?Qr.getMessage("Found_0count0_available_scripts",t.count):Qr.getMessage("No_available_scripts"),s={result_url:t.url}),[{name:r,data:s,button:!0,image:"script_search",id:"script_search"}]}},commands:()=>{const e=[],t={name:"commands",id:"commands",sub_menu_item:!0,pos:"left",items:[]},n={name:Qr.getMessage("Utilities"),id:"commands",sub_menu_item:!0,more_menu:!0,pos:"left",items:[]} +;if(n.items.push({name:Qr.getMessage("Check_for_userscripts_updates"),id:"run_script_updates",button:!0,image:"update"}),wn.values.configMode>=80&&n.items.push({name:Qr.getMessage("Report_a_bug"),image:"bug",url:"https://www.tampermonkey.net/bug",newtab:!0}),wn.values.configMode>=50){let e,t,s,i;["black","black+white"].includes(wn.values.page_filter_mode)&&(e=r.tab)&&(t=e.url)&&(s=zn(t))&&!T.INTERNAL_PAGE_PROTOCOLS.includes(s.protocol)&&(i=s.hostname)&&Gl.isAllowed(t)&&n.items.push({ +name:Qr.getMessage("Blacklist_0domain0",i),image:"no",button:!0,id:"blacklist_page",data:{domain:i}})}return t.items.push({name:Qr.getMessage("Please_consider_a_contribution"),image:"contrib",button:!0,id:"contrib"}),t.items.push(n),e.push(t),y.Pledge(e)},tags:()=>{const e=r.tab;if(!e||!wn.values.tags_enabled)return y.Pledge([]);const t={},n={},s=ch(e,r.sender);Object.keys(s).forEach((e=>{n[e]=!0}));const i=ah(e);Object.keys(i).forEach((e=>{n[e]=!0}));const o=wn.values.tags +;for(const e of Object.keys(n)){const n=sa.getByUid(e);if(n.script&&n.cond&&!n.script.deleted)for(const e of n.script.options.tags)o[e]&&(t[e]||(t[e]=[]),t[e].push(n.script.enabled))}const a=Object.keys(t).sort(((e,n)=>t[e].length-t[n].length));if(!a.length)return y.Pledge([]);const c={name:Qr.getMessage("Tags"),id:"tags",sub_menu_item:!0,more_menu:!0,pos:"left",items:[]};for(const e of a){const n=t[e].length,r={id:"tag_"+e,tag:e,data:{x:t[e].filter((e=>e)).length,of:n}};c.items.push(r)} +return y.Pledge([c])}},a={root:()=>s([i("options.general"),i("options.scripts"),i("options.settings"),i("options.trash")]),general:function(){return y.Pledge([])},scripts:{root:(e,t)=>{const n=y(),r={name:Qr.getMessage("Installed_userscripts"),main_menu_item:!0,id:"dashboard",items:[]};return((null==e?void 0:e.complete)||!t?s(["options.scripts.userscripts","options.scripts.new"].map((e=>i(e)))):(r.referrer="options.scripts",r.partial=!0,s([i("options.scripts.new")]))).done((e=>{r.items=e, +n.resolve([r])})).fail(n.reject),n.promise()},new:()=>{const e=[];return e.push({id:"new-script",name:Qr.getMessage("New_userscript"),image:"script_add",title:Qr.getMessage("Add_new_script___"),icon:ks("unknown"),nnew:!0,uuid:"new-user-script",position:-1,positionof:1e3,enabled:!0,userscript:!0}),y.Pledge(e)},userscripts:{root:async(e,t)=>{const n=(null==e?void 0:e.complete)||!t?void 0:"options.scripts.userscripts",r=sl.determineScriptsToRun({deleted:!1}),s=el(r,{options_page:!0,referrer:n +}),i=s.length,o=Qr.getLocale(),a=await Ku();return s.forEach((e=>{"uuid"in e&&(e.updatable=a.includes(e.uuid))})),s.push({id:"no-script-installed",name:Qr.getMessage("No_script_is_installed"),image:"info",class:"disabled",visible:!i}),s.push({id:"get-some-scripts",name:Qr.getMessage("Get_some_scripts___"),image:"edit_add",url:"https://www.tampermonkey.net/scripts.php"+(o?"?locale="+o:""),newtab:!0,visible:!i}),s},matches:e=>{const{filter:t,uuid:n}=e||{};let r;if(!t||!t.code)return y.Pledge([]) +;const s=/\/(.*)\/(.*)/.exec(t.code);if(!s)return y.Pledge([]);const i=new RegExp(s[1],s[2]);if(n){const e=sa.getByUid(n);e.script&&e.cond&&(r=[e.script])}else r=sl.determineScriptsToRun({deleted:!1});if(r){const e=r.map((e=>-1!=e.textContent.search(i)?e.uuid:null)).filter((e=>e));return y.Pledge(e)}return y.Pledge([])},source:e=>{if(!(null==e?void 0:e.uuid))return y.Pledge([]);const t=sa.getByUid(e.uuid);if(t.script&&t.cond){let e +;return e=wn.values.showFixedSrc?zl.mkCompat(t.script.textContent,t.script,"off"!=wn.values.runtime_strict_mode):t.script.textContent,y.Pledge([e])}return v.warn("tree: unable to process ",t),y.Breach()},storage:e=>{if(!(null==e?void 0:e.uuid))return y.Pledge([]);const t=sa.getStorageByUid(e.uuid);return y.Pledge([t?t.data:{}])},external:e=>{const{uuid:t,url:n}=e||{};if(!t)return y.Pledge([]);const r=sa.getByUid(t);if(r.script&&r.cond){let e +;return[...r.script.requires,...r.script.resources].some((r=>{const s=r.url||Vn(r.unsafe_url,r.abs_url);if(!s||s!=n)return;const i=Lc.getElement(t,s);return i&&i.data&&i.data.content?(e=i.data.content,!0):void 0})),y.Pledge([e])}return v.warn("tree: unable to process ",r),y.Breach()}}},trash:(()=>{const e=()=>"off"===wn.values.trash_mode?[]:sl.determineScriptsToRun({deleted:!0});return{root:(t,n)=>{const r=y(),o=Qr.getMessage("Trash_bin"),a={name:o,image:"trash",title:o,main_menu_item:!0, +hidden:!e().length,id:"trash",items:[]};return(()=>{if((null==t?void 0:t.complete)||!n){const e=s(["options.trash.userscripts"].map((e=>i(e))));return e}return a.referrer="options.trash",a.partial=!0,y.Pledge([])})().done((e=>{a.items=e,r.resolve([a])})).fail((()=>r.reject())),r.promise()},userscripts:{root:(t,n)=>{const r=(null==t?void 0:t.complete)||!n?void 0:"options.trash.userscripts",s=el(e(),{options_page:!0,referrer:r});return y.Pledge(s)}}}})(),settings:(e,t)=>{const n=y(),r={ +name:Qr.getMessage("Settings"),main_menu_item:!0,id:"settings",selected_default:!0,items:[]};return((null==e?void 0:e.complete)||!t?(async()=>{const e=ae.Tests,t={id:"general",name:Qr.getMessage("General"),sub_menu_item:!0,items:[]};t.items.push({name:Qr.getMessage("Config_Mode"),id:"configMode",level:0,option:!0,select:[{name:Qr.getMessage("Novice"),value:0},{name:Qr.getMessage("Beginner"),value:50},{name:Qr.getMessage("Advanced"),value:100}],value:wn.values.configMode, +desc:Qr.getMessage("Changes_the_number_of_visible_config_options")}),t.items.push({name:Qr.getMessage("Language"),id:"i18n",level:0,option:!0,reload:!0,warning:Qr.getMessage("A_reload_is_required"),select:[{name:"Browser Default",value:null},...Qr.supported],value:wn.values.i18n,validation:{image:"info",opacity:.9,msg:Qr.getMessage("Your_language_is_not_supported__Click_here_to_get_intructions_how_to_translate_TM_"),url:"https://www.tampermonkey.net/faq.php#Q500"}}),t.items.push({ +name:Qr.getMessage("Auto_reload_on_script_enabled"),level:20,id:"autoReload",option:!0,checkbox:!0,enabled:wn.values.autoReload,desc:Qr.getMessage("Auto_reload_on_script_enabled_desc")}),t.items.push({name:Qr.getMessage("Anonymous_statistics"),level:0,id:"statistics_enabled",option:!0,checkbox:!0,enabled:!!wn.values.statistics_enabled,validation:{image:"info",opacity:.9,msg:Qr.getMessage("Allow_Tampermonkey_to_collect_anonymous_statistics"), +url:"https://www.tampermonkey.net/privacy.php#extension"}}),t.items.push({name:Qr.getMessage("Debug_scripts"),level:100,id:"debug",option:!0,checkbox:!0,enabled:wn.values.debug,desc:""}),t.items.push({name:Qr.getMessage("Show_fixed_source"),level:100,id:"showFixedSrc",option:!0,checkbox:!0,enabled:wn.values.showFixedSrc,desc:""}),(["heif"].includes(B.short_id)||wn.values.background_control)&&t.items.push({name:"Allow userscripts to control the background context",id:"background_control", +level:wn.values.background_control?0:50,option:!0,checkbox:!0,enabled:wn.values.background_control,validation:{image:"critical",msg:"Don't use this option unless you know what you are doing!"}}),t.items.push({name:Qr.getMessage("LogLevel"),id:"logLevel",level:0,option:!0,select:[{name:Qr.getMessage("Debug"),value:80},{name:Qr.getMessage("Info"),value:60},{name:Qr.getMessage("Warning"),value:30},{name:Qr.getMessage("Error"),value:0}],value:wn.values.logLevel,desc:""}),t.items.push({ +name:Qr.getMessage("Trash_Mode"),id:"trash_mode",level:50,option:!0,select:[{name:Qr.getMessage("Enabled"),value:"on"},{name:Qr.getMessage("Disabled"),value:"off"},{name:Qr.getMessage("Clean_after_session"),value:"session"}],value:wn.values.trash_mode, +desc:Qr.getMessage("Controls_how_deleted_scripts_are_handled__0enabled0_moves_scripts_to_a_virtual_trash__0disabled0_permanently_deletes_scripts__0cleanAfterSession0_automatically_deletes_all_on_session_end_",Qr.getMessage("Enabled"),Qr.getMessage("Disabled"),Qr.getMessage("Clean_after_session"))});const n={id:"script_sync",name:Qr.getMessage("Script_Sync"),sub_menu_item:!0,level:50,need_save:!0,items:[]};n.items.push({name:Qr.getMessage("Enable_Script_Sync"),id:"sync_enabled",enabler:!0, +level:50,option:!0,checkbox:!0,enabled:wn.values.sync_enabled,desc:Qr.getMessage("Synchronize_your_scripts_across_browsers_and_operation_systems")});const r=(()=>{const e=[],t={reset_sync:!0,cloud_url:!1,cloud_user:!1,cloud_pass:!1};return xt.sync.supported&&e.push({name:Qr.getMessage("Browser_Sync"),value:ea.eCHROMESYNC,enable:t}),e.push({name:Qr.getMessage("Google_Drive"),value:ea.eGDRIVE,enable:t}),e.push({name:Qr.getMessage("Dropbox"),value:ea.eDROPBOX,enable:t}),e.push({ +name:Qr.getMessage("OneDrive"),value:ea.eONEDRIVE,enable:t}),e.push({name:Qr.getMessage("Yandex_Disk"),value:ea.eYANDEX,enable:t}),e.push({name:Qr.getMessage("WebDAV"),value:ea.eWEBDAV,enable:{reset_sync:!0,cloud_url:!0,cloud_user:!0,cloud_pass:!0}}),e})();n.items.push({name:Qr.getMessage("Sync_Type"),id:"sync_type",enabler:!0,level:50,option:!0,select:r,value:wn.values.sync_type}),n.items.push({name:Qr.getMessage("URL"),id:"cloud_url",enabledBy:"sync_type",level:50,option:!0,text:!0,width:2, +value:wn.values.cloud_url}),n.items.push({name:Qr.getMessage("Login"),id:"cloud_user",enabledBy:"sync_type",level:50,option:!0,text:!0,width:2,value:wn.values.cloud_user}),n.items.push({name:Qr.getMessage("Password"),id:"cloud_pass",enabledBy:"sync_type",level:50,option:!0,text:!0,password:!0,width:2,value:wn.values.cloud_pass}),n.items.push({name:Qr.getMessage("Sync_Now"),id:"run_sync",enabledBy:"sync_enabled",needsSave:!0,level:50,button:!0}),n.items.push({name:Qr.getMessage("Sync_Reset"), +id:"reset_sync",enabledBy:"sync_enabled",needsSave:!0,level:80,button:!0,reload:!0,warning:Qr.getMessage("This_will_remove_all_remote_data_from_sync_Ok_")}),n.items.push({name:Qr.getMessage("Recent_Sync_Log"),status:!0,event:"syncProgressEvent",id:"sync_status"});const s={id:"appearance",name:Qr.getMessage("Appearance"),sub_menu_item:!0,need_save:!0,items:[],warning:Qr.getMessage("A_reload_is_required"),reload:!0};s.items.push({name:Qr.getMessage("Layout"),id:"layout",level:0,option:!0, +select:vs.map((e=>{const{name:t,theme:n,layout:r}=e;return{name:t,value:n?[r,n].join("#"):r}})),value:wn.values.layout,desc:""}),s.items.push({name:Qr.getMessage("Custom_CSS"),id:"layout_user_css",level:100,option:!0,input:!0,value:wn.values.layout_user_css,desc:Qr.getMessage("You_can_add_your_custom_CSS_rules_here_")}),s.items.push({name:Qr.getMessage("Update_Notification"),id:"notification_showUpdate",level:50,option:!0,select:[{name:Qr.getMessage("Disabled"),value:"off"},{ +name:Qr.getMessage("Show_notification"),value:"notification"},{name:Qr.getMessage("Open_changelog"),value:"changelog"}],value:wn.values.notification_showUpdate,validation:"off"==wn.values.notification_showUpdate?{image:"critical",msg:Qr.getMessage("Are_you_sure_that_you_don_t_want_to_be_notified_of_updates_")}:void 0}),s.items.push({name:Qr.getMessage("Favicon_Service"),id:"favicon_service",level:50,option:!0,select:[{name:Qr.getMessage("Google"),value:"google"},{ +name:Qr.getMessage("DuckDuckGo"),value:"duckduckgo"},{name:Qr.getMessage("Native"),value:"native",warning:Qr.getMessage("Warning_unsafe_site_warnings_might_appear_")}],value:wn.values.favicon_service});const i={id:"tags",name:Qr.getMessage("Tags"),sub_menu_item:!0,level:0,items:[],reload:!0};i.items.push({name:Qr.getMessage("Enable_Tags"),id:"tags_enabled",level:0,option:!0,checkbox:!0,enabled:wn.values.tags_enabled,desc:""}),wn.values.tags_enabled&&i.items.push({ +name:Qr.getMessage("System_Tags"),id:"tags",level:0,option:!0,input:!0,tags:!0,value:wn.values.tags,desc:""});const o={id:"action_menu",name:Qr.getMessage("Action_Menu"),sub_menu_item:!0,need_save:!0,items:[],level:50};o.items.push({name:Qr.getMessage("Hide_disabled_scripts"),id:"action_menu_scripts_hide_disabled",level:100,option:!0,checkbox:!0,enabled:wn.values.action_menu_scripts_hide_disabled,desc:""}),o.items.push({name:Qr.getMessage("Columns"),id:"action_menu_columns",level:50,option:!0, +select:[{name:Qr.getMessage("1"),value:1},{name:Qr.getMessage("2"),value:2},{name:Qr.getMessage("3"),value:3}],value:wn.values.action_menu_columns}),o.items.push({name:Qr.getMessage("Script_order"),id:"action_menu_scripts_sort",level:50,option:!0,select:[{name:Qr.getMessage("Auto"),value:"auto"},{name:Qr.getMessage("Position_"),value:"position"},{name:Qr.getMessage("Name"),value:"name"},{name:Qr.getMessage("Enabled"),value:"enabled"}],value:wn.values.action_menu_scripts_sort}),o.items.push({ +name:Qr.getMessage("Icon_badge_info"),id:"appearance_badges",level:50,option:!0,select:[{name:Qr.getMessage("Disabled"),value:"off"},{name:Qr.getMessage("No_text"),value:"active"},{name:Qr.getMessage("Alltime_running_instances"),value:"alltime"},{name:Qr.getMessage("Running_scripts"),value:"running"},{name:Qr.getMessage("Unique_running_scripts"),value:"running_unique"}],value:wn.values.appearance_badges}),o.items.push({name:Qr.getMessage("Icon_badge_color"),id:"appearance_badge_color",option:!0, +level:100,color:!0,value:wn.values.appearance_badge_color});const a={id:"context_menu",name:Qr.getMessage("Context_Menu"),sub_menu_item:!0,items:[],level:50};let c;a.items.push({name:Qr.getMessage("Enable_context_menu"),id:"context_menu_enabled",level:50,option:!0,checkbox:!0,enabled:wn.values.context_menu_enabled,desc:""}),a.items.push({name:Qr.getMessage("Scripts_activated_by_context_menu"),id:"context_menu_scripts",level:50,option:!0,checkbox:!0,enabled:wn.values.context_menu_scripts,desc:"" +}),a.items.push({name:Qr.getMessage("Script_menu_commands"),id:"context_menu_commands",level:50,option:!0,checkbox:!0,enabled:wn.values.context_menu_commands,desc:""}),wn.values.userscript_search_url&&(c={id:"userscript_search",name:Qr.getMessage("Userscript_Search"),sub_menu_item:!0,level:0,items:[],reload:!0},c.items.push({name:Qr.getMessage("Userscript_search_integration_mode"),id:"userscript_search_mode",level:0,option:!0,select:[{name:Qr.getMessage("Disabled"),value:"off"},{ +name:Qr.getMessage("On_Click"),value:"click"},{name:Qr.getMessage("On_Action_Menu"),value:"action_menu"},{name:Qr.getMessage("Add_to_icon_badge_text"),value:"badge"}],value:wn.values.userscript_search_mode,validation:{image:"info",opacity:.9, +msg:Qr.getMessage("In_order_to_search_for_userscripts__0on_action_menu0__and__0icon_badge_number0__automatically_transfer_the_tab_s_url_to_the_search_website__0on_click0_opens_the_search_page_on_click_Please_click_at_this_icon_to_open_the_privacy_policy_",Qr.getMessage("Add_to_icon_badge_text"),Qr.getMessage("On_Action_Menu"),Qr.getMessage("On_Click")),url:Nl()}}));const l={id:"editor",name:Qr.getMessage("Editor"),sub_menu_item:!0,level:20,need_save:!0,items:[], +warning:Qr.getMessage("A_reload_is_required"),reload:!0};l.items.push({name:Qr.getMessage("Enable_Editor"),id:"editor_enabled",level:100,option:!0,checkbox:!0,enabled:wn.values.editor_enabled,desc:""}),l.items.push({name:Qr.getMessage("Theme"),id:"editor_theme",level:50,option:!0,select:Object.keys(ws).map((e=>({name:ws[e]||e,value:e}))),value:wn.values.editor_theme}),l.items.push({name:Qr.getMessage("Font_Size"),id:"editor_fontSize",level:50,option:!0,select:[{name:"50%",value:50},{name:"70%", +value:70},{name:"80%",value:80},{name:"90%",value:90},{name:"100%",value:100},{name:"110%",value:110},{name:"120%",value:120},{name:"150%",value:150}],value:wn.values.editor_fontSize}),l.items.push({name:Qr.getMessage("Key_Mapping"),id:"editor_keyMap",level:50,option:!0,select:[{name:Qr.getMessage("Windows"),value:"windows"},{name:Qr.getMessage("VSCode"),value:"vscode"},{name:Qr.getMessage("Sublime"),value:"sublime"},{name:Qr.getMessage("Emacs"),value:"emacs"},{name:Qr.getMessage("Vim"), +value:"vim"}],value:wn.values.editor_keyMap}),l.items.push({name:Qr.getMessage("Indentation_Width"),id:"editor_indentUnit",level:50,option:!0,select:[{name:Qr.getMessage("1"),value:1},{name:Qr.getMessage("2"),value:2},{name:Qr.getMessage("3"),value:3},{name:Qr.getMessage("4"),value:4},{name:Qr.getMessage("5"),value:5},{name:Qr.getMessage("6"),value:6},{name:Qr.getMessage("7"),value:7},{name:Qr.getMessage("8"),value:8},{name:Qr.getMessage("9"),value:9},{name:Qr.getMessage("10"),value:10},{ +name:Qr.getMessage("11"),value:11}],value:wn.values.editor_indentUnit,desc:""}),l.items.push({name:Qr.getMessage("Tab_Size"),id:"editor_tabSize",level:50,option:!0,select:[{name:Qr.getMessage("1"),value:1},{name:Qr.getMessage("2"),value:2},{name:Qr.getMessage("3"),value:3},{name:Qr.getMessage("4"),value:4},{name:Qr.getMessage("5"),value:5},{name:Qr.getMessage("6"),value:6},{name:Qr.getMessage("7"),value:7},{name:Qr.getMessage("8"),value:8},{name:Qr.getMessage("9"),value:9},{ +name:Qr.getMessage("10"),value:10},{name:Qr.getMessage("11"),value:11}],value:wn.values.editor_tabSize,desc:""}),l.items.push({name:Qr.getMessage("Indent_with"),id:"editor_indentWithTabs",level:50,option:!0,select:[{name:Qr.getMessage("Tabs"),value:"tabs"},{name:Qr.getMessage("Spaces"),value:"spaces"}],value:wn.values.editor_indentWithTabs,desc:""}),l.items.push({name:Qr.getMessage("TabMode"),id:"editor_tabMode",level:50,option:!0,select:[{name:Qr.getMessage("Classic"),value:"classic"},{ +name:Qr.getMessage("Smart"),value:"smart"},{name:Qr.getMessage("Indent"),value:"indent"}],value:wn.values.editor_tabMode,desc:""}),l.items.push({name:Qr.getMessage("Highlight_selection_matches"),id:"editor_highlightSelectionMatches",level:50,option:!0,select:[{name:Qr.getMessage("Cursor"),value:"cursor"},{name:Qr.getMessage("On"),value:"on"},{name:Qr.getMessage("Off"),value:"off"}],value:wn.values.editor_highlightSelectionMatches,desc:""}),l.items.push({name:Qr.getMessage("Line_break"), +id:"editor_lineWrapping",level:50,option:!0,checkbox:!0,enabled:wn.values.editor_lineWrapping,desc:""}),l.items.push({name:Qr.getMessage("Reindent_on_typing"),id:"editor_electricChars",level:50,option:!0,checkbox:!0,enabled:wn.values.editor_electricChars,desc:""}),l.items.push({name:Qr.getMessage("Enable_autoSave"),id:"editor_autoSave",level:20,option:!0,checkbox:!0,enabled:wn.values.editor_autoSave,desc:""}),l.items.push({name:Qr.getMessage("Enable_easySave"),id:"editor_easySave",level:20, +option:!0,checkbox:!0,enabled:wn.values.editor_easySave,desc:""}),l.items.push({name:Qr.getMessage("Highlight_trailing_whitespace"),id:"editor_highlightTrailingWhitespace",level:50,option:!0,checkbox:!0,enabled:wn.values.editor_highlightTrailingWhitespace,desc:""}),l.items.push({name:Qr.getMessage("Trim_trailing_whitespace_from_modified_lines"),id:"editor_trimTrailingSpacesFromModifiedLines",level:50,option:!0,checkbox:!0,enabled:wn.values.editor_trimTrailingSpacesFromModifiedLines,desc:""}), +l.items.push({name:Qr.getMessage("Auto_syntax_check_on_typing"),id:"editor_autoLint",level:50,option:!0,checkbox:!0,enabled:wn.values.editor_autoLint,desc:Qr.getMessage("Enable_this_option_to_automatically_check_the_code_on_typing_")}),l.items.push({name:Qr.getMessage("Auto_syntax_check_max_length"),id:"editor_autoLintMaxLen",level:50,option:!0,text:!0,value:wn.values.editor_autoLintMaxLen,desc:Qr.getMessage("Check_only_scripts_up_to_this_size_automatically_")}),l.items.push({ +name:Qr.getMessage("Custom_Linter_Config"),id:"editor_linter_config",level:100,option:!0,input:!0,json:!0,value:wn.values.editor_linter_config,validation:{image:"info",opacity:.9,msg:Qr.getMessage("You_can_add_your_custom_linter_config_here_"),url:"https://eslint.org/docs/user-guide/configuring"}});const u={id:"script_update",name:Qr.getMessage("Script_Update"),sub_menu_item:!0,level:0,items:[]};u.items.push({name:Qr.getMessage("Check_interval"),id:"scriptUpdateCheckPeriod",level:0,option:!0, +select:[{name:Qr.getMessage("Never"),value:0},{name:Qr.getMessage("Every_6_Hours"),value:216e5},{name:Qr.getMessage("Every_12_Hour"),value:432e5},{name:Qr.getMessage("Every_Day"),value:864e5},{name:Qr.getMessage("Every_Week"),value:6048e5}],value:wn.values.scriptUpdateCheckPeriod,desc:""}),u.items.push({name:Qr.getMessage("Automatic_installation"),id:"scriptUpdateAutomaticInstall",level:0,option:!0,checkbox:!0,enabled:wn.values.scriptUpdateAutomaticInstall,desc:""}),u.items.push({ +name:Qr.getMessage("Dont_ask_me_for_simple_script_updates"),id:"notification_silentScriptUpdate",level:80,option:!0,checkbox:!0,enabled:wn.values.notification_silentScriptUpdate,desc:""}),u.items.push({name:Qr.getMessage("Check_disabled_scripts"),id:"scriptUpdateCheckDisabled",level:0,option:!0,checkbox:!0,enabled:wn.values.scriptUpdateCheckDisabled,desc:""}),u.items.push({name:Qr.getMessage("Hide_notification_after"),id:"scriptUpdateHideNotificationAfter",level:50,option:!0,select:[{ +name:Qr.getMessage("Never"),value:0},{name:Qr.getMessage("15_Seconds"),value:15e3},{name:Qr.getMessage("30_Seconds"),value:3e4},{name:Qr.getMessage("1_Minute"),value:6e4},{name:Qr.getMessage("5_Minutes"),value:3e5},{name:Qr.getMessage("1_Hour"),value:36e5}],value:wn.values.scriptUpdateHideNotificationAfter,desc:""});const d={id:"externals",name:Qr.getMessage("Externals"),desc:Qr.getMessage("require_and_resource"),sub_menu_item:!0,level:0,items:[]};d.items.push({ +name:Qr.getMessage("Update_interval"),id:"external_update_interval",level:0,option:!0,select:[{name:Qr.getMessage("Always"),value:1},{name:Qr.getMessage("Every_Day"),value:864e5},{name:Qr.getMessage("Every_Week"),value:6048e5},{name:Qr.getMessage("Every_Month"),value:2592e6},{name:Qr.getMessage("Never"),value:0}],value:wn.values.external_update_interval,desc:""});const A={id:"security",name:Qr.getMessage("Security"),sub_menu_item:!0,need_save:!0,level:50,items:[]};A.items.push({ +name:Qr.getMessage("Content_Script_API"),id:"runtime_content_mode",level:80,option:!0,select:"content"!=wn.values.runtime_content_mode?[{name:Qr.getMessage("UserScripts_API"),value:"userscripts"},{name:Qr.getMessage("UserScripts_API_Dynamic"),value:"userscripts-dynamic"}]:[{name:Qr.getMessage("Content_Script"),value:"content"},{name:Qr.getMessage("UserScripts_API"),value:"userscripts"},{name:Qr.getMessage("UserScripts_API_Dynamic"),value:"userscripts-dynamic"}], +value:wn.values.runtime_content_mode}),A.items.push({name:Qr.getMessage("Sandbox_Mode"),id:"sandbox_mode",level:80,option:!0,select:[{name:Qr.getMessage("Default"),value:"default"},{name:Qr.getMessage("All"),value:"raw+"},{name:Qr.getMessage("Force_Raw"),value:"raw"},...["js","-js","js+"].includes(wn.values.sandbox_mode)?[{name:Qr.getMessage("Force_JavaScript"),value:"js"},{name:Qr.getMessage("Raw_and_JavaScript"),value:"-js"},{name:Qr.getMessage("JavaScript_and_DOM"),value:"js+"}]:[],{ +name:Qr.getMessage("Force_DOM"),value:"dom"}],value:wn.values.sandbox_mode,desc:Qr.getMessage("Configures_which_sandbox_values_are_valid"),validation:["dom","js+","raw+"].includes(wn.values.sandbox_mode)?{image:"critical",msg:Qr.getMessage("DOM_mode_is_unsecure__Scripts_can_install_new_scripts_")}:void 0});{const e=[{name:Qr.getMessage("Auto"),value:"auto"},{name:Qr.getMessage("Remove__possibly_unsecure_"),value:"remove"},..."yes"==wn.values.webrequest_fixCSP?[{name:Qr.getMessage("Yes"), +value:"yes"}]:[],{name:Qr.getMessage("No"),value:"no"}];A.items.push({name:Qr.getMessage("Add_TM_to_CSP"),id:"webrequest_fixCSP",level:80,option:!0,select:e,value:wn.values.webrequest_fixCSP,desc:Qr.getMessage("Tampermonkey_might_not_be_able_to_provide_access_to_the_unsafe_context_when_this_is_disabled")}),A.items.push({name:Qr.getMessage("Allow_headers_to_be_modified_by_scripts"),id:"webrequest_modHeaders",level:80,option:!0,reload:!0,select:[{name:Qr.getMessage("Yes"),value:"yes"},{ +name:Qr.getMessage("Auto"),value:"auto"},{name:Qr.getMessage("No"),value:"no"}],value:wn.values.webrequest_modHeaders,warning:Qr.getMessage("Tampermonkey_needs_to_be_restarted_to_make_this_change_apply_Do_you_want_to_continue_"),desc:""})}A.items.push({name:Qr.getMessage("Allow_scripts_to_run_scripts_in"),id:"runtime_run_in",level:80,option:!0,array:!0,select:[{name:Qr.getMessage("All_tabs"),value:[]},{name:Qr.getMessage("Normal_tabs"),value:["normal-tabs"], +warning:Qr.getMessage("Tampermonkey_won_t_inject_into_other_tab_types_anymore_")},{name:Qr.getMessage("Incognito_tabs"),value:["incognito-tabs"],warning:Qr.getMessage("Tampermonkey_won_t_inject_into_other_tab_types_anymore_")}],value:wn.values.runtime_run_in}),A.items.push({name:Qr.getMessage("Script_local_files_access"),id:"script_file_access",level:80,option:!0,select:[{name:Qr.getMessage("All_local_files"),value:"all"},{name:Qr.getMessage("require_and_resource"),value:"externals"},{ +name:Qr.getMessage("Disabled"),value:"off"}],value:wn.values.script_file_access}),A.items.push({name:Qr.getMessage("Script_cookies_access"),id:"script_cookie_access",level:80,option:!0,select:[{name:Qr.getMessage("All"),value:"all"},{name:Qr.getMessage("All_but_HttpOnly"),value:"!httponly"},{name:Qr.getMessage("Disabled"),value:"off"}],value:wn.values.script_cookie_access}),A.items.push({name:Qr.getMessage("Allow_communication_with_cooperate_pages"),id:"external_connect",level:80,option:!0, +reload:!0,select:[{name:Qr.getMessage("Tampermonkey_and_script_version"),value:"all"},{name:Qr.getMessage("Tampermonkey_version"),value:"version"},{name:Qr.getMessage("Disabled"),value:"off"}],value:wn.values.external_connect,desc:Qr.getMessage("This_option_allows_the_Tampermonkey_homepage_and_some_script_hosting_pages_to_determine_the_Tampermonkey_version_and_whether_a_script_is_installed_")}),A.items.push({name:Qr.getMessage("Subresource_Integrity"),id:"require_sri_mode",level:80,option:!0, +select:[{name:Qr.getMessage("Disabled"),value:"ignore"},{name:Qr.getMessage("Validate_if_supported"),value:"supported"},{name:Qr.getMessage("Validate_if_given"),value:"given"},{name:Qr.getMessage("Enforce"),value:"enforce"}],value:wn.values.require_sri_mode,desc:Qr.getMessage("Script_authors_can_secure_external_resources_by_adding_a_SRI_hash_to_the_URL_")});let p=[];(wn.values.configMode>=80||["off","casual"].includes(wn.values.connect_mode))&&(p=p.concat([{name:Qr.getMessage("Disabled"), +value:"off"},{name:Qr.getMessage("Casual"),value:"casual"}])),p=p.concat([{name:Qr.getMessage("Ask_if_unknown"),value:"ask"},{name:Qr.getMessage("Strict"),value:"strict"},{name:Qr.getMessage("Always_ask"),value:"paranoid"}]),A.items.push({name:Qr.getMessage("Script_Include_Mode"),id:"script_include_mode",level:50,option:!0,select:[{name:Qr.getMessage("Disabled"),value:"off"},{name:Qr.getMessage("Treat_like__match"),value:"match"},{name:Qr.getMessage("Unsafe"),value:"unsafe"},{ +name:Qr.getMessage("Default"),value:"default"}],value:wn.values.script_include_mode,desc:Qr.getMessage("Using__include_is_potentially_unsafe_and_may_be_obsolete_soon___0off0_disables__include_completely__0match0__is_safe__but_may_not_compatible_the_script_developers_intention__0unsafe0__mostly_keeps_the_legacy_behavior_0default0__means__0used_default0",Qr.getMessage("Disabled"),Qr.getMessage("Treat_like__match"),Qr.getMessage("Unsafe"),Qr.getMessage("Default"),Qr.getMessage("Unsafe"))}), +A.items.push({name:Qr.getMessage("connect_mode"),id:"connect_mode",level:50,option:!0,select:p,value:wn.values.connect_mode,desc:""}),ht.inIncognitoContext||A.items.push({name:Qr.getMessage("Store_data_in_incognito_mode"),id:"incognito_mode",level:50,option:!0,select:[{name:Qr.getMessage("Temporary"),value:"temporary"},{name:Qr.getMessage("Permanent"),value:"permanent"}],value:wn.values.incognito_mode,validation:"temporary"==wn.values.incognito_mode?void 0:{image:"critical", +msg:"Permanent mode is still a BETA feature!"}}),A.items.push({name:Qr.getMessage("Page_Filter_Mode"),id:"page_filter_mode",level:50,option:!0,select:[{name:Qr.getMessage("Disabled"),value:"off"},{name:Qr.getMessage("Blacklist"),value:"black"},{name:Qr.getMessage("Whitelist"),value:"white"},{name:Qr.getMessage("Both"),value:"black+white"}],value:wn.values.page_filter_mode,desc:""}),A.items.push({name:Qr.getMessage("Whitelisted_Pages"),id:"page_whitelist",level:50,option:!0,input:!0,array:!0, +value:wn.values.page_whitelist,desc:""}),A.items.push({name:Qr.getMessage("Blacklisted_Pages"),id:"forbiddenPages",level:50,option:!0,input:!0,array:!0,value:wn.values.forbiddenPages,desc:""});const h={id:"runtime_host_permissions",name:Qr.getMessage("Runtime_Host_Permissions"),sub_menu_item:!0,level:50,items:[]},f=Object.keys(await Hi.get());h.items.push({name:Qr.getMessage("Requested_Host_Permissions"),id:"missing_host_permissions",level:50,option:!0,permission:!0,array:!0,value:f,desc:""}) +;const m={id:"blackcheck",name:Qr.getMessage("BlackCheck"),sub_menu_item:!0,need_save:!0,level:50,items:[]};let g;m.items.push({name:Qr.getMessage("Script_Blacklist_Source"),id:"script_blacklist_type",level:50,option:!0,select:[{name:Qr.getMessage("Disabled"),value:"off"},{name:Qr.getMessage("Server_And_Manual"),value:"server"},{name:Qr.getMessage("Only_Manual"),value:"only_manual"}],value:wn.values.script_blacklist_type}),m.items.push({name:Qr.getMessage("Blacklist_Severity"), +id:"script_blacklist_severity",level:50,option:!0,select:[{name:Qr.getMessage("severity_1"),value:1},{name:Qr.getMessage("severity_2"),value:2},{name:Qr.getMessage("severity_3"),value:3},{name:Qr.getMessage("severity_4"),value:4},{name:Qr.getMessage("severity_5"),value:5},{name:Qr.getMessage("severity_6"),value:6},{name:Qr.getMessage("severity_7"),value:7},{name:Qr.getMessage("severity_8"),value:8},{name:Qr.getMessage("severity_9"),value:9},{name:Qr.getMessage("severity_10"), +value:Uc.SEVERITY_MAX}],value:wn.values.script_blacklist_severity}),m.items.push({name:Qr.getMessage("Manual_Script_Blacklist"),id:"require_blacklist",level:50,option:!0,input:!0,array:!0,value:wn.values.require_blacklist,desc:""});{const e=["exe","sh","crx","com","bat","scr"].map((e=>"name."+e)).some((e=>Qa.is_whitelisted(e)));g={id:"downloads",name:Qr.getMessage("Downloads")+" BETA",sub_menu_item:!0,need_save:!0,level:50,items:[]},g.items.push({name:Qr.getMessage("Download_Mode"), +id:"downloads_mode",level:50,option:!0,select:[{name:Qr.getMessage("Default"),value:Qa.staticVars.DEFAULT},{name:Qr.getMessage("Disabled"),value:Qa.staticVars.OFF},{name:Qr.getMessage("Native"),value:Qa.staticVars.NATIVE},{name:Qr.getMessage("Browser_API"),value:Et.supported?Qa.staticVars.CHROME:null}].filter((e=>e.value)),value:wn.values.downloads_mode,desc:Qr.getMessage("The_Browser_API_mode_requires_a_special_permission_")}),g.items.push({name:Qr.getMessage("Whitelisted_File_Extensions"), +id:"downloads_extension_whitelist",level:50,option:!0,input:!0,array:!0,value:wn.values.downloads_extension_whitelist,desc:Qr.getMessage("Only_files_with_these_extensions_can_be_saved_to_the_harddisk_Be_careful_to_not_allow_file_extensions_that_represent_executables_at_your_operating_system_"),validation:e?{image:"critical",msg:Qr.getMessage("Your_whitelist_seems_to_include_executable_files_This_means_your_userscripts_may_download_malware_or_spyware_to_your_harddisk_")}:void 0})}const v={ +id:"experimental",name:Qr.getMessage("Experimental"),sub_menu_item:!0,level:80,items:[]};v.items.push({name:Qr.getMessage("strict_mode"),id:"runtime_strict_mode",level:80,option:!0,select:[{name:Qr.getMessage("Default"),value:"byscript"},{name:Qr.getMessage("Always"),value:"on"},{name:Qr.getMessage("Disabled"),value:"off"}],value:wn.values.runtime_strict_mode}),v.items.push({name:Qr.getMessage("top_level_await"),id:"runtime_top_level_await",level:80,option:!0,select:[{ +name:Qr.getMessage("Default"),value:"default"},{name:Qr.getMessage("Enabled"),value:"on"},{name:Qr.getMessage("Disabled"),value:"off"}],value:wn.values.runtime_top_level_await}),vt.filterResponseData&&v.items.push({name:Qr.getMessage("Add_Tampermonkey_to_the_site_s_content_csp"),id:"webrequest_fixContentCSP",level:80,option:!0,select:[{name:Qr.getMessage("Yes"),value:"yes"},{name:Qr.getMessage("No"),value:"no"}],value:wn.values.webrequest_fixContentCSP, +warning:"Warning: enabling this option is may break pages!"});const w={id:"userscripts",name:Qr.getMessage("Userscripts"),sub_menu_item:!0,need_save:!0,level:80,items:[]};w.items.push({name:Qr.getMessage("Script_URL_detection"),id:"scriptUrlDetection",level:80,option:!0,select:[{name:Qr.getMessage("Auto"),value:"auto"},{name:Qr.getMessage("Legacy"),value:"legacy"},{name:Qr.getMessage("Disabled"),value:"manual"}],value:wn.values.scriptUrlDetection}),w.items.push({ +name:Qr.getMessage("New_script_template_"),id:"script_templates",level:80,option:!0,input:!0,array:!0,named:!0,value:wn.values.script_templates});const b={id:"reset",name:Qr.getMessage("Reset_Section"),sub_menu_item:!0,level:50,items:[]};return b.items.push({name:Qr.getMessage("Restart_Tampermonkey"),id:"reset_simple",level:50,button:!0,reload:!0,warning:Qr.getMessage("This_will_restart_Tampermonkey_Ok_")}),b.items.push({name:Qr.getMessage("Factory_Reset"),id:"reset_factory",level:80,button:!0, +reload:!0,warning:Qr.getMessage("This_will_remove_all_scripts_and_reset_all_settings_Ok_")}),e&&b.items.push({name:"Install Tests",id:"install_tests",level:80,button:!0,reload:!1,ignore:!0,warning:"This will install a lot of test scripts!"}),[t,s,i,o,a,c,u,d,n,l,A,h,m,g,w,v,b].filter((e=>e))})():(r.referrer="options.settings",y.Pledge([]))).done((e=>{r.items=e,n.resolve([r])})).fail(n.reject),n.promise()}},c={actions:o,options:a};return v.debug("tree: loading",n,r),i(n,!0)()}, +level:e=>e.replace(/\.$/,"").split(".").length},dd=ud,Ad={};let pd;const hd=({tabId:e,frameId:t,url:n})=>{const r=Ad[e];r&&r.forEach((r=>{r({tabId:e,frameId:t,url:n})}))},fd={addListener:(e,t)=>{Ad[e]=Ad[e]||[],Ad[e].push(t),!pd&&Object.keys(Ad).length&&(wt.supported&&wt.onUrlUpdated&&wt.onUrlUpdated.addDynamicListener(hd),pd=!0)},removeListener:(e,t)=>{let n;const r=Ad[e];r&&(n=r.indexOf(t))>-1&&r.splice(n,1),0===r.length&&fd.removeListeners(e)},removeListeners:e=>{delete Ad[e]}},md=fd +;var gd=e(462),vd=e.n(gd);const wd=e=>{if(!e||"object"!=typeof e)return!1;if("string"!=typeof e.url)return!1;if("content"in e&&"string"!=typeof e.content)return!1;if("sri"in e){const t=e.sri;if(null===t||"object"!=typeof t)return!1;if("mode"in t&&("string"!=typeof t.mode||!["ignore","supported","given","enforce"].includes(t.mode)))return!1}return!(!("ts"in e)||"number"!=typeof e.ts&&null!==e.ts||"mimetype"in e&&"string"!=typeof e.mimetype||"modified"in e&&"boolean"!=typeof e.modified)},bd=(()=>{ +let e,t,n=!1;const r=()=>{const e=y();return t=e,e};return{write:()=>{const t=y();return n=!1,e=new(vd()),t.resolve(e),t.promise()},open:s=>{const i=r();return n=!0,vd().loadAsync(s).then((t=>{e=t,i.resolve(e)}),(e=>{t&&t.reject(e),i.reject(e)})),i.promise()},entries:()=>{const t=r(),n=e.files,s=Object.keys(n).map((e=>{const t=n[e];if(t&&!t.dir)return{filename:t.name}})).filter((e=>e));return t.resolve(s),t.promise()},get:t=>{const n=r(),s=e.file(t.filename) +;return s?s.async("arraybuffer").then((e=>{n.resolve(e)})):n.resolve(),n.promise()},put:(t,n,s)=>{const i=r();try{e.file(t,n,{date:s?new Date(s):void 0}),i.resolve()}catch(e){i.reject(e)}return i.promise()},end:()=>{const t=r();return n?t.reject():e.generateAsync({type:"blob",compression:"DEFLATE",comment:"Created by Tampermonkey"}).then((e=>t.resolve(e)),(e=>t.reject(e))),t.promise()}} +})(),_d=":",yd="/",kd="-",Rd="-error-",xd="default-src",Ed="script-src",Sd="style-src",Cd="frame-src",Md="report-uri",Id="frame-ancestors",Ud="reflected-xss",Gd="upgrade-insecure-requests",Zd="child-src",Td="block-all-mixed-content",Bd="sandbox",Od="worker-src",jd="navigate-to",Dd="script-src-elem",Fd="script-src-attr",Ld="style-src-elem",Pd="style-src-attr",Nd=["sha256","sha384","sha512"],Vd=[Rd,xd,Ed,"object-src",Sd,"img-src","media-src",Cd,"font-src","connect-src",Md,Id,Ud,"base-uri","form-action","manifest-src",Gd,Zd,Td,Bd,Od,jd,Dd,Fd,Ld,Pd],zd="'self'",qd="'unsafe-inline'",Hd="'unsafe-eval'",Qd="'unsafe-hashes'",Wd="'none'",Xd="'nonce-",Yd="'report-sample'",Jd="'strict-dynamic'",Kd="'unsafe-allow-redirects'",$d="'wasm-unsafe-eval'",eA="'sha-",tA=[zd,qd,Hd,Qd,Wd,Xd,Yd,Jd,Kd,$d,eA],nA=-1,rA=e=>"http"===e?80:"https"===e?443:nA +;class sA{constructor(e){this.mDirective=e,this.mSrcs=[]}permits(e,t,n,r,s,i){if(!this.equals(e)&&!this.isDefaultDirective())return console.warn(`cspd::permits, aUri: ${Hn(n)}, aDirective: ${e}, this: ${this.toString()}`),!1;if(t)if(e===Ld){if(u(t,this.mSrcs))return!0}else if(e===Dd||e===Od){if(u(t,this.mSrcs))return!0;const e=[];let n=!1;for(let t=0;tn.allows(e,t)))}toString(){let e="";return e+=this.mDirective+" ", +e+=this.mSrcs.map((e=>e.toString())).join(" "),e}addSrcs(e){this.mSrcs=[...e]}getSrcs(){return[...this.mSrcs]}isDefaultDirective(){return this.mDirective===xd}equals(e){return this.mDirective===e}getReportURIs(){return this.mDirective!=Md?(console.warn("cspd::getReportURIs: not a report-uri directive!",this.mDirective),[]):this.mSrcs.map((e=>e.toString()))}getDirName(){return this.mDirective}allowsAllInlineBehavior(e){let t=!1;for(const n of this.mSrcs){if(n.isNonce()||n.isHash())return!1 +;if((e===Dd||e===Fd)&&n.isKeyword(Jd))return!1;n.isKeyword(qd)&&(t=!0)}return t}}class iA extends sA{constructor(e,t){super(e),this.mStringSrc=t}allows(e,t){return!1}permits(e,t,n,r,s,i){return!1}equals(e){return this.mStringSrc[0]===e}toString(){return this.mStringSrc.join(" ")}}class oA extends sA{constructor(e){super(e)}permits(e,t,n,r,s,i){return!1}allows(e,t){return!1}toString(){return Gd}addSrcs(e){throw new Error("upgrade-insecure-requests does not hold any srcs")}getDirName(){return Gd}} +class aA extends sA{constructor(e){super(e),this.mRestrictWorkers=!1,this.mRestrictScriptElem=!1,this.mRestrictScriptAttr=!1,this.mDirective=e}setRestrictWorkers(){this.mRestrictWorkers=!0}setRestrictScriptElem(){this.mRestrictScriptElem=!0}setRestrictScriptAttr(){this.mRestrictScriptAttr=!0}equals(e){return e===Od?this.mRestrictWorkers:e===Dd?this.mRestrictScriptElem:e===Fd?this.mRestrictScriptAttr:this.mDirective===e}}class cA{permits(e,t,n,r){return!1}allows(e,t){return!1}isReportSample(){ +return!1}isKeyword(e){return!1}isHash(){return!1}isNonce(){return!1}}class lA extends cA{constructor(e){if(super(),this.mKeyword=e,e===zd)throw new Error("'self' should have been replaced in the parser")}allows(e,t){return this.mKeyword===e}toString(){return i(this.mKeyword)}isReportSample(){return this.mKeyword==Yd}isKeyword(e){return this.mKeyword==e}}class uA extends cA{constructor(e){super(),this.mPath="",this.mHost=e.toLowerCase(),this.mGeneratedFromSelfKeyword=!1,this.mIsUniqueOrigin=!1, +this.mWithinFrameAncstorsDir=!1}permits(e,t,n,r){if(this.mIsUniqueOrigin)return!1;if(!A(this.mScheme,e,n,r,this.mGeneratedFromSelfKeyword))return!1;const i=s(e.hostname);if("*"==this.mHost){if("blob"===e.scheme||"data"===e.scheme||"filesystem"===e.scheme)return!1;if(!this.mScheme)return!0}else if("*"==this.mHost[0]){if("."!=this.mHost[1])throw new Error("Second character needs to be '.' whenever host starts with '*'");const e=this.mHost.substr(1);if(!i.endsWith(e))return!1 +}else if(this.mHost!=i)return!1;if(!function(e,t,n){if("*"===t)return!0;let r=n.port;if(!r){if(!e)return!1;const t=rA(e);return t==nA||0==t}if(r===nA&&!t)return!0;if(r===nA){const e=n.scheme;r=rA(e)}const s=r.toString();if(t===s)return!0;let i=t;if(!i){if(!e)throw new Error("need a scheme to query default port");i=rA(e).toString()}return i===s||"80"===i&&"443"===s}(this.mScheme,this.mPort,e))return!1;if(!t&&this.mPath){const t=e.pathname;if(this.mWithinFrameAncstorsDir)return!0;const n=s(t) +;if("/"==this.mPath.substr(-1)){if(!n.startsWith(this.mPath))return!1}else if(this.mPath!=n)return!1}return!0}toString(){let e="";return this.mGeneratedFromSelfKeyword?zd:"*"!==this.mHost||this.mScheme||this.mPort?(e+=this.mScheme,e+="://",e+=this.mHost,this.mPort&&(e+=":"+this.mPort),e+=i(this.mPath),e):this.mHost}setScheme(e){this.mScheme=e.toLowerCase()}setPort(e){this.mPort=`${e}`}appendPath(e){this.mPath+=e}setGeneratedFromSelfKeyword(){this.mGeneratedFromSelfKeyword=!0}setIsUniqueOrigin(){ +this.mIsUniqueOrigin=!0}setWithinFrameAncestorsDir(e){this.mWithinFrameAncstorsDir=e}getScheme(){return this.mScheme}getHost(){return this.mHost}getPort(){return`${this.mPort||nA}`}getPath(){return this.mPath}}class dA extends cA{constructor(e){super(),this.mNonce=e}allows(e,t){return e===Xd&&this.mNonce===t}toString(){return`${Xd}${this.mNonce}'`}getNonce(){return this.mNonce}isNonce(){return!0}}class AA extends cA{constructor(e,t){super(),this.mAlgorithm=e.toLowerCase(), +this.mHash=t.replace(/-/g,"+").replace(/_/g,"/")}allows(e,t){return!1}toString(){return`'${this.mAlgorithm}-${this.mHash}'`}getAlgorithm(){return this.mAlgorithm}getHash(){return this.mHash}isHash(){return!0}}class pA extends cA{constructor(e){super(),this.mScheme=e.toLowerCase()}permits(e,t,n,r){if(""===this.mScheme)throw new Error("scheme cannot be the empty string");return A(this.mScheme,e,n,r,!1)}toString(){return`${this.mScheme}:`}getScheme(){return this.mScheme}}class hA extends cA{ +constructor(e){super(),this.mReportURI=e}toString(){return i(Hn(this.mReportURI))}}class fA{constructor(){this.mDeliveredViaMetaTag=!1,this.mUpgradeInsecDir=null,this.mDirectives=[],this.mReportOnly=!1}setDeliveredViaMetaTagFlag(e){this.mDeliveredViaMetaTag=e}getDeliveredViaMetaTagFlag(){return this.mDeliveredViaMetaTag}matchingOrDefaultDirective(e){let t=null +;for(let n=0;ne.toString())).join("; ")}hasDirective(e,t){for(const n of this.mDirectives)if(t){if(n.getDirName()===e)return!0}else if(n.equals(e))return!0;return!1}addDirective(e){this.mDirectives.push(e)}getDirectives(){return this.mDirectives}setReportOnlyFlag(e){this.mReportOnly=e}getReportOnlyFlag(){ +return this.mReportOnly}getDirectiveAsString(e){for(const t of this.mDirectives)if(!t.equals(Rd)&&t.equals(e))return t.toString();return""}getNumDirectives(){return this.mDirectives.length}getReportURIs(){for(const e of this.mDirectives)if(e.equals(Md))return e.getReportURIs();return[]}allowsAllInlineBehavior(e){const t=this.matchingOrDefaultDirective(e);return!t||t.allowsAllInlineBehavior(e)}addNonce(e){let t=null,n=null,r=null;for(let e=0;e!e.allows(Wd)));this.mDirectives[i].addSrcs([s,...e])}else{const e=new sA(Ed);e.addSrcs([s]),this.mDirectives.push(e)}}getNonces(){const e=[];for(const t of this.mDirectives){const n=t.getSrcs();for(const t of n)t.isNonce()&&e.push(t.getNonce())}return e}getAllowsEval(){ +return!(!this.allows(Ed,Hd)&&!this.getReportOnlyFlag())}getAllowsInline(e,t,n,r,s,i,o,a,c){if(![Dd,Fd,Ld,Pd].includes(e))return console.warn("csppo: can only allow inline for (script/style)-src-(attr/elem)"),!0;let l="";if(this.allowsAllInlineBehavior(e))return!0;if(this.allows(e,Xd,n))return!0;""===l&&s&&(l=s.innerText),""===l&&(l=o);const u=this.allows(e,Qd);if((!t||u)&&this.allows(e,eA,l))return!0;let d=!1;return[Dd,Fd].includes(e)&&this.allows(e,Jd)&&(d=!r),!(!d&&!this.getReportOnlyFlag())}} +class mA{constructor(e,t,n){this.mCurCharPos=0,this.mEndCharPos=0,this.mCurValue="",this.mValue="",this.mHasHashOrNonce=!1,this.mHasAnyUnsafeEval=!1,this.mStrictDynamic=!1,this.mUnsafeInlineKeywordSrc=void 0,this.mWorkerSrc=void 0,this.mScriptSrc=void 0,this.mParsingFrameAncestorsDir=!1,this.mTokens=e,this.mCurDir=[],this.mCurToken="",this.mSelfURI=t,this.mPolicy=void 0,this.mDeliveredViaMetaTag=n}get mCurChar(){return this.mValue[this.mCurCharPos]}atEnd(){ +return this.mCurCharPos>=this.mEndCharPos}accept(e){return!this.atEnd()&&("string"==typeof e?this.mCurChar===e:e(this.mCurChar))&&this.advance()}peek(e){return!this.atEnd()&&("string"==typeof e?this.mCurChar===e:e(this.mCurChar))}advance(){return!this.atEnd()&&(this.mCurValue+=this.mCurChar,this.mCurCharPos++,!0)}resetCurValue(){this.mCurValue=""}resetCurChar(e){this.mValue=e,this.mCurCharPos=0,this.mEndCharPos=e.length,this.resetCurValue()}atEndOfPath(){ +return this.atEnd()||this.peek("?")||this.peek("#")}atValidUnreservedChar(){return this.peek(o)||this.peek(a)||this.peek(kd)||this.peek(".")||this.peek("_")||this.peek("~")}schemeChar(){return!this.atEnd()&&(this.accept(o)||this.accept(a)||this.accept("+")||this.accept(kd)||this.accept("."))}directiveName(){const e=function(e){const t=e.toLowerCase();for(let e=1;e512)return!1}return n=s(this.mCurValue),e.appendPath(n),this.resetCurValue(),!0}path(e){return this.resetCurValue(),this.accept(yd)?this.atEndOfPath()?(e.appendPath("/"), +!0):this.peek(yd)?(console.warn("Couldn't parse invalid source:",this.mCurToken),!1):this.subPath(e):(console.warn("Couldn't parse invalid source:",this.mCurToken),!1)}subHost(){let e=0;for(;!this.atEndOfPath()&&!this.peek(_d)&&!this.peek(yd);){for(e++;this.hostChar();)e++;if(this.accept(".")&&!this.hostChar())return!1;if(e>512)return!1}return!0}host(){if(this.accept("*")){if(this.atEnd()||this.peek(":"))return new uA(this.mCurValue) +;if(!this.accept("."))return console.warn("cspp: couldntParseInvalidHost",this.mCurToken),null}if(!this.hostChar())return console.warn("cspp: couldntParseInvalidHost",this.mCurToken),null;if(!this.subHost())return console.warn("cspp: couldntParseInvalidHost",this.mCurToken),null;if(function(e){const t=e.toLowerCase();for(const e of tA){const n=e.toLowerCase();if(t===n.substring(1,n.length-1))return!0}return!1}(this.mCurValue)){const e=this.mCurValue.toLowerCase() +;console.warn("cspp: hostNameMightBeKeyword",this.mCurToken,e)}return new uA(this.mCurValue)}keywordSource(){return r(this.mCurToken,zd)?function(e){const t=e.hostname,n=new uA(t);n.setGeneratedFromSelfKeyword();const r=e.scheme;if(n.setScheme(r),""===t)return n.setIsUniqueOrigin(),n;const s=e.port||nA;return s>0&&n.setPort(s),n +}(this.mSelfURI):r(this.mCurToken,Yd)?new lA(this.mCurToken):r(this.mCurToken,Jd)?this.mCurDir[0]!==Ed&&this.mCurDir[0]!==Dd&&this.mCurDir[0]!==Fd&&this.mCurDir[0]!==xd?(console.warn("cspp: ignoringStrictDynamic",this.mCurToken),null):(this.mStrictDynamic=!0,new lA(this.mCurToken)):r(this.mCurToken,qd)?this.mUnsafeInlineKeywordSrc?(console.warn("cspp: ignoringDuplicateSrc",this.mCurToken),null):(this.mUnsafeInlineKeywordSrc=new lA(this.mCurToken), +this.mUnsafeInlineKeywordSrc):r(this.mCurToken,Hd)||mA.sSecurityCspWasmUnsafeEvalEnabled&&r(this.mCurToken,$d)?(this.mHasAnyUnsafeEval=!0,new lA(this.mCurToken)):mA.sSecurityCspUnsafeHashesEnabled&&r(this.mCurToken,Qd)?new lA(this.mCurToken):r(this.mCurToken,Kd)?d(this.mCurDir[0],jd)?new lA(this.mCurToken):(console.warn("cspp: IgnoringSourceWithinDirective",this.mCurToken),null):null}nonceSource(){if(!this.mCurToken.startsWith("'nonce-")||"'"!==this.mCurToken[this.mCurToken.length-1])return null +;const e=this.mCurToken.substring(1,this.mCurToken.length-1),t=e.indexOf("-");return t<0?null:l(e.substring(t+1))?(this.mHasHashOrNonce=!0,new dA(e.substring(t+1))):null}hashSource(){if("'"!==this.mCurToken[0]||"'"!==this.mCurToken[this.mCurToken.length-1])return null;const e=this.mCurToken.substring(1,this.mCurToken.length-1),t=e.indexOf("-");if(t<0)return null;if(!l(e.substring(t+1)))return null;const n=e.substring(0,t).toLowerCase(),r=e.substring(t+1) +;for(const e of Nd)if(n===e)return this.mHasHashOrNonce=!0,new AA(n,r);return null}hostSource(){const e=this.host();if(!e)return null;if(this.peek(":")){if(!this.port())return null;e.setPort(this.mCurValue)}return this.atEndOfPath()||this.path(e)?e:null}schemeSource(){if(!this.accept(o))return null;for(;this.schemeChar(););const e=this.mCurValue;return this.accept(_d)?this.peek(a)||this.peek("*")?null:new pA(e):null}sourceExpression(){const e=this.keywordSource();if(e)return e +;const t=this.nonceSource();if(t)return t;const n=this.hashSource();if(n)return n;if("*"===this.mCurToken)return new uA("*");this.resetCurChar(this.mCurToken);let r="";const s=this.schemeSource();if(s){if(this.atEnd())return s;if(r=s.toString(),r=r.replace(":",""),!this.accept(yd)||!this.accept(yd))return console.warn("cspp: failedToParseUnrecognizedSource",this.mCurToken),null}this.resetCurValue(),r||(this.resetCurChar(this.mCurToken),r=this.mSelfURI.scheme);const i=this.hostSource() +;return i?(i.setScheme(r),i.setWithinFrameAncestorsDir(this.mParsingFrameAncestorsDir),i):null}sourceList(){let e=!1;const t=[];for(let n=1;n1&&console.warn("cspp: ignoreSrcForDirective - block-all-mixed-content",e.getDirName(),this.mCurDir));if(e.equals(Gd))return void(this.mCurDir.length>1&&console.warn("cspp: ignoreSrcForDirective - upgrade-insecure-requests",e.getDirName(),this.mCurDir));if(d(this.mCurDir[0],Bd))return;this.mHasHashOrNonce=!1,this.mStrictDynamic=!1,this.mHasAnyUnsafeEval=!1,this.mUnsafeInlineKeywordSrc=void 0;const t=this.directiveValue();if(0==t.length){ +const e=new lA(Wd);t.push(e)}if(this.mStrictDynamic&&!e.equals(xd)){for(const e of t){const t=e.toString();e.isKeyword(Jd)||e.isKeyword(Hd)||e.isKeyword($d)||e.isKeyword(Qd)||e.isNonce()||e.isHash()||console.warn("cspp: ignoringScriptSrcForStrictDynamic",t)}this.mHasHashOrNonce||console.warn("cspp: strictDynamicButNoHashOrNonce",this.mCurDir)} +this.mHasHashOrNonce&&this.mUnsafeInlineKeywordSrc&&(e.isDefaultDirective()||e.equals(Ed)||e.equals(Dd)||e.equals(Fd)||e.equals(Sd)||e.equals(Ld)||e.equals(Pd))&&console.warn("cspp: ignoringSrcWithinNonceOrHashDirective - 'unsafe-inline'",this.mCurDir),this.mHasAnyUnsafeEval&&(e.equals(Dd)||e.equals(Fd))&&console.warn("cspp: ignoringUnsafeEval",this.mCurDir),e.addSrcs(t)}policy(){this.mPolicy=new fA;for(let e=0;e"],runAt:"document_start",allFrames:!0};let vA;const wA=(()=>{const e=new rt(1);let t=!1,n=!1;return{acquire:()=>(t||(t=!0,yi.emit("schedule")),e.acquire().done((()=>{n||(n=!0,yi.emit("start"))}))),release:()=>{e.release(), +e.count>0&&(yi.emit("complete"),t=!1,n=!1)}}})();let bA,_A=!1,yA=!1,kA=[];const RA=({type:e,name:t,script:n})=>{v.verbose(`dc: script ${e} event for ${t} (uuid: ${n.uuid})`),EA(n.uuid,!0)},xA=({uuid:e,tabId:t})=>{v.verbose(`dc: storage changed event for uuid: ${e} from tabId: ${t}`),EA(e,!1)},EA=(e,t)=>{bA&&J(bA),kA.includes(e)||kA.push(e),bA=se((()=>{IA({renew:kA}),kA=[]}),t?100:0)},SA="|",CA="userscript-api";let MA;const IA=async e=>{ +const{force:t,renew:n}=e||{},r="userscripts"==wn.values.runtime_content_mode,s="userscripts-dynamic"==wn.values.runtime_content_mode;await wA.acquire(),v.verbose("dc: userScriptsLock acquired");try{if(r||s){if(!vA.available()){const e="https://www.tampermonkey.net/faq#Q209";ci.all({domain:"developerMode",key:"developer_mode",class:"information",title:Qr.getMessage("Developer_Mode"),text:Qr.getMessage("Please_enable_the_allow_userscripts_extension_setting_"),info_url:e,timeout:864e5}) +;const t=()=>{const e="userscripts"==wn.values.runtime_content_mode,r="userscripts-dynamic"==wn.values.runtime_content_mode;e||r?vA.available()?(ci.all({domain:"developerMode",key:"developer_mode",deleted:!0}),wc.clear(n),IA()):se(t,3e3):ci.all({domain:"developerMode",key:"developer_mode",deleted:!0})};wc.on("devMode",t);const n=await wc.schedule("devMode",{periodInMinutes:1,keepExistent:!0});se(t,3e3);const r=kt;return void(!MA&&r.supported&&(MA=async(t,n,s)=>{const i=s.url +;if("complete"===n.status&&i){const n=Sp.externally_connectable_reg;"off"!=wn.values.external_connect&&n.rinc&&n.rinc.length&&n.rinc.some((e=>e.test(i)))&&r.executeScript({target:{tabId:t,frameIds:[0]},injectImmediately:!0,world:"MAIN",func:(e,t,n,r)=>{const s=window,i=s.console,o=s.external||{};if(o.Tampermonkey)return;const a={getVersion:n=>{n({id:e,version:t,errors:["devmode"]})},openOptions:()=>{i.warn(n,r)},isInstalled:(e,t,s)=>{let o;i.warn(n,r),"function"==typeof t?s=t:o=t||void 0,s&&s({ +name:e,namespace:o,installed:void 0})}};Object.defineProperty(o,"Tampermonkey",{configurable:!0,value:a})},args:[B.short_id,ht.manifest.version,"Please enable developer mode to make this API fully functional.",e]})}},mt.onUpdated.addDynamicListener(MA)))}if(MA&&(mt.onUpdated.removeListener(MA),MA=void 0),!_A){const{dom:e}=Cp(wn.values.sandbox_mode),t=e?"script-src 'self' 'unsafe-inline' 'unsafe-eval' *":"script-src 'self' 'unsafe-inline' *";await vA.configureWorld({csp:t,messaging:!0}),_A=!0} +const e=ht.inIncognitoContext,r=`wwywq+${E()}`,i=(e,t)=>`2${SA}${CA}${SA}${e}${SA}${r}${SA}${t||h}`,o=e=>{const[,t,n,s]=e.split(SA);if(t===CA&&s===r)return n},{js:a,runAt:c,matches:l,allFrames:u}=gA,d=[],A=[];let p=(await vA.getScripts()).map((e=>e.id));const h=Math.random().toString(36).substring(2),f=`1${SA}tm-info${SA}${r}`,m=`1${SA}page${SA}${r}`,g=`3${SA}content${SA}${r}${SA}${s?"d":"r"}`;let w,b=`${g}${SA}${h}`;const _={};if(p.map((e=>{const t=o(e);t?_[t]=e:e.startsWith(g)&&(w=e)})), +v.verbose("dc: getScripts - registered_ids: ",p),!wn.values.enabled)return await vA.unregister({ids:p}),yA&&(wi.off("scriptEvent",RA),wi.off("scriptStorage",xA),yA=!1),void v.verbose("dc: disabled - unregister all scripts",p);if(t)await vA.unregister({ids:p}),p=[],v.verbose("dc: force - registered_ids: ",p);else if(p.length&&!p.includes(m))v.debug("dc: scripts were modified, re-registering all scripts"),await vA.unregister({ids:p}),p=[], +v.verbose("dc: PAGE_ID missing - registered_ids: ",p);else if(n&&n.length){if(!s)throw new Error("renew is only supported in userscripts-dynamic mode");const e=n.map((e=>_[e])).filter((e=>!!e));e.length&&(w&&e.push(w),A.push(...e),p=p.filter((t=>!e.includes(t))),v.verbose("dc: renew && renew.length - registered_ids: ",p," to_unregister_late_ids: ",e))}else w&&(v.verbose("dc: keep current content script: ",w),b=w);if(s){yA||(yA=!0,wi.on("scriptEvent",RA),wi.on("scriptStorage",xA));const t=Up({ +runners:[],contexters:[]},"*",{incognito:e}),r="("+(e=>{const t=window;Object.defineProperty(t,"tm_info",{configurable:!0,get:()=>{delete t.tm_info;const n=t.tm_scripts||{},r={},s={};for(const{entry:e,sandbox:t}of Object.values(n))if(e.script){let n=r[t];n||(n=r[t]=[]),n.push(e)}else{let n=s[t];n||(n=s[t]=[]),n.push(e)}for(const e of Object.keys(r))r[e]=(r[e]||[]).sort(((e,t)=>e.script.position-t.script.position));return e.scripts=r,e.contexters=s,e}}) +}).toString()+`)(${JSON.stringify(t)});\n`+`//# sourceURL=${ht.getURL("userscript-api-init")}\n`,s={allFrames:u,id:f,js:[{code:r}],matches:l,runAt:c,world:"USER_SCRIPT"};d.push({id:f,fn:async()=>(await vA.register([s]),!0)});const{rinc:o,rexc:a}=Gl.conditions||{},A=e?"incognito-tabs":"normal-tabs";await Promise.all(sl.determineScriptsToRun({deleted:!1,enabled:!0}).map((async e=>{const t=!(!0===e.options.noframes||null===e.options.noframes&&!0===e.options.override.orig_noframes);let r=null +;if((r=wn.values.runtime_run_in)&&r.length&&!r.includes(A)||(r=e.options.run_in||e.options.override.orig_run_in)&&r.length&&!r.includes(A))return;const s=sl.getUrlCondition(e.uuid);if(!s)return void v.warn(`dc: unable to get URL conditions for "${e.name}" (${e.uuid})`);let c,l,u,p;const h=[];let{rinc:f,rexc:m}=Xo(s,!0);if(o&&(f=(f||[]).concat(o)),a&&(m=(m||[]).concat(a)),s.inc&&["unsafe","default"].includes(wn.values.script_include_mode)&&s.inc.some((e=>e.startsWith("/")))?(c=[""], +u=s.exc&&s.exc.length?s.exc.filter((e=>!e.startsWith("/"))):void 0,p={warn:!0,inc:null==f?void 0:f.map((e=>Yo(e))),exc:null==m?void 0:m.map((e=>Yo(e)))},h.push(`dc: "${e.name}" (${e.uuid}) is injected ahead of time into every tab due to the use of a RegExp include. The RegExp is then evaluated on each tab.`)):(c=s.match&&s.match.length?s.match.map((e=>(e=>{const{scheme:t,host:n,path:r}=Mn(e),s=[],i=`${n}${r}`;return"http*"===t?(s.push(`http${Cn}${i}`), +s.push(`https${Cn}${i}`)):s.push(`${t}${Cn}${i}`),s})(e))).flat():s.inc&&s.inc.length?["http://willneverexist.tmnk.net/"]:void 0,l=s.inc?s.inc.map((e=>{if(-1!==e.indexOf(".tld")){const t=En(e);if(t){let{protocol:n,host:r,path:s}=t;r.endsWith(".tld")&&(r=r.replace(/\.tld$/,".*"),e=`${n}${r}${s||""}`)}else e=e.replace(/\.tld/,".*")}return e.endsWith("*")||(e+="*"),e})):void 0,u=s.exc&&s.exc.length?s.exc.filter((e=>!e.startsWith("/"))):void 0,p={warn:!1,inc:null==f?void 0:f.map((e=>Yo(e))), +exc:null==m?void 0:m.map((e=>Yo(e)))}),!c||!c.length)return void v.warn(`dc: unable to get URL matches for "${e.name}" (${e.uuid})`);const{name:g,uuid:w,evilness:b}=e;if(b&&b>=Math.min(Uc.SEVERITY_MAX,wn.values.script_blacklist_severity))return;const y=(n&&n.includes(w)?void 0:_[w])||i(w);d.push({id:y,script:!0,fn:async()=>{const n=[],r=[];sl.isContexter(e)?r.push(e):n.push(await tu.bundle(e));const s={runners:n,contexters:r},{scripts:i,contexters:o}=Ip(s),a="("+((e,t,n,r)=>{ +const s=window,i=s.tm_scripts=s.tm_scripts||{},o=e=>!!e.script;for(const a of[e,t]){const e=Object.entries(a);for(const[t,a]of e)if(a)for(const e of a)if(o(e)){const{uuid:o,name:a,position:c}=e.script;if(n){const e=s.location.href.split("#")[0],{inc:t,exc:i,warn:o}=n;if(t&&!t.some((t=>""===e.replace(new RegExp(t.source,t.flags),"")))||i&&i.some((t=>""===e.replace(new RegExp(t.source,t.flags),"")))){ +o&&r>=30&&s.console.warn(`"${a}" uses a RegExp include and is injected ahead of time into every tab`,t,i);continue}}i[o]={entry:e,sandbox:t,position:c}}else i[e.uuid]={entry:e,sandbox:t,position:-1}}}).toString()+`)(${JSON.stringify(i)}, ${JSON.stringify(o)}, ${p?JSON.stringify(p):"undefined"}, ${wn.values.logLevel});\n`+`//# sourceURL=${ht.getURL(y)}\n`,d={allFrames:t,id:y,js:[{code:a}],matches:c,includeGlobs:l,excludeGlobs:u,runAt:"document_start",world:"USER_SCRIPT"} +;if(h.length)for(const e of h)v.warn(e);try{return await vA.register([d]),!0}catch(d){return v.error(`dc: can't register "${g}" (${w})`,d),!1}}})})))}else yA&&(wi.off("scriptEvent",RA),wi.off("scriptStorage",xA),yA=!1);const[y,k]=a;let R;if(s){const e=ht.getURL(k.file),t=await oe(e).then((e=>e.text()));R={allFrames:u,id:b,js:[{code:`window.tm_scripts=window.tm_scripts||null;${t}\n//# sourceURL=${e}\n`}],matches:l,runAt:c,world:"USER_SCRIPT"}}else R={allFrames:u,id:b,js:[k],matches:l,runAt:c, +world:"USER_SCRIPT"};d.push({id:b,fn:async()=>(await vA.register([R]),!0)});const x={allFrames:u,id:m,js:[y],matches:l,runAt:c,world:"USER_SCRIPT"};d.push({id:m,fn:async()=>(await vA.register([x]),!0)});const S=d.map((e=>e.id)),C=p.filter((e=>!S.includes(e)));v.verbose("dc: to_unregister_ids: ",C),C.length&&await vA.unregister({ids:C}),v.verbose("dc: to_register: ",S);for(const{id:e,fn:t}of d)if(!p.includes(e)){v.verbose("dc: register id:",e);try{await t()}catch(t){ +v.error(`dc: can't register ${e}`,t)}}v.verbose("dc: to_unregister_late: ",A),A.length&&await vA.unregister({ids:A})}}finally{v.verbose("dc: userScriptsLock release"),wA.release()}},UA=async()=>{if(yt.supported){vA=yt;try{await IA()}catch(e){v.error("dc: userscripts API init failed",e)}wn.addChangeListener(["enabled","runtime_content_mode"],(()=>IA())),wn.addChangeListener(["sandbox_mode"],(()=>{_A=!1,IA({force:!0})})), +wn.addChangeListener(["runtime_run_in","external_connect","script_include_mode","forbiddenPages","page_whitelist","page_filter_mode"],(()=>{"userscripts-dynamic"===wn.values.runtime_content_mode&&IA({force:!0})}))}},GA=[],ZA=["http://*/*","https://*/*","ftp://*/*","file:///*",...U?["ws://*/*","wss://*/*"]:[]],TA={},BA={},OA=(("TM_"+Pe().substr(0,5)).toLowerCase(), +vt.extraHeaderNeeded),jA=(e,t)=>!(t.types&&!t.types.includes(e.type)||"tabId"in t&&e.tabId!==t.tabId||"windowId"in t&&e.windowId!==t.windowId||"incognito"in t&&"incognito"in e&&e.incognito!==t.incognito),DA=[],FA=[],LA=[],PA=[],NA=e=>{const{tabId:t,type:n,url:r}=e;if(_.late){if(LA.length)for(const{f:t,l:n}of LA)jA(e,t)&&n(e);if("main_frame"==n){if(e.documentId)return;if(bi.emit("reset",{tabId:t,early:!0}), +t>0&&"POST"!=e.method&&("legacy"==wn.values.scriptUrlDetection||"manual"!=wn.values.scriptUrlDetection&&r.startsWith("file:"))&&Vo(r))return v.verbose("webRequest: user script detected @ "+r+" -> open install page"),void sl.installFromUrl(r,{},{silent_fail:!0}).fail((e=>{v.info("webRequest: user script detected @ "+r+" was invalid",e?e.messages:""),mt.update(t,{url:r+"#bypass=true"},(()=>{}))}))}else{let s,i;const o=Po(e);if(!o)return void v.error("webRequest: unable to determine tab sender",e) +;if("sub_frame"==n&&(hh(t,o)&&bi.emit("unload",{tabId:t,sender:o,url:r}),bi.emit("request",{tabId:t,sender:o,url:r,incognito:e.incognito||!1,cookieStoreId:e.cookieStoreId})),(s=ph(t,o))&&(i=((e,t)=>{let n={};const r=e.url;return Object.keys(t).forEach((e=>{const s=t[e];Object.entries(s.rules).some((([e,t])=>{let i,o,a;if(!(i=t.selector)||!(o=t.action))return;const c=s.id+"/"+e;if((a=$o.get(c))||(a=Xo({inc:i.include,match:i.match,exc:i.exclude}),$o.set(c,a)),Jo(r,a)){ +if(o.cancel)return v.log("webRequest: request was canceled by script "+s.uuid,r,t,s),s.callback&&s.callback({type:"cancel",details:{rule:t,url:r}}),n={cancel:!0},!0;if(o.redirect){const{url:e,from:i,to:a}=o.redirect;let c,l;if(e)c=e;else if(i&&a&&(l=r.match(i))){l.shift();let e=a;l.concat(["","",""]).forEach(((t,n)=>{e=e.replace("$"+(n+1),t||"")})),c=e}const u=e=>{v.warn("webRequest: error while request redirect by script "+s.uuid,r,t,s),s.callback&&s.callback({type:"redirect",message:"error", +details:{description:e,rule:t,url:r,redirect_url:c}})};if(!c)return void u("unable to determine the redirect URL");c=Qn(c),Gl.isAllowed(c)?sl.scriptWillRun(s.uuid,c)?(v.log("webRequest: request was redirected by script "+s.uuid,r,c,t,s),s.callback&&s.callback({type:"redirect",details:{rule:t,url:r,redirect_url:c}}),n.redirectUrl=c):u("the redirect URL needs to be included by the scripts @include or @match tag"):u("the redirect URL is filtered by the security settings")}}}))})),n})(e,s)))return i +}}else _.registerLateCallback((()=>{NA(e)}))},VA=e=>{let t,n=!0;if(y.Pledge().then((()=>{if(!_.late){const e=y();return _.registerLateCallback((()=>e.resolve())),e.promise()}})).then((()=>{if(e.responseHeaders,FA.length)for(const{f:t,l:n}of FA)jA(e,t)&&n(e);"xmlhttprequest"==e.type&&(t=null)})).then((()=>{if(void 0!==t)return;let n,r=e.responseHeaders||[];if(wn.values.webrequest_fixCSP,r.some((e=>{if(!e.name)return;const t=e.name.toLowerCase();return n=n||"location"==t,e.value,n})), +n)return v.verbose("webRequest: redirect found, skip script determination",e),void(t=null);const{tabId:s,url:i}=e,o=Po(e);let a;return o?(a="xmlhttprequest"==e.type?Mp(o,i,e):mh(s,o,i,e),y.Pledge().then((()=>{})).then((()=>{})).then((()=>nh(e.tabId,o,{},i))).then((()=>{t=null}))):(v.error("webRequest: unable to determine tab sender",e),void(t=null))})),n=!1,void 0!==t)return t||void 0},zA=e=>{const{type:t,tabId:n,url:r,cookieStoreId:s,requestId:i}=e;if(_.late){ +if(DA.length)for(const{f:t,l:n}of DA)jA(e,t)&&n(e);if("xmlhttprequest"==t)delete BA[i],delete TA[i];else{const t=Po(e);if(!t)return void v.warn("webRequest: unable to determine tab sender",e);bi.emit("response",{tabId:n,sender:t,url:r,cookieStoreId:s,incognito:Fo(e)||!1})}}else _.registerLateCallback((()=>{zA(e)}))},qA=e=>{const{type:t,tabId:n,requestId:r}=e;if(PA.length)for(const{f:t,l:n}of PA)jA(e,t)&&n(e);if("xmlhttprequest"==t)delete BA[r],delete TA[r];else if("main_frame"==t){const t=Po({ +frameId:0},{topframe:!0});bi.emit("error",{tabId:n,sender:t,url:e.url})}else v.warn("webRequest: unexpected request type",e)},HA=e=>{try{e&&(vt.onBeforeRequest.addListener(NA,{urls:ZA,types:["main_frame","sub_frame","script","xmlhttprequest",...U?["websocket"]:[]]},[...GA]),vt.onHeadersReceived.addListener(VA,{urls:ZA,types:["main_frame","sub_frame","xmlhttprequest"]},[...GA,"responseHeaders",...OA?["extraHeaders"]:[]]),vt.onResponseStarted.addListener(zA,{urls:ZA, +types:["main_frame","sub_frame","xmlhttprequest"]},[]),vt.onErrorOccurred.addListener(qA,{urls:ZA,types:["main_frame","xmlhttprequest"]})),vt.handlerBehaviorChanged()}catch(e){v.warn("webRequest: error initializings",e.message)}},QA="https://www.tampermonkey.net/script_installation.php",WA=(e,t)=>{const n=zn(e);if(!n||!n.hash)return;const r=n.hash.substr(5),s=async()=>{if(r.startsWith(QA))return;const e=await np([t]);Promise.race([new Promise((e=>{bi.once("complete",(()=>e()),{tabId:t}) +})),F(3e4)]).then((()=>e())),mt.update(t,{url:r},(()=>{B.lastError}))};Vo(r)?(v.verbose("events.commited: user script detected @ "+r+" -> open install page"),sl.installFromUrl(r,{},{silent_fail:!0}).fail((e=>{v.info("events.commited: user script detected @ "+r+" was invalid",e?e.messages:""),s()})).done((()=>{kt.supported&&kt.executeScript({func:()=>history.length>1?history.back():window.close(),target:{tabId:t,frameIds:[0]},injectImmediately:!0,world:"ISOLATED"})}))):s()},XA=new rt(1);let YA,JA +;const KA=async(e,t)=>await JA.updateSessionRules({addRules:e,removeRuleIds:t});let $A;const ep=e=>{const t=[],[n,r]=e?[4,{excludedTabIds:e}]:[3,{}],s={type:"redirect",redirect:{regexSubstitution:QA+"#url=\\0"}};Object.values(fs).map((e=>{for(const i of e.regexps){const o={id:YA++,priority:n,condition:{...r,requestDomains:e.domains,requestMethods:["get"],regexFilter:"^"+i+"(?:$|\\?|\\#)",resourceTypes:["main_frame"]},action:s};t.push(o)}}));const i={id:YA++,priority:n,condition:{...r, +excludedRequestDomains:["tampermonkey.net",...($A||($A=Object.values(fs).reduce(((e,t)=>e.concat(t.domains)),[])),$A)],requestMethods:["get"],regexFilter:"^(?:https?|ftp)://[^\\#\\?]+/[^\\#\\?]+\\.(?:user|tamper)\\.js[^/]*$",resourceTypes:["main_frame"]},action:s};return t.push(i),t},tp=async e=>{const t=await JA.getSessionRules();let n,r;e&&(n=t.reduce(((e,t)=>Math.max(e,t.id)),1)+1);const s=[],i=[],o=[];return t.forEach((e=>{ +1===e.priority?r=e:2===e.priority?s.push(e):3===e.priority?i.push(e):4===e.priority&&o.push(e)})),{max_id:n,all:t,csp:r,install_general:i,install_excludes:o}},np=async e=>{await XA.acquire();const t=async e=>{try{const{install_general:t,install_excludes:n}=await tp(!1),r=[...t,...n].map((e=>e.id)),s=ep(e);await KA(s,r)}catch(e){v.error("dNr:",e)}};let n;await t(e);const r=async()=>{void 0!==n&&(J(n),n=void 0,await t(),XA.release())};return n=se(r,3e4),r},rp={},sp=new rt(1);let ip=!1 +;const op=async()=>{await sp.acquire();const e=Math.random().toString(36).substr(2);let t;rp[e]=new Promise((e=>{t=e})),sp.release();const n=()=>{t&&(t(),delete rp[e],t=void 0)};return se(n,6e4),{done:n}},ap=["connect","delete","get","head","options","patch","post","put"];let cp=!1;const lp=async(e,t,n,r,s)=>{let i;const o=new Promise((e=>i=e)),a=t.toLowerCase(),c=(l=a,ap.includes(l)?l:"other");var l;let u;const d=s&&!r;await sp.acquire(),d?(ip=!0, +await Promise.all(Object.values(rp))):(u=`${c}-${e}`,await(async e=>{for(;;){const t=rp[e];if(!t)break;await t}})(u),rp[u]=o,sp.release());const A=zn(e),p=YA++;if(n&&"direct"!==n.type&&jt&&jt.supported&&!cp){const e=await qi(Yi.permProxy,Qr.getMessage("Proxy_Permission"),Qr.getMessage("Click_here_to_allow_TM_to_make_use_of_a_proxy"),(e=>v.log("netRequest: permission to use proxy ->",e)));cp=e}if(s){const t=Object.entries(s).map((([e,t])=>({header:e,operation:null===t?"remove":"set", +...null===t?{}:{value:`${t}`}})));if(t.length){const n={urlFilter:d?"*":A?Hn(A,{noprotocol:!0}):e.replace(/^[^:]*:\/\//,""),initiatorDomains:[le],requestMethods:[c],resourceTypes:["xmlhttprequest"]},r={id:p,priority:2,condition:n,action:{type:"modifyHeaders",requestHeaders:t}};try{await JA.updateSessionRules({addRules:[r]})}catch(e){v.error("dNr:",e)}}}let h,f,m,g,w,b;const _=async()=>{if(b)return await b;if(m&&(e=>{const t=FA.findIndex((t=>t.l==e));-1!=t&&FA.splice(t,1)})(m),f&&(e=>{ +const t=DA.findIndex((t=>t.l==e));-1!=t&&DA.splice(t,1)})(f),g&&(e=>{const t=LA.findIndex((t=>t.l==e));-1!=t&&LA.splice(t,1)})(g),w&&jt.supported&&jt.onRequest.removeListener(w),s){s=void 0;try{b=JA.updateSessionRules({removeRuleIds:[p]}),await b}catch(e){v.error("dNr:",e)}}ip&&(ip=!1,sp.release()),u&&delete rp[u]};if(A&&A.protocol.startsWith("http")){const t=A?Hn(A):e;let s,i;const o=[];let c,l;h=new Promise((e=>{c=t=>{e(t),c=void 0}}));const u=e=>{const{tabId:t}=e;if(i&&l!==i){l=i +;const n=Po(e);n?wi.emit("onRequestRedirect",{tabId:t,sender:n,url:i}):v.warn("netRequest: unable to determine tab sender",e)}};g=e=>{var n;if(void 0!==s)return;const r=e.initiator||e.originUrl&&(null===(n=zn(e.originUrl))||void 0===n?void 0:n.origin);c&&r==ce&&Wn(e.url)===t&&e.method.toLowerCase()==a&&(s=e.requestId)};const d=e=>{let t=e.responseHeaders||[],n=401===e.statusCode;t=t.map(((t,r)=>{const{name:s,value:a}=t;if(s){const t=s.toLowerCase();if(t.startsWith(bo))return +;if("set-cookie"==t)o.push({name:`${bo}-${r+0}`,value:a});else if("location"==t){if(n=!0,a){const t=Vn(a,{base:e.url,enforce_path:!0});t&&(i=t)}i&&u(e)}}return t})).filter((e=>!!e)),!n&&i&&t.push({name:wo,value:i}),(!n||r)&&(c(o.concat(t)),_())};m=e=>{var n;c&&(e.initiator||e.originUrl&&(null===(n=zn(e.originUrl))||void 0===n?void 0:n.origin))==ce&&(void 0===s?Wn(e.url)===t&&e.method.toLowerCase()==a:e.requestId===s)&&(s=e.requestId,d(e))},f=e=>{var n +;(e.initiator||e.originUrl&&(null===(n=zn(e.originUrl))||void 0===n?void 0:n.origin))==ce&&(void 0===s?Wn(e.url)===t&&e.method.toLowerCase()==a:e.requestId===s)&&(s=e.requestId,c&&d(e),_())},y=g,k={urls:ZA,types:["xmlhttprequest"]},LA.push({f:k,l:y}),((e,t)=>{FA.push({f:t,l:e})})(m,{urls:ZA,types:["xmlhttprequest"]}),((e,t)=>{DA.push({f:t,l:e})})(f,{urls:ZA,types:["xmlhttprequest"]}),n&&jt.supported&&(w=e=>{var r +;return(e.initiator||e.originUrl&&(null===(r=zn(e.originUrl))||void 0===r?void 0:r.origin))==ce&&(void 0===s?Wn(e.url)===t&&e.method.toLowerCase()==a:e.requestId===s)?(s=e.requestId,[n,null]):{type:"direct"}},jt.onRequest.addListener(w,{urls:ZA,types:["xmlhttprequest"]})),await F(1)}var y,k;const R=async()=>{if(!i)return;const e=i;i=void 0,await _(),e()};return se(R,6e4),{done:R,responseHeaders:h}},up=async()=>{const e=await Oi();await XA.acquire();try{const t=void 0===YA +;let{max_id:n,all:r,csp:s,install_general:i,install_excludes:o}=await tp(t);void 0!==n&&(YA=n);const a=[],c=[];e&&(a.push(...r),s=void 0,i=[],o=[]),"remove"===wn.values.webrequest_fixCSP?s||c.push({id:YA++,priority:1,condition:{resourceTypes:["main_frame","sub_frame"]},action:{type:"modifyHeaders",responseHeaders:[{header:"x-content-security-policy",operation:"remove"},{header:"content-security-policy",operation:"remove"}]}}):s&&a.push(s), +"auto"==wn.values.scriptUrlDetection?i.length||o.length||c.push(...ep()):(i&&a.push(...i),o&&a.push(...o)),await KA(c,a.map((e=>e.id)))}catch(e){v.error("dNr:",e)}finally{XA.release()}},dp=async()=>{Rt.supported&&(JA=Rt,wn.addChangeListener(["webrequest_fixCSP"],up),wn.addChangeListener(["scriptUrlDetection"],up),await up())},Ap=async()=>{var e;if(!S()){if(null===await Sc(_c))return +;const t=ru(),n=(null==t?void 0:t.platform)||"unknown",r=null===(e=null==t?void 0:t.brands)||void 0===e?void 0:e.find((e=>e.brand.includes("Edge"))),s="macOS"===n;if(r&&s)return;const i=r?"edge":s?"safari":"tampermonkey",o="https://www.tampermonkey.net/qr/"+i[0],a=Qr.getMessage("Scan_the_QR_code_to_use_Tampermonkey_on_your_phone_or_tablet_"),c={key:_c,realm:"actions",class:"notice",title:Qr.getMessage("Tampermonkey_is_available_on_mobile_platforms"),text:a,info_url:o,buttons:[{ +text:Qr.getMessage("Learn_more"),url:"https://www.tampermonkey.net/faq#Q406"}],qr:{text:o,img:i,size:66,oversample:4,csize:14,bsize:4,pixelPrecise:!0}};xc(c),ci.actionPage({domain:"status",...c})}},pp=Pe(),hp=e=>"extpage"in e,fp=(()=>{const e={allow:{script:"window.close"},exec:(e,t,n)=>{const r=t&&t.tab?t.tab.id:null;r?mt.query({windowType:"normal"},(e=>{if(e.length<=1){const e="refused to close last tab!";v.warn("mh:",e),n({error:e})}else mt.remove(r,(()=>{const e=ft.lastError;n({ +error:e?e.message:void 0})}))})):n({error:"internal error"})}},t={allow:{extpage:!0},exec:(e,t,n)=>{(!hp(t)||"options"!=t.extpage&&"options"!=e.origin?Ho():y.Pledge(t.tab)).then((t=>{let r,s,i;if(e.uuid&&(r=sa.getByUid(e.uuid))&&r.script&&r.cond){let n;s=sl.determineOrigin(r.script),"hoster"==e.to&&s?i=s:(n=r.script.supportURL||(null==s?void 0:s.issue_url)||(null==s?void 0:s.url))&&(i={issue_url:n}),i&&(Ir(r.script.name,"m"),mt.create({url:i.abuse_url||i.issue_url,active:!0,parent:t},(()=>{})))} +n({})}))}},n={allow:{extpage:!0},exec:(e,t,n)=>{if("dialog"==e.action)ld.dialog.shown(e.extra);else if("clicked"==e.action){let t,n;e.extra&&(t=e.extra.amount,n=e.extra.currency),ld.clicked(e.type,t||"?",n||"?")}else if(ld.button[e.action]){const t=ld.button[e.action];t&&t(e.type,e.extra)}else v.warn("mh: Warning: unknown request ",e);n({})}},r={allow:{extpage:!0},exec:async(e,t,n)=>{const r=hp(t)&&("options"==t.extpage||"options"==e.origin),s=()=>n({});switch(e.name){case"reset_simple": +Xa.reset(s);break;case"reset_factory":Xa.factoryReset(s);break;case"reset_sync":xu.reset().always(s);break;case"run_sync":wi.once("syncFinished",(()=>s())),xu.sync(1,!0);break;case"install_tests":{const e="chrome",t=ae.Tests.framework.prepare(sl,sa,e,E(),"mv3",s);t&&v.error(t);break}case"enabled":{const{name:t}=e;wn.setValue(t,!wn.values[t]).always(s);break}case"installFromUrl":{const{data:{url:t,source:i,transferable:o}}=e;let a;if(o){const e=Us.fromTransferableData(o) +;if(!e)throw new Error("Invalid Transferable");const n=await e.toBlob();if(!n)throw new Error("Invalid Transferable");const r=await nt(n,"utf-8")||"";a=sl.installFromSource(r,{url:t})}else a=i?sl.installFromSource(i,{url:t}):sl.installFromUrl(t);a.done((()=>{r?dd.create("options.scripts").done((e=>{const t={success:!0,items:e,options:wn.snapshot};n(t)})):s()})).fail((()=>s()));break}case"externals_delete":{const{safe_url:t,scriptuid:r}=e;Lc.cleanElement(r,t), +dd.create("options.scripts").done((e=>{n({items:e,options:wn.snapshot})})).fail((e=>{n({error:e||"unknown error",options:wn.snapshot})}));break}case"externals_update":{const{safe_url:t,scriptuid:r}=e,s=sa.getByUid(r);if(!s.script||!s.cond)return void n({error:"script deleted",options:wn.snapshot});const{requires:i,resources:o}=s.script;let a,c,l=!1;i.some((e=>{if(jc(e)===t)return a=e,!0})),a?l=!0:o.some((e=>{if(jc(e)===t)return a=e,!0})),a?(Lc.cleanElement(r,t), +c=l?Lc.updateRequire(r,t):Lc.updateResource(r,t),c.then((()=>dd.create("options.scripts"))).done((e=>{n({items:e,options:wn.snapshot})})).fail((e=>{n({error:e||"unknown error",options:wn.snapshot})}))):n({error:"not found",options:wn.snapshot});break}case"focus_tab":{const{tabid:t}=e;fp.focusTab.exec({},{tab:{id:t,url:"",index:-1,windowId:-1},url:"",frameId:0,id:ht.manifest.id},s);break}case"apply_script_update":{ +const{uuid:t}=e,r=h.race([new h((e=>ki.once("result",((n,r)=>t===n&&e(r)),t))),new h((e=>se((()=>e(!1)),6e4)))]);ki.emit("triggered",t);const s=await r?1:0;n({uuid:t,installed:s});break}case"run_script_updates":{const{scriptuid:t}=e;t?$u(t).done((e=>{n({uuid:t,...e})})).fail((()=>{n({uuid:t})})):($u(),s());break}case"blacklist_page":{const{data:t}=e,n=t.domain;if(!n)throw new Error("Blacklisted domain is missing!");const r="/"+In(`*://*.${n}/*`,!0)+"/" +;wn.setValue("forbiddenPages",wn.values.forbiddenPages.concat([r])).always(s);break}case"permissions":{const{data:t}=e,{origins:r,reset:s}=t;if(s||r){let e,t=[];if(s){const n=await Hi.get();t=Object.keys(n),e=!0}else t=r,e=!r.length||await Yi.askOrigin(r,Qr.getMessage("Cross_Origin_Request_Permission"),Qr.getMessage("Click_here_to_allow_TM_to_access_the_following_hosts_0hostlist0",r.join("\n")));e&&t.length&&await Hi.delete(t),dd.create("options.settings").done((t=>{const r={success:e,items:t, +options:wn.snapshot};n(r)}))}else n({});break}case"script_search":{const{data:t}=e,{url:n,result_url:r}=t;if(n){const e={url:Pl(n),active:!0};mt.create(e,s)}else{if(!r)throw new Error("Search URL is missing!");{const e={url:r,active:!0};mt.create(e,s)}}break}case"toggle_tagged_scripts":{const{data:t}=e,{tag:r,toggle:i}=t,o=sa.getUidList().map((e=>sa.getByUid(e))).filter((e=>!!(e&&e.script&&e.cond&&e.script.options.tags.includes(r))));y.onebyone(o.map((({script:e})=>()=>{ +if(e.enabled!=i)return e.enabled=i,sl.doModify(e.uuid,e,!0)}))).done((()=>{dd.create("actions").done((e=>{const t={items:e,options:wn.snapshot};n(t)})).fail((()=>{const e={items:[],options:wn.snapshot};n(e)}))})).fail((()=>s()));break}case"reset_persistent_hint":{const{data:{key:t}}=e;await(e=>kc.delete(e))(t),await Ap(),s();break}case"contrib":{const e={url:ht.getURL("options.html")+"#contribute",active:!0};mt.create(e,s);break}case"enable_stats":wn.setValue("statistics_enabled",!0).always(s) +;break;case"disable_stats":wn.setValue("statistics_enabled",!1).always(s);break;default:v.warn("mh: Warning: unknown button "+name),s()}}},s={allow:{extpage:!0},exec:async(e,t,n)=>{const{action:r,realm:s,key:i,config:o}=e,a=an(s,i,"cloud"==s?mc:void 0);if("get"==r)n({config:await a.get()});else{if("set"!=r)throw new Error("Invalid action");if(o){if(await a.set(o),"cloud"==s){const e=a,t=await e.get();c=i,hc.includes(c)?fc.emit("credentials",{type:i,credentials:t +}):v.warn("mh+miscConfig[cloud]: invalid key")}}else await a.clear()}var c;n({})}},i=async(e,t)=>{if("userscripts-dynamic"==wn.values.runtime_content_mode){const e=new h((e=>{yi.once("complete",(()=>{e()}))}));await h.race([F(5e3),e])}if(e&&wn.values.autoReload){const e=await new h((e=>mt.getSelected(null,(t=>e(t)))));e&&e.id>=0&&(mt.sendMessage(e.id,{method:"reload"},{frameId:0}),await h.race([F(500),new h((t=>{bi.once("complete",(()=>{t()}),{tabId:e.id})}))]))}dd.create("actions").done((e=>{ +const n={items:e,i18n:wn.values.i18n,options:{enabled:wn.values.enabled}};t(n)})).fail((()=>{const e={items:[],i18n:wn.values.i18n,options:{enabled:wn.values.enabled}};t(e)}))},o={allow:{extpage:!0},exec:(e,t,n)=>{for(const t of e.uuids)sl.doRemove(t,!0);sl.reorderScripts(),y.onebyone([()=>dd.create("options.scripts"),()=>dd.create("options.trash")]).then((e=>e.filter((e=>e)).reduce(((e,t)=>e.concat(t)),[]))).done((e=>{const t={items:e,options:wn.snapshot};n(t)})).fail((e=>{n({ +error:e||"unknown error",options:wn.snapshot})}))}},a={allow:{extpage:!0},exec:(e,t,n)=>{const r=void 0===e.reload||!!e.reload,s=hp(t)&&("options"==t.extpage||"options"==e.origin),o=(t,o)=>{s?o?n({error:o,options:wn.snapshot}):r?y.onebyone([()=>dd.create("options.scripts"),()=>dd.create("options.trash")]).then((e=>e.filter((e=>e)).reduce(((e,t)=>e.concat(t)),[]))).done((e=>{const r={...t,items:e,options:wn.snapshot};n(r)})).fail((e=>{n({error:e||"unknown error",options:wn.snapshot}) +})):n({}):i(e.uuid,n)};if(e.clean){const t=e.uuid;if(!t)return void n({error:"uuid missing",options:wn.snapshot});v.debug("mh: clean userscript "+t);const r=sa.getByUid(t),s=e=>{dd.create("options.scripts").done((r=>{const s={cleaned:e.installed,items:r,options:wn.snapshot};n(s),e.installed&&wi.emit("scriptStorage",{uuid:t,storage:sa.getStorageByUid(t).data})})).fail((e=>{n({error:e||"unknown error",options:wn.snapshot})}))};r.script&&r.cond?sl.doSave({name:e.name,uuid:t, +src:r.script.textContent,clean:!0,ask:!1,internal:!0,save:!0}).always((e=>{s(e||{installed:!1})})):(v.error(Qr.getMessage("fatal_error")+" ("+t+")!!!"),s({installed:!1}))}else if(e.code){let t=e.uuid;if(!t)return void n({error:"uuid missing",options:wn.snapshot});let s=e=>n(e);r&&(s=e=>{sl.reorderScripts(),o(e)}),e.new_script&&(t=Pe()),sl.doSave({name:e.name,uuid:t,force_url:e.force_url,src:e.code,ask:!wn.values.editor_easySave,lastModTime:e.lastModTime,save:!0}).always((e=>{s(e||{installed:!1}) +}))}else if(e.auto_save)o({});else{const t=e.uuids||(e.uuid?[e.uuid]:[]);let n;for(const r of t){const t=sa.getByUid(r);t.script&&t.cond?t.script.system?n=n||"system script":e.restore?sl.restore(r):sl.doRemove(r,!1):(v.error(Qr.getMessage("fatal_error")+" ("+r+")!!!"),n=n||"uuid missing")}sl.reorderScripts(),o({},n)}}},c={allow:{extpage:!0,script:"values"},exec:(e,t,n)=>{if(t.tab){if(e.uuid){const{uuid:t,id:n,value:r,key:s,removed:i,ts:o}=e;sa.setStorageByUidAndNotify(t,o,n,s,r,i)} +}else v.warn("storage: unable to save storage due to empty tabID!");n({})}},l={allow:{extpage:!0},exec:(e,t,n)=>{Gi.onMessage(e.data).always((e=>{const t=wn.values.i18n,r=wn.snapshot;n({i18n:t,options:r,message:e})}))}},u={allow:{script:[]},exec:async(e,t,n)=>{let r,s;try{{const t=s=await ba({justification:"revoke a Object URL",reasons:[to.BLOBS]});await Promise.all(e.urls.map((e=>t.send({action:"objectURL",url:e}))))}}catch(e){return r=e.message||e,void n({error:r})}finally{s&&s.release()}n({ +success:!0})}},d={allow:{script:"cookie"},exec:(e,t,n)=>{var r;const s=["expirationDate","domain","httpOnly","secure","path","sameSite","partitionKey","value"],i=[...s,"url"],o=[...s,"name","session","hostOnly"],a=e.location||t.url||void 0;let{url:c,partitionKey:l,name:u}=e.details;c=c?Vn(c,a)||c:a;const d=t.tab?t.tab.cookieStoreId:void 0;let A;if(Ra.fpi&&a&&(A=null===(r=zn(a))||void 0===r?void 0:r.domain),"off"===wn.values.script_cookie_access)n({data:{error:"not supported"} +});else if(c)if(Gl.isAllowed(Qn(c)))if(sl.scriptWillRun(e.uuid,c))if("list"==e.action){const t=e.details,r={url:c};t.domain&&(r.domain=t.domain),u&&(r.name=u),t.path&&(r.path=t.path),A&&(r.firstPartyDomain=null),void 0!==l&&(r.partitionKey=l),void 0!==d&&(r.storeId=d),Ra.getAll(r).done((e=>{let t=e.map((e=>{const t=o.reduce(((t,n)=>({...t,...n in e?{[n]:e[n]}:{}})),{});return t}));"!httponly"===wn.values.script_cookie_access&&(t=t.filter((e=>!e.httpOnly))),n({data:{cookies:t}})})) +}else if("delete"==e.action){if(!u)return void n({data:{error:"missing name"}});const e={url:c,name:u};A&&(e.firstPartyDomain=A),void 0!==l&&(e.partitionKey=l),void 0!==d&&(e.storeId=d),Ra.remove(e).done((()=>{n({data:{success:!0}})})).fail((e=>{n({data:{error:e}})}))}else if("set"==e.action){let{name:t,value:r,...s}=e.details;t=String(void 0===t?"":t),r=String(void 0===r?"":r);const o={name:t,value:r};void 0!==A&&(o.firstPartyDomain=A),void 0!==d&&(o.storeId=d),i.forEach((e=>{const t=s[e] +;void 0!==t&&(o[e]=t)})),o.url=o.url||c,Ra.set(o).done((()=>n({data:{success:!0}}))).fail((e=>n({data:{error:e}})))}else n({data:{error:"unknown action"}});else n({data:{error:"the URL needs to be included by the scripts @include or @match tag"}});else n({data:{error:"the URL is filtered by the security settings"}});else n({data:{error:"invalid URL"}})}};return{ping:{allow:{insecure:!0},exec:(e,t,n)=>{n({pong:!0,instanceID:pp,config:{layout:wn.values.layout}})}},newTab:{allow:{extpage:!0}, +exec:(e,t,n)=>{(!hp(t)||"options"!=t.extpage&&"options"!=e.origin?Ho():y.Pledge(t.tab)).then((r=>{mt.create({url:e.url,parent:r},(r=>{if(!r)return void v.warn("mh: unable to create tab",t,e);const s={tabId:r.id};n(s)}))}))}},tabs:{allow:{script:"tabs"},exec:(e,t,n)=>{"get"==e.action?t.tab&&e.uuid?n({data:rd(t.tab.id,e.uuid)}):(v.warn("mh: unable to process request",t,e),n({data:null})):"list"==e.action?e.uuid?n({data:sd(e.uuid)}):(v.warn("mh: unable to process request",t,e),n({data:null +})):"set"==e.action?(t.tab&&e.uuid?((e,t,n)=>{const r=nd[e]=nd[e]||{},s={};n&&(Object.assign(s,n),r[t]=s)})(t.tab.id,e.uuid,e.tab):v.warn("mh: unable to process request",t,e),n({})):n({error:"unknown action"})}},focusTab:{allow:{script:"window.focus"},exec:(e,t,n)=>{const r=t&&t.tab;if(!r)return void n({error:"internal error"});const{id:s,windowId:i}=r;s?mt.update(s,{active:!0},(()=>{const e=ft.lastError;if(e)return n({error:e.message});const t=gt;i&&t.supported?t.get(i,{},(e=>{if(!e)return n({ +error:"window closed"});const r="minimized"===e.state?"normal":void 0;t.update(i,{focused:!0,state:r},(()=>{const e=ft.lastError;n({error:e?e.message:void 0})}))})):n({})})):n({error:"internal error"})}},closeTab:e,navigateTab:{allow:{script:[]},exec:(e,t,n)=>{const r=t&&t.tab?t.tab.id:null;if(r){let{url:t,location:s}=e;t=Vn(t||"",s)||t,mt.update(r,{url:t},(()=>{const e=ft.lastError;n({error:e?e.message:void 0})}))}else n({error:"internal error"})}},setOption:{allow:{extpage:!0},exec:(e,t,n)=>{ +const r=hp(t)&&("options"==t.extpage||"options"==e.origin);wn.setValue(e.name,e.value).always((()=>{r?dd.create("options.settings").done((e=>{const t={items:e,options:wn.snapshot};n(t)})).fail((e=>{n({error:e||"unknown error",options:wn.snapshot})})):n({})}))}},reportAnIssue:t,begEvent:n,buttonPress:r,imageUrlToTransferable:{allow:{extpage:!0},exec:async(e,t,n)=>{const{url:r,fallback:s}=e;let i;r&&(i=await Bs(r,s)),n({transferable:i?await i.toTransferableData():void 0})}},loadTree:{allow:{ +extpage:!0},exec:(e,t,n)=>{dd.create(e.referrer,{complete:e.complete,url:e.url,uuid:e.uuid,filter:e.filter,tabId:e.tabId,sender:t}).done((t=>{const r={items:t},s=1==dd.level(e.referrer)?{i18n:wn.values.i18n,options:wn.snapshot,xhr:oo,begging:ld.needed()}:{},i=Object.assign(r,s);n(i)})).fail((e=>{n({error:e||"unknown error",options:wn.snapshot})}))}},miscConfig:s,modifyScriptOptions:{allow:{extpage:!0},exec:(e,t,n)=>{if(!e.uuid)return void n({}) +;const r=hp(t)&&("options"==t.extpage||"options"==e.origin);let s=null==e.reload||1==e.reload,o=!1;const a=sa.getByUid(e.uuid,!0),c=()=>{s?(void 0!==e.position&&sl.reorderScripts(e.uuid,e.position),r?fp.loadTree.exec({referrer:"options.scripts"},t,n):i(e.uuid,n)):n({})};if(a.script&&a.cond)if(e.whitewash&&a.script.evilness==Uc.SEVERITY_FOISTED_SCRIPT)s=!0,a.script&&a.cond?sl.doSave({uuid:e.uuid,src:a.script.textContent,force_settings:{enabled:!0},whitewash:!0,save:!0 +}).always(c):(v.error(Qr.getMessage("fatal_error")+" ("+e.uuid+")!!!"),c());else{let t=!1;const r=As(),s=["includes","excludes","matches"],i=["connects","blockers"],l=a.script.options;Object.keys(r.options).forEach((t=>{const n=e[t];void 0!==n&&(l[t]=n,o=o||!0===xu.SYNCED[t])}));const u=l.override;Object.keys(r.options.override).forEach((n=>{if(-1==n.indexOf("merge_"))return;const r=e[n];void 0!==r&&(u[n]=r,t=!0)})),s.forEach((n=>{const r=e[n];void 0!==r&&(t=!0,u["use_"+n]=r)})),i.forEach((t=>{ +const n=e[t];void 0!==n&&(u["use_"+t]=n)})),void 0!==e.tags&&(l.tags=e.tags),e.add_excludes&&(l.override.use_excludes=l.override.use_excludes.concat(e.add_excludes),t=!0),t&&(a.script=sl.mergeCludes(a.script)),e.temp_connects&&Yc.setSessionConnects(a.script.uuid,e.temp_connects),void 0!==e.enabled&&(a.script.enabled=e.enabled),o&&(a.script.lastModified=Date.now()),void 0!==e.file_url&&(a.script.downloadURL=e.file_url),sl.doModify(a.script.uuid,a.script,o).done(c).fail((()=>{n({})}))}else n({})} +},purgeScripts:o,saveScript:a,saveExternal:{allow:{extpage:!0},exec:(e,t,n)=>{Lc.setElement(e.uuid,e.url,{content:e.code||"",meta:e.mimetype||"text/javascript"},!0),dd.create("options.scripts").done((e=>{const t={success:!0,items:e,options:wn.snapshot};n(t)})).fail((e=>{const t={error:e||"unknown error",options:wn.snapshot};n(t)}))}},saveStorageKey:c,download:{allow:{extpage:!0},exec:(e,t,n)=>{bp.download.exec({postMessage:e=>{(e.error||e.load)&&n(e)},onMessage:()=>null,onDisconnect:()=>null, +disconnect:()=>null},e,t)}},askCom:l,execMenuCmd:{allow:{extpage:!0},exec:async(e,t,n)=>{try{const t=await Ho();if(!t.url)throw new Error("no url");const r={frameId:0,tab:t,url:t.url};Tu(e.id,r,e.event),n({})}catch(t){v.error(`unable to execute menu command ${e.id} due to empty tab!`)}}},prepare:{allow:{script:[]},exec:(e,t,n)=>{const r=t.tab;if(r){const s=Po(t,e);if(!s)return v.error("mh: unknown frameId",t,e);lh(r.id,t);const{url:i}=e,o=Qn(i);if(e.cleanup){let t=e.scripts +;"userscripts-dynamic"==wn.values.runtime_content_mode&&(t||(v.warn("mh: missing scripts for cleanup",e),t={}),nh(r.id,s,t,o)),fh(r.id,s,o),_h.setIcon(r.id),_h.setBadge(r.id),n({})}else gh(r.id,s,o,r,(t=>{const s=t?Up(t,e.url,r):{fast:!0};n(s),_h.setIcon(r.id),_h.setBadge(r.id)}))}else n({})}},contextmenu:{allow:{script:[]},exec:(e,t,n)=>{const{tab:r}=t;r&&wn.values.context_menu_enabled&&Yu.update(r.id),n({})}},clipboard:{allow:{script:"setClipboard",extpage:!0},exec:(e,t,n)=>{ +Mt&&Mt.supported?Mt.set({mimetype:e.mimetype,content:e.content},(()=>{n({success:!0})})):n({error:"unsupported"})}},determineScriptsToRun:{allow:{extpage:!0},exec:(e,t,n)=>{n({scripts:sl.determineScriptsToRun({url:e.url,deleted:!1}).map((e=>e.uuid))})}},externalMessage:{allow:{insecure:!0},exec:(e,t,n)=>wp(e.request,t,n)},cookie:d,audio:{allow:{script:"audio"},exec:(e,t,n)=>{const r=t.tab;if(r)if("setMute"==e.action){const t=e.details;if(!t||"object"!=typeof t)return void n({data:{ +error:"wrong arguments"}});mt.update(r.id,{muted:t.isMuted},(()=>{n({data:{success:!0}})}))}else"getState"==e.action&&mt.get(r.id,(e=>{if(!e)return void n({data:{error:"no tab"}});const t=e.mutedInfo,r=t?!!t.muted&&(t.extensionId?"extension":t.reason||"other"):void 0,s=e.audible;n({data:{muted:r,audible:s}})}))}},revoke:u}})(),mp=e=>{const t=ft.id,n=!T.HAS_SENDER_ID&&e.tab||e.id===t;let r +;const s=T.INTERNAL_PAGE_PROTOCOLS[0],i=s?s+"//":null,o=ft.getInternalPageRegexp(),a=e.url?e.url:e.tab?e.tab.url:null,c=e.origin?e.origin.toLowerCase():void 0;let l=n&&(!a||!!i&&0==a.indexOf(i))&&(!c||c===ce);if(l||!i){if(a){const e=a.match(o);e&&2==e.length&&(r=e[1])}else r="*";!i&&r&&(l=!0)}return{id_valid:n,url:a,page:r,extpage:l}},gp=(e,t)=>{const{uuid:n}=e;if(void 0===t)return!1;const r=De(t);if(0===r.length)return!0;if(!n)return!1;const s=r.map((e=>{const t=ql[e];if(t)return[...t] +})).filter((e=>void 0!==e));return((e,t)=>{const n=De(t),{script:r,cond:s}=sa.getByUid(e);if(r&&s&&r.grant.length){const{grant:e}=r;return n.some((t=>e.includes(t)))}return!1})(n,[].concat(...s))},vp=(e,t,n)=>{if(!_.late)return _.registerLateCallback((()=>{vp(e,t,n)})),!0;v.verbose("mh: request ",e," sender: ",t);const r=fp[e.method];if(!r)return v.warn("mh: unknown method "+e.method),!1;if(!r.allow||!r.exec)return v.warn("mh: invalid implementation of "+e.method),!1 +;const s=mp(t),i=s.extpage,o=s.page,a=s.id_valid;v.verbose("mh: request page:",o,"extpage:",i),i?t.extpage=o:delete e.origin;const c="options"==o,l=a&&!i;let u=!0;if("background"==o||r.allow.insecure||r.allow.extpage&&i||r.allow.options&&c||l&&gp(e,r.allow.script)){const s=r.exec(e,t,(e=>{if(u=!1,n(e),ft.lastError)return ft.lastError.message}));return!1!==u&&!1!==s||void 0}return!1===e.topframe&&(i||c)||v.warn("mh: this context doesn't have the permission to call \""+e.method+'"',s),!1 +},wp=(e,t,n)=>{let r,s;if("off"!=wn.values.external_connect&&(r=t.url)&&Gl.isAllowed(r)){for(const[t,n]of Object.entries(yp)){const i=Xo({match:[t]});if(i&&Jo(r,i)&&(n.includes("*")||n.includes(e.method))){s=!0;break}}if(s)if("getVersion"==e.method)n({version:ht.manifest.version,id:ft.short_id});else if("openOptions"==e.method){const r=t.tab;if(!r)return void v.warn("emh: unable to openOptions due to empty tabID!");let s=e.params||"";s&&!s.startsWith("#")&&(s=`#${s}`),mt.update(r.id,{ +url:ht.getURL("options.html")+s,active:!0},(()=>n({})))}else if("all"!=wn.values.external_connect)v.warn("mh: calling external method "+e.method+" is not permitted to "+r+" by the user");else if("isInstalled"==e.method){let t,r,s,i,o=!1;const a=e.script.name,c=e.script.namespace||void 0;(r=sa.getUidsByName(a,c)[0])&&(t=sa.getByUid(r))&&t.script&&!t.script.deleted&&(o=!0,i=t.script.enabled,s=t.script.version),n({name:a,namespace:c,installed:o,enabled:i,version:s}) +}else v.warn("emh: unknown external method "+e.method);else v.warn("mh: calling external method "+e.method+" is not permitted to "+r)}},bp=(()=>{const e={allow:{extpage:!0},exec:async(e,t,n)=>{let r,s,i=[];const o=hp(n),a=o&&("options"==n.extpage||"options"==t.origin),c=o&&("ask"==n.extpage||"ask"==t.origin);if(ht.inIncognitoContext&&"temporary"==wn.values.incognito_mode&&i.push({domain:"incognito",id:"incognito",image:"critical", +text:Qr.getMessage("All_modifications_are_only_kept_a_few_moments_Reconfigure_the_0name0_option_to_save_them_permanently_",Qr.getMessage("Store_data_in_incognito_mode"))}),!c){let t;gs.forEach((e=>{i.push({domain:"status",image:"critical",class:"warning",text:e.text,title:e.description,info_url:e.url})})),a?(t=oi.on("options",(t=>{if(!("options"in t))return void v.warn("mh: wrong notifyUiEvent options",t);const n=t.options;e.postMessage({hints:[n]})})), +(r=ci.optionsStatus())&&r.length?i=i.concat(r):(s=vi.updateAvailable())&&i.push({domain:"extensionUpdate",id:"extensionupdate",image:"info",class:"information",text:Qr.getMessage("0name0_0version0_is_available__Please_re_start_your_browser_to_update_",ht.manifest.name,s)})):(t=oi.on("actions",(t=>{const n="method"in t?{refresh:!0}:{hints:[t.options]};e.postMessage(n)})),i=i.concat(ci.actionStatus())),e.onDisconnect((()=>t()))}e.onMessage((e=>{if(e.clear)for(const t of e.clear){ +const{key:e,id:n,domain:r}=t,s=e||n;ci.all({domain:r,key:s,deleted:!0}),Rc(s)}})),e.postMessage({hints:i})}},t={allow:{script:"xmlHttpRequest"},exec:(e,t,n)=>{const{disconnect:r,postMessage:s,onMessage:i,onDisconnect:o}=e;let a=!1;const{details:c}=t;let{url:l,tfd:u,...d}=c;const{anonymous:A,cookiePartition:p}=d,h=d.redirect||"follow",f=n.tab?n.tab.cookieStoreId:void 0,m=p&&p.topLevelSite?p:void 0,g=!A&&(!!m||false);g&&(d.anonymous=!0,d.redirect&&"follow"!==d.redirect||(d.redirect="manual")) +;const w=async(e,t)=>{const r=(t||go(e.responseHeaders||""))["set-cookie"];if(r&&l)return await(async(e,t)=>{await Promise.all(e.toString().split(",").map((async e=>{var r;const s=(e=>{const t=e.split(";").filter((e=>"string"==typeof e&&!!e.trim())),n=t.shift();if(!n)return;const r=n.split("="),s=r.shift(),i=r.join("=");if(!s)return;const o={name:s,value:i};return t.forEach((function(e){var t;const n=e.split("="),r=null===(t=n.shift())||void 0===t?void 0:t.trimLeft().toLowerCase(),s=n.join("=") +;if(r)if("expires"===r){const e=new Date($(s));isNaN(e.getTime())||(o.expires=e)}else"max-age"===r?o.maxAge=parseInt(s,10):"secure"===r?o.secure=!0:"partitioned"===r?o.partitioned=!0:"httponly"===r?o.httpOnly=!0:"samesite"===r?o.sameSite=s:o[r]=s})),o})(e);if(!s)return;const{expires:i,httpOnly:o,name:a,path:c,sameSite:l,secure:u,partitioned:d,value:A}=s;let p=(l?(e=>{switch(e.toLowerCase()){case"lax":return"lax";case"strict":return"strict";case"none":return"no_restriction";default: +return"unspecified"}})(l):void 0)||"unspecified";const h={expirationDate:i?i.getTime():void 0,httpOnly:o,name:a,path:c,sameSite:p,secure:u,url:t,value:A};if(d)if(void 0!==m)h.partitionKey=m;else{let e;if(n.origin?e=n.origin.toLowerCase():n.url&&(e=null===(r=zn(n.url))||void 0===r?void 0:r.origin),!e)return void v.warn("mh: no origin for partitioned cookie");h.partitionKey={topLevelSite:e}}void 0!==f&&(h.storeId=f);try{await Ra.set(h)}catch(e){v.log("mh: failed to set/overwrite cookie",e)}}))) +})(r,e.finalUrl||l),!0};let b;d.partialSize=d.partialSize||Z.PARTIAL_SIZE;const _=new rt(1),y=[()=>{r()}],k=Object.assign({},...Object.keys(t.callbacks).map((e=>{const n=t.callbacks[e]||"onload"===e,r="ondone"===e,i=g&&"onreadystatechange"===e,o=g&&"onredirect"===e;if(n||r||o||i)return{[e]:async t=>{await _.acquire();const a=(t=t||{}).response;try{if(b&&await b(t,e))return;if((o||i&&2===a.readyState&&!ro.includes(a.status))&&await w(a),n||r){const n={data:a||{},exception:t.exception,[e]:!0};s(n) +}r&&y.forEach((e=>e(t)))}finally{_.release()}}}})));let R;const x=t.location||n.url||void 0;l&&(l=Vn(l,x)||l);const E=d.responseType;void 0!==E&&so.includes(E)&&"document"!==E||delete d.responseType,"no"!=wn.values.webrequest_modHeaders&&(d.headers=d.headers||{},T.SENDS_ORIGIN&&!Object.keys(d.headers).map((e=>e.toLowerCase())).includes("origin")&&(d.headers.origin=null));const S=d.cookie,C=async(e,t)=>(t||g)&&e?await ya(e,{anonymous:A,cookie:t,sender_domain:undefined,cookie_store_id:f, +cookie_partition:m}):void 0;C(l,S).then((e=>{delete d.cookie,e&&(d.headers=d.headers||{},d.headers.cookie=e)})).then((async()=>{var e;if(a){const e={response:ho("aborted"),exception:"aborted"};return k.onabort&&k.onabort(e),void k.ondone(e)}let r;if(l&&(r=null===(e=zn(l))||void 0===e?void 0:e.protocol)&&["file:"].concat(T.INTERNAL_PAGE_PROTOCOLS).includes(r)){const e=e=>{const t='Refused to connect to "'+l+'": '+e,n=ho(t);["onerror","ondone"].forEach((e=>{const r=k[e];r&&r({response:n, +exception:t})}))};if("file:"==r){let n,r;if(Ft()&&("all"==wn.values.script_file_access?n=!0:"externals"!=wn.values.script_file_access||(r=sa.getByUid(t.uuid))&&r.script&&r.cond&&[...r.script.resources,...r.script.requires].map((e=>Vn(e.unsafe_url,e.abs_url))).includes(l)&&(n=!0)),!n)return e("Access to this local file is forbidden!")}St(l,(e=>{const t=Ye(e),n=k.onpartial;if(n){const e=Ne(t||"",Z.PARTIAL_SIZE);e.forEach(((t,r)=>{n({response:{partial:t,index:r,length:e.length}})}))}const r={ +readyState:4,responseHeaders:"",status:0,statusText:""};["onload","ondone"].forEach((e=>{const t=k[e];t&&t({response:r})}))}),e)}else{if(u){const e=Us.fromTransferableData(u);e&&(y.push((()=>e.dispose())),l=e.tryObjectUrl||e.tryDataUri||l,l||(l=await e.toObjectUrl()))}if(!l)throw new Error("neither url nor tfd set!");const e={foreign_context:false,no_blob:t.no_blob};if(R=Yc.exec({...d,url:l},t.uuid,n||{},e,k),g){let r,s=!1;b=async({response:i},o)=>{if(a)return!1;if("onredirect"===o)return!1 +;if("onreadystatechange"===o&&i&&2==i.readyState&&ro.includes(i.status)){s=!0;const e=i.responseHeaders,t=go(e),{location:n}=t;return"follow"==h&&(r=n),await w(i,t),"follow"==h}if("ondone"==o&&r){const s=r;if(r=void 0,"follow"===h){l=Vn(s,{base:l,enforce_path:!0})||s;const r=await C(l,S);return r&&(d.headers=d.headers||{},d.headers.cookie=r),R=Yc.exec({...d,url:l},t.uuid,n||{},e,k),!0}return!1}return!("follow"!==h||!r&&(!s||!["onloadstart"].includes(o)))}}}}));const M=()=>{a||(R?R.abort():a=!0)} +;i((e=>{e.cancel&&M()})),o(M)}},n={allow:{script:"download"},exec:(e,t,n)=>{const{disconnect:r,postMessage:s,onMessage:i,onDisconnect:o}=e;let a,c=e;if("details"in t){const e=t.details;if(e.from.url){const r=t.location||n.url||void 0;e.from.url=Vn(e.from.url,r)||e.from.url}a=Qa.start(e,{internal:!!hp(n)})}else a=t.id;const l=e=>{c&&s({id:a,load:!0,data:e.info})},u=e=>{c&&s({id:a,progress:!0,data:e.info})},d=e=>{c&&s({id:a,error:!0,data:e})},A=e=>{c&&s({id:a,timeout:!0,data:e})},p=()=>{c&&r(), +c=null,Ea.off("load",l),Ea.off("progress",u),Ea.off("error",d),Ea.off("timeout",A),Ea.off("done",p)};Ea.on("load",l,{id:a}),Ea.on("progress",u,{id:a}),Ea.on("error",d,{id:a}),Ea.on("timeout",A,{id:a}),Ea.on("done",p,{id:a}),i((e=>{e.cancel&&Qa.cancel(a)})),o((()=>{c=null}))}},r={allow:{script:"values"},exec:(e,t,n)=>{const{postMessage:r,onMessage:s,onDisconnect:i}=e;if(n.tab){v.verbose("storage: "+t.uuid+" "+t.id);const o=e=>{if(e.id===t.id)return;const{storage:n,ts:s,removed:i}=e;r({storage:n, +ts:s,removed:i})},a=({tabId:e})=>{wi.has("scriptStorage",o)||v.warn("storage: no scriptStorage listener found for tab "+e+" "+t.uuid+" "+t.id),wi.off("scriptStorage",o)};bi.once("remove",a,{tabId:n.tab.id}),wi.on("scriptStorage",o,{uuid:t.uuid}),s((t=>{"saveStorageKey"===t.method?fp.saveStorageKey.exec(t,n,(t=>e&&r(t))):v.warn("storage: unknown message",t)})),i((()=>{v.verbose("storage disconnectHandler "+t.uuid+" "+t.id),wi.off("scriptStorage",o),bi.off("remove",a)})) +}else v.verbose("storage: unable to load storage due to empty tabID!",t),r({error:"missing tab id"})}},s={allow:{script:"openInTab"},exec:(e,t,n)=>{const{postMessage:r,onMessage:s,onDisconnect:i}=e;let o,a=e;const c=["active"];let l=null;const u=[];let d;const A=e=>{e.tabId===l&&(bi.off("remove",A),a&&r({closed:!0}))};y((({resolve:e,reject:r})=>{if("details"in t){const s={url:t.details.url};if(o=t.details.options){for(const e of c)void 0!==o[e]&&(s[e]=o[e]);if(o.incognito)s.incognito=!0;else{ +const e=n.tab;if(!e)return v.warn("mh: unknown tab ID",n);o.insert&&(s.index=e.index+1),o.setParent?s.parent=e:s.parent={windowId:e.windowId}}}mt.create(s,(async t=>{t?(l=t.id,await(e=>cl.acquire().then((async()=>{ol[e]||(ol[e]=!0,await al.set(e.toString(),!0))})).always((()=>cl.release())))(l)):v.warn("openInTab: cannot control new tab (maybe incognito)"),e()})),ft.lastError&&r()}else(e=>cl.acquire().then((()=>!!ol[e])).always((()=>cl.release())))(t.tabId).then((n=>{n&&(l=t.tabId,e())})) +})).promise().then((()=>{a&&(null===l?r({success:!1}):(d=!1,bi.on("remove",A),u.push((()=>bi.off("remove",A))),r({success:!0,tabId:l})))})),s((e=>{if(null===l||d)return;const{close:t,focus:n,name:s}=e;if(n)mt.update(l,{active:!0},(()=>{const e=ft.lastError;e&&v.warn("tab.focus",e.message)}));else if(t)mt.remove(l,(()=>{const e=ft.lastError;e?v.warn("tab.close",e.message):d=!0}));else if(void 0!==s){const e=5;let t=0;const n=()=>{if(null===l)return;const i=l,o=({tabId:o})=>{if(o!==i)return;a() +;const c={method:"setForeignAttr",attr:"name",value:s};mt.sendMessage(i,c,{frameId:0},(i=>{i?r({name:s}):t++{bi.off("complete",o),bi.off("commited",o)};u.push(a)};n()}})),i((()=>{u.forEach((e=>e())),a=null}))}},i={allow:{script:"menuCommand"},exec:(e,t,n)=>{const{postMessage:r,onDisconnect:s,onMessage:i}=e;if(n.tab){v.verbose("registerMenuCommand: add "+t.menuId) +;const{name:e,uuid:o,accessKey:a,autoClose:c,menuId:l,title:u}=t,d=n.tab.id,A=e=>{r({method:"run",menuId:l,event:e.event})};Eu.on("run",A,{menuId:l}),Uu({tabId:d,name:e,title:u,uuid:o,accessKey:a,autoClose:c,menuId:l,exec:!1}),i((e=>{if("registerMenuCommand"!==e.method)throw new Error("Unexpected message");const{name:t,uuid:n,accessKey:r,autoClose:s,menuId:i,title:o}=e;Uu({tabId:d,name:t,title:o,uuid:n,accessKey:r,autoClose:s,menuId:i,exec:!1}),ci.updateActionPage()})),s((()=>{ +v.verbose(`registerMenuCommand: unreg ${l}`),(e=>{delete Su[e]})(l),ci.updateActionPage(),Eu.off("run",A)})),ci.updateActionPage(),mt.getSelected(null,(e=>{e&&e.id==d&&Yu.update(d)}))}else v.warn("Unable to register menu cmd due to empty tabID!")}},o={allow:{script:"notification",extpage:!0},exec:(e,t,n)=>{const{postMessage:r,onMessage:s,onDisconnect:i}=e;if("canceled"in t)return void v.warn("notification: unexpected request",t);const o=t.image?t.image:Rs("tampermonkey");let a,c=!1 +;const{highlight:l,title:u,text:d,timeout:A,silent:p,url:h,tag:f,id:m}=t,g=e=>{c||(c=!0,mt.getSelected(null,(t=>mt.create({url:e,parent:t}))))};let w,b;s((e=>{b&&a&&"canceled"in e&&!e.canceled&&g(a)})),i((()=>{!w||h||f||w(),w=void 0})),(()=>{const e=y();var t,r;return l&&n.tab?(t=n.tab.id,r=()=>e.resolve(),mt.highlight({tabs:t},r)):e.resolve(),e.promise()})().then((()=>{const e=y();return d?(a=h,w=ti(u,d,o,{timeout:A,silent:p,notificationId:m},(t=>e.resolve(t.clicked))).cancel):e.resolve(), +e.promise()})).always((e=>{b=e;const t=r({clicked:b,notificationId:m});b&&t&&a&&g(a)}))}},a={allow:{extpage:!0},exec:async(e,t)=>{const{postMessage:n,onDisconnect:r}=e;let s=e;const i=void 0===t.reload||!!t.reload;let o,a,c,{data:l,json:u,code:d,url:A,tfd:p}=t;if(A)try{s&&n({progress:Qr.getMessage("Loading")}),c=await zo(A)}catch(e){return void n({error:Qr.getMessage("Unable_to_load_script_from_url_0url0",A)})}if(p){let e,t +;if(!(e=Us.fromTransferableData(p))||!(t=await e.toBlob()))return void n({error:Qr.getMessage("Unable_to_parse_this_")});c=await t.arrayBuffer()}if(l||c){if(c){s&&n({progress:Qr.getMessage("Decoding")});try{l=await Ke(c)}catch(e){}}if(l)try{a=await function(e){const t=y();let n;return y.Pledge().then((()=>bd.open(e))).then((()=>bd.entries())).then((async e=>{const r={},s={},i=2*e.length,o={};await Promise.all(e.map((async e=>{const n=await bd.get(e) +;let r=e.filename.match(/((.*)\.(storage\.json)|(.*)\.(options\.json)|(.*)\.(global\.json)|(.*)\.(user\.js)|(.*)\.user\.js-[0-9a-f]+-.*\.(resources\.json)|(.*)\.user\.js-[0-9a-f]+-.*\.(requires\.json))$/);if(r&&(r=r.slice(1).filter((e=>e))),!n||!r||r.length<3)return void(s[e.filename]=n);const a=r[1],c=r[2];o[e.filename]={filename:e.filename,name:a,type:c,ab:n},t.notify("Zip: "+Math.floor(Object.keys(o).length/i*100)+"%")})));const a=async({name:e,filename:t,type:s,ab:i})=>{const o=await Ke(i,{ +encoding:"UTF-8"});if("global.json"==s)n=JSON.parse(o);else{const n=r[e]||{resources:{},requires:{}};r[e]=n,"user.js"==s?n.source=o:"options.json"==s?n.options=JSON.parse(o):"resources.json"==s?n.resources[t]={name:t,data:JSON.parse(o)}:"requires.json"==s?n.requires[t]={name:t,data:JSON.parse(o)}:"storage.json"==s&&(n.storage=JSON.parse(o))}};for(const e of Object.values(o).filter((e=>e&&["requires.json","resources.json"].includes(e.type))))try{ +const n=e.filename.substr(0,e.filename.length-(e.type.length+1)),r=o[n];r&&(s[n]=r.ab,delete o[n]),await a(e),delete o[e.filename],t.notify("Zip: "+Math.floor((i-Object.keys(o).length)/i*100)+"%")}catch(e){v.log("porter: read zip failed",e)}for(const e of Object.values(o))try{await a(e),delete o[e.filename],t.notify("Zip: "+Math.floor((i-Object.keys(o).length)/i*100)+"%")}catch(e){v.log("porter: read zip failed",e)}const c=[];for(const[e,t]of Object.entries(r)){ +const{options:n,source:r,storage:i}=t;if(!r){v.warn(`porter: invalid script ${e}`);continue}const o={requires:[],resources:[]};["resources","requires"].forEach((e=>{for(const n of Object.values(t[e])){const t=n.name.replace("."+e+".json",""),r=s[t];r&&o[e].push({meta:n.data,source:Ye(r,{encoding:"resources"==e?void 0:"UTF-8"})||void 0})}}));const a={...o,...n,source:r,storage:i};c.push(a)}return{scripts:c,global_settings:n}})).done((e=>{t.resolve(e)})).fail((()=>{t.reject()})),t.promise() +}(l).progress((e=>{s&&n({progress:e})}))}catch(e){}if(!a){if(c)try{u=await Ke(c,{encoding:"UTF-8"})}catch(e){}u=l}}if(u&&!d&&!a)try{a=await function(e){const t=y(),n=(e,r)=>{if(e.trim()){let s=null;try{s=JSON.parse(e);const n=e=>{if(e&&e.length)return e.map((e=>({meta:e.meta,source:e.source?Qe(Xe(e.source)):e.source})))},r=s.scripts.map((e=>({meta:{uuid:e.uuid,name:e.name,file_url:e.file_url},settings:{enabled:e.enabled,position:e.position},options:e.options,storage:e.storage, +source:Qe(Xe(e.source)),resources:n(e.resources)||[],requires:n(e.requires)||[]})));return t.resolve({scripts:r,global_settings:s.settings})}catch(t){if(!r){const t="",r="";if(-1!=e.indexOf(t)){const s=e.indexOf(t),i=e.lastIndexOf(r);if(-1!=s&&-1!=i)return e=e.substr(s+t.length,i-(s+t.length)),n(e,!0)}}}}t.reject()};return n(e),t.promise()}(u)}catch(e){try{d=Qe(u)}catch(e){d=u}}if(a){const e={scripts:Object.values(a.scripts).map((e=>(e=>{const t=e.meta||{},n=e.settings||{},r=e=>({ +url:e.meta.url,sri:e.meta.sri,ts:e.meta.ts||null,mimetype:e.meta.mimetype,modified:e.meta.modified,content:e.source});return{source:e.source,name:t.name,uuid:t.uuid,file_url:t.file_url,options:e.options,storage:e.storage||{ts:0,data:{}},lastModified:t.modified,enabled:n.enabled,position:n.position,resources:e.resources?e.resources.map(r):[],requires:e.requires?e.requires.map(r):[]}})(e))),global_settings:a.global_settings};o=sl.importFromJson(e).then((e=>({reload:!!e.global_settings,success:!0 +}))).fail((()=>{n({error:Qr.getMessage("Unable_to_parse_this_")})}))}else{if(!d)return void n({error:Qr.getMessage("Unable_to_parse_this_")});o=sl.installFromSource(d,{force_url:A},{silent_fail:!0}).fail((e=>{var t;const r=((null===(t=null==e?void 0:e.messages)||void 0===t?void 0:t.errors)||[])[0]||Qr.getMessage("Unable_to_parse_this_");n({error:r})})).then((e=>({installed:e?1:0,success:!0})))}o.done((e=>{i&&!e.reload?dd.create("options.scripts").done((t=>{const r={...e,items:t};n(r) +})).fail((e=>{n({error:e||Qr.getMessage("An_error_occured_during_import_")})})):n(e)})),r((()=>{s=null}))}};return{keepAlive:{allow:{script:[],extpage:!0},exec:(e,t,n)=>{hp(n)?(su.emit("added",n),e.onDisconnect((()=>{su.emit("removed",n),ft.lastError}))):e.onMessage((()=>{}))}},tabInfo:{allow:{script:[]},exec:(e,t,n)=>{const r=n.tab;if(!r)return void v.warn("mh: unknown tab ID",n);if(r.id<0)return;const s=r.id;if(Lo(n)){const{info:r}=t;e.onDisconnect((()=>{i(),ft.lastError})), +bi.once("reset",(()=>{i()}),{tabId:s});const i=_i.on("set",(({info:t})=>{v.verbose("mh: tabInfo got info",t,n),e.postMessage({info:t})}),{tabId:s});if(r){for(const e of Object.values(r.map))Lo(e.sender)||(e.active=!1);_i.emit("got",{tabId:s,info:r})}else _i.emit("get",{tabId:s})}else{const r=Po(n);if(!r)return void v.error("mh: unknown frameId",n,t);const{url:i}=t;if(!i)return void v.warn("mh: missing URL for tabInfo");bi.emit("frameStart",{tabId:s,sender:r,url:i}),e.onDisconnect((()=>{ +v.verbose("mh: unload check url: "+i),bi.emit("frameStop",{tabId:s,sender:r,url:i}),ft.lastError}))}}},hints:e,xhr:t,xhrLocking:{allow:{extpage:!0},exec:async(e,t)=>{const{url:n}=t,{done:r}=await op();e.postMessage({ack:!0}),e.onDisconnect((()=>{r(),ft.lastError}))}},download:n,webRequest:{allow:{script:"webRequest"},exec:(e,t,n)=>{const r=n.tab;if(!r)return v.warn("mh: unknown tab ID",n);const{postMessage:s}=e;if(r.id,!Po(n))return v.error("mh: unknown frameId",n,t);s({type:"error", +message:"currently not supported in MV3",details:{}})}},addStorageListener:r,exportToJson:{allow:{extpage:!0},exec:(e,t)=>{const{postMessage:n}=e;sl.exportToJson(t.ids,t.options).done((e=>{const t=JSON.stringify(e);Ne(t,Z.PARTIAL_SIZE).forEach((e=>n({partial:e}))),n({done:!0})})).fail((e=>{n({error:e||"serialization error"})}))}},openInTab:s,notification:o,registerMenuCommand:i,registerCtxer:{allow:{script:[]},exec:(e,t,n)=>{var r;const{postMessage:s,onDisconnect:i}=e;if(n.tab){ +const{uuid:e,contextId:o}=t,a=null===(r=n.tab)||void 0===r?void 0:r.id;if(a){const t=`ctxer-${e}-${o}`;Uu({tabId:a,name:Qr.getMessage("Execute_now"),uuid:e,autoClose:!0,menuId:t,exec:!0});const n=()=>{s({done:!0})};Eu.once("run",n,{menuId:t}),i((()=>{Eu.off("run",n)})),mt.getSelected(null,(e=>{e&&e.id==a&&Yu.update(a)}))}else v.warn(`unable to register ctxer ${e} due to empty tabID!`)}else v.warn("Unable to register context menu script due to empty tabID!")}},observeUrlChanges:{allow:{ +script:"window.onurlchange"},exec:(e,t,n)=>{const{postMessage:r,onDisconnect:s}=e,{tab:i,frameId:o}=n;if(!i)return v.warn("mh: unknown tab ID",n);const a=i.id,c=e=>{e.tabId==a&&e.frameId==o&&r({url:e.url})};md.addListener(a,c),s((()=>{md.removeListener(a,c)}))}},observeAudioStateChanges:{allow:{script:"audio"},exec:(e,t,n)=>{const{postMessage:r,onDisconnect:s}=e,{tab:i}=n;if(!i)return v.warn("mh: unknown tab ID",n);const o=i.id,a=(e,t)=>{t.id==o&&("muted"in e&&r({muted:e.muted}), +"audible"in e&&r({audible:t.audible}))};gl.addListener(a),s((()=>{gl.removeListener(a)}))}},tabWatch:{allow:{extpage:!0},exec:(e,t,n)=>{const{disconnect:r,postMessage:s,onDisconnect:i}=e,{active:o,url:a,filter:c}=t,l=n.tab,u=gl.openAndWatch({url:a,active:o,filter:c?new RegExp(c):void 0,index:((null==l?void 0:l.index)||0)+1,parent:l},(e=>{e?s({tab:e}):(d(),r())})),d=()=>{u.cancel()};i(d)}},syncInfo:{allow:{extpage:!0},exec:e=>{const{postMessage:t,onDisconnect:n}=e,r=e=>t({info:e}) +;wi.on("syncProgressEvent",r),n((()=>{wi.off("syncProgressEvent",r)}))}},importEx:a,backgroundControl:{allow:{script:[]},exec:async(e,t)=>{const{postMessage:n}=e;let r;wn.values.background_control?"restart"in t&&t.restart?(await F(45e3),r="still there"):r="unsupported action":r="not supported",n({error:r})}}}})(),_p=(()=>{const e=(e,t)=>{const{messageId:n,refreshId:r,method:s}=t;if(n||r){const t={messageId:n,refreshId:r,ack:!0,method:s};try{e.postMessage(t)}catch(n){ +v.debug("mh: Error sending port ("+e.name+") message ACK",t,n)}return!!r}};return t=>{let n;const r=s=>{_.ensureLate((()=>{if(n)n(s);else if(void 0!==s.method){const i=((t,n)=>{const r=t.sender;v.verbose("mh: connect.method "+n.method+" contextId "+n.id+" tabId: "+(r.tab?r.tab.id:"unknown!!!"));const s=bp[n.method];if(!s)return v.warn("mh:"+Qr.getMessage("Unknown_method_0name0",n.method)),!1;if(!s.allow||!s.exec)return v.warn("mh: invalid implementation of "+n.method),!1 +;const i=mp(r),o=i.extpage,a=i.page,c="options"==a,l=i.id_valid&&!o;if("background"==a||s.allow.insecure||o&&s.allow.extpage||c&&s.allow.options||l&&gp(n,s.allow.script)){let i;return e(t,n),s.exec({postMessage:e=>{try{t.postMessage(e)}catch(n){return v.debug("mh: Error sending port ("+t.name+") message",e,n),n.message||n}},disconnect:()=>t.disconnect(),onMessage:n=>{if(!1===i)throw Error("port message listener registration must be done synchronously");i=r=>{e(t,r)||n(r,t)}}, +onDisconnect:e=>t.onDisconnect.addListener(e)},n,{...r,...a?{extpage:a}:{}}),i=i||!1,i}return!1===n.topframe&&(o||c)||v.warn("mh: this context doesn't have the permission to call \""+n.method+'"'),!1})(t,s);i?n=i:t.onMessage.removeListener(r)}else v.warn("mh: invalid request",s)}))};t.onMessage.addListener(r)}})(),yp={"*://*.tampermonkey.net/*":["getVersion","openOptions"],"*://*.greasyfork.org/*":["*"],"*://*.sleazyfork.org/*":["*"],"*://*.openuserjs.org/*":["*"],"*://*.userstyles.org/*":["*"], +"*://*.userscript.zone/*":["*"]},kp=(()=>{const e={exec:async(e,t,n,r)=>{if(!e)throw Error("invalid port");const s="options.scripts.userscripts",{action:i,messageId:o}=t,a=(e,t,n)=>r({messageId:e,error:{number:t,message:n}});try{if("options"==i){const e=t.activeUrls;e&&e.length&&Gl.forbid(e),r({messageId:o,allow:["options","list","get","patch"]})}else if("list"==i){const e=(await dd.create(s)).filter((e=>e.userscript)),t={messageId:o,list:e.map((e=>{ +const{uuid:t,namespace:n,name:r,requires:s,storage_key_count:i}=e,o=`${ee(t)}`;return{namespace:n||"",name:r,path:`${o}/source`,requires:s.filter((e=>e.url)).map((e=>`${o}/external/${ee(e.url)}`)),storage:i?`${o}/storage`:void 0}}))};r(t)}else if("get"==i){const{path:e,ifNotModifiedSince:n,ifModifiedSince:i}=t,[c,l,u]=e.split("/").map((e=>$(e)));if(!["source","storage","external"].includes(l))return a(o,404,"Not found");const d=i||n;try{let e,t +;if("storage"===l)e=sa.getStorageByUid(c).ts;else if("source"===l){const{script:t,cond:n}=sa.getByUid(c);if(!t||!n)return a(o,404,"Not found");e=t.lastModified}else if(u){const t=Lc.getElement(c,u);t&&(e=t.ts)}if(!d||!e||e>d){const e=(await dd.create(`${s}.${l}`,{uuid:c,url:u}))[0];if(void 0===e)return a(o,404,"Not found");if("string"==typeof e)t=e;else{const n={};Object.keys(e).forEach((t=>{n[t]=Pt(e[t])})),t=(e=>{const t=`__undefined__${Pe()}` +;return JSON.stringify(e,((e,n)=>void 0===n?t:n),void 0).replace(new RegExp(`"${t}"`,"g"),"undefined")})(n)}}r({messageId:o,value:t,lastModified:e})}catch(e){return a(o,404,"Not found")}}else if("patch"===i){const{path:e,value:n,lastModified:s}=t,[i,c,l]=e.split("/").map((e=>$(e)));if(!i||"string"!=typeof n)return a(o,400,"Bad Request");const{script:u,cond:d}=sa.getByUid(i);if(!u||!d)return a(o,404,"Not found");if("source"==c){if(void 0!==l)return a(o,400,"Bad Request");sl.doSave({name:u.name, +uuid:i,src:n,ask:!wn.values.editor_easySave,external:!0,save:!0,...s?{force_meta:{lastModified:s}}:{}}).done((()=>{r({messageId:o})})).fail((()=>{a(o,400,"Bad Request")}))}else if("storage"==c){if(void 0!==l)return a(o,400,"Bad Request");const e=s||Date.now();try{const t=sa.getStorageByUid(i).data,r=Object.entries(JSON.parse(n)).reduce(((e,[t,n])=>(e[t]=Nt(n),e)),{});((t,n)=>{const r=Object.keys(n),s=Object.keys(t);r.concat(s).filter(((e,t,n)=>n.lastIndexOf(e)===t)).forEach((o=>{ +r.includes(o)?s.includes(o)?n[o]!==t[o]&&((t,n,r)=>{sa.setStorageByUidAndNotify(i,e,void 0,t,r)})(o,t[o],n[o]):((t,n)=>{sa.setStorageByUidAndNotify(i,e,void 0,t,n)})(o,n[o]):(t=>{sa.setStorageByUidAndNotify(i,e,void 0,t,void 0,!0)})(o,t[o])}))})(t,r)}catch(e){return a(o,400,"Bad Request")}r({messageId:o})}else{if("external"!=c)return a(o,404,"Not found");{const e=Lc.getElement(i,l);if(!e)return a(o,404,"Not found");const t=e.data.meta||"text/javascript";await Lc.setElement(i,l,{content:n,meta:t, +lastModified:s},!0),r({messageId:o})}}}else{if("put"===i||"delete"==i)return a(o,405,"Method Not Allowed");v.warn(`emh: unknown action ${i}`),e.disconnect()}}catch(e){return a(o,500,"Internal error")}}};return{userscripts:e}})(),Rp=["editor-firefox@tampermonkey.net","afknhifbpphifnhohilgdbjclplncbij","lieodnapokbjkkdkhdljlllmgkmdokcm"],xp=e=>{_.late?e.onMessage.addListener((t=>{void 0!==t.method&&((e,t)=>{const{sender:n}=e,{id:r}=n;if(!Rp.includes(r))return void e.disconnect() +;v.verbose("emh: connect.method "+t.method+" contextId "+t.id+" tabId: "+(n.tab?n.tab.id:"unknown!!!"),t);const s=kp[t.method]||{},{exec:i}=s;if(!i)return v.warn("emh: unknown method "+t.method),!1;const o=i(e,t,n,(t=>{try{e.postMessage(t)}catch(n){v.debug(`emh: error sending message to port[${e.name}]`,t,n)}}));"function"==typeof o&&e.onDisconnect.addListener(o),v.verbose("emh: connect.method "+t.method+" end!")})(e,t)})):_.registerLateCallback((()=>{_p(e)}))};let Ep;const Sp={init:()=>{ +ht.onMessage.addListener(vp),ht.onConnect.addListener(_p),ht.onConnectExternal.addListener(xp)},get externally_connectable_reg(){return Ep||(Ep=Xo({match:Object.keys(yp)})),Ep},externally_connectable:yp},Cp=e=>{let t,n,r;switch(e){case"raw+":r=t=n=!0;break;case"default":case"-js":r=t=!0,n=!1;break;case"js+":t=n=!0,r=!1;break;case"js":t=!0,r=n=!1;break;case"dom":n=!0,t=r=!1;break;case"raw":r=!0,n=t=!1}return{js:t,dom:n,raw:r}},Mp=(e,t,n,r)=>{ +const s=Fo(n),i=e.id+"#"+(s?"i":"n")+(r?"a":"e")+"#"+t,o=Ko.get(i);let a=o?JSON.parse(o):void 0;if(!a){const o=[],c=[],l=[],u=[],d={};if(t){const i=sl.determineScriptsToRun({url:t,warn:false,enabled:!r||void 0,deleted:!1});for(const t of i){if(v.verbose("check "+t.name+" for enabled:"+t.enabled),void 0!==s){const e=s?"incognito-tabs":"normal-tabs";let r,i=null +;if((i=wn.values.runtime_run_in)&&i.length&&!i.includes(e)||(i=t.options.run_in||t.options.override.orig_run_in)&&i.length&&!(i.includes(e)||n.cookieStoreId&&(r=j.getIdFromStoreId(n.cookieStoreId))&&i.includes(`container-id-${r}`)))continue}(Lo(e)||!0!==t.options.noframes&&(null!==t.options.noframes||!0!==t.options.override.orig_noframes))&&(t.evilness&&t.evilness>=Math.min(Uc.SEVERITY_MAX,wn.values.script_blacklist_severity)?l.push(t):t.enabled?(d[t.uuid]=t.name, +sl.isContexter(t)?u.push(t):o.push(t)):c.push(t))}}a={contexters:u,runners:o,disabled:c,evilness:l,script_map:d},t&&Ko.set(i,JSON.stringify(a))}return a},Ip=e=>{const{runners:t,contexters:n}=e,{js:r,dom:s,raw:i}=Cp(wn.values.sandbox_mode),o=e=>{const t=[],n=[],r=[];return e.forEach((e=>{let t,o;Kl(e)?(t=e.script.options.sandbox,o=e.script.name):(t=e.options.sandbox,o=e.name) +;const a="raw"===t||null===t,c="JavaScript"===t,l="DOM"===t,u=()=>v.info(`content: script "${o}" wants to be executed inside a ${t||"raw"}-level sandbox, but this mode is currently disabled at the security settings`);l&&s?r.push(e):((c||l)&&u(),i?n.push(e):(a&&u(),s?r.push(e):v.warn(`content: script "${o}" can't be executed`)))})),{dom:r.length?r:void 0,raw:n.length?n:void 0,js:t.length?t:void 0}};return{scripts:o(t||[]),contexters:o((n||[]).map((e=>(e=>{ +const{uuid:t,options:n,name:r,name_i18n:s,description:i,description_i18n:o}=e;return{uuid:t,options:n,name:r,name_i18n:s,description:i,description_i18n:o}})(e))))}},Up=(e,t,n)=>{const{scripts:r,contexters:s}=Ip(e),i=[{m:"native",t:[Qa.staticVars.DEFAULT,Qa.staticVars.NATIVE]},{m:"disabled",t:[Qa.staticVars.OFF]},{m:"browser",t:[Qa.staticVars.CHROME]}].filter((e=>{if(e.t.includes(wn.values.downloads_mode))return!0})).map((e=>e.m))[0]||"disabled",o=ru(),a=Sp.externally_connectable_reg;return{ +scripts:r,contexters:s,external_connect:"off"!=wn.values.external_connect&&a.rinc&&a.rinc.length?a.rinc.map((e=>Yo(e))):void 0,nonce:e.nonce,originalURL:t,injectMode:wn.values.runtime_inject_mode,contentMode:wn.values.runtime_content_mode,inIncognitoContext:Fo(n)||!1,isFirstPartyIsolation:Ra.fpi,sharedBlobs:!1,sharedObjectUrls:!0,container:n.cookieStoreId?j.getIdFromStoreId(n.cookieStoreId):void 0,userAgent:o,downloadMode:i,relaxedCsp:wn.values.webrequest_fixCSP, +sandboxMode:wn.values.sandbox_mode,enforce_strict_mode:"on"==wn.values.runtime_strict_mode,top_level_await:["default","on"].includes(wn.values.runtime_top_level_await),measure_scripts:wn.values.debug,logLevel:wn.values.logLevel,version:ht.manifest.version}};let Gp=1;const Zp=Gp++,Tp=Gp++,Bp=Gp++,Op=Gp++,jp=Gp++,Dp=Gp++,Fp=Gp++,Lp=Gp++,Pp=Gp++,Np=Gp++,Vp=(Ns("execInfo"),{}),zp=z({retimeout_on_get:!0,timeout:300,check_interval:120}),qp={},Hp=(e,t)=>{ +(t||["running_unique","running"].includes(wn.values.appearance_badges))&&(_h.setIcon(e),_h.setBadge(e))},Qp=e=>{const t=Vp[e];t&&_i.emit("set",{tabId:e,info:t})},Wp=e=>{const t=`${e}`;delete qp[e],delete Vp[e],zp.remove(t)},Xp=e=>{const t=Vp[e];if(t)return t;{const t={map:{},scripts:{},searched:{}};return Vp[e]=t,t}},Yp=(e,t,n,r)=>$p(e,t,n,r),Jp=(e,t)=>$p(e,void 0,void 0,void 0,void 0,t),Kp=(e,t,n)=>$p(e,t,void 0,void 0,void 0,void 0,!1,n),$p=(e,t,n,r,s,i,o,a)=>{const c=Xp(e) +;if(void 0!==s&&n)c.searched[n]=s;else if(void 0!==i)c.allowed=i;else if(t){const e=t.id;let s=c.map[e];if(void 0===s){if(!1===o)return;s=c.map[e]={active:!0,sender:t,scripts:[],urls:[]}}if(r)s.scripts.push(r.uuid),c.scripts[r.uuid]=r.name;else if(s.active=!!o,a){const t=Math.random().toString(36).substr(2,10),n=`${e}_${Date.now()}_${t}`;c.map[n]=s,delete c.map[e]}n&&!s.urls.includes(n)&&s.urls.push(n)}else v.warn("setExecInfo: sender missing");Qp(e)},eh=(e,t)=>{const n=`${e}`,r=zp.get(n) +;if(r)return r;if(!t){const e={scripts:{},objurl:{},running:0,disabled:0};return zp.set(n,e),e}},th=(e,t,n)=>{let r=qp[e];if(r||n||(r={frames:{},requests:{}},qp[e]=r),r){const e=t.id,n=r.frames;n[e]||(n[e]={sender:t,state:Zp})}return r},nh=function(e,t,n,r){const s=Object.entries(n);if(s.length)for(const[n,i]of s)Yp(e,t,r,{uuid:n,name:i});else $p(e,t,r)},rh=function(e,t,n,r){let s;const i=Fo(r)?"incognito-tabs":"normal-tabs",o=wn.values.runtime_run_in +;return o.length&&!o.includes(i)||!Gl.isAllowed(n)?(v.log("This URL is filtered by the security settings:",n,"-> Do nothing!"),Jp(e,!1),s={contexters:[],runners:[],disabled:[],evilness:[],script_map:{}}):s=Mp(t,n,r),s.runners.forEach((n=>{n.webRequest&&n.webRequest.length&&uh(e,t,n.uuid,n.webRequest)})),s},sh=(e,t)=>{wn.values.userscript_search_url&&"badge"==wn.values.userscript_search_mode&&void 0===Xp(t).searched[e]&&Ll(e).then((n=>{((e,t,n)=>{$p(e,void 0,t,void 0,n)})(t,e,n.count), +_h.setBadge(t)}))};let ih,oh;const ah=e=>{const t=Xp(e.id),{scripts:n,map:r}=t,s={};for(const e of Object.keys(n)){let t=[],n=0,i=[];Object.values(r).forEach((({active:r,scripts:s,urls:o})=>{i=i.concat(o),r&&(t=t.concat(s.filter((t=>t==e)))),n+=s.filter((t=>t==e)).length}));const o=Ce(t).length;s[e]={count:o,all_time:n,urls:i}}return s},ch=(e,t)=>{const n={},r=Vp[e.id];let s;if(r)s=r.map;else{if(!t)return n;$p(e.id,t,e.url),s=Xp(e.id).map} +for(const{sender:t,urls:r}of Object.values(s))for(const s of r){if(v.verbose(`Found at info[${e.id}] -> ${s}`),!Gl.isAllowed(s))continue;const{runners:r,contexters:i,disabled:o,evilness:a}=Mp(t,s,e,!0);[r,i,o,a].forEach((e=>{e.forEach((e=>{n[e.uuid]=e}))}))}return n},lh=(e,t)=>{Lo(t)&&void 0===Ah(e)&&Jp(e,!0)},uh=(e,t,n,r,s)=>{const i=t.frameId;if(void 0===i)return;const o=[];r.forEach((e=>{const t="string"==typeof e.selector?{include:[e.selector] +}:e.selector,n=["include","match","exclude"].reduce(((e,n)=>{const r=t[n];return r&&(e[n]="string"==typeof r?[r]:r),e}),{}),r=e.action;let s;if("string"==typeof r)s="cancel"===r?{cancel:!0}:{};else{const{cancel:e,redirect:t}=r;s="string"==typeof t?{redirect:{url:t}}:{cancel:e,redirect:t}}o.push({selector:n,action:s})})),((e,n,r,s)=>{const o=th(e,t);(o.requests[i]||(o.requests[i]={}))[r]=s})(e,0,n,{id:n+"@"+e+":"+t.id+"#"+Date.now(),rules:o,uuid:n,callback:s})},dh=(e,t)=>{ +const n=Xp(e),{map:r,searched:s}=n;let i=0,o=0,a=0,c=[];for(const{active:e,scripts:n,urls:l}of Object.values(r)){for(const e of l){const t=s[e];void 0!==t&&(a=t)}i+=n.length,e&&(o+=n.length,t&&(c=c.concat(n)))}return{active:o,executed:i,searched:a,unique:c.length?Ce(c).length:0}},Ah=e=>Xp(e).allowed,ph=(e,t)=>{var n;const r=t.frameId;if(void 0!==r)return null===(n=qp[e])||void 0===n?void 0:n.requests[r]},hh=(e,t)=>{const n=qp[e],r=t.id;return!!(null==n?void 0:n.frames[r])},fh=(e,t,n)=>{ +if(th(e,t,!0)){if(n){const t=Qn(n),r=eh(e,!0);r&&delete r.scripts[t]}const r=((e,t)=>{const n=eh(e),r=n.objurl[t.id];return void 0!==r&&delete n.objurl[t.id],r})(e,t);r&&URL.revokeObjectURL(r)}};bi.on("active",(({tabId:e,windowId:t})=>{ih=t,oh=e,mt.getSelected(t,(t=>{t&&t.id==e&&t.url&&sh(t.url,e)}))})),bi.on("reset",(({tabId:e})=>{let t;if(t=qp[e])for(const{sender:n}of Object.values(t.frames))fh(e,n);Wp(e)}));const mh=(e,t,n,r)=>{if(!wn.values.enabled)return +;const s=t.id,i=th(e,t).frames[s],o=i.state||Zp,a=Qn(n);let c;const l=eh(e);return c=l.scripts[a],o{if(!wn.values.enabled)return;const i=th(e,t),o=t.id,a=i.frames[o];(a.state||Zp){ +if(!wn.values.enabled||!["https:","http:","file:"].some((e=>n.startsWith(e))))return;const r=th(e,t),s=t.id,i=r.frames[s];(i.state||Zp)>=Tp||(i.state=Tp)})),bi.on("request",(({tabId:e,sender:t,url:n})=>{if(!wn.values.enabled||!["https:","http:","file:"].some((e=>n.startsWith(e))))return;const r=th(e,t),s=t.id,i=r.frames[s];(i.state||Zp)>=Bp||(i.state=Bp)})),bi.on("loading",(({tabId:e,sender:t,url:n,incognito:r,cookieStoreId:s})=>{ +if(!wn.values.enabled||!["https:","http:","file:"].some((e=>n.startsWith(e))))return;const i=th(e,t),o=t.id,a=i.frames[o],{incognito:c,cookieStoreId:l}=a.incognitoInfo||{};a.incognitoInfo={incognito:c||r,cookieStoreId:l||s},(a.state||Zp)>=Dp||(a.state=Dp)}));const gh=(e,t,n,r,s)=>{if(!wn.values.enabled)return;const i=th(e,t),o=t.id,a=i.frames[o],c=Qn(n),l=eh(e);let u=l.scripts[c];if(!u&&(v.log("tv: lazy init @ events.prepare("+e+", "+o+", "+n+")"),u=l.scripts[c]=rh(e,t,c,r), +!u))return void v.warn("tv: no script run info for tab "+e+" @ "+c);const d=a.state;a.state=Fp,d!=Fp&&nh(e,t,u.script_map,c);const{contexters:A,nonce:p}=u,h=s?r=>{fh(e,t,n);const i=r||A.length?{runners:r,contexters:A,nonce:p}:void 0;s(i)}:void 0,f=function(e,t,n,r,s){const i=[];for(const e of r)i.push(tu.bundle(e));let o;return y.when(i).then((e=>e.filter((e=>{const t=Kl(e);return t&&v.log("run script "+e.script.name+" @ "+n),t})))).always((e=>{s?s(e):o=e})),o}(0,0,c,u.runners,h) +;return f||A.length?{runners:f,contexters:A,nonce:p}:u.runners.length||A.length?{count:u.runners.length||A.length,nonce:p}:void 0},vh=(e,t,n,r,s)=>{const i=y.Pledge();if(!wn.values.enabled||!["https:","http:","file:"].some((e=>n.startsWith(e))))return i;const o=th(e,t),a=t.id,c=o.frames[a];if((c.state||Zp)>=Lp)return i;const l=y();return s&&(gh(e,t,n,r,(s=>{if(!s)return l.resolve();const i=Up(s,n,r);((e,t,n)=>{const{js:r}=gA,s=t.frameId,i=y();if(void 0===s)return v.error("dc: no frameId set!"), +i.resolve(),i.promise();if(kt.supported){const t=y();n?kt.executeScript({target:{tabId:e,frameIds:[s]},injectImmediately:!0,world:"ISOLATED",func:e=>{window.tm_info=e},args:[n]}).then((()=>t.resolve())):t.resolve();const o=y();return kt.executeScript({target:{tabId:e,frameIds:[s]},injectImmediately:!0,world:"ISOLATED",files:r.map((e=>e.file))}).then((()=>o.resolve())),y.when([t.promise(),o.promise()]).then((()=>i.resolve()))}{let t;if(n){ +const e=JSON.stringify(n),r=String.fromCharCode(8232),s=String.fromCharCode(8233);t=-1!==e.search(r)||-1!==e.search(s)?`window.tm_info=JSON.parse(atob("${We(e)}"));`:`window.tm_info=${e};`}const o=y();return t?mt.executeScript(e,{frameId:s,code:t,runAt:"document_start"},(()=>o.resolve())):o.resolve(),y.when([o.promise(),...r.map((t=>{const n=y();return mt.executeScript(e,{frameId:s,file:t.file,runAt:"document_start"},(()=>n.resolve())),n.promise()}))]).then((()=>i.resolve()))} +})(e,t,i).then((()=>l.resolve()))})),c.state=Lp),l.promise()};bi.on("complete",(({tabId:e,sender:t,url:n})=>{if(!wn.values.enabled||!["https:","http:","file:"].some((e=>n.startsWith(e))))return;const r=th(e,t),s=t.id,i=r.frames[s];i.state,i.state=Pp,Lo(t)&&(oh==e&&sh(n,e),"auto"==wn.values.scriptUrlDetection&&n.startsWith(QA)&&WA(n,e))})),bi.on("unload",(({tabId:e,sender:t})=>{fh(e,t);const n=th(e,t),r=t.id;n.frames[r].state=Np,Kp(e,t,!0),Hp(e),delete n.frames[r]})), +bi.on("remove",(({tabId:e})=>{const t=qp[e];t&&Object.values(t.frames).forEach((t=>{fh(e,t.sender)})),Wp(e)})),bi.on("error",(({tabId:e,sender:t,url:n})=>{Lo(t)&&"auto"==wn.values.scriptUrlDetection&&n.startsWith(QA)&&WA(n,e)})),bi.on("frameStart",(({tabId:e,sender:t})=>{((e,t)=>{$p(e,t,void 0,void 0,void 0,void 0,!0)})(e,t),Hp(e)})),bi.on("frameStop",(({tabId:e,sender:t})=>{Kp(e,t),Hp(e)}));const wh=()=>{ft.lastError&&ft.lastError},bh={init:()=>{if(!_t.supported)return;bh.setIcon() +;let e=wn.values.appearance_badge_color||"#ee3131";"#"===e[0]||e.startsWith("rgb")||(e="#"+e),_t.setBadgeBackgroundColor({color:e}),e=wn.values.appearance_badge_text_color||"#ffffff","#"===e[0]||e.startsWith("rgb")||(e="#"+e),_t.setBadgeTextColor({color:e})},setIcon:(e,t)=>{if(!_t.supported||void 0!==e&&e<0)return;let n,r,s;if(t)s=!0;else if(void 0!==e){const t=Ah(e);void 0!==t&&(s=t)}s?n=wn.values.enabled&&void 0!==e?"":"_grey":(n="_forbidden", +r=Qr.getMessage("Some_URLs_are_restricted_by_your_browser_or_a_setting_")),v.debug("badge: set icon "+n);const i={path:ht.getURL("images/icon"+n+".png")},o={title:r||ht.manifest.name};void 0!==e&&(i.tabId=e,o.tabId=e);try{_t.setIcon(i,wh),_t.setTitle(o)}catch(e){v.warn("bg: ERROR while setIcon! "+e.message)}},setBadge:(e,t)=>{if(!_t.supported||e<0)return;let n=0 +;t||"off"==wn.values.appearance_badges?n=0:"active"==wn.values.appearance_badges?e&&(n=dh(e).executed?" ":null):"alltime"==wn.values.appearance_badges?e&&(n=dh(e).executed||0):"running"==wn.values.appearance_badges?e&&(n=dh(e).active||0):"running_unique"==wn.values.appearance_badges&&e&&(n=dh(e,!0).unique||0);let r=n?`${n}`:"";if(wn.values.userscript_search_url&&"badge"==wn.values.userscript_search_mode){const t=dh(e).searched||0;if(t>0){let e="" +;null==n||"string"==typeof n?r=`${t}`:(e=n>999?"":n>99||`${r}+${t}`.length>4?"+":`${t}`,r=`${r}+${e}`)}}v.debug("badge: set "+r),_t.setBadgeText({text:r,tabId:e})}},_h=bh,yh=e=>(()=>{const t=y();return"activate"==e?(_t.supported&&_t.openPopup(),t.resolve()):"toggle-enable"==e?(wn.values.enabled=!wn.values.enabled,t.resolve()):mt.getSelected(null,(n=>{if(!n)return void t.reject();let r;if("open-dashboard"==e)r=ht.getURL("options.html")+"#nav=dashboard";else{const t=n.url +;t?"open-dashboard-with-running-scripts"==e?r=ht.getURL("options.html")+"#nav=dashboard&filter="+ee(t):"open-new-script"==e&&(r=ht.getURL("options.html")+"#url="+We(t)+"&nav=new-user-script"):console.warn("cl: no URL in tab",n)}t.resolve(r?{url:r,active:!0,parent:n}:void 0)})),t.promise()})().then((e=>{e&&mt.create(e)})),kh=e=>!!e&&!("scripts"in e&&(!Array.isArray(e.scripts)||e.scripts.some((e=>{ +return"object"!=typeof e||e.file_url&&"string"!=typeof e.file_url||"string"!=typeof e.source||e.options&&"object"!=typeof e.options||e.storage&&("object"!=typeof e.storage||!("object"==typeof(t=e.storage)&&null!==t&&"number"==typeof t.ts&&"object"==typeof t.data&&null!==t.data))||e.resources&&(!Array.isArray(e.resources)||e.resources.some((e=>!wd(e))))||e.requires&&(!Array.isArray(e.requires)||e.requires.some((e=>!wd(e))));var t +})))||"global_settings"in e&&"object"!=typeof e.global_settings),Rh=an("managed","consumed");self.setTimeout=N;const xh=new Date;ae.down=Qa,ae.dast=nn,v.debug("Starting background fred @"+pp);const Eh=()=>{const e="temporary"==wn.values.incognito_mode&&ht.inIncognitoContext;nn.setTemporary(e),e&&(wn.values.sync_enabled=!1,wn.values.scriptUpdateCheckPeriod=0,wn.values.sync_type=0,wn.values.statistics_enabled=!1)},Sh=ae.init=async()=>{Qr.init(),_.init(),HA(!0),gl.init(),Sp.init(),It&&function(e){ +if(!pt)throw new Error("commands.onCommand listener can only be registered during startup in non-persistent background pages!");C.commands.onCommand.addListener(e)}(yh),ft.setUninstallURL(`https://www.tampermonkey.net/uninstall.php?ext=${ft.short_id}`),(e=>{Wr=e})(zl),_t.supported&&(_t.setIcon({path:ht.getURL("images/icon_grey.png")}),_t.setPopup({popup:"action.html"}),_t.setTitle({title:"Tampermonkey"})),ft.onUpdateAvailable.addListener(vi.onUpdateAvailable),ft.onInstalled.addListener((e=>{ +v.log("bg: onInstalled",e);const t=e.reason||"unknown";_.ensureLate((()=>{"install"==t?(G.SECURE||sa.getUidList().forEach((e=>{const t=sa.getByUid(e);t.script&&t.cond&&t.script.evilness!=Uc.SEVERITY_FOISTED_SCRIPT&&(v.warn("content security: found unfamiliar script",t.script.name),t.script.evilness=Uc.SEVERITY_FOISTED_SCRIPT,sl.doModify(e,t.script,!1))})),vi.onInstalled()):"update"==t&&(e.previousVersion,vi.onUpdated(e.previousVersion))}))})),Yu.init();const e=ht.manifest.version;((e,t)=>{ +Sr=`${(null==t?void 0:t.version)||""} `;const n=B.short_id;gr=(mr[n]||mr[Jn])(),Ae("error",(e=>{const{message:t,filename:n,lineno:r,colno:s,error:i}=e;((e,t,n,r,s)=>{let i="";if(s)try{i=s.stack||""}catch(e){}Zr(e.toString(),Sr+"bg@"+O.urls.prepareForReport(t||""),[n+":"+r,i].join(";"))})(t,n,r,s,i)}));const r=e=>{let t="";try{t=e.stack}catch(e){} +Zr("CSP violation of "+e.effectiveDirective,Sr+"bg@"+O.urls.prepareForReport(e.documentURI),[e.sourceFile," -> ",e.lineNumber+":"+e.columnNumber,t].join(";"))};we?we.addEventListener("securitypolicyviolation",(e=>r(e))):Ae("securitypolicyviolation",(e=>r(e))),(null==t?void 0:t.started)&&(lr=Date.now()-t.started.getTime())})(0,{version:e,started:xh}),v.log("bg: listeners registered!");{let t,n=!1;const r=new Promise((e=>{t=e}));let s=10;const i=()=>{if(C&&C.storage&&C.storage.local)n=!0,t();else{ +const t=`chrome.storage.local is not available on startup, wait ${s} ms`;v.error(t),Zr(t,e+"bg@"+ht.urls.prepareForReport(ne.href||"")),se((()=>i()),s),s=Math.min(1e3,2*s)}};i(),n||await r}const t=await Oi();v.debug("bg: init tab handling"),await(async()=>{_i.on("got",(({tabId:e,info:t})=>{t&&(Vp[e]=((e,t)=>{if(!e)return t;const{map:n,scripts:r,searched:s}=e,{map:i,scripts:o,searched:a}=t,c={map:{...n},scripts:{...r,...o},searched:{...s,...a}} +;for(const[e,{active:t,sender:r,scripts:s,urls:o}]of Object.entries(i)){const i=n[e];i?(i.active=t,i.urls=Ce(i.urls.concat(o)),i.scripts=Ce(i.scripts.concat(s))):c.map[e]={active:t,sender:r,scripts:s,urls:o}}return c})(Vp[e],t),Hp(e,!0))})),_i.on("get",(({tabId:e})=>Qp(e)))})(),await(()=>{const e=y(),t="0.0.0.0";let n,r;const s=ht.manifest.version;let i,o;const a=e=>`!extdb.${e}`;let c=a;return ia.init().then((()=>{let e=ia.getValue(c(oa),!0);void 0===e&&(e=ia.getValue(oa,!0), +void 0===e?e="3.5":c=e=>e),i=o=e,r=ia.getValue(c(ca),!0)||ia.getValue(ua,!0)||(xe?xe.getItem(ua):null)||t,n=ls(s,r)==ls.eNEWER})).then((()=>{if("localStorage"===G.DEFAULT||!xe)return y.Pledge(!1);const e=y(),t=ia.getValue(c(ca));let n=!1;return xe.getItem(c(ua))&&!t&&(ia.listValues().length?v.error("storage: unable to find version information"):n=!0),e.resolve(n),e.promise()})).then((e=>{if(!n&&e){ +const e=["Tampermonkey detected inconsistencies that indicate that your browser wiped the extension database!","You can continue to use Tampermonkey normally, but your settings and scripts might be lost. Click here to get more information.","https://www.tampermonkey.net/faq.php#Q207"];v.error(e.join("\n")),((e,t,n)=>{gs.push({text:e,description:t,url:n})})(...e)}})).always((()=>{let c=0;const l=()=>{if(c{c++,l()},n=d[c].schema;d[c].cond(n)?d[c].fn().done((()=>{ +n&&(v.info("Converted database from",o,"to",n),o=n),t()})).fail((()=>{e.reject()})):t()}},u=()=>{v.error("Incognito mode detected. Database conversion can only be done in non-incognito mode! Stopping now..."),((e,t,n)=>{const r={title:e.join("\n\n")},s=t?"_"+t:"",i=ht.getURL("images/icon"+s+".png");v.warn(e.join("\n")),_t.supported&&(_t.setIcon({path:i}),_t.setTitle(r)),n||ht.onMessage.addDynamicListener(((t,n,r)=>{const s={name:"1",id:"1",sub_menu_item:!0,pos:"left",items:[]};s.items.push({ +name:e[0],image:"info"}),e.length>1&&s.items.push({name:e[1]}),r({items:[s],options:{enabled:!1}})}))})(["Tampermonkey needs to convert its database but this can't be done in incogonito mode!","Please open a non-incognito mode window and/or restart your browser."],"paused")},d=[{cond:()=>n&&ls("3.6.3650",o)==ls.eNEWER&&ls("3.5.3650",r)==ls.eNEWER,fn:async()=>{if(ht.inIncognitoContext)throw u(),new Error("can't migrate in incognito mode!");{o="3.6.3650";const e=[];[{o:"TM_config",n:aa},{ +o:"TM_update_check",n:la},{o:"TM_version"},{o:"TM_unload_ts"}].forEach((t=>{if(t.n){const n=ia.getValue(t.o);void 0!==n&&e.push(ia.setValue(t.n,n))}e.push(ia.deleteValue(t.o))}));let t=new RegExp("@re$");const n=[];ia.listValues().forEach((e=>{if(-1==e.search(t))return;const r=e.replace(t,"");n.push(r)})),n.forEach((t=>{const n=ia.getValue(t+"@st"),r=ia.getValue(t),s=ia.getValue(t+"@re"),i=ia.getValue(t+"@source"),o=sa.getUidByName(t)||Pe();e.push(ia.deleteValue(t+"@st")), +e.push(ia.deleteValue(t)),e.push(ia.deleteValue(t+"@re")),e.push(ia.deleteValue(t+"@source")),r&&s&&i?(e.push(ia.setValue(da+o,t)),e.push(ia.setValue(Aa+o,s)),e.push(ia.setValue(pa+o,n)),e.push(ia.setValue(ha+o,i)),e.push(ia.setValue(fa+o,r))):v.error("invalid script entry",{source:i,meta:r,cond:s})})),t=new RegExp("@st$"),ia.listValues().forEach((n=>{-1!=n.search(t)&&e.push(ia.deleteValue(n))})),await y.heal(e).done((()=>{v.info("Converted database from",r,"to",o)}))}}},{schema:"3.7.0", +cond:e=>ls(e,o)==ls.eNEWER,fn:async()=>{if(ht.inIncognitoContext)throw u(),new Error("can't migrate in incognito mode!");{const e=[];ia.listValues().forEach((t=>{if(!t.startsWith(fa))return;const n=ia.getValue(t);if(n&&n.options&&n.options.override&&!n.options.override.orig_run_at){n.options.override.orig_run_at=n.options.run_at||"document-idle",n.options.run_at=null;const r={...n};e.push(ia.setValue(t,r))}})),await y.heal(e)}}},{schema:"5465",cond:e=>ls(e,o)==ls.eNEWER,fn:async()=>{ +if(ht.inIncognitoContext)throw u(),new Error("can't migrate in incognito mode!");{const e=ia.getValue(aa,!0);e&&1==e.sync_version&&(e.sync_enabled=!1,await y.heal(ia.setValue(aa,e,!0)))}}},{schema:"6226",cond:e=>ls(e,o)==ls.eNEWER,fn:async()=>{if(ht.inIncognitoContext)throw u(),new Error("can't migrate in incognito mode!");{const e=[oa,"#storage",aa,"#session",ca,"#laststart",la,"#begging"],t=[da,Aa,pa,ha,"@ext#",fa],n="#misc_config",r=["TM_version","@state#"],s=[];let i=[] +;for(const o of ia.listValues()){const c=ia.getValue(o,!0);if(i.length>50&&(await y.heal(i),i=[]),void 0===c)v.error(`Unable to migrate key ${o} because it's empty!`);else if(o.startsWith(n)){const e=o.slice(n.length);i.push(ia.setValue(`!misc.${e}`,c,!0))}else r.some((e=>o.startsWith(e)))?(v.info(`Dropping key ${o} because it's not needed anymore!`),i.push(ia.deleteValue(o))):e.includes(o)||t.some((e=>o.startsWith(e)))?i.push(ia.setValue(a(o),c,!0).fail((()=>{ +v.error(`Unable to migrate key ${o}! A backup is available at the database root.`)})).then((()=>ia.deleteValue(o).fail((()=>v.error(`Unable to delete migrated key ${o}!`)))))):s.includes(o)||v.error(`Unable to migrate unknown or already migrated key ${o}!`)}await y.heal(i)}}},{cond:()=>n||ls(o,i)==ls.eNEWER,fn:()=>y.heal([ia.setValue(a(ca),s,!0),ia.setValue(a(oa),o,!0)])},{cond:()=>n,fn:()=>(v.info("First run of version "+s+"!"),vi.scheduleNotification(r,r==t),y.Pledge())},{cond:()=>!0, +fn:async()=>{const t=y();return e.resolve(),await null,t.resolve(),t.promise()}}];l()})),e.promise()})();const n=await(async()=>await(async()=>{const e=await(async()=>{const e=await(async()=>{let e;if(!xt.managed.supported)return e;for(let t=5;!e&&t>0;--t)5!==t&&console.warn(`Managed storage is slow or not responding! Retrying (attempt ${5-t})...`),await Promise.race([new Promise((e=>se((()=>e(!1)),200))),new Promise((t=>{xt.managed.get(["jsonImport"],(n=>{e=n,t(!0)}))}))]);return e})();return{ +...e}})();if(!e||!e.jsonImport)return;const t=e.jsonImport;if(!t.length)return;const n=await Rh.get(),r=t.filter((e=>"string"==typeof e.hash&&!n[e.hash]));let s;const i=[];for(const e of r){const{hash:t,url:n,haltOnError:r,installAsSystemScripts:o}=e,a=e=>{if(r)throw new Error(e);console.error(`provisioning[${t.substr(0,8)}]: ${e}`)};console.info(`provisioning[${t.substr(0,8)}]: start downloading from ${n}`);const[c,l]=t.split(":");if("1"!==c){a("Invalid provisioning jsonImport hash version") +;continue}let u;try{u=(await new Promise(((e,t)=>{Uo.internal({method:"GET",url:n,responseType:"json",timeout:6e5},{onload:t=>e(t),onerror:e=>t(e),ontimeout:()=>t("timeout")})}))).response}catch(e){}if(!u){a(`Failed to load provisioning jsonImport from ${n}`);continue}if(!kh(u)){a(`Invalid provisioning jsonImport from ${n}`);continue}const d=await No(u);if(d!==l){a(`Hash mismatch for provisioning jsonImport from ${n}: expected 1:${l} !== calculated 1:${d}`);continue}let A=!1 +;const{version:p,scripts:h,settings:f}=u;if("1"===p){if(h)for(const e of h)i.push((async()=>{const n=Pe(),{file_url:r,source:s,storage:i,options:c,resources:l,requires:u}=e,d=Qe(Xe(s));let p;try{p=await sl.doSave({uuid:n,url:r,src:d,ask:!1,force_options:c,force_settings:"enabled"in e||"position"in e?{enabled:e.enabled,position:e.position}:void 0,defaultscript:!1!==o,replace:!0,internal:!0})}catch(e){}if(p&&p.installed){ +if(console.info(`provisioning[${t.substr(0,8)}]: installed jsonImport script ${e.name}([uuid: ${n}])`),[l,u].forEach((e=>{e&&e.forEach((e=>Lc.setElement(n,e.url,{content:e.content||"",meta:e.mimetype||"text/javascript"},e.modified)))})),i)try{await sa.setStorageByUid(n,{data:i.data||{},ts:i.ts||Date.now()})}catch(t){return void a(`Failed to set storage for jsonImport script from ${e.file_url}`)}A=!0}else a(`Failed to install jsonImport script from ${e.file_url}`)}));f&&(s||(s={}),s={...s,...f}, +console.info(`provisioning[${t.substr(0,8)}]: imported global settings`)),i.push((async()=>{A?(Gr("installed",t.substr(0,8)),await Rh.set({[e.hash]:Date.now()}),console.info(`provisioning[${t.substr(0,8)}]: successfully applied`)):console.warn(`provisioning[${t.substr(0,8)}]: failed to apply`)}))}else a(`Invalid provisioning jsonImport version from ${n}: expected 1 !== retrieved ${p}`)}if(s){const e=new ze("");await e.set(I.STORAGE.CONFIG,s),Xt=e, +console.info("provisioning[*]: global settings set")}return i.length?async()=>{for(const e of i)await e()}:void 0})())();v.debug("bg: init storage handling"),await nn.init(),await y.Pledge(),v.debug("bg: init config"),await wn.init(),n&&await n(),ae.cfgo=wn,Eh(),(e=>{if(v.set(wn.values.logLevel),Qr.setLocale(wn.values.i18n),wn.values.userscript_search_url){const e=()=>{(({url:e,mode:t})=>{Dl=Uo.internal,"string"==typeof e?Tl=Bl=e:(Tl=(e=>{const t=e.api||e.www +;return`${e.protocol}//${t?t+".":""}${e.domain}`})(e),Bl=(e=>{const t=e.www;return`${e.protocol}//${t?t+".":""}${e.domain}`})(e)),jl=t,Ol=Qr.getLocale()||Qr.getUiLocale()})({url:["dhdg","gcal","fire","iikm","mfdh","fcmf"].includes(ft.short_id)?sn:wn.values.userscript_search_url,mode:wn.values.userscript_search_mode})};wn.addChangeListener("userscript_search_mode",e),e()}var t,n,r,s,i,o;t=sl.doModify,n=sa.getByUid,Pc=t,Nc=n,oo={prefix:void 0,mozAnon:!1},void 0!==(r=Wi)&&(lo=r), +void 0!==(s=op)&&(co=s),void 0!==(i=lp)&&(ao=i),void 0!==(o=ba)&&(io=o),Uo.init(),_.ensureLate((()=>{e&&(cr=e);const t=wn.values.statistics_enabled;null===t?ci.all({key:"stats",domain:"stats",class:"information",title:Qr.getMessage("Anonymous_statistics"),text:Qr.getMessage("Please_enable_anonymous_statistics_and_help_to_improve_this_extension_"),info_url:"https://www.tampermonkey.net/privacy.php",timeout:864e5,buttons:[{text:Qr.getMessage("Enable"),id:"enable_stats"},{text:Qr.getMessage("No"), +id:"disable_stats"}]}):Cr(!!t)})),bi.on("reset",(({tabId:e,early:t})=>{(e=>{const t=Object.values(Su).filter((t=>t.tabId==e));for(const e of t)delete Su[e.menuId]})(e),t||_h.setIcon(e)}));const a=(e,t)=>{e>=0&&mt.get(e,(n=>{!ft.lastError&&n&&(_h.setIcon(e,t),_h.setBadge(e,t))}))};bi.on("commited",(({tabId:e,sender:t})=>{Lo(t)&&a(e,!0)})),bi.on("complete",(({tabId:e})=>a(e))),bi.on("reset",(({tabId:e})=>Yc.purgeAppeals(e))),bi.on("remove",(({tabId:e})=>{Yc.purgeAppeals(e),(e=>{delete nd[e]})(e) +})),xu.init(),Gl.init(),Uc.init(),sa.init(),Qa.init(),Ka.init(),HA(),ld.init(),td(),$a=ba})(!0===t),wn.addChangeListener("logLevel",(()=>{v.set(wn.values.logLevel)})),wn.addChangeListener("i18n",(()=>{Qr.setLocale(wn.values.i18n)})),wn.addChangeListener("incognito_mode",(()=>{Eh()})),wn.addChangeListener("statistics_enabled",(()=>{Cr(!!wn.values.statistics_enabled)})),wn.addChangeListener("context_menu_enabled",(()=>{wn.values.context_menu_enabled||Yu.clear()})), +wn.addChangeListener(["require_blacklist","script_blacklist_server","script_blacklist_type"],sl.blackCheckAll),wn.addChangeListener("webrequest_modHeaders",((e,t,n,r)=>{null==r||r.done((()=>se(Xa.reset,1)))})),wn.addChangeListener(["appearance_badge_color","appearance_badge_text_color"],_h.init),wn.addChangeListener("script_include_mode",(()=>$o.removeAll())),_h.init(),v.debug("bg: init user agent infos"),await(async()=>{let e,t,n;try{ +const r=navigator.userAgentData&&navigator.userAgentData.getHighEntropyValues?await navigator.userAgentData.getHighEntropyValues(["fullVersionList"]):void 0;r&&(e=r.fullVersionList,t=r.mobile,n=r.platform)}catch(e){}if(!e){const r=navigator&&navigator.userAgentData;r&&(e=r.brands,t=r.mobile,n=r.platform)}const{arch:r,os:s}=await new Promise((e=>B.getPlatformInfo((t=>e(t||{}))))),{name:i,version:o}=await new Promise((e=>B.getBrowserInfo((t=>e(t||{})))));return nu={brands:e||[{brand:i||"", +version:o||""}],mobile:void 0===t?S():t,platform:(s?{mac:"macOS",win:"Windows",android:"Android",cros:"Chrome OS",linux:"Linux",openbsd:"Open/FreeBSD",fuchsia:"Fuchsia"}[s]:void 0)||n,...r?{arm64:{bitness:"64",architecture:"arm"},mips64:{bitness:"64",architecture:"mips"},"x86-32":{bitness:"32",architecture:"x86"},"x86-64":{bitness:"64",architecture:"x86"}}[r]:{architecture:r}},nu})(),v.debug("bg: init script injection handling"),await Promise.race([(async()=>{await Promise.all([UA(),dp()]) +})(),(async()=>{await F(1e4),_.late||v.warn("bg: initialization of script injection handling took too long, continue anyway")})()]),sl.clean(),await y.Pledge(),v.log(`bg: ready! [sessionStart=${t}]`),_.setReady(),(async()=>{await(async()=>{const e=await kc.get();for(const t of Object.values(e))if("number"!=typeof t&&t.expires&&t.expires{const e=await kc.get();return Object.values(e).filter(yc).map((e=>Ec(e)))})() +;for(const t of e){const e={domain:"status",...t};"actions"==t.realm?ci.actionPage(e):"options"==t.realm?ci.optionsPage(e):ci.all(e)}})()},Ch=Sh;{try{importScripts("/test.js")}catch(e){console.error(e)}const e=globalThis,{skipWaiting:t,clients:n}=e;try{e.oninstall=()=>t(),e.onactivate=()=>n.claim()}catch(e){console.error(e)}}Ch()})()})(); \ No newline at end of file diff --git a/backend/neko/tampermonkey-seed/Default/Extensions/dhdgffkkebhmkfjojejmpbldmpobfkfo/5.5.0_0/cache.js b/backend/neko/tampermonkey-seed/Default/Extensions/dhdgffkkebhmkfjojejmpbldmpobfkfo/5.5.0_0/cache.js new file mode 100644 index 0000000..fdc5211 --- /dev/null +++ b/backend/neko/tampermonkey-seed/Default/Extensions/dhdgffkkebhmkfjojejmpbldmpobfkfo/5.5.0_0/cache.js @@ -0,0 +1,5 @@ +(()=>{"use strict";const{AbortController:e,FileReader:t,TextDecoder:s,atob:n,btoa:o,clearInterval:r,clearTimeout:a,crypto:c,decodeURIComponent:i,encodeURIComponent:l,escape:u,location:h,setInterval:d,setTimeout:p,unescape:f}=self;let{fetch:w}=self;h.origin,h.host;const{addEventListener:g,removeEventListener:m}=self,{DOMParser:W,Notification:v,Image:y,Worker:x,alert:S,confirm:T,document:b,screen:k,webkitNotifications:R,navigation:D,showOpenFilePicker:I}=self;let L;try{L=self.localStorage +}catch(e){}let{XMLHttpRequest:q}=self;const{clients:E}=self;self.addEventListener("install",(()=>{console.log("SW: started"),self.skipWaiting().catch((e=>console.warn(e)))}));const $="x-sw-cache-timestamp";self.addEventListener("fetch",(e=>{const t=e.request.url,s=caches.match(t).then((async s=>{let n;if(s&&(!(n=s.headers.get($))||Date.now(){console.log(`SW: caching ${e}`);const s=await caches.open("dynamic"),n=await(async(e,t)=>{const s=t?t((()=>{const t=new Headers;for(const[s,n]of e.headers.entries())t.append(s,n);return t})()):e.headers,n=await e.blob();return new Response(n,{status:e.status, +statusText:e.statusText,headers:s})})(t,(e=>(e.set($,Date.now().toString()),e)));return s.put(e,n.clone()).catch((e=>console.warn(e))),n})(t,s)}catch(e){return(async(e,t)=>{console.log(`SW: caching error response for ${e}`);const s=await caches.open("dynamic"),n=new Response(null,{status:500,statusText:t||"internal error",headers:{[$]:Date.now().toString()}});return s.put(e,n.clone()).catch((e=>console.warn(e))),n})(t,e.message)}})).catch((e=>{const t=e.message||e.statusText||"unknown error" +;return console.log(`SW: unexpected error ${t}`),new Response(null,{status:500,statusText:t})}));e.respondWith(s)}))})(); \ No newline at end of file diff --git a/backend/neko/tampermonkey-seed/Default/Extensions/dhdgffkkebhmkfjojejmpbldmpobfkfo/5.5.0_0/content.js b/backend/neko/tampermonkey-seed/Default/Extensions/dhdgffkkebhmkfjojejmpbldmpobfkfo/5.5.0_0/content.js new file mode 100644 index 0000000..dac4379 --- /dev/null +++ b/backend/neko/tampermonkey-seed/Default/Extensions/dhdgffkkebhmkfjojejmpbldmpobfkfo/5.5.0_0/content.js @@ -0,0 +1,92 @@ +((twod, k) => { if(window[k]) return; window[k] = true;(()=>{"use strict";function e(e,t,n,o,s,r,i){try{var c=r(e,i),a=kt(c,"value")}catch(e){return void n(e)}kt(c,"done")?t(a):an(new dn((e=>e(a))),o,s)}function t(t){const n=function(){var n=this,o=arguments;return new dn((function(s,r){function i(t){e(a,s,r,i,c,ln,t)}function c(t){e(a,s,r,i,c,un,t)}var a=$t(t,n,o);i(void 0)}))};return Tt(n,"apply",(function(e,t){return $t(n,e,t)})),n}function n(e,t){let n,o=!0;return"boolean"==typeof e?(o=e,n=t):n=e,Xn((e=>{const t=_n(_t.document) +;"interactive"==t||"complete"==t?(n&&n(),e()):Fn.addEventListener("DOMContentLoaded",(()=>{n&&n(),e()}),At({capture:o,once:!0}))}))}const o=["chrome"],s=e=>{const t=Object.call,n=t.bind(t),o=Object.assign,s=Object.getOwnPropertyDescriptor,r=Object.getPrototypeOf,i=e=>o({__proto__:null},e),c=r(function*(){}()),a=r(Uint8Array.prototype);return i({sourceWindow:e,cSO:i,F_c:n,F_a:Object.apply,F_b:Object.bind,F_tS:Function.toString,A_fE:[].forEach,A_so:[].some,A_sh:[].shift,A_j:[].join, +A_iO:[].indexOf,A_iA:Array.isArray,O_a:o,O_k:Object.keys,O_v:Object.values,O_dP:Object.defineProperties,O_dPy:Object.defineProperty,O_hOP:Object.hasOwnProperty,O_gOPN:Object.getOwnPropertyNames,O_gOPD:s,O_gOPDs:Object.getOwnPropertyDescriptors,O_gPO:r,O_tS:{}.toString,J_p:JSON.parse,J_s:JSON.stringify,M_f:Math.floor,M_r:Math.random,M_m:Math.max,M_mi:Math.min,N_tS:(0).toString,N_MSI:Number.MAX_SAFE_INTEGER,P_t:Promise.prototype.then,P_c:Promise.prototype.catch,P_co:Promise.prototype.constructor, +G_n:c.next,G_t:c.throw,R_rABS:FileReader.prototype.readAsBinaryString,R_rAT:FileReader.prototype.readAsText,R_r:s(FileReader.prototype,"result").get,R_enq:e.ReadableStreamDefaultController?e.ReadableStreamDefaultController.prototype.enqueue:null,R_cl:e.ReadableStreamDefaultController?e.ReadableStreamDefaultController.prototype.close:null,S_fCC:String.fromCharCode,S_sl:"".slice,S_su:"".substr,S_sp_nr:"".split,S_iO:"".indexOf,S_tr:"".trim,S_r_nr:"".replace,S_rA_nr:"".replaceAll, +S_cCA:"".charCodeAt,S_tLC:"".toLowerCase,S_tUC:"".toUpperCase,Y_tST:Symbol.toStringTag,Y_unsc:Symbol.unscopables,USP_tS:URLSearchParams.prototype.toString,D_pFS:DOMParser.prototype.parseFromString,U_cOU:URL.createObjectURL,U_rOU:URL.revokeObjectURL,X_o:XMLHttpRequest.prototype.open,X_pSD:XMLHttpRequest.prototype.DONE,X_pSH:XMLHttpRequest.prototype.HEADERS_RECEIVED,X_pSL:XMLHttpRequest.prototype.LOADING,X_pSO:XMLHttpRequest.prototype.OPENED,X_pSU:XMLHttpRequest.prototype.UNSENT, +X_s:XMLHttpRequest.prototype.send,D_n:Date.now,I_tS:e=>""+e,E_r:Element.prototype.remove,E_s:Element.prototype.setAttribute,E_rA:Element.prototype.removeAttribute,D_cS:s(Document.prototype,"currentScript").get,D_gRS:s(Document.prototype,"readyState").get,D_cE:Document.prototype.createElementNS,D_gEBT:Document.prototype.getElementsByTagName,M_rT:s(MouseEvent.prototype,"relatedTarget").get,C_d:s(CustomEvent.prototype,"detail").get,P_p:s(PageTransitionEvent.prototype,"persisted").get, +C_pA:CustomEvent.prototype.AT_TARGET,M_d:MutationObserver.prototype.disconnect,W_aEL:addEventListener,W_rEL:removeEventListener,FD_e:FormData.prototype.entries,TA_b:s(a,"buffer").get,TA_sa:Uint8Array.prototype.subarray,parseInt,parseFloat,CustomEvent,CompositionEvent,KeyboardEvent,MouseEvent,MutationObserver,console:Object.assign({},console),Error,Uint8Array,Blob,ReadableStream,Number,String,Proxy,Window,FileReader,DOMParser,XMLHttpRequest,Function,RegExp,Promise,encodeURIComponent, +decodeURIComponent,encodeURI,decodeURI,escape,unescape,atob,btoa,setTimeout,clearTimeout,setInterval,clearInterval,postMessage,dispatchEvent,alert,prompt,confirm,close,getElementById:e.Document.prototype.getElementById,createEvent:e.Document.prototype.createEvent,createElement:e.Document.prototype.createElement})},r="vault"in twod;if(r&&void 0===twod.vault)throw"Invalid vault" +;const i=twod.vault=twod.vault||s(twod.unsafeWindow),{cSO:c,F_c:a,F_a:d,F_b:l,F_tS:u,A_fE:p,A_so:g,A_sh:m,A_j:f,A_iO:h,A_iA:v,O_a:b,O_k:_,O_v:w,O_dP:y,O_dPy:M,O_hOP:L,O_gOPN:E,O_gOPD:I,O_gOPDs:S,O_gPO:O,O_tS:x,J_p:D,J_s:j,M_f:R,M_r:P,M_m:C,M_mi:$,N_tS:A,N_MSI:T,P_t:U,P_c:k,P_co:B,G_n:F,G_t:X,R_rABS:N,R_rAT:q,R_r:W,R_enq:H,R_cl:G,S_fCC:J,S_sl:K,S_su:z,S_iO:Y,S_sp_nr:V,S_tr:Z,S_rA_nr:Q,S_cCA:ee,S_tLC:te,S_tUC:ne,Y_tST:oe,Y_unsc:se,D_pFS:re,D_cS:ie,D_gRS:ce,D_cE:ae,D_gEBT:de,E_r:le,E_s:ue,E_rA:pe,C_pA:ge,M_d:me,C_d:fe,P_p:he,M_rT:ve,U_cOU:be,U_rOU:_e,USP_tS:we,X_o:ye,X_s:Me,X_pSD:Le,X_pSH:Ee,X_pSL:Ie,X_pSO:Se,X_pSU:Oe,D_n:xe,I_tS:De,W_aEL:je,W_rEL:Re,FD_e:Pe,TA_b:Ce,TA_sa:$e,parseInt:Ae,parseFloat:Te,console:Ue,encodeURIComponent:ke,decodeURIComponent:Be,encodeURI:Fe,decodeURI:Xe,escape:Ne,unescape:qe,atob:We,btoa:He,postMessage:Ge,dispatchEvent:Je,alert:Ke,prompt:ze,confirm:Ye,close:Ve,getElementById:Ze,createEvent:Qe,createElement:et,CustomEvent:tt,CompositionEvent:nt,KeyboardEvent:ot,MouseEvent:st,MutationObserver:rt,Uint8Array:it,FileReader:ct,DOMParser:at,XMLHttpRequest:dt,Function:lt,RegExp:ut,Blob:pt,ReadableStream:gt,Number:mt,String:ft,Proxy:ht,Window:vt}=i,bt=twod,{unsafeWindow:_t,unsafeThis:wt}=bt,yt=a,Mt=d,Lt=_,Et=w,It=b,St=M,Ot=E,xt=I,Dt=O,jt=v,Rt=P,Pt=C,Ct=$,$t=(e,t,n)=>yt(Mt,e,t,n),At=c,Tt=(e,t,n)=>(St(e,t,At({ +value:n,configurable:!0,enumerable:!0,writable:!0})),e),Ut=(e,t)=>Zt(e,t)?e[t]:void 0,kt=(e,t)=>{const n=xt(e,t);return n?At(n).value:void 0},Bt=(e,t)=>{const n=(e,t,o)=>{const s=xt(e,t),r=s?At(s):void 0;let i;return r?r.enumerable?r.value:void 0:--o>=0&&(i=Dt(e))?n(i,t,o):void 0};return n(e,t,5)},Ft=e=>{const t=(t,...n)=>$t(e,t,n);return Tt(t,"wrappedJSObject",e),t},Xt=()=>e=>Ft(e),Nt=Ft(l),qt=D,Wt=Xt()(g),Ht=Xt()(m),Gt=(e,t)=>{const n=[];return Vt(e,(e=>{t(e)&&zt(n,e)})),n},Jt=(e,t,n)=>{ +const o=e.length;let s=t||0;if(s>=o)return[];s<0&&(s=Pt(0,o+s));let r=void 0===n?o:n;r<0&&(r=Pt(0,o+r)),r>o&&(r=o);const i=At({});for(let t=s;t{let n=e.length||0;return Tt(e,n,t),n++,e.length=n},Yt=Xt()(h),Vt=Xt()(p),Zt=Xt()(L),Qt=Xt()(V),en=Xt()(K),tn=Ft(x),nn=Dt({}),on=e=>{const t=At(e),n=Ot(t);for(let e=0;e{const t=Qt(tn(e)," ") +;return en(Kt(Jt(t,1)," "),0,-1)},rn=Xt()(u),cn=Xt()(A),an=Xt()(U),dn=(Xt()(k),Nt(B,Dt((async()=>{})()))),ln=Xt()(F),un=Xt()(X),pn=Xt()(N),gn=(Xt()(q),Xt()(W)),mn=(H&&Xt()(H),G&&Xt()(G),J),fn=Xt()(z),hn=Xt()(Y),vn=(Xt()(Z),Xt()(Q||function(e,t){return Kt(Qt(this,e),t)}),Xt()(ee)),bn=Xt()(te),_n=(Xt()(ne),Ft(re),Ft(ie),Ft(ce)),wn=Ft(ae),yn=Ft(de),Mn=(Ft(le),Ft(ue),Ft(pe),Ft(ve)),Ln=Ft(fe),En=Ft(he),In=me?Xt()(me):me,Sn=be,On=_e,xn=(Ft(we),Ft(Pe),Ft(Ce)),Dn=(Xt()($e),Xt()(ye),Xt()(Me), +xe),jn=tt,Rn=st,Pn=it,Cn=rt,$n=pt,An=ut,Tn=function(e,t){return kt(e,t)},Un=At({addEventListener:!1,Array:!0,Blob:!0,close:!1,CustomEvent:!0,Date:!0,DOMParser:!0,Error:!0,Event:!0,FileReader:!0,KeyboardEvent:!0,location:!0,Math:!0,MouseEvent:!0,Number:!0,Object:!0,ReadableStream:!0,removeEventListener:!1,Uint8Array:!0,XMLHttpRequest:!0}),kn=((()=>{const e=At({getElementById:Ze,createEvent:Qe,createElement:et,dispatchEvent:Je,addEventListener,removeEventListener}),t=At({});Vt(Lt(e),(n=>{try{ +const o=e[n];t[n]=function(...e){return $t(o,_t.document,e)}}catch(e){t[n]=((e,t)=>{if(Bn.error(`Tampermonkey sandbox preparation ${t?"("+t+") ":""}failed. This usually is caused by a third-party extension.`,e),t)return()=>{}})(e,`document.${n}`)}}))})(),At({top:!0,location:!0}));twod.bridges=twod.bridges||At({});const Bn=twod.console=twod.console||At({}),Fn=At({addEventListener:Nt(je,_t),removeEventListener:Nt(Re,_t)});Vt(Lt(kn),(async e=>{if(!Fn[e])try{const t=_t[e];if(null==t)return;Fn[e]=t +}catch(e){}})),Vt(Lt(Un),(async e=>{if(!Fn[e])try{let t=kt(_t,e);if(void 0===t&&(wt===_t||void 0===(t=kt(wt,e))))return;const n=Un[e];Fn[e]=!1===n&&"function"==typeof t?Nt(t,wt):t}catch(e){}}));const Xn=e=>{let t,n=[],o=!1;e((e=>{if(!o){if(n.length){const t=n;n=[],Vt(t,(t=>t(e)))}else t=e;o=!0}}));const s=At({then:e=>(o?e(t):zt(n,e),s)});return s},Nn=()=>cn(Dn()+19831206*Rt()+1,36),qn=function(){var e=t((function*(e){yield null,e()}));return function(t){return e.apply(this,arguments)} +}(),Wn=(()=>{const{console:e,bridges:t}=twod,n=At({});let o;const s=(t,o,s,i)=>{let c,a=[],d=[],l=[],u=[];const p=()=>{d=[],l=[],u=[],h(),y=null,delete n[o]},g=e=>{t.send("port.message",At({response_id:o,value:e}))},m=e=>{i&&"messageId"in e&&zt(a,e),g(e)},f=(e,t=!0)=>{c=e,t&&g(e)},h=()=>{c=void 0},v=At({addListener:e=>{zt(d,e)}}),b=At({addListener:e=>{zt(l,e)}}),_=At({addListener:e=>{zt(u,e)}}),w=()=>{p(),t.send("port.message",At({response_id:o,disconnect:!0}))};let y=At(s?{postMessage:m, +connectMessage:f,stopReconnecting:h,onMessage:v,onDisconnect:b,onReconnect:_,disconnect:w}:{postMessage:m,onMessage:v,onDisconnect:b,disconnect:w});return n[o]=At({message:t=>{if(i&&(e=>"ack"in e)(t)){const{messageId:n,refreshId:o}=t;((t,n)=>{if(n)return;if(!t)return void e.warn("PortMessaging: no message id in ack message");if(c&&c.messageId===t)return;let o=-1;Wt(a,((e,n)=>e.messageId===t&&(o=n,!0))),-1!==o?(Vt(Jt(a,0,o),(t=>e.warn(`PortMessaging: message ${t.messageId} was not ack'ed!`,t))), +a=Jt(a,o+1)):e.warn(`PortMessaging: no one is waiting for ${t}`)})(n,o)}d&&Vt(d,(e=>e(t)))},disconnect:()=>{if(c&&s)return r(s,o),f(c),i&&Vt(a,(e=>g(e))),void(u.length&&Vt(u,(e=>e())));l.length&&Vt(l,(e=>e())),p()}}),y},r=(e,n)=>{t.first.send("port.message",At({response_id:n,connect:!0,destination:e}))};return At({message:(t,r)=>{let i;if(t.connect){if(!t.destination||!t.response_id)throw"invalid message";o&&o(t.destination,s(r,t.response_id))}else{if(!t.response_id)throw"invalid message" +;if(!(i=n[t.response_id]))return void e.warn("ports: unknown id",t.response_id,t);t.disconnect?i.disconnect():i.message(t.value)}},connect:function(e,n,o){const i=Nn();return r(e,i),s(t.first,i,n?e:void 0,o)},onConnect:At({addListener:e=>{o=e}})})})(),{setInterval:Hn,setTimeout:Gn,clearInterval:Jn,clearTimeout:Kn,console:zn,cloneInto:Yn,exportFunction:Vn,createObjectIn:Zn,btoa:Qn}=_t,eo=Object.assign({},zn),to=Hn.bind(_t),no=Gn.bind(_t),oo=Jn.bind(_t),so=(Kn.bind(_t), +wt==_t.top),{arrayBuffer:ro,blob:io}=_t.Response.prototype,{arrayBuffer:co}=_t.Blob.prototype,{then:ao}=_t.Promise.prototype,{fetch:lo,location:uo,document:po,Response:go}=_t,mo=Ft(ro),fo=Ft(io),ho=Ft(co),vo=Yn,bo=(At({encode:e=>qe(ke(e)),decode:e=>Be(Ne(e))}),At({encode:e=>{let t="";for(let n=0;nWe(e)})),_o=e=>{const t=new Pn(e.length);for(let n=0;n{let t;const n=Qt(e,","),o=Tn(n,0),s=Tn(n,1) +;t=-1!=hn(o,"base64")?We(s):qe(s);const r=Tn(Qt(o,":"),1),i=Tn(Qt(r,";"),0);return new $n([_o(t)],At({type:i}))},yo=(e,t)=>{const n=wn(_t.document,"http://www.w3.org/1999/xhtml",e);return"string"==typeof t?n.append(t):t&&Vt(Lt(t),(e=>{"textContent"==e?n.textContent=t[e]:n.setAttribute(e,t[e])})),n},Mo=e=>{const t=_t.document;if(t.body||"text/xml"==t.contentType)e();else{let t=!1;const o=new Cn((()=>{t=!0,Mo(e),(In||(e=>e.disconnect()))(o)}));o.observe(_t.document,At({childList:!0})),n((()=>{ +t||((In||(e=>e.disconnect()))(o),e())}))}},Lo=e=>{n((()=>{no((()=>e()),1)}))};let Eo,Io;const So=uo.host,Oo=e=>{"n:"==fn(e,0,2)?Eo=fn(e,2):e&&(Io=fn(e,2))},xo=()=>Eo||(Io?(Eo=(e=>{const t=(e,t)=>e<>>32-t,n=(e,t)=>{const n=2147483648&e,o=2147483648&t,s=1073741824&e,r=1073741824&t,i=(1073741823&e)+(1073741823&t);return s&r?2147483648^i^n^o:s|r?1073741824&i?3221225472^i^n^o:1073741824^i^n^o:i^n^o},o=(e,o,s,r,i,c,a)=>(e=n(e,n(n(((e,t,n)=>e&t|~e&n)(o,s,r),i),a)), +n(t(e,c),o)),s=(e,o,s,r,i,c,a)=>(e=n(e,n(n(((e,t,n)=>e&n|t&~n)(o,s,r),i),a)),n(t(e,c),o)),r=(e,o,s,r,i,c,a)=>(e=n(e,n(n(((e,t,n)=>e^t^n)(o,s,r),i),a)),n(t(e,c),o)),i=(e,o,s,r,i,c,a)=>(e=n(e,n(n(((e,t,n)=>t^(e|~n))(o,s,r),i),a)),n(t(e,c),o)),c=e=>{let t,n,o="",s="";for(n=0;n<=3;n++)t=e>>>8*n&255,s="0"+cn(t,16),o+=fn(s,s.length-2,2);return o};let a,d,l,u,p,g,m,f;const h=(e=>{let t;const n=e.length,o=n+8,s=16*((o-o%64)/64+1),r=[];for(let e=0;e<=s-1;e++)zt(r,0);let i=0,c=0;for(;c>>29,r})(e);p=1732584193,g=4023233417,m=2562383102,f=271733878;for(let e=0;evoid 0!==kt(e,"objUrl"),jo=e=>void 0!==kt(e,"blob"),Ro=e=>void 0!==kt(e,"dataUri"),Po=e=>void 0!==e.binary,Co=globalThis;let $o,Ao,To,Uo,{chrome:ko,browser:Bo}=Co;To=()=>{if(void 0!==$o)return $o;try{const e=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);e&&($o=parseInt(e[2]))}catch(e){}return $o},Uo=()=>{if(void 0!==Ao)return Ao;try{Ao=-1!=navigator.userAgent.search(/Android|Mobile/)}catch(e){} +return Ao},To();const Fo=["chrome-extension:"];[].concat(["chrome"]);const Xo=(()=>{const e={getInternalPathRegexp:function(e,t){const n=new RegExp("(\\"+["/",".","+","?","|","(",")","[","]","{","}","\\"].join("|\\")+")","g"),o=Fo[0]+"//"+Xo.id+"/";return new RegExp(o.replace(n,"\\$1")+"([a-zA-Z"+(e?"\\/":"")+"]*)"+(t||"").replace(n,"\\$1"))},getInternalPageRegexp:function(){return Xo.getInternalPathRegexp(!1,".html")},getPlatformInfo:e=>ko.runtime.getPlatformInfo(e),getBrowserInfo:e=>{e({ +name:"Chrome",version:`${To()}`,vendor:"unknown"})}};return Object.defineProperty(e,"lastError",{get:()=>ko.runtime.lastError,enumerable:!0}),Object.defineProperty(e,"id",{get:()=>ko.runtime.id,enumerable:!0}),Object.defineProperty(e,"short_id",{get:()=>e.id.replace(/[^0-9a-zA-Z]/g,"").substr(0,4),enumerable:!0}),e})(),No=(()=>{let e;return Object.defineProperties({},{inIncognitoContext:{get:()=>(void 0===e&&(e=ko.extension.inIncognitoContext),e),set:t=>{e=t},enumerable:!0}, +...Object.getOwnPropertyDescriptors({getURL:function(e){return ko.runtime.getURL(e)},sendMessage:(e,t)=>ko.runtime.sendMessage(e,t),onMessage:{addListener:e=>ko.runtime.onMessage.addListener(e)},connect:e=>ko.runtime.connect({name:e}),urls:{prepareForReport:function(e){return e}}})})})();t((function*(e,t){yield ko.offscreen.createDocument({url:"offscreen.html",...e}),t&&t()})),t((function*(e){yield ko.offscreen.closeDocument(),e&&e()})) +;const qo=ko&&ko.userScripts&&ko.userScripts.onBeforeScript?{supported:!0,onBeforeScript:{addListener:e=>ko.userScripts.onBeforeScript.addListener(e)}}:{supported:!1},Wo=({sendPrefix:e,listenPrefix:n,send:o,onMessage:s})=>{if(void 0===o||void 0===s)throw"invalid args";let r,i,c=1;const a=At({}),d=At({}),l=e=>{e&&(r=e)},u=e=>{const t=++c;return d[c]=e,t};s(((t,s)=>t==`${n}_${r}`?(t=>{const{m:n,r:s,a:c,n:l}=t;if(a[n]&&(Vt(a[n],(e=>e(c))),delete a[n]),"message.response"==n){ +if(null==s)throw"Invalid Message";((e,t,n)=>{let o;e&&(o=d[e])&&(o(t,n),delete d[e])})(s,c,l)}else if(i){const t=s?(t,n)=>{o(`${e}_${r}`,At({m:"message.response",a:t,r:s,n}))}:()=>{};i(At({method:n,args:c,node:l}),t)}})(s):null));const p=At({init:(g=t((function*(e){r?l():l(e)})),function(e){return g.apply(this,arguments)}),refresh:()=>null,switchId:e=>{r&&p.cleanup(),l(e)},send:(t,n,s,i)=>Xn((c=>{let a,d;"function"!=typeof s&&null!==s?(a=s,d=i):d=s,o(`${e}_${r}`,At({m:t,a:n,r:d?u(d):null,n:a})), +c()})),sendToId:(t,n,s)=>{o(`${e}_${t}`,At({m:n,a:s,r:null}))},once:(e,t)=>{a[e]||(a[e]=[]),zt(a[e],t)},setMessageListener:e=>{i=e},cleanup:()=>null});var g;return p},Ho=qo,Go=qo.supported&&!_t.pagejs;let Jo;const Ko=(e,t)=>{try{Jo(e),t&&t()}catch(e){t&&t(e.message||e)}},zo="u"+Nn(),{bridges:Yo}=twod;let Vo=[];const Zo=e=>{Ho.onBeforeScript.addListener((o=>{const s=(e,n)=>{Vt(t,(t=>t(e,n)))},r=e=>zt(n,At({listener:e,clone:o.export}));St(o.global,"pagejs",At({set:o.export((t=>{ +delete o.global.pagejs;const n=o.metadata,{modes:i,nonce:c}=n;if(c&&Oo(c),Vt(Vo,(e=>e(t,n))),Vo=[],i.js){const n=At({unsafeWindow:o.global,unsafeThis:o.global.window,pageWindow:void 0,contextId:zo,fSend:s,fOnMessage:r,cloneInto:void 0,exportFunction:void 0});t(o.export(n)),Yo.js.sendToId(zo,"commid",At({id:e}))}})),configurable:!0})),Jo=o.global.eval}));const t=[],n=[],o=(e,t)=>{Vt(n,(({listener:n,clone:o})=>n(e,o(t))))},s=e=>zt(t,e);return At({createBridge:()=>{const t=Wo(At({sendPrefix:"2S", +listenPrefix:"2U",cloneInto:vo,send:o,onMessage:s}));return t.init(e),t}})},Qo=At({});let es,ts;const ns=function(){var e=t((function*(){if(es)return;const{contextId:e}=twod,{location:t,document:n}=_t;ts=n,es=()=>{try{No.sendMessage(At({method:"contextmenu",url:t.href,id:e}),(()=>{}))}catch(e){}},ts.addEventListener("mouseenter",es,!1)}));return function(){return e.apply(this,arguments)}}(),os=function(){var e=t((function*(e){es||(yield ns()),ts.addEventListener("mousemove",es,At({once:!0})), +Qo[e]=!0}));return function(t){return e.apply(this,arguments)}}(),ss=function(){var e=t((function*(e){delete Qo[e],!Lt(Qo).length&&es&&(ts.removeEventListener("mouseenter",es,!1),es=void 0)}));return function(t){return e.apply(this,arguments)}}();let rs=[],is=[];const cs=At({}),as=e=>{const t=No.connect(e);if(Xo.lastError)return;let n=[],o=[];const s=Nn(),r=At({postMessage:e=>{try{return t.postMessage(e)}catch(e){const t="message"in e?e.message:"unknown error" +;eo.warn("port: background communication error - this context might have missed important events!",t),c(t)}},onMessage:At({addListener:e=>t.onMessage.addListener(e)}),onError:At({addListener:e=>{zt(o,e)}}),onDisconnect:At({addListener:e=>{zt(n,e)}}),disconnect:()=>(i(!1),t.disconnect())});cs[s]=r;const i=e=>{e&&Vt(n,(e=>e())),n=[],o=[],rs=Gt(rs,(e=>e!==a)),is=Gt(is,(e=>e!==d)),delete cs[s]};t.onDisconnect.addListener((()=>i(!0)));const c=e=>{Vt(o,(t=>t(e))),delete cs[s],Vt(Lt(cs),(e=>{ +const t=cs[e];t&&t.postMessage(At({refreshId:Nn()}))}))},a=()=>{t.disconnect(),Xo.lastError,i(!0)};zt(rs,a);const d=()=>{t.disconnect(),Xo.lastError};return zt(is,d),r};let ds,ls,us;Fn.addEventListener("pagehide",(e=>{En(e)&&Vt(is,(e=>e()))})),Fn.addEventListener("pageshow",(e=>{En(e)&&Vt(rs,(e=>e()))}));const{console:ps}=twod,gs=e=>Xn(function(){var n=t((function*(t){const n=e.url;let o,s,r,i;if(!n)return t(At({t:e,c:o}));const c=sn(n);if("string"==typeof n){const e=fn(n,0,5) +;if("blob:"===e)if(us)s=At({objUrl:At({url:n})});else{const e=yield lo(n);i=yield fo(e)}else(us||ls)&&"data:"===e?i=wo(n):r=n}else"Blob"==c||"File"==c?i=n:"ArrayBuffer"==c&&(i=new $n([n]));if(i)if(ls)s=At({blob:i});else if(us){const e=Sn(i);o=()=>On(e),s=At({objUrl:At({url:e})})}else{const e=yield(a=i,Xn((e=>{const t=new Fn.FileReader;t.onload=()=>{e(gn(t))},t.onerror=t=>{Bn.warn(`unable to decode data ${t}`),e("")},pn(t,a)}))),t=i.type||"application/octet-stream";try{s=At({ +dataUri:`data:${t};base64,${bo.encode(e)}`})}catch(e){ps.warn(`content: failed to get blob data from ${n}`,e)}}var a;t(At({t:At({url:r,tfd:s}),c:o}))}));return function(e){return n.apply(this,arguments)}}()),ms=At({setInterval:e=>{let t;e.onMessage.addListener((n=>{"setInterval"==n.method&&(t=to(e.postMessage,n.t))})),e.onDisconnect.addListener((()=>{t&&oo(t),t=null}))},registerMenuCommand:e=>{const t=as("registerMenuCommand");if(!t)return void no((()=>e.disconnect()),1);let n +;t.onMessage.addListener((t=>{if("ack"in t)e.postMessage(t);else{const{method:n,event:o}=t;e.postMessage(At({method:n,event:o}))}})),t.onDisconnect.addListener((()=>e.disconnect())),t.onError.addListener((()=>e.disconnect())),e.onMessage.addListener((e=>{const{messageId:o,name:s,uuid:r,accessKey:i,autoClose:c,title:a,id:d}=e,l=n=Kt([d,ds,r],"#");os(n),t.postMessage(At({messageId:o,method:"registerMenuCommand",name:s,title:a,uuid:r,menuId:l,accessKey:i,autoClose:c}))})), +e.onDisconnect.addListener((()=>{n&&ss(n),t.disconnect()}))},notification:e=>{const t=as("notification");t?(t.onMessage.addListener((t=>{e.postMessage(t)})),t.onDisconnect.addListener((()=>e.disconnect())),t.onError.addListener((()=>e.disconnect())),e.onMessage.addListener((e=>{t.postMessage(e)})),e.onDisconnect.addListener((()=>{t.disconnect()}))):no((()=>e.disconnect()),1)},openInTab:e=>{const t=as("openInTab");t?(t.onMessage.addListener((t=>{e.postMessage(t)})), +t.onDisconnect.addListener((()=>e.disconnect())),t.onError.addListener((()=>e.disconnect())),e.onMessage.addListener((e=>{const{messageId:n}=e;if("method"in e){const{method:o}=e;if("openInTab"==o)if("url"in e){let o=e.url;const{active:s,loadInBackground:r,insert:i,incognito:c,setParent:a,cookieStoreId:d}="boolean"==typeof e.options||void 0===e.options?At({loadInBackground:e.options}):e.options,l=void 0===s?void 0!==r&&!r:s,u=void 0===i||i;o&&"//"==fn(o,0,2)&&(o=uo.protocol+o),t.postMessage(At({ +messageId:n,method:"openInTab",details:At({url:o,options:At({active:!!l,insert:!!u,incognito:!!c,setParent:!c&&!!a,cookieStoreId:d})}),uuid:e.uuid}))}else t.postMessage(e);else ps.warn(`content: unknown method ${o}`)}else"name"in e?t.postMessage(At({messageId:n,name:e.name})):"focus"in e?t.postMessage(At({messageId:n,focus:!0})):"close"in e&&t.postMessage(At({messageId:n,close:!0}))})),e.onDisconnect.addListener((()=>{t.disconnect()}))):no((()=>e.disconnect()),1)},download:e=>{let t +;const n=as("download");if(!n)return void no((()=>e.disconnect()),1);let o;n.onMessage.addListener((t=>{e.postMessage(t)})),n.onDisconnect.addListener((()=>{e.disconnect(),t=!0})),n.onError.addListener((()=>e.disconnect())),e.onMessage.addListener((e=>{if("cancel"in e)t=!0,n.postMessage(At({cancel:!0,id:ds,uuid:e.uuid}));else if("details"in e){const{details:s,messageId:r,uuid:i}=e;gs(s).then((({t:e,c})=>{if(t)return void(c&&c());o=c;const{url:a,...d}=s;n.postMessage(At({messageId:r, +method:"download",details:At({...d,from:e}),id:ds,uuid:i,location:uo.href}))}))}else n.postMessage(At({messageId:e.messageId,method:"download",uuid:e.uuid,id:e.id}))})),e.onDisconnect.addListener((()=>{o&&o(),o=void 0,n.disconnect()}))},webRequest:e=>{const t=as("webRequest");t?(t.onMessage.addListener((t=>{e.postMessage(t)})),t.onDisconnect.addListener((()=>{e.disconnect()})),t.onError.addListener((()=>e.disconnect())),e.onMessage.addListener((e=>{const{messageId:n,rules:o,uuid:s}=e +;t.postMessage(At({messageId:n,method:"webRequest",rules:o,uuid:s}))})),e.onDisconnect.addListener((()=>{t.disconnect()}))):no((()=>e.disconnect()),1)},xhr:e=>{let n,o;const s=[];let r;const i=function(){var e=t((function*(e){if(e&&zt(s,e),o)yield o,i();else{const e=Ht(s);e&&e()}}));return function(t){return e.apply(this,arguments)}}(),c=as("xhr");c?(c.onMessage.addListener((n=>{"ack"in n?e.postMessage(n):i((()=>{const{onpartial:s,data:r,...i}=n;let c;if(s&&r){const{tfd:n}=r;if(n){ +const r=(e=>e&&(jo(e)||Do(e)||Ro(e)||Po(e))?((e,t)=>{let n,o,s,r,i;if(Do(e))n=e.objUrl.url;else if(jo(e))o=e.blob;else if(Ro(e))s=e.dataUri;else{if(!Po(e))throw"incompatible TransferableData";r=e.binary,i=e.type}return At({toBlob:()=>Xn((e=>{if(o)e(o);else if(n)try{an(lo(n),(t=>{an(fo(t),(t=>{e(t)}))}))}catch(t){e(void 0)}else if(s)e(wo(s));else{if(void 0===r)throw"incompatible Transferable";{const t=_o(r);e(new $n([t],i?At({type:i}):void 0))}}})),get tryObjectUrl(){return n},dispose:()=>{ +t?t():n&&On(n),n=o=s=r=void 0}})})(e,(()=>{const e=r&&r.tryObjectUrl;e&&fs.revoke(At({args:At({method:"revoke",urls:[e]})}))})):void 0)(n);if(!r)return;return void(o=Xn(function(){var n=t((function*(t){const n=()=>{o=null,t(),r&&r.dispose()};try{const t=yield r.toBlob();if(!t)return void n();const o=t.type;let a;if(a="arrayBuffer"in t?yield ho(t):yield mo(new go(t)),!a)return void n();c=At({nada:At({buffer:a,type:o})}),e.postMessage(At({...i,onpartial:s,data:c})),n()}catch(e){ps.warn(e),n()}})) +;return function(e){return n.apply(this,arguments)}}()))}c=r}else c=r;e.postMessage(At({...i,onpartial:s,data:c}))}))})),c.onDisconnect.addListener((()=>{i(function(){var o=t((function*(){e.disconnect(),n=!0}));return function(){return o.apply(this,arguments)}}())})),c.onError.addListener((()=>e.disconnect())),e.onMessage.addListener((e=>{Go&&(e=((e,t=[])=>{const n=(e,o)=>{if(null===e)return null;if("object"==typeof e){const s=sn(e);if(-1!=Yt(t,s))return e;if(o){ +if(-1!==Yt(o,e))throw"Converting circular structure to clone";Tt(o,o.length,e)}else o=[e];if(jt(e)){const t=[];for(let s=0;s{const r=n(e[s],o);void 0!==r&&(t[s]=r)})),o.length-=1,t}throw`Unsupported type in clone: ${s}`}return e};return n(e)})(e,["Blob","File","ArrayBuffer"]));const{details:t}=e;(t?gs(t):Xn((e=>e()))).then((o=>{const{t:s,c:i}=o||At({}) +;if(n)return void(i&&i());let a,d;r=i,s&&t?(a=At({...t,...s}),d=At({...e,details:a,location:uo.href})):d=e,c.postMessage(d)}))})),e.onDisconnect.addListener((()=>{r&&r(),r=void 0,c.disconnect()}))):no((()=>e.disconnect()),1)},onurlchange:e=>{const t=as("onurlchange");t?(t.onMessage.addListener((t=>{e.postMessage(t)})),t.onDisconnect.addListener((()=>{e.disconnect()})),t.onError.addListener((()=>e.disconnect())),e.onMessage.addListener((e=>{t.postMessage(e)})),e.onDisconnect.addListener((()=>{ +t.disconnect()}))):no((()=>e.disconnect()),1)},onaudiostatechange:e=>{const t=as("onaudiostatechange");t?(t.onMessage.addListener((t=>{e.postMessage(t)})),t.onDisconnect.addListener((()=>e.disconnect())),t.onError.addListener((()=>e.disconnect())),e.onMessage.addListener((e=>{t.postMessage(e)})),e.onDisconnect.addListener((()=>{t.disconnect()}))):no((()=>e.disconnect()),1)},values:e=>{const t=as("values");t?(t.onMessage.addListener((t=>{e.postMessage(t)})), +t.onDisconnect.addListener((()=>e.disconnect())),t.onError.addListener((()=>e.disconnect())),e.onMessage.addListener((e=>{t.postMessage(e)})),e.onDisconnect.addListener((()=>{t.disconnect()}))):no((()=>e.disconnect()),1)},backgroundControl:e=>{const t=as("backgroundControl");t?(t.onMessage.addListener((t=>{e.postMessage(t)})),t.onDisconnect.addListener((()=>e.disconnect())),t.onError.addListener((()=>e.disconnect())),e.onMessage.addListener((e=>{t.postMessage(e)})), +e.onDisconnect.addListener((()=>{t.disconnect()}))):no((()=>e.disconnect()),1)},keepAlive:e=>{const t=as("keepAlive");t?(t.onMessage.addListener((t=>{e.postMessage(t)})),t.onDisconnect.addListener((()=>e.disconnect())),t.onError.addListener((()=>e.disconnect())),e.onMessage.addListener((e=>{t.postMessage(e),Xo.lastError})),e.onDisconnect.addListener((()=>{t.disconnect()}))):no((()=>e.disconnect()),1)}}),fs=At({setTimeout:({args:e,cb:t})=>{no(t,e.t)},setClipboard:({args:e,cb:t})=>{ +const{content:n,info:o,uuid:s}=e;let r,i;"object"==typeof o?(o.type&&(r=o.type),o.mimetype&&(i=o.mimetype)):"string"==typeof o&&(r=o);const c=i||("html"==r?"text/html":"text/plain");_t.document.addEventListener("copy",(e=>{e.stopImmediatePropagation(),e.preventDefault(),e.clipboardData&&e.clipboardData.setData(c,n)}),At({capture:!0,once:!0})),_t.document.execCommand("copy"),t()},closeTab:({args:{uuid:e},cb:t})=>{No.sendMessage(At({method:"closeTab",uuid:e,id:ds}),(e=>{ +e&&e.error&&ps.warn(e.error),t(e)}))},focusTab:({args:{uuid:e},cb:t})=>{No.sendMessage(At({method:"focusTab",uuid:e,id:ds}),(e=>{e&&e.error&&ps.warn(e.error),t(e)}))},navigateTab:({args:{uuid:e,url:t,location:n},cb:o})=>{No.sendMessage(At({method:"navigateTab",uuid:e,url:t,location:n,id:ds}),(e=>{e&&e.error&&ps.warn(e.error),o(e)}))},addElement:(hs=t((function*({args:e,node:t,cb:o}){try{const s=yo(e.tag,At({...e.properties||At({}),...e.id?At({id:e.id}):At({})}));let r,i +;if("script"===e.tag&&(r=xo())&&s.setAttribute("nonce",r),t)i=t;else{const e=_t.document;if(i=e.head||e.body||e.documentElement,!i){const e=_t.document;i=yield Xn((t=>n((()=>t(e.head||e.body)))))}}i.appendChild(s),r&&s.removeAttribute("nonce"),o(void 0,s)}catch(e){ps.warn("content: error adding script",e)}})),function(){return hs.apply(this,arguments)}),tabs:({args:e,cb:t})=>{e.method="tabs",No.sendMessage(e,(e=>e&&t(e.data)))},cookie:({args:e,cb:t})=>{e.method="cookie", +No.sendMessage(e,(e=>e&&t(e.data)))},audio:({args:e,cb:t})=>{e.method="audio",No.sendMessage(e,(e=>e&&t(e.data)))},revoke:({args:e})=>{e.method="revoke",No.sendMessage(e,(e=>{e&&e.error&&ps.warn("content: revoke error:"+e.error)}))}});var hs;const vs=At({init:()=>{ds=twod.contextId},setup:(e,t)=>{ls=e,us=t},processMessage:({method:e,args:t,node:n},o)=>{let s;if(s=fs[e])return s(At({args:t,node:n,cb:o}));ps.warn(`content: unknown method ${e}`),o()},processConnect:(e,t)=>{let n +;if(n=ms[e])return n(t)}}),bs=["GM_info","GM.info"],_s=["unsafeWindow","navigate",...bs],ws=e=>e.replace(new RegExp("[\"']","g"),"\\$1");let ys=!1;const Ms=(e,n,o,s,r)=>{const{console:i}=twod;ys=ys||e.logLevel>=60;const{version:c,injectMode:a,inIncognitoContext:d,isFirstPartyIsolation:l,downloadMode:u,relaxedCsp:p,userAgent:g,container:m,logLevel:f}=e,h=At({version:c,injectMode:a,inIncognitoContext:d,isFirstPartyIsolation:l,downloadMode:u,relaxedCsp:p,container:m});Vt(n,function(){ +var n=t((function*(t){const{script:n,storage:c}=t,{name:a,uuid:d,options:{run_at:l}}=n,{requires:u,...p}=n,m=u.length,v=!n.options.unwrap,b=At({...h,userAgent:g,logLevel:f,sandboxMode:r}),_="context-menu"===l;let w,y;const M=((e,t)=>{const{measure_scripts:n,top_level_await:o,enforce_strict_mode:s}=e,{source_url:r,script:i,code:c}=t,{name:a,grant:d}=i,{requires:l}=i,u=!i.options.unwrap,p=l.map((e=>e.textContent||"")).join("\n");if(u){let e="" +;const t=["define","module","exports"],l=t.map((()=>"undefined")),u=-1!==i.grant.indexOf("none");let g;return g=u?bs:d.concat(_s),g.forEach((e=>{const n=e.split(".")[0];"window"!==n&&-1===t.indexOf(n)&&(t.push(n),l.push(`p.${n}`))})), +[`with (${u?"this.s":"this"}) {`,"(async (u, { p, r, s }) => {","try {",n?`console.time("${e=`SCRIPT RUN TIME[${ws(a)}]`}");\n`:"","r(u, s, [",l.join(","),"]);",n?`console.timeEnd("${e}");\n`:"","} catch (e) {","if (e.message && e.stack) {","console.error(\"ERROR: Execution of script '",ws(a),"' failed! \" + e.message);","console.log(e.stack);","} else {","console.error(e);","}","}","})","(",(o?"async ":"")+"function(",t.join(","),") {",s?'"use strict";\n':"\n",p,c,"\n",`}, ${u?"this":"seed"})`,"}","\n",r?`//# sourceURL=${r}\n`:""].join("") +}return[p,c,"\n",r?`//# sourceURL=${r}\n`:""].join("")})(e,t);return v?(w=()=>{ys&&i.debug(`env: inject "${a}" now`);const e=`__f__${Nn()}`,t=At({storage:c,script:p}),n=`window["${e}"] = function(){${M}}`;let r=!0;s.once(`scriptack-${e}`,(()=>{ys&&!r&&i.log(`env: execution of "${a}" was delayed`),o(n,(e=>{e&&i.error(`Uncaught SyntaxError: ${e}`)}))})),s.send("script",At({id:e,unwrap:!1,bundle:t,flags:b})),r=!1},y=_||"document-start"==l?void 0:()=>{ +ys&&i.debug(`env: run "${a}" now (${m} requires)`),s.send("run",At({uuid:d}))}):y=()=>{ys&&i.debug(`env: inject @unwrap "${a}" now`),o(M,(e=>{e&&i.error(`Uncaught SyntaxError: ${e}`)}))},_&&ss(d),Ls(a,l,w,y,ys)}));return function(e){return n.apply(this,arguments)}}())},Ls=(e,t,o,s,r)=>{const{console:i}=twod;let c;"document-start"==t?(r&&i.debug(`env: run "${e}" ASAP -> document-start`),c=e=>e()):"document-body"==t?(r&&i.debug(`env: schedule "${e}" for document-body`), +c=Mo):"context-menu"==t?r&&i.debug(`env: run "${e}" ASAP -> context-menu`):"document-end"==t?(r&&i.debug(`env: schedule "${e}" for document-end`),c=e=>n(!1,e)):(r&&i.debug(`env: schedule "${e}" for document-idle`),c=Lo),o&&o(),s&&c&&c((()=>{s()}))},Es=(e,t)=>{let n,o;try{o=(0,eval)(e)}catch(e){n=e.message||e}return t&&t(n),o},Is=({sendPrefix:e,listenPrefix:n,cloneInto:o})=>{const s=e=>o?o(e,_t.document):e,i=At({});let c,a,d=1;const l=At({});let u=!1,p=[];const g=()=>{ +_=_t.document.documentElement,u=!1;const e=p;p=[],Vt(e,(e=>{u||y()?zt(p,e):e()}))};let m;const f=e=>{const t=++d;return l[d]=e,t},h=(e,t)=>{const{m:n,a:o,r,n:i}=t,{m:c,c:a}=((e,t,n)=>{let o,r;return n?(r=new Rn(e,At({relatedTarget:n})),o=new jn(e,At({detail:s(t)}))):o=new jn(e,At({detail:s(t)})),At({m:r,c:o})})(e,At({m:n,a:o,r}),i);c&&$t(Je,_t,[c]),$t(Je,_t,[a])},v=t=>{const n=(e=>{if("MouseEvent"===sn(e)){const t=Mn(e);if(!t)throw"Invalid MouseEvent";return void(m=t)}const t=on(Ln(e)) +;return m&&(t.n=m,m=void 0),t})(t);if(!n)return;const{m:o,r:s,a:r,n:d}=n;if(i[o]&&(Vt(i[o],(e=>e(r))),delete i[o]),"unlock"==o)h(`${e}_${a}`,At({m:"unlocked",a:void 0,r:null})),g();else if("unlocked"==o)g();else if("message.response"==o){if(null==s)throw"Invalid Message";((e,t,n)=>{let o;e&&(o=l[e])&&(o(t,n),delete l[e])})(s,r,d)}else if(c){const t=s?(t,n)=>{h(`${e}_${a}`,At({m:"message.response",a:t,r:s,n}))}:()=>{};c(At({method:o,args:r,node:d}),t)}},b=e=>{e&&(a=e), +a&&Fn.addEventListener(`${n}_${a}`,v,!0)};let _,w;const y=()=>{if((()=>{const e=_t.document.documentElement;return _||(_=e),_!==e})()){if(w){const e=w;w=void 0,e(_t.document)}return!0}},M=e=>(_=_t.document.documentElement,Xn(function(){var n=t((function*(t){if(w=t,r&&!e&&(yield null,y()))return;const n=new Cn((()=>{y()&&n.disconnect()}));n.observe(_t.document,At({childList:!0}))}));return function(e){return n.apply(this,arguments)}}())),L=At({init:(E=t((function*(t,n){a?b():b(t),M(n).then((()=>{ +u=!0,L.refresh(),h(`${e}_${a}`,At({m:"unlock",a:void 0,r:null}))}))})),function(e,t){return E.apply(this,arguments)}),refresh:()=>{const e=a;e&&(L.cleanup(),L.init(e,!0))},switchId:e=>{a&&L.cleanup(),b(e)},send:(t,n,o,s)=>Xn((r=>{let i,c;"function"!=typeof o&&null!==o?(i=o,c=s):c=o,y();const d=()=>{h(`${e}_${a}`,At({m:t,a:n,r:c?f(c):null,n:i})),r()};u?zt(p,d):d()})),sendToId:(t,n,o)=>{h(`${e}_${t}`,At({m:n,a:o,r:null}))},setMessageListener:e=>{c=e},once:(e,t)=>{i[e]||(i[e]=[]),zt(i[e],t)}, +cleanup:()=>{a&&(Fn.removeEventListener(`${n}_${a}`,v,!0),a=void 0)}});var E;return L},Ss=function(e,t,n,o,s){let r;const i=xo(),c=yo("script");i&&c.setAttribute("nonce",i);try{c.textContent=t,e.appendChild(c)}catch(e){r=e.message||e}if(i&&c.removeAttribute("nonce"),!s){const e=c.parentNode;e&&e.removeChild(c)}return o&&o(r),!r},Os=(e,t)=>{try{Ss(po.head||po.body||po.documentElement||po,e,0,t)}catch(e){t&&t(e.message||e)}};let xs,Ds;const js=e=>{const t=as("tabInfo") +;t?(t.onMessage.addListener((e=>{if("ack"in e);else{const{info:t}=e;t?xs=on(t):eo.warn("tabInfo: unexpected message",e)}})),t.onDisconnect.addListener((()=>{Rs()})),t.onError.addListener((()=>{try{t.disconnect()}catch(e){}Rs()})),e(t)):no((()=>js(e)),100)},Rs=()=>{js((e=>{xs=Ds||xs,Ds=void 0,e.postMessage(At({method:"tabInfo",messageId:Nn(),info:xs}))}))},Ps=e=>{e=e||Fn.location.href;const t=as("tabInfo");t?(t.onMessage.addListener((e=>{"ack"in e||eo.warn("tabInfo.frame: unexpected message",e) +})),t.onDisconnect.addListener((()=>{Ps(e)})),t.onError.addListener((()=>{try{t.disconnect()}catch(e){}Ps(e)})),t.postMessage(At({method:"tabInfo",messageId:Nn(),url:e}))):no((()=>Ps(e)),100)};let Cs=!1;const $s=location.pathname+location.search;Xo.short_id,window.btoa($s.length+$s).substr(0,255).replace(/[#=/]/g,"_");let As=!1;const Ts=(e,t,o)=>{const{contextId:s,bridges:r,console:i}=twod;let c;Xn((n=>{const o=e=>{let t=1;const o=()=>{Cs&&i.log('content: send "prepare" message'), +No.sendMessage({method:"prepare",id:s,topframe:so,url:window.location.href},(s=>{if(!As){if(!s)return Cs&&i.log("content: _early_ execution, connection to bg failed -> retry!"),window.setTimeout(o,t),void(t=Ct(2*t,3e3));As=!0,s.nonce&&Oo(s.nonce),Lt(s.contexters).length||Lt(s.scripts).length||s.external_connect?(e&&e(s),n({info:s,type:"complete"==_n(_t.document)?"late":"normal"})):n({info:s})}}))};!function(e){const t=()=>"prerender"!==document.webkitVisibilityState,n=()=>{ +t()&&(document.removeEventListener("webkitvisibilitychange",n,!1),e())};t()?e():document.addEventListener("webkitvisibilitychange",n,!1)}(o)},r=()=>{let r;if(Cs&&i.log("content: Started ("+s+", "+window.location.origin+window.location.pathname+")",wt.tm_info),r=wt.tm_info){delete wt.tm_info,r.nonce&&Oo(r.nonce);const{contexters:o,scripts:i}=r;if(Lt(o).length||Lt(i).length){if(r.contexters.raw||r.scripts.raw)if(e.raw)void 0===c&&(c=e.raw());else if(!t)throw"raw inject missing";n({info:r, +type:"sync"})}else n({info:r});{let e;if("userscripts-dynamic"===r.contentMode){const t=e={};Vt(Lt(i),(e=>{const n=i[e];n&&Vt(n,(({script:{uuid:e,name:n}})=>t[e]=n))}))}No.sendMessage({method:"prepare",id:s,topframe:so,url:window.location.href,scripts:e,cleanup:!0},(()=>null))}}else t?o((({scripts:t,contexters:n})=>{e.raw&&void 0===c&&(t.raw||n.raw)&&(c=e.raw())})):(e.raw&&void 0===c&&(c=e.raw()),o())};t?window.setTimeout((()=>r()),1):r()})).then((({info:a,type:d})=>{const{external_connect:l}=a +;if(!t&&(e=>{if(e){const t=location.href.split("#")[0];return e.some((({source:e,flags:n})=>{const o=new An(e,n);if(""===t.replace(o,""))return!0}))}return!1})(l)&&(void 0===c&&e.raw&&(c=e.raw()),c||i.warn("content: external connectability detected, but unable to initialize raw mode!"),qn((()=>r.first.send("external.connect")))),d){Cs=Cs||a.logLevel>=60;const{scripts:c,sharedBlobs:l,sharedObjectUrls:p}=a;if(vs.setup(l,p),c.raw){let n;t&&!e.raw&&(n=!0),n&&(e.js?(c.js=(c.js||[]).concat(c.raw||[]), +delete c.raw):e.dom&&(c.dom=(c.dom||[]).concat(c.raw||[]),delete c.raw))}if(c.js){if(!e.js)throw"js inject missing";e.js()}if(c.dom){if(!e.dom)throw"dom inject missing";e.dom()}n(!1,(()=>{Cs&&i.log("content: DOMContentLoaded"),Vt(Lt(r),(e=>r[e].send("DOMContentLoaded")))})),u=()=>{Cs&&i.log("content: load"),Vt(Lt(r),(e=>r[e].send("load")))},"complete"==_n(_t.document)?u():Fn.addEventListener("load",(()=>u()),At({capture:!0,once:!0})) +;const g=(c.dom||[]).length+(c.js||[]).length+(c.raw||[]).length;Cs&&i.log("content: "+(d||"normal")+" start event processing for "+s+" ("+g+" to run)"),Us(a,"sync"===d),!so&&g&&Ps(location.href),o()}else o();var u}))},Us=e=>{const{bridges:n,contextId:s}=twod,{scripts:r,contexters:i,...c}=e;r.js&&Ms(c,r.js,Ko,n.js,"js"),r.dom&&(Vt(o,(e=>wt[e]=void 0)),Ms(c,r.dom,Es,n.dom,"dom")),r.raw&&Ms(c,r.raw,Os,n.raw,"raw"),Vt(Et(i),(e=>{e&&Vt(e,function(){var e=t((function*({uuid:e,name:t}){os(e);let n=!1 +;const o=()=>{const r=as("registerCtxer");r&&(r.onMessage.addListener((e=>{"ack"in e||e.done&&(n=!0,r.disconnect())})),r.onDisconnect.addListener((()=>{console.log(`content: context-menu ${t} disconnect`),n||o()})),r.onError.addListener((e=>{console.warn(`content: context-menu ${t} error`,e)})),r.postMessage(At({messageId:Nn(),contextId:s,uuid:e,method:"registerCtxer"})))};o()}));return function(t){return e.apply(this,arguments)}}())}))};let ks;t((function*(){ +const{unsafeWindow:e,bridges:t}=twod,{location:n,document:o}=e,r=o instanceof XMLDocument;if(!At({"http:":!0,"https:":!0,"file:":!0})[e.location.protocol])return;so&&(Rs(),Fn.addEventListener("pagehide",(e=>{En(e)&&(Ds=xs)})));const i=twod.contextId?twod.contextId:twod.contextId=Nn();let c;const a=At({});It(twod.console,eo),Xn((n=>{if(Go){const{createBridge:e}=Zo(i);zt(Vo,((o,s)=>{ks=c=o;const{modes:i}=s;i.js&&(t.js=e(),a.js=()=>!1,r&&(i.raw=!1)),n(s)}))}else Xn((t=>{ks=c=e.pagejs, +delete e.pagejs,ks?t():(()=>{let e=n=>{delete _t.pagejs,e=void 0,(e=>{if(!e)throw"Error: pagejs missing. Please see http://tmnk.net/faq#Q208 for more information.";ks=c=e,t()})(n)};St(_t,"pagejs",At({set:e,configurable:!0})),no((()=>{e&&e()}),1)})()})).then((()=>{n(At({modes:At({js:!1,raw:!0,dom:!0})}))}))})).then((({modes:{dom:o,raw:d},answer:l})=>{var u;if(l&&(u=l).scripts&&u.contexters&&(wt.tm_info=l),o){const e=Go?Es(`() => ${c};`)():c,{createBridge:n,inject:o}=((e,t)=>{const n=(e,t)=>{ +Vt(s,(n=>n(e,t)))},o=e=>zt(r,At({listener:e,clone:e=>e})),s=[],r=[],i=(e,t)=>{Vt(r,(({listener:n,clone:o})=>n(e,o(t))))},c=e=>zt(s,e),a="c"+Nn();let d;return At({createBridge:()=>(d=Wo(At({sendPrefix:"2S",listenPrefix:"2U",send:i,onMessage:c})),d.init(e),d),inject:()=>(t(At({unsafeWindow:_t,unsafeThis:wt,pageWindow:void 0,contextId:a,fSend:n,fOnMessage:o})),d.sendToId(a,"commid",At({id:e})),!0)})})(i,e);a.dom=o,t.dom=n()}if(d){const{createBridge:e,inject:n}=((e,t)=>{let n;return At({ +createBridge:()=>(n=Is(At({sendPrefix:"2P",listenPrefix:"2C",cloneInto:vo})),n),inject:()=>{n.init(e);let o=!1;const r=Nn(),i="("+rn(((e,t)=>{const n=window,o=t(n),s=n.parent,{O_dPy:r,cSO:i}=o;r(s,e,i({value:o,enumerable:!1,writable:!1,configurable:!0}))}))+')("'+r+'", '+rn(s)+")";return n.once("ack",(()=>{o=!0})),(o=>{((e,t)=>{const n=Tn(yn(_t.document,"*"),0)||_t.document,o=yo("div"),s=o.attachShadow(At({mode:"closed"}));s.appendChild(yo("style",":host { display: none }")) +;const r=yo("iframe",At({sandbox:"allow-scripts allow-same-origin",style:"display: none",src:"javascript:void 0"}));let i=()=>{if(null===i)return;i=null;let n=!1;try{const t=r.contentDocument,o=r.contentWindow;t&&o&&(n=Ss(Tn(t.getElementsByTagName("*"),0),e))}catch(e){}t(o,n),r.remove(),o.remove()};r.addEventListener("load",i,At({once:!0,capture:!0})),s.appendChild(r),n.appendChild(o),i&&i()})(o,((o,s)=>{ +Ss(o,`((w, g) => {(${t})({ unsafeWindow: typeof g === "undefined" ? w : g, unsafeThis: w, vault: ${s?`w["${r}"]`:"null"}, contextId: "${r}", __proto__: null }); delete w["${r}"]; })(window, globalThis)\n`,0,(()=>{n.sendToId(r,"commid",At({id:e}))}),!0)}))})(i),o}})})(i,c);a.raw=n,t.raw=e()}const p=t.first=t.js||t.raw||t.dom;No.onMessage.addListener(((t,o,s)=>{"executeScript"==t.method?(t.url&&0!==hn(n.href,t.url)||void 0!==t.topframe&&t.topframe!=so||Us(t.info,!1), +s(At({}))):so&&("loadUrl"==t.method?(e.location=t.url,s(At({}))):"reload"==t.method?(n.reload(),s(At({}))):"setForeignAttr"==t.method?(p.send(t.method,t),s(At({}))):eo.log("content: unknown method "+(e=>{const t=(e,n)=>{let o;if(null===e)o="null";else{const s=typeof e;if("object"===s){if(n){if(-1!=Yt(n,e))throw"Converting circular structure to JSON";Tt(n,n.length,e)}else n=[e];if(jt(e)){let s="";for(let o=0;o{const r=t(e[o],n);void 0!==r&&(s+=`${s?",":""}${j(o)}: ${r}`)})),o=`{${s}}`}n.length-=1}else{if("bigint"===s)throw"Do not know how to serialize a BigInt";o=j(e)}}return o};return t(e)})(t)))})),Wn.onConnect.addListener(((e,t)=>{vs.processConnect(e,t)})),vs.init(),Vt(Lt(t),(e=>{if("first"==e)return;const n=t[e];n.setMessageListener(((t,o)=>{const{method:s,args:r}=t +;if("port.message"==s)Wn.message(r,n);else if("csp"==s){let t;t="raw"==e?Os:"dom"==e?Es:Ko,t(r.src,(e=>{e&&eo.error(`Uncaught Error: ${e}`)}))}else if("external.message"==s)No.sendMessage(At({method:"externalMessage",request:r}),(e=>{o(e)}));else if("console"==s){const e=r,t=Tn(e,0),n=Tn(e,1),o=eo[t]||eo.log;o&&$t(o,eo,((e,...t)=>{let n=e.length;const o=At(e);for(let e=0;e{const t=[];return Vt(e,(e=>{zt(t,(e=>"string"==typeof e?qt(e):e)(e))})),t})(n)))}else"commid"==s||(e=>"ack"==e.method||"injectableack"==e.method||0===hn(e.method,"scriptack-"))(t)||vs.processMessage(t,o)}))})),Ts(a,r,(()=>ks=void 0))}))}))()})();})({ __proto__: null, unsafeWindow: typeof globalThis === "undefined" ? window : globalThis, unsafeThis: window, }, "tm_wwywqw") \ No newline at end of file diff --git a/backend/neko/tampermonkey-seed/Default/Extensions/dhdgffkkebhmkfjojejmpbldmpobfkfo/5.5.0_0/editor.css b/backend/neko/tampermonkey-seed/Default/Extensions/dhdgffkkebhmkfjojejmpbldmpobfkfo/5.5.0_0/editor.css new file mode 100644 index 0000000..481d2e5 --- /dev/null +++ b/backend/neko/tampermonkey-seed/Default/Extensions/dhdgffkkebhmkfjojejmpbldmpobfkfo/5.5.0_0/editor.css @@ -0,0 +1 @@ +@charset "UTF-8";.CodeMirror{font-family:monospace;height:300px;color:black;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0 !important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor-mark{background-color:rgba(20, 255, 20, 0.5);-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def,.cm-s-default .cm-defarg,.cm-s-default .cm-deffunc{color:blue}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-matchhighlight{background-color:lightgrey}.cm-s-default span.CodeMirror-selectedtext{background-color:transparent}.cm-s-default .cm-error{color:red}.cm-invalidchar{color:red}.CodeMirror-selection-highlight-scrollbar{background-color:rgb(199, 170, 5)}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255, 150, 0, 0.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none !important;border:none !important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255, 255, 0, 0.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.cm-s-diff .cm-negative{color:#d44}.cm-s-diff .cm-positive{color:#292}.dark .CodeMirror.cm-s-diff{background:hsl(0, 0%, 10%)}.dark .cm-s-diff .CodeMirror-line span{color:hsl(0, 0%, 90%)}.dark .cm-s-diff span.cm-negative{color:rgb(255, 103, 103)}.dark .cm-s-diff span.cm-positive{color:#39c539}.dark .cm-s-diff span.cm-meta{color:#777}.cm-s-diff .cm-negative{color:#d44}.cm-s-diff .cm-positive{color:#292}.dark .CodeMirror.cm-s-diff{background:hsl(0, 0%, 10%)}.dark .cm-s-diff .CodeMirror-line span{color:hsl(0, 0%, 90%)}.dark .cm-s-diff span.cm-negative{color:rgb(255, 103, 103)}.dark .cm-s-diff span.cm-positive{color:#39c539}.dark .cm-s-diff span.cm-meta{color:#777}.CodeMirror-dialog{position:absolute;left:0;right:0;background:inherit;z-index:15;padding:.1em .8em;overflow:hidden;color:inherit}.CodeMirror-dialog-top{border-bottom:1px solid #eee;top:0}.CodeMirror-dialog-bottom{border-top:1px solid #eee;bottom:0}.CodeMirror-dialog input{border:none;outline:none;background:transparent;width:20em;color:inherit;font-family:monospace}.CodeMirror-dialog button{font-size:70%}.CodeMirror-search-match{background:gold;border-top:1px solid orange;border-bottom:1px solid orange;-moz-box-sizing:border-box;box-sizing:border-box;opacity:.5}.CodeMirror-search-field.no-result{background-color:lightcoral}.CodeMirror-activeline .cm-trailingspace{background-color:rgba(0, 0, 0, 0)}.cm-trailingspace{background-color:rgba(249, 38, 114, 0.8)}.CodeMirror-activeline .cm-trailingspace{background-color:rgba(0, 0, 0, 0)}.cm-trailingspace{background-color:rgba(249, 38, 114, 0.8)}.CodeMirror-hints{position:absolute;z-index:10;overflow:hidden;list-style:none;margin:0;padding:2px;-webkit-box-shadow:2px 3px 5px rgba(0, 0, 0, 0.2);-moz-box-shadow:2px 3px 5px rgba(0, 0, 0, 0.2);box-shadow:2px 3px 5px rgba(0, 0, 0, 0.2);border-radius:3px;border:1px solid silver;background:white;font-size:90%;font-family:monospace;max-height:20em;overflow-y:auto}.CodeMirror-hint{margin:0;padding:0 4px;border-radius:2px;white-space:pre;color:black;cursor:pointer}li.CodeMirror-hint-active{background:#08f;color:white}.CodeMirror-lint-markers{width:16px}.CodeMirror-lint-tooltip{background-color:#ffd;border:1px solid black;border-radius:4px 4px 4px 4px;color:black;font-family:monospace;font-size:10pt;overflow:hidden;padding:2px 5px;position:fixed;white-space:pre;white-space:pre-wrap;z-index:100;max-width:600px;opacity:0;transition:opacity .4s;-moz-transition:opacity .4s;-webkit-transition:opacity .4s;-o-transition:opacity .4s;-ms-transition:opacity .4s}.CodeMirror-lint-mark{background-position:left bottom;background-repeat:repeat-x}.CodeMirror-lint-mark-warning{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=")}.CodeMirror-lint-mark-error{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==")}.CodeMirror-lint-marker{background-position:center center;background-repeat:no-repeat;cursor:pointer;display:inline-block;height:16px;width:16px;vertical-align:middle;position:relative}.CodeMirror-lint-message{padding-left:18px;background-position:top left;background-repeat:no-repeat}.CodeMirror-lint-marker-warning,.CodeMirror-lint-message-warning{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=")}.CodeMirror-lint-marker-error,.CodeMirror-lint-message-error{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=")}.CodeMirror-lint-marker-multiple{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC");background-repeat:no-repeat;background-position:right bottom;width:100%;height:100%}.CodeMirror-foldmarker{color:blue;text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded{cursor:pointer}.CodeMirror-foldgutter-open:after{content:"\25be"}.CodeMirror-foldgutter-folded:after{content:"\25b8"}.CodeMirror-activeline-background{background-color:rgba(0, 0, 0, 0) !important}.CodeMirror-activeline .CodeMirror-gutter-wrapper .CodeMirror-linenumber{background-color:#c7cacf;color:black}.CodeMirror-activeline-background{background-color:rgba(0, 0, 0, 0) !important}.CodeMirror-activeline .CodeMirror-gutter-wrapper .CodeMirror-linenumber{background-color:#c7cacf;color:black}.CodeMirror-bookmarks{width:100%;position:absolute;left:0}.CodeMirror-bookmarks-marked{width:100%;background-color:rgba(255, 224, 85, 0.4)}.CodeMirror-bookmarks{width:100%;position:absolute;left:0}.CodeMirror-bookmarks-marked{width:100%;background-color:rgba(255, 224, 85, 0.4)}.cm-s-eclipse span.cm-meta{color:#ff1717}.cm-s-eclipse span.cm-keyword{line-height:1em;font-weight:bold;color:#7f0055}.cm-s-eclipse span.cm-atom{color:#219}.cm-s-eclipse span.cm-number{color:#164}.cm-s-eclipse span.cm-def,.cm-s-eclipse span.cm-defarg,.cm-s-eclipse span.cm-deffunc{color:blue}.cm-s-eclipse span.cm-variable{color:black}.cm-s-eclipse span.cm-variable-2{color:#0000c0}.cm-s-eclipse span.cm-variable-3,.cm-s-eclipse span.cm-type{color:#0000c0}.cm-s-eclipse span.cm-property,.cm-s-eclipse span.cm-objprop{color:black}.cm-s-eclipse span.cm-operator{color:black}.cm-s-eclipse span.cm-comment{color:#3f7f5f}.cm-s-eclipse span.cm-string{color:#2a00ff}.cm-s-eclipse span.cm-string-2{color:#f50}.cm-s-eclipse span.cm-qualifier{color:#555}.cm-s-eclipse span.cm-builtin{color:#30a}.cm-s-eclipse span.cm-bracket{color:#cc7}.cm-s-eclipse span.cm-tag{color:#170}.cm-s-eclipse span.cm-attribute{color:#00c}.cm-s-eclipse span.cm-link{color:#219}.cm-s-eclipse span.cm-error{color:red}.cm-s-eclipse .CodeMirror-activeline-background{background:#e8f2ff}.cm-s-eclipse .CodeMirror-matchingbracket{outline:1px solid grey;color:black !important}.cm-s-eclipse .cm-matchhighlight{background-color:lightgrey}.cm-s-eclipse span.CodeMirror-selectedtext{background-color:transparent}.cm-s-mdn-like.CodeMirror{color:#999;background-color:#fff}.cm-s-mdn-like div.CodeMirror-selected{background:#cfc}.cm-s-mdn-like .CodeMirror-line::selection,.cm-s-mdn-like .CodeMirror-line>span::selection,.cm-s-mdn-like .CodeMirror-line>span>span::selection{background:#cfc}.cm-s-mdn-like .CodeMirror-line::-moz-selection,.cm-s-mdn-like .CodeMirror-line>span::-moz-selection,.cm-s-mdn-like .CodeMirror-line>span>span::-moz-selection{background:#cfc}.cm-s-mdn-like .CodeMirror-gutters{background:#f8f8f8;border-left:6px solid rgba(0, 83, 159, 0.65);color:#333}.cm-s-mdn-like .CodeMirror-linenumber{color:#aaa;padding-left:8px}.cm-s-mdn-like .CodeMirror-cursor{border-left:2px solid #222}.cm-s-mdn-like .cm-keyword{color:#6262ff}.cm-s-mdn-like .cm-atom{color:#f90}.cm-s-mdn-like .cm-number{color:#ca7841}.cm-s-mdn-like .cm-def,.cm-s-mdn-like .cm-defarg,.cm-s-mdn-like .cm-deffunc{color:#8da6ce}.cm-s-mdn-like span.cm-variable-2,.cm-s-mdn-like span.cm-tag{color:#690}.cm-s-mdn-like span.cm-variable-3,.cm-s-mdn-like span.cm-def,.cm-s-mdn-like span.cm-type,.cm-s-mdn-like span.cm-defarg,.cm-s-mdn-like span.cm-defunc{color:#07a}.cm-s-mdn-like .cm-variable{color:#07a}.cm-s-mdn-like .cm-property,.cm-s-mdn-like .cm-objprop{color:#905}.cm-s-mdn-like .cm-qualifier{color:#690}.cm-s-mdn-like .cm-operator{color:#cda869}.cm-s-mdn-like .cm-comment{color:#777;font-weight:normal}.cm-s-mdn-like .cm-string{color:#07a;font-style:italic}.cm-s-mdn-like .cm-string-2{color:#bd6b18}.cm-s-mdn-like .cm-meta{color:#000}.cm-s-mdn-like .cm-builtin{color:#9b7536}.cm-s-mdn-like .cm-tag{color:#997643}.cm-s-mdn-like .cm-attribute{color:#d6bb6d}.cm-s-mdn-like .cm-header{color:#ff6400}.cm-s-mdn-like .cm-hr{color:#aeaeae}.cm-s-mdn-like .cm-link{color:#ad9361;font-style:italic;text-decoration:none}.cm-s-mdn-like .cm-error{border-bottom:1px solid red}div.cm-s-mdn-like .CodeMirror-activeline-background{background:#efefff}div.cm-s-mdn-like span.CodeMirror-matchingbracket{outline:1px solid grey;color:inherit}.cm-s-mdn-like.CodeMirror{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFcAAAAyCAYAAAAp8UeFAAAHvklEQVR42s2b63bcNgyEQZCSHCdt2vd/0tWF7I+Q6XgMXiTtuvU5Pl57ZQKkKHzEAOtF5KeIJBGJ8uvL599FRFREZhFx8DeXv8trn68RuGaC8TRfo3SNp9dlDDHedyLyTUTeRWStXKPZrjtpZxaRw5hPqozRs1N8/enzIiQRWcCgy4MUA0f+XWliDhyL8Lfyvx7ei/Ae3iQFHyw7U/59pQVIMEEPEz0G7XiwdRjzSfC3UTtz9vchIntxvry5iMgfIhJoEflOz2CQr3F5h/HfeFe+GTdLaKcu9L8LTeQb/R/7GgbsfKedyNdoHsN31uRPWrfZ5wsj/NzzRQHuToIdU3ahwnsKPxXCjJITuOsi7XLc7SG/v5GdALs7wf8JjTFiB5+QvTEfRyGOfX3Lrx8wxyQi3sNq46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0tYZ2Vtr0Xv7tPV3hkWp9EFkgS/J0vosngTaSoaG06WHi+xObQkaAdlbanP8B2+2l0f90LmUAAAAASUVORK5CYII=)}.cm-s-mdn-like .cm-matchhighlight{background-color:#d3eed3}.cm-s-mdn-like span.CodeMirror-selectedtext{background-color:transparent}.cm-s-monokai.CodeMirror{background:#272822;color:#f8f8f2}.cm-s-monokai div.CodeMirror-selected{background:#49483e}.cm-s-monokai .CodeMirror-line::selection,.cm-s-monokai .CodeMirror-line>span::selection,.cm-s-monokai .CodeMirror-line>span>span::selection{background:rgba(73, 72, 62, 0.99)}.cm-s-monokai .CodeMirror-line::-moz-selection,.cm-s-monokai .CodeMirror-line>span::-moz-selection,.cm-s-monokai .CodeMirror-line>span>span::-moz-selection{background:rgba(73, 72, 62, 0.99)}.cm-s-monokai .CodeMirror-gutters{background:#272822;border-right:0px}.cm-s-monokai .CodeMirror-guttermarker{color:white}.cm-s-monokai .CodeMirror-guttermarker-subtle{color:#d0d0d0}.cm-s-monokai .CodeMirror-linenumber{color:#d0d0d0}.cm-s-monokai .CodeMirror-cursor{border-left:1px solid #f8f8f0 !important}.cm-s-monokai span.cm-comment{color:#75715e !important}.cm-s-monokai span.cm-atom{color:#ae81ff}.cm-s-monokai span.cm-number{color:#ae81ff}.cm-s-monokai span.cm-comment.cm-attribute{color:#97b757}.cm-s-monokai span.cm-comment.cm-def{color:#bc9262}.cm-s-monokai span.cm-comment.cm-tag{color:#bc6283}.cm-s-monokai span.cm-comment.cm-type{color:#5998a6}.cm-s-monokai span.cm-property{color:#66d9ef}.cm-s-monokai span.cm-attribute{color:#a6e22e}.cm-s-monokai span.cm-keyword,.cm-s-monokai span.cm-operator{color:#f92672}.cm-s-monokai span.cm-keyword.cm-js-function-def{color:#66d9ef;font-style:italic}.cm-s-monokai span.cm-keyword.cm-js-var{color:#66d9ef;font-style:italic}.cm-s-monokai span.cm-deffunc{color:#a6e22e}.cm-s-monokai span.cm-builtin{color:#66d9ef}.cm-s-monokai span.cm-string{color:#e6db74}.cm-s-monokai span.cm-string-2{color:#e6db74}.cm-s-monokai .cm-searching,.cm-s-monokai span.cm-searching,.cm-s-monokai .cm-searching span{border:rgba(222, 222, 222, 0.8) .1em solid;border-radius:.2em;margin:-1px;background:none}.cm-s-monokai span.cm-objprop.cm-global-property{color:#f8f8f2}.cm-s-monokai span.cm-js-function-def.cm-def,.cm-s-monokai span.cm-js-function-def.cm-objprop,.cm-s-monokai span.cm-js-function-def.cm-variable,.cm-s-monokai span.cm-js-function-def.cm-property{color:#a6e22e}.cm-s-monokai .cm-searching.CodeMirror-selectedtext{border:rgba(230, 219, 116, 0.99) .1em solid;background:rgba(230, 219, 116, 0.99);color:black !important}.cm-s-monokai span.cm-variable{color:#f8f8f2}.cm-s-monokai span.cm-variable-3,.cm-s-monokai span.cm-type{color:#66d9ef}.cm-s-monokai span.cm-defarg{color:#fd971f;font-style:italic}.cm-s-monokai span.cm-bracket{color:#f8f8f2}.cm-s-monokai span.cm-tag{color:#f92672}.cm-s-monokai span.cm-header{color:#ae81ff}.cm-s-monokai span.cm-link{color:#ae81ff}.cm-s-monokai span.cm-error{background:#f92672;color:#f8f8f0}.cm-s-monokai span.cm-global-property{color:#66d9ef}.cm-s-monokai span.cm-js-well-known.cm-variable{color:#66d9ef;font-style:italic}.cm-s-monokai .CodeMirror-activeline-background{background:#373831}.cm-s-monokai .CodeMirror-matchingbracket{text-decoration:underline;color:white !important}.cm-s-monokai .cm-matchhighlight{background-color:#3c4f56}.cm-s-monokai span.CodeMirror-selectedtext{background-color:transparent}.cm-s-claude.CodeMirror{background:#282c34;color:#abb2bf}.cm-s-claude div.CodeMirror-selected{background:#3e4451}.cm-s-claude .CodeMirror-line::selection,.cm-s-claude .CodeMirror-line>span::selection,.cm-s-claude .CodeMirror-line>span>span::selection{background:rgba(62, 68, 81, 0.99)}.cm-s-claude .CodeMirror-line::-moz-selection,.cm-s-claude .CodeMirror-line>span::-moz-selection,.cm-s-claude .CodeMirror-line>span>span::-moz-selection{background:rgba(62, 68, 81, 0.99)}.cm-s-claude .CodeMirror-gutters{background:#282c34;border-right:0px}.cm-s-claude .CodeMirror-guttermarker{color:white}.cm-s-claude .CodeMirror-guttermarker-subtle{color:#abb2bf}.cm-s-claude .CodeMirror-linenumber{color:#5c6370}.cm-s-claude .CodeMirror-cursor{border-left:1px solid #528bff}.cm-s-claude span.cm-comment{color:#5c6370}.cm-s-claude span.cm-atom{color:#d19a66}.cm-s-claude span.cm-number{color:#d19a66}.cm-s-claude span.cm-property{color:#e06c75}.cm-s-claude span.cm-attribute{color:#e5c07b}.cm-s-claude span.cm-keyword{color:#c678dd}.cm-s-claude span.cm-builtin{color:#56b6c2}.cm-s-claude span.cm-string{color:#98c379}.cm-s-claude span.cm-variable{color:#e06c75}.cm-s-claude span.cm-variable-2{color:#abb2bf}.cm-s-claude span.cm-variable-3{color:#56b6c2}.cm-s-claude span.cm-type{color:#e5c07b}.cm-s-claude span.cm-def{color:#61afef}.cm-s-claude span.cm-bracket{color:#abb2bf}.cm-s-claude span.cm-tag{color:#e06c75}.cm-s-claude span.cm-header{color:#c678dd}.cm-s-claude span.cm-link{color:#61afef}.cm-s-claude span.cm-error{background:#e06c75;color:#282c34}.cm-s-claude .CodeMirror-activeline-background{background:#2c323c}.cm-s-claude .CodeMirror-matchingbracket{text-decoration:underline;color:#61afef !important}.cm-s-railscasts.CodeMirror{background:#2b2b2b;color:#f4f1ed}.cm-s-railscasts .CodeMirror-selectedtext{color:black !important}.cm-s-railscasts .CodeMirror-gutters{background:#2b2b2b;border-right:0px}.cm-s-railscasts .CodeMirror-linenumber{color:#5a647e}.cm-s-railscasts .CodeMirror-cursor{border-left:1px solid #d4cfc9 !important}.cm-s-railscasts span.cm-comment{color:#bc9458}.cm-s-railscasts span.cm-atom{color:#b6b3eb}.cm-s-railscasts span.cm-number{color:#b6b3eb}.cm-s-railscasts span.cm-property,.cm-s-railscasts span.cm-objprop,.cm-s-railscasts span.cm-attribute{color:#a5c261}.cm-s-railscasts span.cm-keyword{color:#da4939}.cm-s-railscasts span.cm-string{color:#ffc66d}.cm-s-railscasts span.cm-variable{color:#a5c261}.cm-s-railscasts span.cm-variable-2{color:#6d9cbe}.cm-s-railscasts span.cm-def,.cm-s-railscasts span.cm-defarg,.cm-s-railscasts span.cm-deffunc{color:#cc7833}.cm-s-railscasts span.cm-error{background:#da4939;color:#d4cfc9}.cm-s-railscasts span.cm-bracket{color:#f4f1ed}.cm-s-railscasts span.cm-tag{color:#da4939}.cm-s-railscasts span.cm-link{color:#b6b3eb}.cm-s-railscasts .CodeMirror-matchingbracket{text-decoration:underline;color:white !important}.cm-s-railscasts .CodeMirror-activeline-background{background:#303040}.cm-s-railscasts .cm-matchhighlight{background-color:#484954}.cm-s-railscasts span.CodeMirror-selectedtext{background-color:transparent}.solarized.base03{color:#002b36}.solarized.base02{color:#073642}.solarized.base01{color:#586e75}.solarized.base00{color:#657b83}.solarized.base0{color:#839496}.solarized.base1{color:#93a1a1}.solarized.base2{color:#eee8d5}.solarized.base3{color:#fdf6e3}.solarized.solar-yellow{color:#b58900}.solarized.solar-orange{color:#cb4b16}.solarized.solar-red{color:#dc322f}.solarized.solar-magenta{color:#d33682}.solarized.solar-violet{color:#6c71c4}.solarized.solar-blue{color:#268bd2}.solarized.solar-cyan{color:#2aa198}.solarized.solar-green{color:#859900}.cm-s-solarized{line-height:1.45em;color-profile:sRGB;rendering-intent:auto}.cm-s-solarized.cm-s-dark{color:#839496;background-color:#002b36;text-shadow:#002b36 0 1px}.cm-s-solarized.cm-s-light{background-color:#fdf6e3;color:#657b83;text-shadow:#eee8d5 0 1px}.cm-s-solarized .CodeMirror-widget{text-shadow:none}.cm-s-solarized .cm-header{color:#586e75}.cm-s-solarized .cm-quote{color:#93a1a1}.cm-s-solarized .cm-keyword{color:#cb4b16}.cm-s-solarized .cm-atom{color:#d33682}.cm-s-solarized .cm-number{color:#d33682}.cm-s-solarized .cm-def,.cm-s-solarized .cm-defarg,.cm-s-solarized .cm-deffunc{color:#2aa198}.cm-s-solarized .cm-variable{color:#839496}.cm-s-solarized .cm-variable-2{color:#b58900}.cm-s-solarized .cm-variable-3,.cm-s-solarized .cm-type{color:#6c71c4}.cm-s-solarized .cm-property,.cm-s-solarized .cm-objprop{color:#2aa198}.cm-s-solarized .cm-operator{color:#6c71c4}.cm-s-solarized .cm-comment{color:#586e75;font-style:italic}.cm-s-solarized .cm-string{color:#859900}.cm-s-solarized .cm-string-2{color:#b58900}.cm-s-solarized .cm-meta{color:#859900}.cm-s-solarized .cm-qualifier{color:#b58900}.cm-s-solarized .cm-builtin{color:#d33682}.cm-s-solarized .cm-bracket{color:#cb4b16}.cm-s-solarized .CodeMirror-matchingbracket{color:#859900}.cm-s-solarized .CodeMirror-nonmatchingbracket{color:#dc322f}.cm-s-solarized .cm-tag{color:#93a1a1}.cm-s-solarized .cm-attribute{color:#2aa198}.cm-s-solarized .cm-hr{color:transparent;border-top:1px solid #586e75;display:block}.cm-s-solarized .cm-link{color:#93a1a1;cursor:pointer}.cm-s-solarized .cm-special{color:#6c71c4}.cm-s-solarized .cm-em{color:#999;text-decoration:underline;text-decoration-style:dotted}.cm-s-solarized .cm-error,.cm-s-solarized .cm-invalidchar{color:#586e75;border-bottom:1px dotted #dc322f}.cm-s-solarized.cm-s-dark div.CodeMirror-selected{background:#073642}.cm-s-solarized.cm-s-dark.CodeMirror ::selection{background:rgba(7, 54, 66, 0.99)}.cm-s-solarized.cm-s-dark .CodeMirror-line::-moz-selection,.cm-s-dark .CodeMirror-line>span::-moz-selection,.cm-s-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(7, 54, 66, 0.99)}.cm-s-solarized.cm-s-light div.CodeMirror-selected{background:#eee8d5}.cm-s-solarized.cm-s-light .CodeMirror-line::selection,.cm-s-light .CodeMirror-line>span::selection,.cm-s-light .CodeMirror-line>span>span::selection{background:#eee8d5}.cm-s-solarized.cm-s-light .CodeMirror-line::-moz-selection,.cm-s-ligh .CodeMirror-line>span::-moz-selection,.cm-s-ligh .CodeMirror-line>span>span::-moz-selection{background:#eee8d5}.cm-s-solarized.CodeMirror{-moz-box-shadow:inset 7px 0 12px -6px #000;-webkit-box-shadow:inset 7px 0 12px -6px #000;box-shadow:inset 7px 0 12px -6px #000}.cm-s-solarized .CodeMirror-gutters{border-right:0}.cm-s-solarized.cm-s-dark .CodeMirror-gutters{background-color:#073642}.cm-s-solarized.cm-s-dark .CodeMirror-linenumber{color:#586e75;text-shadow:#021014 0 -1px}.cm-s-solarized.cm-s-light .CodeMirror-gutters{background-color:#eee8d5}.cm-s-solarized.cm-s-light .CodeMirror-linenumber{color:#839496}.cm-s-solarized .CodeMirror-linenumber{padding:0 5px}.cm-s-solarized .CodeMirror-guttermarker-subtle{color:#586e75}.cm-s-solarized.cm-s-dark .CodeMirror-guttermarker{color:#ddd}.cm-s-solarized.cm-s-light .CodeMirror-guttermarker{color:#cb4b16}.cm-s-solarized .CodeMirror-gutter .CodeMirror-gutter-text{color:#586e75}.cm-s-solarized .CodeMirror-cursor{border-left:1px solid #819090}.cm-s-solarized.cm-s-light.cm-fat-cursor .CodeMirror-cursor{background:#7e7}.cm-s-solarized.cm-s-light .cm-animate-fat-cursor{background-color:#7e7}.cm-s-solarized.cm-s-dark.cm-fat-cursor .CodeMirror-cursor{background:#586e75}.cm-s-solarized.cm-s-dark .cm-animate-fat-cursor{background-color:#586e75}.cm-s-solarized.cm-s-dark .CodeMirror-activeline-background{background:rgba(255, 255, 255, 0.06)}.cm-s-solarized.cm-s-light .CodeMirror-activeline-background{background:rgba(0, 0, 0, 0.06)}.cm-s-solarized .cm-matchhighlight{background-color:#e2e2e2}.cm-s-solarized span.CodeMirror-selectedtext{background-color:transparent}.cm-s-zenburn .CodeMirror-gutters{background:#3f3f3f !important}.cm-s-zenburn .CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded{color:#999}.cm-s-zenburn .CodeMirror-cursor{border-left:1px solid white}.cm-s-zenburn{background-color:#3f3f3f;color:#dcdccc}.cm-s-zenburn span.cm-builtin{color:#dcdccc;font-weight:bold}.cm-s-zenburn span.cm-comment{color:#7f9f7f}.cm-s-zenburn span.cm-keyword{color:#f0dfaf;font-weight:bold}.cm-s-zenburn span.cm-atom{color:#bfebbf}.cm-s-zenburn span.cm-def{color:#dcdccc}.cm-s-zenburn span.cm-variable{color:#dfaf8f}.cm-s-zenburn span.cm-variable-2{color:#dcdccc}.cm-s-zenburn span.cm-string{color:#cc9393}.cm-s-zenburn span.cm-string-2{color:#cc9393}.cm-s-zenburn span.cm-number{color:#dcdccc}.cm-s-zenburn span.cm-tag{color:#93e0e3}.cm-s-zenburn span.cm-property{color:#dfaf8f}.cm-s-zenburn span.cm-attribute{color:#dfaf8f}.cm-s-zenburn span.cm-qualifier{color:#7cb8bb}.cm-s-zenburn span.cm-meta{color:#f0dfaf}.cm-s-zenburn span.cm-header{color:#f0efd0}.cm-s-zenburn span.cm-operator{color:#f0efd0}.cm-s-zenburn span.CodeMirror-matchingbracket{box-sizing:border-box;background:transparent;border-bottom:1px solid}.cm-s-zenburn span.CodeMirror-nonmatchingbracket{border-bottom:1px solid;background:none}.cm-s-zenburn .CodeMirror-activeline{background:#000}.cm-s-zenburn .CodeMirror-activeline-background{background:#000}.cm-s-zenburn div.CodeMirror-selected{background:#545454}.cm-s-zenburn .CodeMirror-focused div.CodeMirror-selected{background:#4f4f4f}.cm-s-zenburn .cm-matchhighlight{background-color:#4e1c1c}.cm-s-zenburn span.CodeMirror-selectedtext{background-color:transparent} \ No newline at end of file diff --git a/backend/neko/tampermonkey-seed/Default/Extensions/dhdgffkkebhmkfjojejmpbldmpobfkfo/5.5.0_0/editor.js b/backend/neko/tampermonkey-seed/Default/Extensions/dhdgffkkebhmkfjojejmpbldmpobfkfo/5.5.0_0/editor.js new file mode 100644 index 0000000..7b9464d --- /dev/null +++ b/backend/neko/tampermonkey-seed/Default/Extensions/dhdgffkkebhmkfjojejmpbldmpobfkfo/5.5.0_0/editor.js @@ -0,0 +1,821 @@ +(()=>{function e(r){var i=n[r];if(void 0!==i)return i.exports;var o=n[r]={exports:{}};return t[r].call(o.exports,o,o.exports,e),o.exports}var t={1340:(e,t,n)=>{"use strict";function r(e,t){return null===e||void 0===e&&t?"":void 0===e?void 0:`${e}`}n.r(t),n.d(t,{$:()=>l});const i=(e,t)=>{for(let n=0,r=e.length;n{const n=document.querySelectorAll(t);let r=e.parentNode;for(;r&&!i(n,r);)r=r.parentNode;return r +},a=e=>e&&void 0!==e.nodeType,s=e=>e&&void 0!==e.tagName,l=(...e)=>{const t=e.length>1?e:e[0];if(null==t?void 0:t.queryHelper)return t;if("function"==typeof t)return"loading"!=window.document.readyState?t(null):window.addEventListener("DOMContentLoaded",t),l([]);if("string"==typeof t){let e=[];if("<"==t.trim()[0]){let n=t;try{if(-1!=n.indexOf("]*>[^<]*<\/script>/g,r=/([^\r\n\t\f\v= '"]+)(?:=(["'])?((?:.(?!\2?\s+(?:\S+)=|\2))+.)\2?)?/g,i=n.match(t) +;i&&i.length&&(n=n.replace(t,""),i.forEach((t=>{const n=t.match(r);if(!n||!n.length)return;const i={};if(n.slice(1,-1).forEach((e=>{const t=e.split("="),n=t.shift()||e;i[n]=(t.join("=")||"").replace(/^"|"$/g,"")})),!i.src)return void console.error(`ssjq: unable to parse "${t}"`,i);const o=document.createElement("script");["src","async"].forEach((e=>{void 0!==i[e]&&o.setAttribute(e,i[e])})),e.push(o)})))}const t=/^<([^>]+)>$/.exec(n);t&&2==t.length&&(n=`${n}`) +;const r=(new DOMParser).parseFromString(n,"text/html"),i=[].slice.call(r.body.children);e=i.concat(e)}catch(t){console.error(`ssjq: ${t}`),e=[]}}else{const n=document.querySelectorAll(t);e=[].slice.call(n)}return l(e)}if(Array.isArray(t)){const e=[].concat(...t.map((e=>Array.isArray(e)?e:"string"==typeof e?l(e):[e])).filter((e=>e))),n={},i=Object.assign(e,{queryHelper:!0,append:(...t)=>(t.forEach((t=>{const n=e[0];a(n)&&l(t).forEach((e=>n.appendChild(l(e)[0])))})),l(e)),appendTo:t=>{ +const n=l(t);return e.filter(a).forEach((e=>n.append(e))),l(e)},insertBefore:t=>{const n=[...e];if(e.length){const r=l(t)[0],i=null==r?void 0:r.parentNode;i&&e.forEach((e=>{const t=l(e)[0];t&&(i.insertBefore(t,r),n.push(t))}))}return l(n)},remove:()=>(e.filter(a).forEach((e=>{var t;return null===(t=e.parentNode)||void 0===t?void 0:t.removeChild(e)})),l([])),replaceWith:t=>{const n=e[0];if(n){const e=(e=>e&&e.queryHelper)(n)?n[0]:n,r=l(t),i=r.shift();return void 0!==i&&s(e)&&(e.replaceWith(i), +r.forEach((e=>{var t;null===(t=i.parentNode)||void 0===t||t.insertBefore(e,i.nextSibling)}))),l(e)}return l(e)},prevAll:t=>{var n;const r=e[0];if(!r)return l([]);const i=null===(n=l(r).parent())||void 0===n?void 0:n.children(t);if(!i||!i.length)return l([]);const o=[];for(let e=0;e{var n;const r=e[0];if(!r)return l([]);const i=null===(n=l(r).parent())||void 0===n?void 0:n.children(t) +;if(!i||!i.length)return l([]);const o=[];let a=!1;for(let e=0;e{const n=t.trim().split(" ");return e.filter(s).forEach((e=>n.forEach((t=>e.classList.add(t))))),l(e)},removeClass:t=>{const n=t.trim().split(" ");return e.filter(s).forEach((e=>n.forEach((t=>e.classList.remove(t))))),l(e)},toggleClass:(t,n)=>(t.trim().split(" ").forEach((t=>{ +!0===n?i.addClass(t):!1===n?i.removeClass(t):e.filter(s).forEach((e=>e.classList.toggle(t)))})),l(e)),hasClass:t=>!!e.filter((e=>s(e)&&e.classList.contains(t))).length,is:t=>{const n=e[0];if(n&&s(n))return":visible"==t?"none"!==window.getComputedStyle(n).display:":checked"==t?1==n.checked:void 0},attr:(t,n)=>{if(e.length){const r=(t,n)=>{null===n?e.filter(s).forEach((e=>e.removeAttribute(t))):e.filter(s).forEach((e=>e.setAttribute(t,n.toString())))};if("string"==typeof t){if(void 0===n){ +const n=e[0];return s(n)&&n.getAttribute(t)||void 0}r(t,n)}else for(const e of Object.keys(t))r(e,t[e])}return l(e)},prop:(t,n)=>{if(e.length){const r=(t,n)=>{null===n?e.filter(s).forEach((e=>{delete e[t],e.removeAttribute(t)})):e.forEach((e=>e[t]=n))};if("string"==typeof t){if(void 0===n)return e[0][t];r(t,n)}else for(const e of Object.keys(t))r(e,t[e])}return l(e)}, +text:t=>void 0===t?e.length?e.filter(s).map((e=>"textarea"==e.type?e.value:e.innerText)).join(""):void 0:(e.length&&null!=t&&e.filter(s).forEach((e=>{"textarea"==e.type?e.value=`${t}`:e.innerText=r(t)})),l(e)),html:t=>{if(e.length){if(void 0===t)return e.filter(s).map((e=>e.innerHTML)).join("");e.filter(s).forEach((e=>e.innerHTML=r(t)))}return l(e)},closest:t=>{const n=[];for(const r of e){const e=s(r)&&o(r,t);e&&n.push(e)}return l(n)},parent:()=>{const t=e[0];return s(t)?l(t.parentNode):l([])}, +children:t=>{const n=e[0];if(s(n))if(t){if(n.querySelectorAll){const e=n.querySelectorAll(t);return l([].slice.call(e))}}else if(n.children)return l([].slice.call(n.children));return l([])},find:t=>{let n=[];return e.forEach((e=>{l(e).children(t).forEach((e=>{const r=l(e).find(t).toArray();n=[...n,e,...r]}))})),l(n)},each:t=>(e.forEach(((e,n)=>t(n,e))),l(e)),not:t=>{const n=l(t);return l(e.filter((e=>-1===n.indexOf(l(e)[0]))))},first:()=>l(e.slice(0,1)),toArray:()=>[...e], +bind:(t,r)=>(t.split(" ").forEach((t=>{(n[t]||(n[t]=[])).push(r),e.forEach((e=>e.addEventListener(t,r)))})),l(e)),unbind:t=>(t.split(" ").forEach((t=>{n[t]&&(n[t].forEach((n=>{e.forEach((e=>{e.removeEventListener(t,n)}))})),n[t]=[])})),l(e)),value:t=>{if(void 0===t){let t;return e.slice().reverse().some((e=>{if(!e.disabled)if("checkbox"==e.type){if(1==e.checked)return t=e.value,!0}else{if("radio"!=e.type)return t=e.value,!0;if(1==e.checked)return t=e.value,!0}})),t}{ +const n=e.length?e[e.length-1]:void 0;return n&&("checkbox"==n.type?n.value==t&&(n.checked=!0):"select-one"==n.type?n.value=r(t):((e=>e&&void 0!==e.type)(n)&&"text"==n.type&&(n.value=r(t)),n.setAttribute("value",r(t)))),l(e)}},data:(t,n)=>{const i=e[0];return s(i)&&i.dataset?void 0===n?i.dataset[t]:(null===n?delete i.dataset[t]:i.dataset[t]=r(n),l(e)):void 0===n?l(e):void 0},offset:()=>{const t=e[0];return s(t)&&(null==t?void 0:t.getBoundingClientRect())||{left:-1,top:-1,right:-1,bottom:-1,x:-1, +y:-1,height:-1,width:-1}},height:()=>{const t=e[0];return t&&((e=>e&&void 0!==e.document)(t)?window.innerHeight:t.offsetHeight)||0},scrollTop:()=>{const t=e[0];return t&&(t.scrollTop||t.pageYOffset)||0},get:t=>e[t],on:(t,n)=>(t.split(" ").forEach((t=>e.forEach((e=>null==e?void 0:e.addEventListener(t,n))))),l(e)),off:(t,n)=>(t.split(" ").forEach((t=>e.forEach((e=>null==e?void 0:e.removeEventListener(t,n))))),l(e)),trigger:(t,n)=>{const r=new Event(t,{bubbles:!0,cancelable:!0}) +;return n&&Object.assign(r,n),e.forEach((e=>{if(["focus","blur"].includes(t)){const n=e[t];"function"==typeof n&&n.apply(e,[])}e.dispatchEvent(r)})),l(e)},toggle:t=>(e.forEach((e=>{const n=l(e);(void 0===t?n.is(":visible"):!t)?n.hide():n.show()})),l(e)),hide:()=>(e.filter(s).forEach((e=>{var t;const n=null===(t=null==e?void 0:e.style)||void 0===t?void 0:t.display;n&&-1==n.indexOf("none")&&(e.backuped_display=n),l(e).attr("style","display: none !important")})),l(e)), +fadeOut:async t=>new Promise((n=>{e.filter(s).forEach((e=>{e.style.opacity="1",e.style.transition=`opacity ${t||150}ms`,setTimeout((()=>{e.style.opacity="0"}),1)})),setTimeout((()=>{e.filter(s).forEach((e=>{e.style.transition="",e.style.opacity=""})),i.hide(),n(l(e))}),(t||150)+1)})),show:()=>(e.filter(s).forEach((e=>{e.style.display=e.backuped_display||""})),l(e)),fadeIn:async t=>new Promise((n=>{e.filter(s).forEach((e=>{e.style.opacity="0",e.style.transition=`opacity ${t||150}ms`, +setTimeout((()=>{e.style.opacity="1"}),1)})),i.show(),setTimeout((()=>{e.filter(s).forEach((e=>{e.style.transition="",e.style.opacity=""})),n(l(e))}),(t||150)+1)})),animate:(t,n)=>new Promise((r=>{const i=e[0];i.current_action&&window.clearInterval(i.current_action),i.current_action=window.setInterval((()=>{if(void 0!==t.scrollTop){const n=i===window?document.documentElement:i,o=n.scrollTop;n.scrollTop{if(void 0!==t.height){const n=l(e).get(0);n&&n.style&&(n.style.height=`${t.height}px`)}})),r(l(e))}),void 0===n?100:n)})),serialize:()=>{if(1==e.length&&(t=e[0])&&"FORM"==t.tagName)return l(e[0]).find("input, textarea, select, button").map((e=>{const t=e.name,n=l(e).value() +;if("string"==typeof t&&"string"==typeof n)return`${t}=${encodeURIComponent(n)}`})).filter((e=>"string"==typeof e)).join("&");var t}});return i}return l(void 0===t||null==t?[]:[t])}},3495:(e,t,n)=>{!function(e){"use strict";var t="CodeMirror-bookmarks",n=[void 0,t,"CodeMirror-linenumbers"],r=e.Pos,i=e.Range,o=function(e,t,o){var a;-1!=n.indexOf(o)&&((a=e.listSelections().filter((function(e){return!e.empty()})))&&0===a.length&&(a=[new i(new r(t,0),new r(t,e.getLine(t).length))]),c(e,a)) +},a=function(e,n,i){for(var o,a,s,l=0;l{!function(e){"use strict";function t(e){var t=e.search(i);return-1==t?0:t}function n(e,t){var n=e.getMode();return!1!==n.useInnerComments&&n.innerMode?e.getModeAt(t):n}var r={},i=/[^\s\u00a0]/,o=e.Pos,a=e.cmpPos;e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",(function(e){e||(e=r) +;for(var t=this,n=1/0,i=this.listSelections(),a=null,s=i.length-1;s>=0;s--){var l=i[s].from(),c=i[s].to();l.line>=n||(c.line>=n&&(c=o(n,0)),n=l.line,null==a?t.uncomment(l,c,e)?a="un":(t.lineComment(l,c,e),a="line"):"un"==a?t.uncomment(l,c,e):t.lineComment(l,c,e))}})),e.defineExtension("lineComment",(function(e,a,s){s||(s=r);var l,c,u=this,f=n(u,e),d=u.getLine(e.line);if(null!=d&&(l=e,c=d,!/\bstring\b/.test(u.getTokenTypeAt(o(l.line,0)))||/^[\'\"\`]/.test(c))){var h=s.lineComment||f.lineComment +;if(h&&!s.blockComment){var p=Math.min(0!=a.ch||a.line==e.line?a.line+1:a.line,u.lastLine()+1),m=null==s.padding?" ":s.padding,g=s.commentBlankLines||e.line==a.line;u.operation((function(){if(s.indent){for(var n=null,r=e.line;ra.length)&&(n=a)}for(r=e.line;rd||l.operation((function(){if(0!=s.fullLines){var n=i.test(l.getLine(d));l.replaceRange(h+f,o(d)),l.replaceRange(u+h,o(e.line,0));var r=s.blockCommentLead||c.blockCommentLead;if(null!=r)for(var p=e.line+1;p<=d;++p)(p!=d||n)&&l.replaceRange(r+h,o(p,0))}else{var m=0==a(l.getCursor("to"),t),g=!l.somethingSelected();l.replaceRange(f,t),m&&l.setSelection(g?t:l.getCursor("from"),t),l.replaceRange(u,e)}}))} +}else(s.lineComment||c.lineComment)&&0!=s.fullLines&&l.lineComment(e,t,s)})),e.defineExtension("uncomment",(function(e,t,a){a||(a=r);var s,l=this,c=n(l,e),u=Math.min(0!=t.ch||t.line==e.line?t.line:t.line-1,l.lastLine()),f=Math.min(e.line,u),d=a.lineComment||c.lineComment,h=[],p=null==a.padding?" ":a.padding;e:if(d){for(var m=f;m<=u;++m){var g=l.getLine(m),v=g.indexOf(d);if(v>-1&&!/comment/.test(l.getTokenTypeAt(o(m,v+1)))&&(v=-1),-1==v&&i.test(g))break e;if(v>-1&&i.test(g.slice(0,v)))break e +;h.push(g)}if(l.operation((function(){for(var e=f;e<=u;++e){var t=h[e-f],n=t.indexOf(d),r=n+d.length;n<0||(t.slice(r,r+p.length)==p&&(r+=p.length),s=!0,l.replaceRange("",o(e,n),o(e,r)))}})),s)return!0}var y=a.blockCommentStart||c.blockCommentStart,b=a.blockCommentEnd||c.blockCommentEnd;if(!y||!b)return!1;var k=a.blockCommentLead||c.blockCommentLead,w=l.getLine(f),C=w.indexOf(y);if(-1==C)return!1;var x=u==f?w:l.getLine(u),S=x.indexOf(b,u==f?C+y.length:0),M=o(f,C+1),L=o(u,S+1) +;if(-1==S||!/comment/.test(l.getTokenTypeAt(M))||!/comment/.test(l.getTokenTypeAt(L))||l.getRange(M,L,"\n").indexOf(b)>-1)return!1;var T=w.lastIndexOf(y,e.ch),A=-1==T?-1:w.slice(0,e.ch).indexOf(b,T+y.length);if(-1!=T&&-1!=A&&A+b.length!=e.ch)return!1;A=x.indexOf(b,t.ch);var O=x.slice(t.ch).lastIndexOf(y,A-t.ch);return T=-1==A||-1==O?-1:t.ch+O,(-1==A||-1==T||T==t.ch)&&(l.operation((function(){l.replaceRange("",o(u,S-(p&&x.slice(S-p.length,S)==p?p.length:0)),o(u,S+b.length));var e=C+y.length +;if(p&&w.slice(e,e+p.length)==p&&(e+=p.length),l.replaceRange("",o(f,C),o(f,e)),k)for(var t=f+1;t<=u;++t){var n=l.getLine(t),r=n.indexOf(k);if(-1!=r&&!i.test(n.slice(0,r))){var a=r+k.length;p&&n.slice(a,a+p.length)==p&&(a+=p.length),l.replaceRange("",o(t,r),o(t,a))}}})),!0)}))}(n(4538))},2073:(e,t,n)=>{!function(e){function t(t){if(t.getOption("disableInput"))return e.Pass;for(var i,a=t.listSelections(),s=[],l=0;l-1&&/\bcomment\b/.test(t.getTokenTypeAt({line:c.line,ch:d+1 +})));else if(c.ch>=p.length&&(d=f.lastIndexOf(p,c.ch-p.length))>-1&&d>g)if(n(0,f)>=d)h=f.slice(0,d);else{var v,y=t.options.tabSize;d=e.countColumn(f,d,y),h=t.options.indentWithTabs?o.call("\t",v=Math.floor(d/y))+o.call(" ",d-y*v):o.call(" ",d)}else(d=f.indexOf(i.blockCommentContinue))>-1&&d<=c.ch&&d<=n(0,f)&&(h=f.slice(0,d));null!=h&&(h+=i.blockCommentContinue)}if(null==h&&m&&r(t))if(null==f&&(f=t.getLine(c.line)),d=f.indexOf(m),c.ch||d){if(d>-1&&n(0,f)>=d){if(!(h=n(c.ch,f)>-1)){ +var b=t.getLine(c.line+1)||"",k=b.indexOf(m);h=k>-1&&n(0,b)>=k||null}h&&(h=f.slice(0,d)+m+f.slice(d+m.length).match(/^\s*/)[0])}}else h="";if(null==h)return e.Pass;s[l]="\n"+h}t.operation((function(){for(var e=a.length-1;e>=0;e--)t.replaceRange(s[e],a[e].from(),a[e].to(),"+insert")}))}function n(e,t){i.lastIndex=e;var n=i.exec(t);return n?n.index:-1}function r(e){var t=e.getOption("continueComments");return!t||"object"!=typeof t||!1!==t.continueLineComment}var i=/\S/g,o="".repeat||function(e){ +return Array(e+1).join(this)};e.defineOption("continueComments",null,(function(n,r,i){if(i&&i!=e.Init&&n.removeKeyMap("continueComment"),r){var o="Enter";"string"==typeof r?o=r:"object"==typeof r&&r.key&&(o=r.key);var a={name:"continueComment"};a[o]=t,n.addKeyMap(a)}}))}(n(4538))},3489:(e,t,n)=>{!function(e){function t(t,n,r){var i,o=t.getWrapperElement() +;return(i=o.appendChild(document.createElement("div"))).className=r?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof n?i.innerHTML=n:i.appendChild(n),e.addClass(o,"dialog-opened"),i}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}e.defineExtension("openDialog",(function(r,i,o){function a(t){if("string"==typeof t)f.value=t;else{if(c)return;c=!0, +e.rmClass(l.parentNode,"dialog-opened"),l.parentNode.removeChild(l),u.focus(),o.onClose&&o.onClose(l)}}o||(o={}),n(this,null);var s,l=t(this,r,o.bottom),c=!1,u=this,f=l.getElementsByTagName("input")[0];return f?(f.focus(),o.value&&(f.value=o.value,!1!==o.selectValueOnOpen&&f.select()),o.onInput&&e.on(f,"input",(function(e){o.onInput(e,f.value,a)})),o.onKeyUp&&e.on(f,"keyup",(function(e){o.onKeyUp(e,f.value,a)})),e.on(f,"keydown",(function(t){ +o&&o.onKeyDown&&o.onKeyDown(t,f.value,a)||((27==t.keyCode||!1!==o.closeOnEnter&&13==t.keyCode)&&(f.blur(),e.e_stop(t),a()),13==t.keyCode&&i(f.value,t))})),!1!==o.closeOnBlur&&e.on(l,"focusout",(function(e){null!==e.relatedTarget&&a()}))):(s=l.getElementsByTagName("button")[0])&&(e.on(s,"click",(function(){a(),u.focus()})),!1!==o.closeOnBlur&&e.on(s,"blur",a),s.focus()),a})),e.defineExtension("openConfirm",(function(r,i,o){function a(){c||(c=!0,e.rmClass(s.parentNode,"dialog-opened"), +s.parentNode.removeChild(s),u.focus(),o.onClose&&o.onClose(s))}o||(o={}),n(this,null);var s=t(this,r,o.bottom),l=s.getElementsByTagName("button"),c=!1,u=this,f=1;l[0].focus();for(var d=0;d{!function(e){"use strict";var t;e.defineOption("autoTrimTrailingSpace",!1,(function(e,r){t=r, +r?e.on("change",n):!r&&e.state.clearEmptyLines&&e.off("change",n)})),e.commands.trimTrailingSpacesIfEnabled=function(e){t&&r(e,!0,!0)};var n=function(t,n){if("undo"!==n.origin){var r=e.changeEnd(n);t.getDoc().markText(n.from,r,{className:"user_change",history:!0})}},r=function(t){var n,r,i,o,a,s,l;t.getDoc().getAllMarks().forEach((function(c){if("user_change"==c.className&&(n=c.find()))for(var u=n.from.line;u<=n.to.line;u++)(r=t.getLine(u))&&(i=r.match(/\s+$/))&&(o=i[0].length)&&(a=r.length, +s=new e.Pos(u,a-o),l=new e.Pos(u,a),t.replaceRange("",s,l,void 0))}))}}(n(4538))},2446:(e,t,n)=>{!function(e){function t(e){return e&&e.bracketRegex||/[(){}[\]]/}function n(e,n,i){var o=e.getLineHandle(n.line),a=n.ch-1,c=i&&i.afterCursor;null==c&&(c=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var u=t(i),f=!c&&a>=0&&u.test(o.text.charAt(a))&&l[o.text.charAt(a)]||u.test(o.text.charAt(a+1))&&l[o.text.charAt(++a)];if(!f)return null;var d=">"==f.charAt(1)?1:-1 +;if(i&&i.strict&&d>0!=(a==n.ch))return null;var h=e.getTokenTypeAt(s(n.line,a+1)),p=r(e,s(n.line,a+(d>0?1:0)),d,h||null,i);return null==p?null:{from:s(n.line,a),to:p&&p.pos,match:p&&p.ch==f.charAt(0),forward:d>0}}function r(e,n,r,i,o){for(var a=o&&o.maxScanLineLength||1e4,c=o&&o.maxScanLines||1e3,u=[],f=t(o),d=r>0?Math.min(n.line+c,e.lastLine()+1):Math.max(e.firstLine()-1,n.line-c),h=n.line;h!=d;h+=r){var p=e.getLine(h);if(p){var m=r>0?0:p.length-1,g=r>0?p.length:-1 +;if(!(p.length>a))for(h==n.line&&(m=n.ch-(r<0?1:0));m!=g;m+=r){var v=p.charAt(m);if(f.test(v)&&(void 0===i||e.getTokenTypeAt(s(h,m+1))==i)){var y=l[v];if(y&&">"==y.charAt(1)==r>0)u.push(v);else{if(!u.length)return{pos:s(h,m),ch:v};u.pop()}}}}}return h-r!=(r>0?e.lastLine():e.firstLine())&&null}function i(e,t,r){for(var i=e.state.matchBrackets.maxHighlightLineLength||1e3,o=[],l=e.listSelections(),c=0;c",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};e.defineOption("matchBrackets",!1,(function(t,n,r){function i(e){ +e.state.matchBrackets&&e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null)}r&&r!=e.Init&&(t.off("cursorActivity",o),t.off("focus",o),t.off("blur",i),i(t)),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",o),t.on("focus",o),t.on("blur",i))})),e.defineExtension("matchBrackets",(function(){i(this,!0)})),e.defineExtension("findMatchingBracket",(function(e,t,r){ +return(r||"boolean"==typeof t)&&(r?(r.strict=t,t=r):t=t?{strict:!0}:null),n(this,e,t)})),e.defineExtension("scanForBracket",(function(e,t,n,i){return r(this,e,t,n,i)}))}(n(4538))},8095:(e,t,n)=>{var r;(r=n(4538)).defineOption("showTrailingSpace",!1,(function(e,t,n){n==r.Init&&(n=!1),n&&!t?e.removeOverlay("trailingspace"):!n&&t&&e.addOverlay({token:function(e){for(var t=e.string.length,n=t;n&&/\s/.test(e.string.charAt(n-1));--n);return n>e.pos?(e.pos=n,null):(e.pos=t,"trailingspace")}, +name:"trailingspace"})}))},7440:(e,t,n)=>{!function(e){"use strict";e.registerHelper("fold","brace",(function(t,n){function r(r){for(var s=n.ch,l=0;;){var c=s<=0?-1:a.lastIndexOf(r,s-1);if(-1!=c){if(1==l&&ct.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1)) +;if(/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"keyword"!=r.type||"import"!=r.string)return null;for(var i=n,o=Math.min(t.lastLine(),n+10);i<=o;++i){var a=t.getLine(i).indexOf(";");if(-1!=a)return{startCh:r.end,end:e.Pos(i,a)}}}var i,o=n.line,a=r(o);if(!a||r(o-1)||(i=r(o-2))&&i.end.line==o-1)return null;for(var s=a.end;;){var l=r(s.line+1);if(null==l)break;s=l.end}return{from:t.clipPos(e.Pos(o,a.startCh+1)),to:s}})),e.registerHelper("fold","include",(function(t,n){function r(n){ +if(nt.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));return/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"meta"==r.type&&"#include"==r.string.slice(0,8)?r.start+8:void 0}var i=n.line,o=r(i);if(null==o||null!=r(i-1))return null;for(var a=i;null!=r(a+1);)++a;return{from:e.Pos(i,o+1),to:t.clipPos(e.Pos(a))}}))}(n(4538))},7544:(e,t,n)=>{!function(e){"use strict";e.registerGlobalHelper("fold","comment",(function(e){return e.blockCommentStart&&e.blockCommentEnd +}),(function(t,n){var r=t.getModeAt(n),i=r.blockCommentStart,o=r.blockCommentEnd;if(i&&o){for(var a,s=n.line,l=t.getLine(s),c=n.ch,u=0;;){var f=c<=0?-1:l.lastIndexOf(i,c-1);if(-1!=f){if(1==u&&f{!function(e){"use strict";function t(t,r,i,o){function a(e){var n=s(t,r);if(!n||n.to.line-n.from.linet.firstLine();)r=e.Pos(r.line-1,0),c=a(!1);if(c&&!c.cleared&&"unfold"!==o){var u=function(e,t,r){var i=n(e,t,"widget");if("function"==typeof i&&(i=i(r.from,r.to)),"string"==typeof i){var o=document.createTextNode(i);(i=document.createElement("span")).appendChild(o),i.className="CodeMirror-foldmarker"}else i&&(i=i.cloneNode(!0)) +;return i}(t,i,c);e.on(u,"mousedown",(function(t){f.clear(),e.e_preventDefault(t)}));var f=t.markText(c.from,c.to,{replacedWith:u,clearOnEnter:n(t,i,"clearOnEnter"),__isFold:!0});f.on("clear",(function(n,r){e.signal(t,"unfold",t,n,r)})),e.signal(t,"fold",t,c.from,c.to)}}function n(e,t,n){if(t&&void 0!==t[n])return t[n];var i=e.options.foldOptions;return i&&void 0!==i[n]?i[n]:r[n]}e.newFoldFunction=function(e,n){return function(r,i){t(r,i,{rangeFinder:e,widget:n})}}, +e.defineExtension("foldCode",(function(e,n,r){t(this,e,n,r)})),e.defineExtension("isFolded",(function(e){for(var t=this.findMarksAt(e),n=0;n{!function(e){"use strict";function t(e){this.options=e,this.from=this.to=0}function n(e,t){for(var n=e.findMarks(f(t,0),f(t+1,0)),r=0;r=l){if(d&&o&&d.test(o.className))return;i=r(a.indicatorOpen)}}(i||o)&&e.setGutterMarker(t,a.gutter,i)}))}function o(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function a(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation((function(){i(e,t.from,t.to)})),n.from=t.from,n.to=t.to)}function s(e,t,r){var i=e.state.foldGutter;if(i){var o=i.options;if(r==o.gutter){var a=n(e,t);a?a.clear():e.foldCode(f(t,0),o)}}}function l(e){ +var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){a(e)}),n.foldOnChangeTimeSpan||600)}}function c(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){var n=e.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?a(e):e.operation((function(){n.fromt.to&&(i(e,t.to,n.to),t.to=n.to)})) +}),n.updateViewportTimeSpan||400)}}function u(e,t){var n=e.state.foldGutter;if(n){var r=t.line;r>=n.from&&r{!function(e){function t(e,t){for(var n=0,r=e.length;ns.ch&&(l.end=s.ch,l.string=l.string.slice(0,s.ch-l.start)):l={start:s.ch,end:s.ch,string:"",state:l.state,type:"."==l.string?"property":null};for(var u=l;"property"==u.type;){if("."!=(u=r(t,o(s.line,u.start))).string)return;if(u=r(t,o(s.line,u.start)),!f)var f=[];f.push(u)}return{list:i(l,f,n,a),from:o(s.line,l.start),to:o(s.line,l.end)}}}}function r(e,t){var n=e.getTokenAt(t) +;return t.ch==n.start+1&&"."==n.string.charAt(0)?(n.end=n.start,n.string=".",n.type="property"):/^\.[\w$_]*$/.test(n.string)&&(n.type="property",n.start++,n.string=n.string.replace(/\./,"")),n}function i(e,n,r,i){function o(e){0!=e.lastIndexOf(f,0)||function(e,t){if(![].indexOf){for(var n=e.length;n--;)if(e[n]===t)return!0;return!1}return-1!=e.indexOf(t)}(u,e)||u.push(e)}function c(e){"string"==typeof e?t(a,o):e instanceof Array?t(s,o):e instanceof Function&&t(l,o),function(e,t){ +if(Object.getOwnPropertyNames&&Object.getPrototypeOf)for(var n=e;n;n=Object.getPrototypeOf(n))Object.getOwnPropertyNames(n).forEach(t);else for(var r in e)t(r)}(e,o)}var u=[],f=e.string,d=i&&i.globalScope||window;if(n&&n.length){var h,p=n.pop();for(p.type&&0===p.type.indexOf("variable")?(i&&i.additionalContext&&(h=i.additionalContext[p.string]), +i&&!1===i.useGlobalScope||(h=h||d[p.string])):"string"==p.type?h="":"atom"==p.type?h=1:"function"==p.type&&(null==d.jQuery||"$"!=p.string&&"jQuery"!=p.string||"function"!=typeof d.jQuery?null!=d._&&"_"==p.string&&"function"==typeof d._&&(h=d._()):h=d.jQuery());null!=h&&n.length;)h=h[n.pop().string];null!=h&&c(h)}else{for(var m=e.state.localVars;m;m=m.next)o(m.name);for(var g=e.state.context;g;g=g.prev)for(m=g.vars;m;m=m.next)o(m.name);for(m=e.state.globalVars;m;m=m.next)o(m.name) +;if(i&&null!=i.additionalContext)for(var v in i.additionalContext)o(v);i&&!1===i.useGlobalScope||c(d),t(r,o)}return u}var o=e.Pos;e.registerHelper("hint","javascript",(function(e,t){var r=c;return t.keywords&&(r=r.concat(t.keywords)),n(e,r,(function(e,t){return e.getTokenAt(t)}),t)})),e.registerHelper("hint","coffeescript",(function(e,t){return n(e,u,r,t)})) +;var a="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),s="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),l="prototype apply call bind".split(" "),c="break case catch class const continue debugger default delete do else export extends false finally for function if in import instanceof new null return super switch this throw true try typeof var void while with yield".split(" "),u="and break catch class continue delete do else extends false finally for if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes".split(" ") +}(n(4538))},3660:(e,t,n)=>{!function(e){"use strict";function t(e,t){this.cm=e,this.options=t,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length;var n=this;e.on("cursorActivity",this.activityFunc=function(){n.cursorActivity()})}function n(e){return"string"==typeof e?e:e.text}function r(e,t){for(;t&&t!=e;){if("LI"===t.nodeName.toUpperCase()&&t.parentNode==e)return t +;t=t.parentNode}}function i(t,i){this.completion=t,this.data=i,this.picked=!1;var o=this,l=t.cm,c=l.getInputField().ownerDocument,u=c.defaultView||c.parentWindow,f=this.hints=c.createElement("ul"),d=t.cm.options.theme;f.className="CodeMirror-hints "+d,this.selectedHint=i.selectedHint||0;for(var h=i.list,p=0;pf.clientHeight+1,I=l.getScrollInfo();if(E>0){var R=N.bottom-N.top;if(b.top-(b.bottom-N.top)-R>0)f.style.top=(w=b.top-R-S)+"px",C=!1;else if(R>O){f.style.height=O-5+"px",f.style.top=(w=b.bottom-N.top-S)+"px";var B=l.getCursor() +;i.from.ch!=B.ch&&(b=l.cursorCoords(B),f.style.left=(k=b.left-x)+"px",N=f.getBoundingClientRect())}}var F,H=N.right-A;if(H>0&&(N.right-N.left>A&&(f.style.width=A-5+"px",H-=N.right-N.left-A),f.style.left=(k=b.left-H-x)+"px"),P)for(var D=f.firstChild;D;D=D.nextSibling)D.style.paddingRight=l.display.nativeBarWidth+"px";return l.addKeyMap(this.keyMap=function(e,t){function n(e,n){var i;i="string"!=typeof n?function(e){return n(e,t)}:r.hasOwnProperty(n)?r[n]:n,o[e]=i}var r={Up:function(){ +t.moveFocus(-1)},Down:function(){t.moveFocus(1)},PageUp:function(){t.moveFocus(1-t.menuSize(),!0)},PageDown:function(){t.moveFocus(t.menuSize()-1,!0)},Home:function(){t.setFocus(0)},End:function(){t.setFocus(t.length-1)},Enter:t.pick,Tab:t.pick,Esc:t.close};/Mac/.test(navigator.platform)&&(r["Ctrl-P"]=function(){t.moveFocus(-1)},r["Ctrl-N"]=function(){t.moveFocus(1)});var i=e.options.customKeys,o=i?{}:r;if(i)for(var a in i)i.hasOwnProperty(a)&&n(a,i[a]);var s=e.options.extraKeys +;if(s)for(var a in s)s.hasOwnProperty(a)&&n(a,s[a]);return o}(t,{moveFocus:function(e,t){o.changeActive(o.selectedHint+e,t)},setFocus:function(e){o.changeActive(e)},menuSize:function(){return o.screenAmount()},length:h.length,close:function(){t.close()},pick:function(){o.pick()},data:i})),t.options.closeOnUnfocus&&(l.on("blur",this.onBlur=function(){F=setTimeout((function(){t.close()}),100)}),l.on("focus",this.onFocus=function(){clearTimeout(F)})),l.on("scroll",this.onScroll=function(){ +var e=l.getScrollInfo(),n=l.getWrapperElement().getBoundingClientRect(),r=w+I.top-e.top,i=r-(u.pageYOffset||(c.documentElement||c.body).scrollTop);if(C||(i+=f.offsetHeight),i<=n.top||i>=n.bottom)return t.close();f.style.top=r+"px",f.style.left=k+I.left-e.left+"px"}),e.on(f,"dblclick",(function(e){var t=r(f,e.target||e.srcElement);t&&null!=t.hintId&&(o.changeActive(t.hintId),o.pick())})),e.on(f,"click",(function(e){var n=r(f,e.target||e.srcElement);n&&null!=n.hintId&&(o.changeActive(n.hintId), +t.options.completeOnSingleClick&&o.pick())})),e.on(f,"mousedown",(function(){setTimeout((function(){l.focus()}),20)})),this.scrollToActive(),e.signal(i,"select",h[this.selectedHint],f.childNodes[this.selectedHint]),!0}function o(e,t,n,r){if(e.async)e(t,r,n);else{var i=e(t,n);i&&i.then?i.then(r):r(i)}}var a="CodeMirror-hint",s="CodeMirror-hint-active";e.showHint=function(e,t,n){if(!t)return e.showHint(n);n&&n.async&&(t.async=!0);var r={hint:t};if(n)for(var i in n)r[i]=n[i];return e.showHint(r)}, +e.defineExtension("showHint",(function(n){n=function(e,t,n){var r=e.options.hintOptions,i={};for(var o in u)i[o]=u[o];if(r)for(var o in r)void 0!==r[o]&&(i[o]=r[o]);if(n)for(var o in n)void 0!==n[o]&&(i[o]=n[o]);return i.hint.resolve&&(i.hint=i.hint.resolve(e,t)),i}(this,this.getCursor("start"),n);var r=this.listSelections();if(!(r.length>1)){if(this.somethingSelected()){if(!n.hint.supportsSelection)return;for(var i=0;i=this.data.list.length?t=n?this.data.list.length-1:0:t<0&&(t=n?0:this.data.list.length-1),this.selectedHint!=t){var r=this.hints.childNodes[this.selectedHint];r&&(r.className=r.className.replace(" "+s,"")),(r=this.hints.childNodes[this.selectedHint=t]).className+=" "+s,this.scrollToActive(),e.signal(this.data,"select",this.data.list[this.selectedHint],r)}},scrollToActive:function(){ +var e=this.completion.options.scrollMargin||0,t=this.hints.childNodes[Math.max(0,this.selectedHint-e)],n=this.hints.childNodes[Math.min(this.data.list.length-1,this.selectedHint+e)],r=this.hints.firstChild;t.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=n.offsetTop+n.offsetHeight-this.hints.clientHeight+r.offsetTop)},screenAmount:function(){ +return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},e.registerHelper("hint","auto",{resolve:function(t,n){var r,i=t.getHelpers(n,"hint");if(i.length){var a=function(e,t,n){var r=function(e,t){if(!e.somethingSelected())return t;for(var n=[],r=0;r0?t(e):i(a+1)}))}(0)};return a.async=!0,a.supportsSelection=!0,a} +return(r=t.getHelper(t.getCursor(),"hintWords"))?function(t){return e.hint.fromList(t,{words:r})}:e.hint.anyword?function(t,n){return e.hint.anyword(t,n)}:function(){}}}),e.registerHelper("hint","fromList",(function(t,n){var r,i=t.getCursor(),o=t.getTokenAt(i),a=e.Pos(i.line,o.start),s=i;o.start,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};e.defineOption("hintOptions",null)}(n(4538))},4698:(e,t,n)=>{var r;(r=n(4538)).defineOption("specifyMoreJsTokens",!1,(function(e,t,n){n==r.Init&&(n=!1),n&&!t?e.removeOverlay("jstoken"):!n&&t&&e.addOverlay({token:function(e){var t,n,r={ +"js-function-def":/(["']{1,1}[^\r\n\t'"]*["']{1,1}[\s\t\r\n]*:|[$a-zA-Z_0-9]+[\s\t\r\n]*:|[a-zA-Z_0-9]+[\s\t\r\n]*=)?[\s\t\r\n]*function[\s\t\r\n]*([$a-zA-Z_0-9]*)[\s\t\r\n]*\([\s\t\r\n]*([a-zA-Z_0-9,$\s\r\n\t]*)[\s\t\r\n]*\)/g,"js-var":/var /g,"js-well-known":/window|document|Math|Number|String|Object|Array/g,"global-property":/eval|alert|prompt|confirm/g},i=e.string.length,o=Object.keys(r),a={index:i};for(n=0;n{!function(e){"use strict";e.registerHelper("lint","javascript",(function(t,n){return new Promise(((r,i)=>{if(!window.Hinter)return window.console&&window.console.error("Error: CodeMirror JavaScript linting cannot run."),i([]);n.indent||(n.indent=1), +window.Hinter.hint(t,{config:n.hintConfig,options:n.hintOptions,userscript:n.userscript}).then((function(t){var n=[];t&&function(t,n){for(var r=0;r-1&&(a+=s)}var l={message:"eslint: "+i.ruleId+" - "+i.message, +severity:(i.severity&&i.severity<2?"warning":"error")||"error",from:e.Pos(i.line-1,o),to:e.Pos(i.line-1,a)};n.push(l)}}}(t,n),r(n)}),(function(e){i(e)}))}))}))}(n(4538))},1598:(e,t,n)=>{!function(e){"use strict";function t(e){e.parentNode&&e.parentNode.removeChild(e)}function n(n,r,i,o){function a(){var n;e.off(o,"mouseout",a),s&&((n=s).parentNode&&(null==n.style.opacity&&t(n),n.style.opacity=0,setTimeout((function(){t(n)}),600)),s=null)}var s=function(t,n,r){function i(t){ +if(!o.parentNode)return e.off(document,"mousemove",i);o.style.top=Math.max(0,t.clientY-o.offsetHeight-5)+"px",o.style.left=t.clientX+5+"px"}var o=document.createElement("div");return o.className="CodeMirror-lint-tooltip cm-s-"+t.options.theme,o.appendChild(r.cloneNode(!0)),t.state.lint.options.selfContain?t.getWrapperElement().appendChild(o):document.body.appendChild(o),e.on(document,"mousemove",i),i(n),null!=o.style.opacity&&(o.style.opacity=1),o}(n,r,i),l=setInterval((function(){ +if(s)for(var e=o;;e=e.parentNode){if(e&&11==e.nodeType&&(e=e.host),e==document.body)return;if(!e){a();break}}if(!s)return clearInterval(l)}),400);e.on(o,"mouseout",a)}function r(e,t,r){this.marked=[],this.options=t,this.timeout=null,this.hasGutter=r,this.onMouseOver=function(t){!function(e,t){var r=t.target||t.srcElement;if(/\bCodeMirror-lint-mark-/.test(r.className)){for(var i=r.getBoundingClientRect(),o=(i.left+i.right)/2,s=(i.top+i.bottom)/2,l=e.findMarksAt(e.coordsChar({left:o,top:s +},"client")),c=[],u=0;ur.options.autoLintMaxLen)r.autolinted&&r.marked&&r.marked.length&&(i(t),r.autolinted=!1);else{if(r.autolinted=!n,o.async||s.async)return function(t,n,r){function i(){a=-1,t.off("change",i)}var o=t.state.lint,a=++o.waitingFor;return t.on("change",i),n(t.getValue(),(function(n,r){t.off("change",i), +o.waitingFor==a&&(r&&n instanceof e&&(n=r),t.operation((function(){l(t,n)})))}),r,t)}(t,s,a);var c=s(t.getValue(),a,t);if(c)return c.then?c.then((function(e){t.operation((function(){l(t,e)}))})):(t.operation((function(){l(t,c)})),c)}}function l(e,t){i(e);for(var n=e.state.lint,r=n.options,s=function(e){for(var t=[],n=0;n1,n.options.tooltips))}}var g;r.onUpdateLinting&&r.onUpdateLinting(t,s,e)}function c(e){var t=e.state.lint +;t&&(clearTimeout(t.timeout),t.timeout=setTimeout((function(){s(e)}),t.options.delay||500))}var u="CodeMirror-lint-markers";const f=e.Pos;e.defineOption("lint",!1,(function(t,n,o){if(o&&o!=e.Init&&(i(t),!1!==t.state.lint.options.lintOnChange&&t.off("change",c),e.off(t.getWrapperElement(),"mouseover",t.state.lint.onMouseOver),clearTimeout(t.state.lint.timeout),delete t.state.lint),n){for(var a=t.getOption("gutters"),l=!1,f=0;f{let n=!1;const r=e.getViewport(),i=e.listSelections(),o=e.doc;let a=r.from,s=0 +;for(let e=0;e=r.from&&i[e].anchor.line<=r.to){const t=i[e].anchor;a=t.line,s=t.ch;break}const l=e=>(e.lines||[]).some((e=>e.gutterMarkers&&null!=e.gutterMarkers[u]));let c=()=>{const r=t?e.findMarks(f(0,0),f(a,s),l).reverse():e.findMarks(o.clipPos(f(a+1,0)),f(o.lastLine()),l);n&&r.reverse();for(const t of r){const n=t.find(-1);if(n&&n.line)return e.setSelection(n,n),e.scrollIntoView({from:n,to:n},20),!0}};c()||(n=!0,t=!t,c())} +;e.commands.nextProblem=function(e){d(e,!1)},e.commands.prevProblem=function(e){d(e,!0)}}(n(4538))},8190:(e,t,n)=>{!function(e){"use strict";function t(e,t){function n(e){clearTimeout(r.doRedraw),r.doRedraw=setTimeout((function(){r.redraw()}),e)}this.cm=e,this.options=t,this.buttonHeight=t.scrollButtonHeight||e.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=e.getWrapperElement().appendChild(document.createElement("div")), +this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();var r=this;e.on("refresh",this.resizeHandler=function(){clearTimeout(r.doUpdate),r.doUpdate=setTimeout((function(){r.computeScale()&&n(20)}),100)}),e.on("markerAdded",this.resizeHandler),e.on("markerCleared",this.resizeHandler),!1!==t.listenForChanges&&e.on("changes",this.changeHandler=function(){n(250)})}e.defineExtension("annotateScrollbar",(function(e){ +return"string"==typeof e&&(e={className:e}),new t(this,e)})),e.defineOption("scrollButtonHeight",0),t.prototype.computeScale=function(){var e=this.cm,t=(e.getWrapperElement().clientHeight-e.display.barHeight-2*this.buttonHeight)/e.getScrollerElement().scrollHeight;if(t!=this.hScale)return this.hScale=t,!0},t.prototype.update=function(e){this.annotations=e,this.redraw()},t.prototype.redraw=function(e){function t(e,t){if(l!=e.line){l=e.line,c=n.getLineHandle(e.line) +;var r=n.getLineHandleVisualStart(c);r!=c&&(l=n.getLineNumber(r),c=r)}return c.widgets&&c.widgets.length||a&&c.height>s?n.charCoords(e,"local")[t?"top":"bottom"]:n.heightAtLine(c,"local")+(t?0:c.height)}!1!==e&&this.computeScale();var n=this.cm,r=this.hScale,i=document.createDocumentFragment(),o=this.annotations,a=n.getOption("lineWrapping"),s=a&&1.5*n.defaultTextHeight(),l=null,c=null,u=n.lastLine();if(n.display.barWidth)for(var f,d=0;du)){ +for(var p=f||t(h.from,!0)*r,m=t(h.to,!1)*r;du)&&!((f=t(o[d+1].from,!0)*r)>m+.9);)m=t((h=o[++d]).to,!1)*r;if(m!=p){var g=Math.max(m-p,3),v=i.appendChild(document.createElement("div"));v.style.cssText="position: absolute; right: 0px; width: "+Math.max(n.display.barWidth-1,2)+"px; top: "+(p+this.buttonHeight)+"px; height: "+g+"px",v.className=this.options.className,h.id&&v.setAttribute("annotation-id",h.id)}}}this.div.textContent="",this.div.appendChild(i)}, +t.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("changes",this.changeHandler),this.div.parentNode.removeChild(this.div)}}(n(4538))},3773:(e,t,n)=>{!function(e){"use strict";function t(e){for(var t in this.options={},l)this.options[t]=(e&&e.hasOwnProperty(t)?e:l)[t];this.overlay=this.timeout=null,this.matchesonscroll=null,this.active=!1} +function n(e){var t=e.state.matchHighlighter;(t.active||e.hasFocus())&&i(e,t)}function r(e){var t=e.state.matchHighlighter;t.active||(t.active=!0,i(e,t))}function i(e,t){clearTimeout(t.timeout),t.timeout=setTimeout((function(){s(e)}),t.options.delay)}function o(e,t,n,r){var i=e.state.matchHighlighter;if(e.addOverlay(i.overlay=function(e,t,n){return{token:function(r){if(r.match(e)&&(!t||function(e,t){ +return!(e.start&&t.test(e.string.charAt(e.start-1))||e.pos!=e.string.length&&t.test(e.string.charAt(e.pos)))}(r,t)))return n;r.next(),r.skipTo(e.charAt(0))||r.skipToEnd()}}}(t,n,r)),i.options.annotateScrollbar&&e.showMatchesOnScrollbar){var o=n?new RegExp((/\w/.test(t.charAt(0))?"\\b":"")+t.replace(/[\\\[.+*?(){|^$]/g,"\\$&")+(/\w/.test(t.charAt(t.length-1))?"\\b":"")):t;i.matchesonscroll=e.showMatchesOnScrollbar(o,!1,{className:"CodeMirror-selection-highlight-scrollbar"})}}function a(e){ +var t=e.state.matchHighlighter;t.overlay&&(e.removeOverlay(t.overlay),t.overlay=null,t.matchesonscroll&&(t.matchesonscroll.clear(),t.matchesonscroll=null))}function s(e){e.operation((function(){var t=e.state.matchHighlighter;if(a(e),e.somethingSelected()||!t.options.showToken){if(!t.options.cursorOnly){var n=e.getCursor("from"),r=e.getCursor("to");if(n.line==r.line&&(!t.options.wordsOnly||function(e,t,n){if(null!==e.getRange(t,n).match(/^\w+$/)){if(t.ch>0){var r={line:t.line,ch:t.ch-1} +;if(null===e.getRange(r,t).match(/\W/))return!1}return!(n.ch=t.options.minChars&&o(e,i,!1,t.options.style)}}}else{for(var s=!0===t.options.showToken?/[\w$]/:t.options.showToken,l=e.getCursor(),c=e.getLine(l.line),u=l.ch,f=u;u&&s.test(c.charAt(u-1));)--u;for(;f{!function(e){"use strict";function t(e,t,n,r){this.cm=e,this.options=r;var i={listenForChanges:!1};for(var o in r)i[o]=r[o];i.className||(i.className="CodeMirror-search-match"),this.annotation=e.annotateScrollbar(i),this.query=t,this.caseFold=n,this.gap={from:e.firstLine(),to:e.lastLine()+1},this.matches=[],this.update=null,this.findMatches(),this.annotation.update(this.matches);var a=this;e.on("change",this.changeHandler=function(e,t){a.onChange(t)})} +function n(e,t,n){return e<=t?e:Math.max(t,e+n)}e.defineExtension("showMatchesOnScrollbar",(function(e,n,r){return"string"==typeof r&&(r={className:r}),r||(r={}),new t(this,e,n,r)})),t.prototype.findMatches=function(){if(this.gap){for(var t=0;t=this.gap.to);t++)i.to.line>=this.gap.from&&this.matches.splice(t--,1);for(var n=this.cm.getSearchCursor(this.query,e.Pos(this.gap.from,0),{caseFold:this.caseFold,multiline:this.options.multiline +}),r=this.options&&this.options.maxMatches||1e3;n.findNext();){var i;if((i={from:n.from(),to:n.to()}).from.line>=this.gap.to)break;if(this.matches.splice(t++,0,i),this.matches.length>r)break}this.gap=null}},t.prototype.onChange=function(t){var r=t.from.line,i=e.changeEnd(t).line,o=i-t.to.line;if(this.gap?(this.gap.from=Math.min(n(this.gap.from,r,o),t.from.line),this.gap.to=Math.max(n(this.gap.to,r,o),t.from.line)):this.gap={from:t.from.line,to:i+1},o)for(var a=0;a{ +const{$:r}=n(1340);!function(e){"use strict";function t(){this.posFrom=this.posTo=this.lastPattern=this.pattern=null,this.overlay=null}function n(e){return e.state.search||(e.state.search=new t)}function i(e,t,n){var r,i="";return t&&(r=t.caseInsensitive,i=t.query),e.getSearchCursor(i,n,{caseFold:r,multiline:!0})}function o(t,n,r,i,o){if(t.openDialog)return t.openDialog(n,(function(t,n){return e.e_stop(n),o.apply(this,arguments)}),{value:i,selectValueOnOpen:!0,closeOnBlur:!1,bottom:!0, +closeOnEnter:!1});o(prompt(r,i))}function a(e,t){var n,i=r(e.display.wrapper),o=void 0!==t?t:i.find(".CodeMirror-search-field").value(),a=i.find(".CodeMirror-search-re-field").is(":checked"),s=!i.find(".CodeMirror-search-case-field").is(":checked");if(a)try{n={query:new RegExp(o,s?"i":""),text:o,caseInsensitive:s,regex:a}}catch(e){}else n={query:o,text:o,caseInsensitive:s,regex:a};return n&&n.query&&!("string"==typeof n.query?""==n.query:n.query.test(""))||(n={query:/x^/,text:""}),n} +function s(){y&&window.clearTimeout(y),y=null}function l(e,t,n){s(),t.pattern=n,e.removeOverlay(t.overlay,n.caseInsensitive),t.overlay=function(e){var t=e.query;return"string"==typeof t?t=new RegExp(t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),e.caseInsensitive?"gi":"g"):t.global||(t=new RegExp(e.text,e.caseInsensitive?"gi":"g")),{token:function(e){t.lastIndex=e.pos;var n=t.exec(e.string);if(n&&n.index==e.pos)return e.pos+=n[0].length||1,"searching";n?e.pos=n.index:e.skipToEnd()}} +}(n),e.addOverlay(t.overlay),e.showMatchesOnScrollbar&&(t.annotate&&(t.annotate.clear(),t.annotate=null),t.annotate=e.showMatchesOnScrollbar(n.query,n.caseInsensitive),r(e.display.wrapper).find(".CodeMirror-search-field").toggleClass("no-result",t.annotate.matches.length<=0))}function c(e,t){return""+e.query==""+t.query&&e.regex==t.regex&&e.caseInsensitive==t.caseInsensitive}function u(e){return e.query instanceof RegExp&&"x^"==e.query.source}function f(t,i,f,p){var m,g,w=n(t) +;if(w.pattern&&(g=a(t))){if(c(w.pattern,g))return d(t,i)}else g=g||t.getSelection()||w.lastPattern||a(t)||"";if("string"==typeof g&&(g=a(t,g)),u(g)&&(g=null),f&&t.openDialog){var C=null,x=function(n,r){var i=a(t);e.e_stop(r),w.pattern&&c(w.pattern,i)||(l(t,w,i),w.posFrom=w.posTo=t.getCursor()),C&&(C.style.opacity=1),d(t,r.shiftKey,(function(e,n){var r +;n.line<3&&document.querySelector&&(r=t.display.wrapper.querySelector(".CodeMirror-dialog"))&&r.getBoundingClientRect().bottom-4>t.cursorCoords(n,"window").top&&((C=r).style.opacity=.4)}))};w.pattern||(b(t),m=function(e,t,n,r,i){return e.openDialog(t,r,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){h(e)},onKeyDown:i,closeOnBlur:!1,bottom:!0})}(t,v(g),g?g.text:"",x,(function(r){var i=e.keyName(r),o=t.getOption("extraKeys"),f=o&&o[i]||e.keyMap[t.getOption("keyMap")][i],d=a(t) +;u(d)||("findNext"==f||"findPrev"==f||"findPersistentNext"==f||"findPersistentPrev"==f?(e.e_stop(r),l(t,n(t),d),t.execCommand(f)):"find"==f||"findPersistent"==f?(e.e_stop(r),x(0,r)):void 0===f&&function(t){s(),y=window.setTimeout((function(){y=null;var r=n(t);if(r.dialog){var i=a(t);if(!(u(i)||r.pattern&&c(r.pattern,i))){const n=r.pattern&&r.pattern.text.length>i.text.length&&r.pattern.text.startsWith(i.text);let o=t.getCursor() +;r.posFrom&&r.posTo&&(!n&&e.cmpPos(r.posFrom,o)<0?o=r.posFrom:n&&0==e.cmpPos(r.posTo,o)&&r.posTo.ch&&(o=e.Pos(r.posTo.line,r.posTo.ch-1))),r.posFrom=r.posTo=o,t.setCursor(o),l(t,r,i),n?t.execCommand("findPrev"):t.execCommand("findNext")}}}),200)}(t))}))),p&&g&&(l(t,w,g),d(t,i))}else b(t),m=o(t,v(),e.I18N.getMessage("Search_for")+":",g,(function(e){e&&!w.pattern&&t.operation((function(){l(t,w,a(t)),w.posFrom=w.posTo=t.getCursor(),d(t,i)}))}));if(m&&k(t,{close:function(){m(),w.dialog=null}}), +w.dialog&&!w.dialog.initialized){w.dialog.initialized=!0;var S=r(t.display.wrapper);S.find(".CodeMirror-search-find-button").on("click",(function(){e.commands.findNext(t)})),S.find(".CodeMirror-search-find-prev-button").on("click",(function(){e.commands.findPrev(t)})),S.find(".CodeMirror-search-close-button").on("click",(function(){w.dialog&&w.dialog.close&&w.dialog.close()}))}}function d(t,r,o){t.operation((function(){var a=n(t);const s=t.getCursor();let l,c=r?a.posTo:a.posFrom +;l=c&&0!=e.cmpPos(s,c)?s:r?a.posFrom:a.posTo;var u=i(t,a.pattern,l);(u.find(r)||(u=i(t,a.pattern,r?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0))).find(r))&&(t.setSelection(u.from(),u.to()),t.scrollIntoView({from:u.from(),to:u.to()},20),a.posFrom=u.from(),a.posTo=u.to(),o&&o(u.from(),u.to()))}))}function h(e,t){return e.operation((function(){var r,i=n(e);if(!i.closing)return i.dialog&&!t&&(i.closing=!0,i.dialog.close(),i.closing=!1,r=!0),i.lastPattern=i.pattern,i.pattern?(i.pattern=null, +e.removeOverlay(i.overlay),i.annotate&&(i.annotate.clear(),i.annotate=null),!0):r}))}function p(e){const t=new RegExp("(\\"+["/",".","+","?","|","(",")","[","]","{","}","\\","*"].join("|\\")+")","g");return e.replace(t,"\\$1")}function m(e,t,n){e.operation((function(){for(var r=i(e,t);r.findNext();)if("string"!=typeof t){const i=t.regex?t.query:new RegExp(p(t.query),t.caseInsensitive?"i":"");var o=e.getRange(r.from(),r.to()).match(i);r.replace(n.replace(/\$(\d)/g,(function(e,t){return o[t]}))) +}else r.replace(n)}))}function g(t,r){if(!t.getOption("readOnly")){var s=t.getSelection()||n(t).lastPattern||"";"string"==typeof s&&(s=a(t,s));var l=n(t),c=(r?e.I18N.getMessage("Replace_all_with"):e.I18N.getMessage("Replace"))+":";b(t);var u=o(t,c+w,c,s.text,(function(n){if(n){var s=a(t);b(t);var c=o(t,C(),e.I18N.getMessage("Replace_with")+":","",(function(o){if(r)m(t,s,o);else{h(t);var a=i(t,s,t.getCursor("from")),c=function(){var n,r=a.from();!(n=a.findNext())&&(a=i(t,s), +!(n=a.findNext())||r&&a.from().line==r.line&&a.from().ch==r.ch)||(t.setSelection(a.from(),a.to()),t.showInCenter?t.showInCenter():t.scrollIntoView({from:a.from(),to:a.to()},20),window.setTimeout((function(){b(t);var r=function(e,t,n,r,i,o){if(e.openConfirm)return e.openConfirm(t,r,{onKeyDown:o,onClose:function(){l.dialog=null},closeOnBlur:!1});confirm(n)&&r[0]()}(t,x(),e.I18N.getMessage("Replace_"),[function(){u(n)},c,function(){m(t,s,o)}],0,(function(n){ +if("Esc"==e.keyName(n))return e.e_stop(n),h(t)}));r&&k(t,{close:function(){r(),l.dialog=null}})}),1))},u=function(e){a.replace("string"==typeof n?o:o.replace(/\$(\d)/g,(function(t,n){return e[n]}))),c()};c()}}));c&&k(t,{close:function(){c(),l.dialog=null}})}}));u&&k(t,{close:function(){u(),l.dialog=null}})}}var v=function(t){ +return''+e.I18N.getMessage("Search_for")+': .* Aa" +},y=null,b=function(e){var t=n(e);t.dialog&&(t.closing=!0,t.dialog.close(),t.closing=!1)},k=function(e,t){n(e).dialog=t +},w=' .* Aa',C=function(){ +return''+e.I18N.getMessage("Replace_with")+': '},x=function(){return''+e.I18N.getMessage("Replace_")+""} +;e.commands.find=e.commands.findPersistent=function(e){h(e,!0),f(e,!1,!0)},e.commands.findNext=e.commands.findPersistentNext=function(e){f(e,!1,!0,!0)},e.commands.findPrev=e.commands.findPersistentPrev=function(e){f(e,!0,!0,!0)},e.commands.clearSearch=h,e.commands.replace=g,e.commands.replaceAll=function(e){g(e,!0)}}(n(4538))},8334:(e,t,n)=>{!function(e){"use strict";function t(e,t){for(var n=function(e){var t=e.flags;return null!=t?t:(e.ignoreCase?"i":"")+(e.global?"g":"")+(e.multiline?"m":"") +}(e),r=n,i=0;ic);u++){ +var f=e.getLine(l++);a=null==a?f:a+"\n"+f}s*=2,i.lastIndex=o.ch;var d=i.exec(a);if(d){var h=a.slice(0,d.index).split("\n"),m=d[0].split("\n"),g=o.line+h.length-1,v=h[h.length-1].length;return{from:p(g,v),to:p(g+m.length-1,1==m.length?v+m[0].length:m[m.length-1].length),match:d}}}}function o(e,t,n){for(var r,i=0;i<=e.length;){t.lastIndex=i;var o=t.exec(e);if(!o)break;var a=o.index+o[0].length;if(a>e.length-n)break;(!r||a>r.index+r[0].length)&&(r=o),i=o.index+1}return r}function a(e,n,r){ +n=t(n,"g");for(var i=r.line,a=r.ch,s=e.firstLine();i>=s;i--,a=-1){var l=e.getLine(i),c=o(l,n,a<0?0:l.length-a);if(c)return{from:p(i,c.index),to:p(i,c.index+c[0].length),match:c}}}function s(e,r,i){if(!n(r))return a(e,r,i);r=t(r,"gm");for(var s,l=1,c=e.getLine(i.line).length-i.ch,u=i.line,f=e.firstLine();u>=f;){for(var d=0;d=f;d++){var h=e.getLine(u--);s=null==s?h:h+"\n"+s}l*=2;var m=o(s,r,c);if(m){var g=s.slice(0,m.index).split("\n"),v=m[0].split("\n"),y=u+g.length,b=g[g.length-1].length +;return{from:p(y,b),to:p(y+v.length-1,1==v.length?b+v[0].length:v[v.length-1].length),match:m}}}}function l(e,t,n,r){if(e.length==t.length)return n;for(var i=0,o=n+Math.max(0,e.length-t.length);;){if(i==o)return i;var a=i+o>>1,s=r(e.slice(0,a)).length;if(s==n)return a;s>n?o=a:i=a+1}}function c(e,t,n,r){if(!t.length)return null;var i=r?d:h,o=i(t).split(/\r|\n\r?/);e:for(var a=n.line,s=n.ch,c=e.lastLine()+1-o.length;a<=c;a++,s=0){var u=e.getLine(a).slice(s),f=i(u);if(1==o.length){ +var m=f.indexOf(o[0]);if(-1==m)continue e;return n=l(u,f,m,i)+s,{from:p(a,l(u,f,m,i)+s),to:p(a,l(u,f,m+o[0].length,i)+s)}}var g=f.length-o[0].length;if(f.slice(g)==o[0]){for(var v=1;v=c;a--,s=-1){var u=e.getLine(a);s>-1&&(u=u.slice(0,s));var f=i(u);if(1==o.length){var m=f.lastIndexOf(o[0]);if(-1==m)continue e;return{from:p(a,l(u,f,m,i)),to:p(a,l(u,f,m+o[0].length,i))}}var g=o[o.length-1];if(f.slice(0,g.length)==g){var v=1;for(n=a-o.length+1;v0);)r.push({anchor:i.from(),head:i.to()});r.length&&this.setSelections(r,0)}))}(n(4538))},2498:(e,t,n)=>{!function(e){"use strict";function t(e){for(var t=0;t{!function(e){"use strict";function t(e){e.state.markedSelection&&e.operation((function(){!function(e){if(!e.somethingSelected())return i(e);if(e.listSelections().length>1)return o(e);var t=e.getCursor("start"),n=e.getCursor("end"),s=e.state.markedSelection;if(!s.length)return r(e,t,n);var c=s[0].find(),u=s[s.length-1].find() +;if(!c||!u||n.line-t.line<=a||l(t,u.to)>=0||l(n,c.from)<=0)return o(e);for(;l(t,c.from)>0;)s.shift().clear(),c=s[0].find();for(l(t,c.from)<0&&(c.to.line-t.line0&&(n.line-u.from.line=n.line,h=d?n:s(f,0),p=e.markText(u,h,{className:o});if(null==r?i.push(p):i.splice(r++,0,p),d)break;c=f}}function i(e){for(var t=e.state.markedSelection,n=0;n{!function(e){"use strict";function t(e,t){return e.line==t.line&&e.ch==t.ch}function n(e){A.push(e),A.length>50&&A.shift()}function r(e){ +return A[A.length-(e?Math.min(e,1):1)]||""}function i(e,r,i,o,a){null==a&&(a=e.getRange(r,i)),"grow"==o&&O&&O.cm==e&&t(r,O.pos)&&e.isClean(O.gen)?function(e){if(!A.length)return n(e);A[A.length-1]+=e}(a):!1!==o&&n(a),e.replaceRange("",r,i,"+delete"),O="grow"==o?{cm:e,pos:r,gen:e.changeGeneration()}:null}function o(e,t,n){return e.findPosH(t,n,"char",!0)}function a(e,t,n){return e.findPosH(t,n,"word",!0)}function s(e,t,n){return e.findPosV(t,n,"line",e.doc.sel.goalColumn)}function l(e,t,n){ +return e.findPosV(t,n,"page",e.doc.sel.goalColumn)}function c(e,t,n){for(var r=t.line,i=e.getLine(r),o=/\S/.test(n<0?i.slice(0,t.ch):i.slice(t.ch)),a=e.firstLine(),s=e.lastLine();;){if((r+=n)s)return e.clipPos(T(r-n,n<0?0:null));if(i=e.getLine(r),/\S/.test(i))o=!0;else if(o)return T(r,0)}}function u(e,t,n){for(var r=t.line,i=t.ch,o=e.getLine(t.line),a=!1;;){var s=o.charAt(i+(n<0?-1:0));if(s){if(a&&/[!?.]/.test(s))return T(r,i+(n>0?1:0));a||(a=/\w/.test(s)),i+=n}else{ +if(r==(n<0?e.firstLine():e.lastLine()))return T(r,i);if(o=e.getLine(r+n),!/\S/.test(o))return T(r,i);r+=n,i=n<0?o.length:0}}}function f(e,n,r){var i;if(e.findMatchingBracket&&(i=e.findMatchingBracket(n,{strict:!0}))&&i.match&&(i.forward?1:-1)==r)return r>0?T(i.to.line,i.to.ch+1):i.to;for(var o=!0;;o=!1){var a=e.getTokenAt(n),s=T(n.line,r<0?a.start:a.end);if(!(o&&r>0&&a.end==n.ch)&&/\w/.test(a.string))return s;var l=e.findPosH(s,r,"char");if(t(s,l))return n;n=l}}function d(e,t){ +var n=e.state.emacsPrefix;return n?(k(e),"-"==n?-1:Number(n)):t?null:1}function h(e){var t="string"==typeof e?function(t){t.execCommand(e)}:e;return function(e){var n=d(e);t(e);for(var r=1;r1&&"+input"==t.origin){for(var r=t.text.join("\n"),i="",o=1;o1&&A.pop(),r()),"around","paste")},"Ctrl-Space":x,"Ctrl-Shift-2":x,"Ctrl-F":m(o,1),"Ctrl-B":m(o,-1),Right:m(o,1),Left:m(o,-1),"Ctrl-D":function(e){g(e,o,1,!1)}, +Delete:function(e){v(e,!1)||g(e,o,1,!1)},"Ctrl-H":function(e){g(e,o,-1,!1)},Backspace:function(e){v(e,!1)||g(e,o,-1,!1)},"Alt-F":m(a,1),"Alt-B":m(a,-1),"Alt-Right":m(a,1),"Alt-Left":m(a,-1),"Alt-D":function(e){g(e,a,1,"grow")},"Alt-Backspace":function(e){g(e,a,-1,"grow")},"Ctrl-N":m(s,1),"Ctrl-P":m(s,-1),Down:m(s,1),Up:m(s,-1),"Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd",End:"goLineEnd",Home:"goLineStart","Alt-V":m(l,-1),"Ctrl-V":m(l,1),PageUp:m(l,-1),PageDown:m(l,1),"Ctrl-Up":m(c,-1), +"Ctrl-Down":m(c,1),"Alt-A":m(u,-1),"Alt-E":m(u,1),"Alt-K":function(e){g(e,u,1,"grow")},"Ctrl-Alt-K":function(e){g(e,f,1,"grow")},"Ctrl-Alt-Backspace":function(e){g(e,f,-1,"grow")},"Ctrl-Alt-F":m(f,1),"Ctrl-Alt-B":m(f,-1),"Shift-Ctrl-Alt-2":function(e){var t=e.getCursor();e.setSelection(p(e,t,f,1),t)},"Ctrl-Alt-T":function(e){var t=f(e,e.getCursor(),-1),n=f(e,t,1),r=f(e,n,1),i=f(e,r,-1);e.replaceRange(e.getRange(i,r)+e.getRange(n,i)+e.getRange(t,n),t,r)},"Ctrl-Alt-U":h((function(e){ +for(var t=e.getCursor(),n=t.line,r=t.ch,i=[];n>=e.firstLine();){for(var o=e.getLine(n),a=null==r?o.length:r;a>0;)if(")"==(r=o.charAt(--a)))i.push("(");else if("]"==r)i.push("[");else if("}"==r)i.push("{");else if(/[\(\{\[]/.test(r)&&(!i.length||i.pop()!=r))return e.extendSelection(T(n,a));--n,r=null}})),"Alt-Space":function(e){for(var t=e.getCursor(),n=t.ch,r=t.ch,i=e.getLine(t.line);n&&/\s/.test(i.charAt(n-1));)--n;for(;r0)return e.setCursor(t-1);!function(e,t,n){ +e.openDialog?e.openDialog(t+': ',n,{bottom:!0}):n(prompt(t,""))}(e,"Goto line",(function(t){var n;t&&!isNaN(n=Number(t))&&n==(0|n)&&n>0&&e.setCursor(n-1)}))},"Ctrl-X Tab":function(e){e.indentSelection(d(e,!0)||e.getOption("indentUnit"))},"Ctrl-X Ctrl-X":function(e){e.setSelection(e.getCursor("head"),e.getCursor("anchor"))},"Ctrl-X Ctrl-S":"save","Ctrl-X Ctrl-W":"save","Ctrl-X S":"saveAll","Ctrl-X F":"open","Ctrl-X U":h("undo"),"Ctrl-X K":"close", +"Ctrl-X Delete":function(e){i(e,e.getCursor(),u(e,e.getCursor(),1),"grow")},"Ctrl-X H":"selectAll","Ctrl-Q Tab":h("insertTab"),"Ctrl-U":function(e){e.state.emacsPrefixMap=!0,e.addKeyMap(P),e.on("keyHandled",C),e.on("inputRead",C)},fallthrough:"default"}),P={"Ctrl-G":k},I=0;I<10;++I)L(String(I));L("-")}(n(4538))},9573:(e,t,n)=>{!function(e){"use strict";e.keyMap.pcDefault["Alt-Up"]="swapLineUp",e.keyMap.pcDefault["Alt-Down"]="swapLineDown",e.keyMap.pcDefault["Ctrl-Space"]="autocomplete", +e.keyMap.macDefault["Alt-Space"]="autocomplete",e.commands.backOrClose=function(e){var t=e.execCommand("clearSearch");return!0===t?t:e.getSelection()?(e.setCursor(e.getCursor()),!0):void e.execCommand("close")},e.keyMap.default.Esc="backOrClose",e.keyMap.default["Alt-Pause"]="nextTheme",e.defineExtension("showInCenter",(function(){return e.commands.showInCenter(this)})),e.commands.intelligentTab=function(t){if(t.getOption("indentByTab")){var n=t.getCursor("head"),r=t.getCursor("anchor") +;t.operation((function(){for(var e=Math.min(n.line,r.line),i=Math.max(n.line,r.line),o=e;o<=i;o++)t.indentLine(o,"smart")}))}else{if(t.getOption("indentWithTabs"))return e.Pass;var i=new Array(t.getOption("indentUnit")+1).join(" ");t.replaceSelection(i)}},e.keyMap.default.Tab="intelligentTab"}(n(4538))},4174:(e,t,n)=>{!function(e){"use strict";var t=e.keyMap.pcDefault,n=e.keyMap.macDefault,r=e.Pos;e.commands.splitSelection=function(e){ +for(var t=[],n=e.getCursor("from"),i=e.getCursor("to"),o=n.line;o<=i.line;++o)t.push({anchor:o==n.line?n:r(o,0),head:o==i.line?i:r(o)});e.setSelections(t,0)},e.commands.addNextOccurrenceToSelection=function(e){var t=e.getCursor("to"),n=e.getSearchCursor(e.getRange(e.getCursor("from"),t),t);n.findNext()&&e.addSelection(n.from(),n.to())},e.commands.selectMatchingPartsOfCurrentSelection=function(e){e.somethingSelected()&&function(e,t,n,r){ +e.openDialog?e.openDialog('Match: (Use /re/ syntax for regexp)',r):r(prompt("Match:",""))}(e,0,0,(function(t){var n=t.match(/^\/(.*)\/([a-z]*)$/);n&&(t=new RegExp(n[1],-1==n[2].indexOf("i")?"":"i")),e.selectMatches(t)}))},t["Shift-Ctrl-L"]=n["Shift-Cmd-L"]="splitSelection",t["Ctrl-D"]=n["Cmd-D"]="addNextOccurrenceToSelection",t["Alt-F"]=n["Alt-F"]="selectMatchingPartsOfCurrentSelection"}(n(4538)),function(e){"use strict" +;var t=e.keyMap.pcDefault,n=e.keyMap.macDefault,r=e.Pos;e.commands.splitSelection=function(e){for(var t=[],n=e.getCursor("from"),i=e.getCursor("to"),o=n.line;o<=i.line;++o)t.push({anchor:o==n.line?n:r(o,0),head:o==i.line?i:r(o)});e.setSelections(t,0)},e.commands.addNextOccurrenceToSelection=function(e){var t=e.getCursor("to"),n=e.getSearchCursor(e.getRange(e.getCursor("from"),t),t);n.findNext()&&e.addSelection(n.from(),n.to())},e.commands.selectMatchingPartsOfCurrentSelection=function(e){ +e.somethingSelected()&&function(e,t,n,r){e.openDialog?e.openDialog('Match: (Use /re/ syntax for regexp)',r):r(prompt("Match:",""))}(e,0,0,(function(t){var n=t.match(/^\/(.*)\/([a-z]*)$/);n&&(t=new RegExp(n[1],-1==n[2].indexOf("i")?"":"i")),e.selectMatches(t)}))},t["Shift-Ctrl-L"]=n["Shift-Cmd-L"]="splitSelection",t["Ctrl-D"]=n["Cmd-D"]="addNextOccurrenceToSelection", +t["Alt-F"]=n["Alt-F"]="selectMatchingPartsOfCurrentSelection"}(n(4538))},1626:(e,t,n)=>{!function(e){"use strict";function t(t,n){t.extendSelectionsBy((function(r){return t.display.shift||t.doc.extend||r.empty()?function(t,n,r){if(r<0&&0==n.ch)return t.clipPos(d(n.line-1));var i=t.getLine(n.line);if(r>0&&n.ch>=i.length)return t.clipPos(d(n.line+1,0));for(var o,a="start",s=n.ch,l=s,c=r<0?0:i.length,u=0;l!=c;l+=r,u++){var f=i.charAt(r<0?l-1:l),h="_"!=f&&e.isWordChar(f)?"w":"o" +;if("w"==h&&f.toUpperCase()==f&&(h="W"),"start"==a)"o"!=h?(a="in",o=h):s=l+r;else if("in"==a&&o!=h){if("w"==o&&"W"==h&&r<0&&l--,"W"==o&&"w"==h&&r>0){if(l==s+1){o="w";continue}l--}break}}return d(n.line,l)}(t.doc,r.head,n):n<0?r.from():r.to()}))}function n(t,n){if(t.isReadOnly())return e.Pass;t.operation((function(){for(var e=t.listSelections().length,r=[],i=-1,o=0;o=0;s--){var c=i[o[s]];if(!(l&&e.cmpPos(c.head,l)>0)){var u=r(t,c.head);l=u.from,t.replaceRange(n(u.word),u.from,u.to)}}}))}function c(t){var n=t.getCursor("from"),i=t.getCursor("to");if(0==e.cmpPos(n,i)){var o=r(t,n);if(!o.word)return;n=o.from,i=o.to}return{from:n,to:i,query:t.getRange(n,i),word:o} +}function u(e,t){var n=c(e);if(n){var r=n.query,i=e.getSearchCursor(r,t?n.to:n.from);(t?i.findNext():i.findPrevious())?e.setSelection(i.from(),i.to()):(i=e.getSearchCursor(r,t?d(e.firstLine(),0):e.clipPos(d(e.lastLine()))),(t?i.findNext():i.findPrevious())?e.setSelection(i.from(),i.to()):n.word&&e.setSelection(n.from,n.to))}}var f=e.commands,d=e.Pos;f.goSubwordLeft=function(e){t(e,-1)},f.goSubwordRight=function(e){t(e,1)},f.scrollLineUp=function(e){var t=e.getScrollInfo() +;if(!e.somethingSelected()){var n=e.lineAtHeight(t.top+t.clientHeight,"local");e.getCursor().line>=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},f.scrollLineDown=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},f.splitSelectionByLine=function(e){ +for(var t=e.listSelections(),n=[],r=0;ri.line&&a==o.line&&0==o.ch||n.push({anchor:a==i.line?i:d(a,0),head:a==o.line?o:d(a)});e.setSelections(n,0)},f.singleSelectionTop=function(t){var n;if(!((n=t.listSelections())&&n.length>1))return e.Pass;var r=n[0];t.setSelection(r.anchor,r.head,{scroll:!1})},f.selectLine=function(e){for(var t=e.listSelections(),n=[],r=0;ri?r.push(l,c):r.length&&(r[r.length-1]=c),i=c}t.operation((function(){for(var e=0;et.lastLine()?t.replaceRange("\n"+a,d(t.lastLine()),null,"+swapLine"):t.replaceRange(a+"\n",d(i,0),null,"+swapLine")}t.setSelections(o),t.scrollIntoView()}))},f.swapLineDown=function(t){if(t.isReadOnly())return e.Pass;for(var n=t.listSelections(),r=[],i=t.lastLine()+1,o=n.length-1;o>=0;o--){ +var a=n[o],s=a.to().line+1,l=a.from().line;0!=a.to().ch||a.empty()||s--,s=0;e-=2){var n=r[e],i=r[e+1],o=t.getLine(n);n==t.lastLine()?t.replaceRange("",d(n-1),d(n),"+swapLine"):t.replaceRange("",d(n,0),d(n+1,0),"+swapLine"),t.replaceRange(o+"\n",d(i,0),null,"+swapLine")}t.scrollIntoView()}))},f.toggleCommentIndented=function(e){e.toggleComment({indent:!0})},f.joinLines=function(e){ +for(var t=e.listSelections(),n=[],r=0;r=0;i--){var o=n[i].head,a=t.getRange({line:o.line,ch:0},o),s=e.countColumn(a,null,t.getOption("tabSize")),l=t.findPosH(o,-1,"char",!1);if(a&&!/\S/.test(a)&&s%r==0){var c=new d(o.line,e.findColumn(a,s-r,r));c.ch!=o.ch&&(l=c)} +t.replaceRange("",l,o,"+delete")}}))},f.delLineRight=function(e){e.operation((function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange("",t[n].anchor,d(t[n].to().line),"+delete");e.scrollIntoView()}))},f.upcaseAtCursor=function(e){l(e,(function(e){return e.toUpperCase()}))},f.downcaseAtCursor=function(e){l(e,(function(e){return e.toLowerCase()}))},f.setSublimeMark=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())}, +f.selectToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},f.deleteToSublimeMark=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var r=t.getCursor(),i=n;if(e.cmpPos(r,i)>0){var o=i;i=r,r=o}t.state.sublimeKilled=t.getRange(r,i),t.replaceRange("",r,i)}},f.swapWithSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(), +e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},f.sublimeYank=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},f.showInCenter=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},f.findUnder=function(e){u(e,!0)},f.findUnderPrevious=function(e){u(e,!1)},f.findAllUnder=function(e){var t=c(e);if(t){for(var n=e.getSearchCursor(t.query),r=[],i=-1;n.findNext();)r.push({ +anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&i++;e.setSelections(r,i)}};var p=e.keyMap;p["Ctrl+Shift-/"]=p["Ctrl+Shift-7"]=function(e){e.toggleComment({indent:!0,blockComment:!0})},p.macSublime={"Shift-Cmd-P":"reindentall","Shift-Cmd-N":"lint_script","Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp", +"Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F5:"sortLines","Cmd-F5":"sortLinesInsensitive", +F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-D":"skipAndSelectNextOccurrence","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter", +"Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-1":"foldAll","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"}, +e.normalizeKeyMap(p.macSublime),p.pcSublime={"Shift-Ctrl-P":"reindentall","Shift-Ctrl-N":"lint_script","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence", +"Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Ctrl-F9":"sortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-D":"skipAndSelectNextOccurrence", +"Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-1":"foldAll","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine", +"Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault",F4:"nextProblem","Shift-F4":"prevProblem"},e.normalizeKeyMap(p.pcSublime);var m=p.default==p.macDefault;p.sublime=m?p.macSublime:p.pcSublime}(n(4538))},4514:(e,t,n)=>{!function(e){ +"use strict";var t=[{keys:"",type:"keyToKey",toKeys:"h"},{keys:"",type:"keyToKey",toKeys:"l"},{keys:"",type:"keyToKey",toKeys:"k"},{keys:"",type:"keyToKey",toKeys:"j"},{keys:"",type:"keyToKey",toKeys:"l"},{keys:"",type:"keyToKey",toKeys:"h",context:"normal"},{keys:"",type:"keyToKey",toKeys:"x",context:"normal"},{keys:"",type:"keyToKey",toKeys:"W"},{keys:"",type:"keyToKey",toKeys:"B",context:"normal"},{keys:"",type:"keyToKey", +toKeys:"w"},{keys:"",type:"keyToKey",toKeys:"b",context:"normal"},{keys:"",type:"keyToKey",toKeys:"j"},{keys:"",type:"keyToKey",toKeys:"k"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S", +type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"",type:"keyToKey",toKeys:"0"},{keys:"",type:"keyToKey",toKeys:"$"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0, +toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1, +linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{ +forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1, +toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{ +keys:"",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion", +motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0, +inclusive:!0}},{keys:"F",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'",type:"motion", +motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0, +actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion", +motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator", +operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"gn",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!0}},{keys:"gN",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!1}},{keys:"x", +type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion", +operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{ +shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"",type:"idle",context:"normal"},{keys:"",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"",type:"action",action:"scroll",actionArgs:{forward:!0, +linewise:!0}},{keys:"",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0, +actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"gi",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"lastEdit"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"gI",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"bol"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"}, +context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{ +keys:"",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"gJ",type:"action",action:"joinLines",actionArgs:{keepSpaces:!0},isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r",type:"action",action:"replace",isEdit:!0 +},{keys:"@",type:"action",action:"replayMacro"},{keys:"q",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!0},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual", +isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"",type:"action",action:"redo"},{keys:"m",type:"action",action:"setMark"},{keys:'"',type:"action",action:"setRegister"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action", +action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"",type:"action",action:"incrementNumberToken",isEdit:!0, +actionArgs:{increase:!0,backtrack:!1}},{keys:"",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a",type:"motion",motion:"textObjectManipulation"},{keys:"i",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{ +keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search", +searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],n=t.length,r=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"unmap"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute", +shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"global",shortName:"g"}],i=e.Pos;e.Vim=function(){function o(t,n){this==e.keyMap.vim&&(e.rmClass(t.getWrapperElement(),"cm-fat-cursor"),"contenteditable"==t.getOption("inputStyle")&&null!=document.body.style.caretColor&&(function(e){l(e),e.off("cursorActivity",s),e.state.fatCursorMarks=null}(t), +t.getInputField().style.caretColor="")),n&&n.attach==a||function(t){t.setOption("disableInput",!1),t.off("cursorActivity",xe),e.off(t.getInputField(),"paste",u(t)),t.state.vim=null}(t)}function a(t,n){this==e.keyMap.vim&&(e.addClass(t.getWrapperElement(),"cm-fat-cursor"),"contenteditable"==t.getOption("inputStyle")&&null!=document.body.style.caretColor&&(function(e){e.state.fatCursorMarks=[],s(e),e.on("cursorActivity",s)}(t),t.getInputField().style.caretColor="transparent")), +n&&n.attach==a||function(t){t.setOption("disableInput",!0),t.setOption("showCursorWhenSelecting",!1),e.signal(t,"vim-mode-change",{mode:"normal"}),t.on("cursorActivity",xe),C(t),e.on(t.getInputField(),"paste",u(t))}(t)}function s(e){if(e.state.fatCursorMarks){l(e);for(var t=e.listSelections(),n=[],r=0;r")}(t);if(!r)return!1;var i=e.Vim.findKey(n,r);return"function"==typeof i&&e.signal(n,"vim-keypress",r),i}}function u(e){var t=e.state.vim;return t.onPasteFn||(t.onPasteFn=function(){t.insertMode||(e.setCursor(P(e.getCursor(),0,1)),Xe.enterInsertMode(e,{},t))}),t.onPasteFn}function f(e,t){for(var n=[],r=e;r=e.firstLine()&&t<=e.lastLine()}function h(e){return/^[a-z]$/.test(e)}function p(e){return/^[A-Z]$/.test(e)}function m(e){return/^\s*$/.test(e)}function g(e){return-1!=".?!".indexOf(e)}function v(e,t){for(var n=0;n"==t.slice(-11)){var n=t.length-11,r=e.slice(0,n),i=t.slice(0,n);return r==i&&e.length>n?"full":0==i.indexOf(r)&&"partial"}return e==t?"full":0==t.indexOf(e)&&"partial"}function R(e,t,n){return function(){for(var r=0;r2&&(t=D.apply(void 0,[].slice.call(arguments,1))),H(e,t)?e:t}function W(e,t){return arguments.length>2&&(t=W.apply(void 0,[].slice.call(arguments,1))),H(e,t)?t:e}function z(e,t,n){var r=H(e,t),i=H(t,n);return r&&i}function K(e,t){return e.getLine(t).length}function j(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function U(e,t,n){var r=K(e,t),o=new Array(n-r+1).join(" ");e.setCursor(i(t,r)),e.replaceRange(o,e.getCursor())}function _(e,t){ +var n=[],r=e.listSelections(),o=B(e.clipPos(t)),a=!F(t,o),s=function(e,t){for(var n=0;ns?c:0,f=r[u].anchor,d=Math.min(f.line,o.line),h=Math.max(f.line,o.line),p=f.ch,m=o.ch,g=r[u].head.ch-p,v=m-p;g>0&&v<=0?(p++,a||m--):g<0&&v>=0?(p--,l||m++):g<0&&-1==v&&(p--,m++);for(var y=d;y<=h;y++){var b={anchor:new i(y,p),head:new i(y,m)};n.push(b)} +return e.setSelections(n),t.ch=m,f.ch=p,f}function V(e,t,n){for(var r=[],i=0;ic&&(o.line=c),o.ch=K(e,o.line)}return{ranges:[{anchor:a,head:o}], +primary:0}}if("block"==n){for(var u=Math.min(a.line,o.line),f=Math.min(a.ch,o.ch),d=Math.max(a.line,o.line),h=Math.max(a.ch,o.ch)+1,p=d-u+1,m=o.line==u?0:p-1,g=[],v=0;v=s.length)return null;r?c=Re[0]:(c=Ie[0])(s.charAt(l))||(c=Ie[1]);for(var u=l,f=l;c(s.charAt(u))&&u=0;)f--;if(f++,t){for(var d=u;/\s/.test(s.charAt(u))&&u0;)f-- +;f||(f=h)}}return{start:i(a.line,f),end:i(a.line,u)}}function Q(e,t,n){F(t,n)||Ke.jumpList.add(e,t,n)}function Z(e,t){Ke.lastCharacterSearch.increment=e,Ke.lastCharacterSearch.forward=t.forward,Ke.lastCharacterSearch.selectedCharacter=t.selectedCharacter}function ee(e,t,n,r,i){var o=t.line,a=t.ch,s=e.getLine(o),l=n?1:-1,c=r?Re:Ie;if(i&&""==s){if(o+=l,s=e.getLine(o),!d(e,o))return null;a=n?0:s.length}for(;;){if(i&&""==s)return{from:0,to:0,line:o};for(var u=l>0?s.length:-1,f=u,h=u;a!=u;){ +for(var p=!1,m=0;m0?0:s.length}}function te(e,t,n,r,o){var a=i(t.line+n.repeat-1,1/0),s=e.clipPos(a);return s.ch--,o||(r.lastHPos=1/0,r.lastHSPos=e.charCoords(s,"div").left),a}function ne(e,t,n,r){for(var o,a=e.getCursor(),s=a.ch,l=0;l0;)s(d,r)&&n--, +d+=r;return new i(d,0)}var h=e.state.vim;if(h.visualLine&&s(c,1,!0)){var p=h.sel.anchor;s(p.line,-1,!0)&&(o&&p.line==c||(c+=1))}var m=a(c);for(d=c;d<=f&&n;d++)s(d,1,!0)&&(o&&a(d)==m||n--);for(l=new i(d,0),d>f&&!m?m=!0:o=!1,d=c;d>u&&(o&&a(d)!=m&&d!=c||!s(d,-1,!0));d--);return{start:new i(d,0),end:l}}function ae(){}function se(e){var t=e.state.vim;return t.searchState_||(t.searchState_=new ae)}function le(e,t){var n=ce(e,t)||[];if(!n.length)return[];var r=[];if(0===n[0]){ +for(var i=0;i'+t+"",{bottom:!0,duration:5e3}):alert(t)}function fe(e,t){var n,r,i,o=(t.prefix||"")+" "+(t.desc||"");!function(e,t,n,r,i){e.openDialog?e.openDialog(t,r,{bottom:!0,value:i.value, +onKeyDown:i.onKeyDown,onKeyUp:i.onKeyUp,selectValueOnOpen:!1}):r(prompt(n,""))}(e,(n=t.prefix,r=t.desc,i=''+(n||"")+'',r&&(i+=' '+r+""),i),o,t.onClose,t)}function de(e,t,n,r){if(t){var i=se(e),o=function(e,t,n){if(Ke.registerController.getRegister("/").setText(e),e instanceof RegExp)return e;var r,i,o=ce(e,"/") +;return o.length?(r=e.substring(0,o[0]),i=-1!=e.substring(o[0]).indexOf("i")):r=e,r?(k("pcre")||(r=function(e){for(var t=!1,n=[],r=-1;r1&&(Ae(t,n,n.insertModeRepeat-1,!0),n.lastEditInputState.repeatOverride=n.insertModeRepeat),delete n.insertModeRepeat,n.insertMode=!1,t.setCursor(t.getCursor().line,t.getCursor().ch-1),t.setOption("keyMap","vim"),t.setOption("disableInput",!0),t.toggleOverwrite(!1),i.setText(a.changes.join("")),e.signal(t,"vim-mode-change",{mode:"normal"}),r.isRecording&&function(e){if(!e.isPlaying){var t=e.latestRegister,n=Ke.registerController.getRegister(t) +;n&&n.pushInsertModeChanges&&n.pushInsertModeChanges(e.lastInsertModeChanges)}}(r)}function ke(e){t.unshift(e)}function we(t,n,r,i){var o=Ke.registerController.getRegister(i);if(":"==i)return o.keyBuffer[0]&&it.processCommand(t,o.keyBuffer[0]),void(r.isPlaying=!1);var a=o.keyBuffer,s=0;r.isPlaying=!0,r.replaySearchQueries=o.searchQueries.slice(0);for(var l=0;l|<\w+>|./.exec(f))[0],f=f.substring(c.index+u.length),e.Vim.handleKey(t,u,"macro"), +n.insertMode){var d=o.insertModeChanges[s++].changes;Ke.macroModeState.lastInsertModeChanges.changes=d,Oe(t,d,1),be(t)}r.isPlaying=!1}function Ce(e,t){var n=Ke.macroModeState,r=n.lastInsertModeChanges;if(!n.isPlaying)for(;t;){if(r.expectCursorActivityForChange=!0,r.ignoreCount>1)r.ignoreCount--;else if("+input"==t.origin||"paste"==t.origin||void 0===t.origin){var i=e.listSelections().length;i>1&&(r.ignoreCount=i);var o=t.text.join("\n");r.maybeReset&&(r.changes=[],r.maybeReset=!1), +o&&(e.state.overwrite&&!/\n/.test(o)?r.changes.push([o]):r.changes.push(o))}t=t.next}}function xe(t){var n=t.state.vim;if(n.insertMode){var r=Ke.macroModeState;if(r.isPlaying)return;var i=r.lastInsertModeChanges;i.expectCursorActivityForChange?i.expectCursorActivityForChange=!1:i.maybeReset=!0}else t.curOp.isVimOp||function(t,n){var r=t.getCursor("anchor"),i=t.getCursor("head");if(n.visualMode&&!t.somethingSelected()?X(t,!1):n.visualMode||n.insertMode||!t.somethingSelected()||(n.visualMode=!0, +n.visualLine=!1,e.signal(t,"vim-mode-change",{mode:"visual"})),n.visualMode){var o=H(i,r)?0:-1,a=H(i,r)?-1:0;i=P(i,0,o),r=P(r,0,a),n.sel={anchor:r,head:i},re(t,n,"<",D(i,r)),re(t,n,">",W(i,r))}else n.insertMode||(n.lastHPos=t.getCursor().ch)}(t,n);n.visualMode&&Se(t)}function Se(e){var t="cm-animate-fat-cursor",n=e.state.vim,r=N(e,B(n.sel.head)),i=P(r,0,1);if(Me(n),r.ch==e.getLine(r.line).length){var o=document.createElement("span");o.textContent=" ",o.className=t, +n.fakeCursorBookmark=e.setBookmark(r,{widget:o})}else n.fakeCursor=e.markText(r,i,{className:t})}function Me(e){e.fakeCursor&&(e.fakeCursor.clear(),e.fakeCursor=null),e.fakeCursorBookmark&&(e.fakeCursorBookmark.clear(),e.fakeCursorBookmark=null)}function Le(e){this.keyName=e}function Te(t){var n=Ke.macroModeState.lastInsertModeChanges,r=e.keyName(t);r&&(-1==r.indexOf("Delete")&&-1==r.indexOf("Backspace")||e.lookupKey(r,"vim-insert",(function(){return n.maybeReset&&(n.changes=[],n.maybeReset=!1), +n.changes.push(new Le(r)),!0})))}function Ae(e,t,n,r){function i(){s?$e.processAction(e,t,t.lastEditActionCommand):$e.evalInput(e,t)}function o(n){if(a.lastInsertModeChanges.changes.length>0){n=t.lastEditActionCommand?n:1;var r=a.lastInsertModeChanges;Oe(e,r.changes,n)}}var a=Ke.macroModeState;a.isPlaying=!0;var s=!!t.lastEditActionCommand,l=t.inputState;if(t.inputState=t.lastEditInputState,s&&t.lastEditActionCommand.interlaceInsertRepeat)for(var c=0;c"]),We=[].concat(Be,Fe,He,["-",'"',".",":","_","/"]),ze={};y("filetype",void 0,"string",["ft"],(function(e,t){if(void 0!==t){if(void 0===e)return"null"==(n=t.getOption("mode"))?"":n;var n=""==e?"null":e;t.setOption("mode",n)}}));var Ke,je,Ue=function(){function e(e,a){(n+=a)>r?n=r:n0?1:-1,u=e.getCursor();do{if((s=o[(t+(n+=c))%t])&&(l=s.find())&&!F(u,l))break +}while(ni)}return s}var t=100,n=-1,r=0,i=0,o=new Array(t);return{cachedCursor:void 0,add:function(e,a,s){function l(r){var i=++n%t,a=o[i];a&&a.clear(),o[i]=e.setBookmark(r)}var c=o[n%t];if(c){var u=c.find();u&&!F(u,a)&&l(a)}else l(a);l(s),r=n,(i=n-t+1)<0&&(i=0)},find:function(t,r){var i=n,o=e(t,r);return n=i,o&&o.find()},move:e}},_e=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}} +;w.prototype={exitMacroRecordMode:function(){var e=Ke.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1},enterMacroRecordMode:function(e,t){var n=Ke.registerController.getRegister(t);n&&(n.clear(),this.latestRegister=t,e.openDialog&&(this.onRecordingDone=e.openDialog("(recording)["+t+"]",null,{bottom:!0})),this.isRecording=!0)}};var Ve={buildKeyMap:function(){},getRegisterController:function(){return Ke.registerController},resetVimGlobalState_:x, +getVimGlobalState_:function(){return Ke},maybeInitVimState_:C,suppressErrorLogging:!1,InsertModeKey:Le,map:function(e,t,n){it.map(e,t,n)},unmap:function(e,t){it.unmap(e,t)},noremap:function(e,r,i){function o(e){return e?[e]:["normal","insert","visual"]}for(var a=o(i),s=t.length,l=s-n;l=0;a--){var s=o[a];if(e!==s.context)if(s.context)this._mapCommand(s);else{var l=["normal","insert","visual"];for(var c in l)if(l[c]!==e){var u={};for(var f in s)u[f]=s[f];u.context=l[c],this._mapCommand(u)}}}},setOption:b,getOption:k,defineOption:y,defineEx:function(e,t,n){if(t){ +if(0!==e.indexOf(t))throw new Error('(Vim.defineEx) "'+t+'" is not a prefix of "'+e+'", command not registered')}else t=e;rt[e]=n,it.commandMap_[t]={name:e,shortName:t,type:"api"}},handleKey:function(e,t,n){var r=this.findKey(e,t,n);if("function"==typeof r)return r()},findKey:function(n,r,i){function o(){if(""==r)return M(n),s.visualMode?X(n):s.insertMode&&be(n),!0}var a,s=C(n);return!1===(a=s.insertMode?function(){if(o())return!0 +;for(var e=s.inputState.keyBuffer=s.inputState.keyBuffer+r,i=1==r.length,a=$e.matchCommand(e,t,s.inputState,"insert");e.length>1&&"full"!=a.type;){e=s.inputState.keyBuffer=e.slice(1);var l=$e.matchCommand(e,t,s.inputState,"insert");"none"!=l.type&&(a=l)}if("none"==a.type)return M(n),!1;if("partial"==a.type)return je&&window.clearTimeout(je),je=window.setTimeout((function(){s.insertMode&&s.inputState.keyBuffer&&M(n)}),k("insertModeEscKeysTimeout")),!i;if(je&&window.clearTimeout(je),i){ +for(var c=n.listSelections(),u=0;u|<\w+>|./.exec(t),r=i[0],t=t.substring(i.index+r.length),e.Vim.handleKey(n,r,"mapping")}(a.toKeys):$e.processCommand(n,s,a)}catch(t){throw n.state.vim=void 0,C(n),e.Vim.suppressErrorLogging||console.log(t),t}return!0}))}},handleEx:function(e,t){it.processCommand(e,t)},defineMotion:function(e,t){qe[e]=t},defineAction:function(e,t){Xe[e]=t},defineOperator:function(e,t){Ge[e]=t}, +mapCommand:function(e,t,n,r,i){var o={keys:e,type:t};for(var a in o[t]=n,o[t+"Args"]=r,i)o[a]=i[a];ke(o)},_mapCommand:ke,defineRegister:function(e,t){var n=Ke.registerController.registers;if(!e||1!=e.length)throw Error("Register name must be 1 character");if(n[e])throw Error("Register already defined "+e);n[e]=t,We.push(e)},exitVisualMode:X,exitInsertMode:be};S.prototype.pushRepeatDigit=function(e){ +this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)},S.prototype.getRepeat=function(){var e=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(e=1,this.prefixRepeat.length>0&&(e*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(e*=parseInt(this.motionRepeat.join(""),10))),e},L.prototype={setText:function(e,t,n){this.keyBuffer=[e||""],this.linewise=!!t,this.blockwise=!!n},pushText:function(e,t){ +t&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(e)},pushInsertModeChanges:function(e){this.insertModeChanges.push(_e(e))},pushSearchQuery:function(e){this.searchQueries.push(e)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},T.prototype={pushText:function(e,t,n,r,i){if("_"!==e){r&&"\n"!==n.charAt(n.length-1)&&(n+="\n") +;var o=this.isValidRegister(e)?this.getRegister(e):null;if(o)p(e)?o.pushText(n,r):o.setText(n,r,i),this.unnamedRegister.setText(o.toString(),r);else{switch(t){case"yank":this.registers[0]=new L(n,r,i);break;case"delete":case"change":-1==n.indexOf("\n")?this.registers["-"]=new L(n,r):(this.shiftNumericRegisters_(),this.registers[1]=new L(n,r))}this.unnamedRegister.setText(n,r,i)}}},getRegister:function(e){return this.isValidRegister(e)?(e=e.toLowerCase(), +this.registers[e]||(this.registers[e]=new L),this.registers[e]):this.unnamedRegister},isValidRegister:function(e){return e&&v(e,We)},shiftNumericRegisters_:function(){for(var e=9;e>=2;e--)this.registers[e]=this.getRegister(""+(e-1))}},A.prototype={nextMatch:function(e,t){var n=this.historyBuffer,r=t?-1:1;null===this.initialPrefix&&(this.initialPrefix=e) +;for(var i=this.iterator+r;t?i>=0:i=n.length?(this.iterator=n.length,this.initialPrefix):i<0?e:void 0},pushInput:function(e){var t=this.historyBuffer.indexOf(e);t>-1&&this.historyBuffer.splice(t,1),e.length&&this.historyBuffer.push(e)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var $e={matchCommand:function(e,t,n,r){ +var i,o=function(e,t,n,r){for(var i,o=[],a=[],s=0;s"==i.keys.slice(-11)){var l=function(e){ +var t=/^.*(<[^>]+>)$/.exec(e),n=t?t[1]:e.slice(-1);if(n.length>1)switch(n){case"":n="\n";break;case"":n=" ";break;default:n=""}return n}(e);if(!l)return{type:"none"};n.selectedCharacter=l}return{type:"full",command:i}},processCommand:function(e,t,n){switch(t.inputState.repeatOverride=n.repeatOverride,n.type){case"motion":this.processMotion(e,t,n);break;case"operator":this.processOperator(e,t,n);break;case"operatorMotion":this.processOperatorMotion(e,t,n);break;case"action": +this.processAction(e,t,n);break;case"search":this.processSearch(e,t,n);break;case"ex":case"keyToEx":this.processEx(e,t,n)}},processMotion:function(e,t,n){t.inputState.motion=n.motion,t.inputState.motionArgs=E(n.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,n){var r=t.inputState;if(r.operator){if(r.operator==n.operator)return r.motion="expandToLine",r.motionArgs={linewise:!0},void this.evalInput(e,t);M(e)}r.operator=n.operator,r.operatorArgs=E(n.operatorArgs), +n.exitVisualBlock&&(t.visualBlock=!1,q(e)),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,n){var r=t.visualMode,i=E(n.operatorMotionArgs);i&&r&&i.visualLine&&(t.visualLine=!0),this.processOperator(e,t,n),r||this.processMotion(e,t,n)},processAction:function(e,t,n){var r=t.inputState,i=r.getRepeat(),o=!!i,a=E(n.actionArgs)||{};r.selectedCharacter&&(a.selectedCharacter=r.selectedCharacter),n.operator&&this.processOperator(e,t,n),n.motion&&this.processMotion(e,t,n), +(n.motion||n.operator)&&this.evalInput(e,t),a.repeat=i||1,a.repeatIsExplicit=o,a.registerName=r.registerName,M(e),t.lastMotion=null,n.isEdit&&this.recordLastEdit(t,r,n),Xe[n.action](e,a,t)},processSearch:function(t,n,r){function i(e,i,o){Ke.searchHistoryController.pushInput(e),Ke.searchHistoryController.reset();try{de(t,e,i,o)}catch(n){return ue(t,"Invalid regex: "+e),void M(t)}$e.processMotion(t,n,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:r.searchArgs.toJumplist}})} +if(t.getSearchCursor){var o=r.searchArgs.forward,a=r.searchArgs.wholeWordOnly;se(t).setReversed(!o);var s=o?"/":"?",l=se(t).getQuery(),c=t.getScrollInfo();switch(r.searchArgs.querySrc){case"prompt":var u=Ke.macroModeState;u.isPlaying?i(h=u.replaySearchQueries.shift(),!0,!1):fe(t,{onClose:function(e){t.scrollTo(c.left,c.top),i(e,!0,!0);var n=Ke.macroModeState;n.isRecording&&function(e,t){if(!e.isPlaying){var n=e.latestRegister,r=Ke.registerController.getRegister(n) +;r&&r.pushSearchQuery&&r.pushSearchQuery(t)}}(n,e)},prefix:s,desc:et,onKeyUp:function(n,r,i){var a,s,l,u=e.keyName(n);"Up"==u||"Down"==u?(a="Up"==u,s=n.target?n.target.selectionEnd:0,i(r=Ke.searchHistoryController.nextMatch(r,a)||""),s&&n.target&&(n.target.selectionEnd=n.target.selectionStart=Math.min(s,n.target.value.length))):"Left"!=u&&"Right"!=u&&"Ctrl"!=u&&"Alt"!=u&&"Shift"!=u&&Ke.searchHistoryController.reset();try{l=de(t,r,!0,!0)}catch(n){}l?t.scrollIntoView(pe(t,!o,l),30):(me(t), +t.scrollTo(c.left,c.top))},onKeyDown:function(n,r,i){var o=e.keyName(n);"Esc"==o||"Ctrl-C"==o||"Ctrl-["==o||"Backspace"==o&&""==r?(Ke.searchHistoryController.pushInput(r),Ke.searchHistoryController.reset(),de(t,l),me(t),t.scrollTo(c.left,c.top),e.e_stop(n),M(t),i(),t.focus()):"Up"==o||"Down"==o?e.e_stop(n):"Ctrl-U"==o&&(e.e_stop(n),i(""))}});break;case"wordUnderCursor":var f=J(t,!1,0,!1,!0),d=!0;if(f||(f=J(t,!1,0,!1,!1),d=!1),!f)return;var h=t.getLine(f.start.line).substring(f.start.ch,f.end.ch) +;h=d&&a?"\\b"+h+"\\b":h.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1"),Ke.jumpList.cachedCursor=t.getCursor(),t.setCursor(f.start),i(h,!0,!1)}}},processEx:function(t,n,r){function i(e){Ke.exCommandHistoryController.pushInput(e),Ke.exCommandHistoryController.reset(),it.processCommand(t,e)}function o(n,r,i){var o,a,s=e.keyName(n);("Esc"==s||"Ctrl-C"==s||"Ctrl-["==s||"Backspace"==s&&""==r)&&(Ke.exCommandHistoryController.pushInput(r),Ke.exCommandHistoryController.reset(),e.e_stop(n),M(t),i(), +t.focus()),"Up"==s||"Down"==s?(e.e_stop(n),o="Up"==s,a=n.target?n.target.selectionEnd:0,i(r=Ke.exCommandHistoryController.nextMatch(r,o)||""),a&&n.target&&(n.target.selectionEnd=n.target.selectionStart=Math.min(a,n.target.value.length))):"Ctrl-U"==s?(e.e_stop(n),i("")):"Left"!=s&&"Right"!=s&&"Ctrl"!=s&&"Alt"!=s&&"Shift"!=s&&Ke.exCommandHistoryController.reset()}"keyToEx"==r.type?it.processCommand(t,r.exArgs.input):n.visualMode?fe(t,{onClose:i,prefix:":",value:"'<,'>",onKeyDown:o, +selectValueOnOpen:!1}):fe(t,{onClose:i,prefix:":",onKeyDown:o})},evalInput:function(e,t){var n,r,o,a=t.inputState,s=a.motion,l=a.motionArgs||{},c=a.operator,u=a.operatorArgs||{},f=a.registerName,d=t.sel,h=B(t.visualMode?N(e,d.head):e.getCursor("head")),p=B(t.visualMode?N(e,d.anchor):e.getCursor("anchor")),g=B(h),v=B(p);if(c&&this.recordLastEdit(t,a),(o=void 0!==a.repeatOverride?a.repeatOverride:a.getRepeat())>0&&l.explicitRepeat?l.repeatIsExplicit=!0:(l.noRepeat||!l.explicitRepeat&&0===o)&&(o=1, +l.repeatIsExplicit=!1),a.selectedCharacter&&(l.selectedCharacter=u.selectedCharacter=a.selectedCharacter),l.repeat=o,M(e),s){var y=qe[s](e,h,l,t,a);if(t.lastMotion=qe[s],!y)return;if(l.toJumplist){var b=Ke.jumpList,k=b.cachedCursor;k?(Q(e,k,y),delete b.cachedCursor):Q(e,h,y)}y instanceof Array?(r=y[0],n=y[1]):n=y,n||(n=B(h)),t.visualMode?(t.visualBlock&&n.ch===1/0||(n=N(e,n)),r&&(r=N(e,r)),r=r||v,d.anchor=r,d.head=n,q(e),re(e,t,"<",H(r,n)?r:n),re(e,t,">",H(r,n)?n:r)):c||(n=N(e,n), +e.setCursor(n.line,n.ch))}if(c){if(u.lastSel){r=v;var w=u.lastSel,C=Math.abs(w.head.line-w.anchor.line),x=Math.abs(w.head.ch-w.anchor.ch);n=w.visualLine?i(v.line+C,v.ch):w.visualBlock?i(v.line+C,v.ch+x):w.head.line==w.anchor.line?i(v.line,v.ch+x):i(v.line+C,v.ch),t.visualMode=!0,t.visualLine=w.visualLine,t.visualBlock=w.visualBlock,d=t.sel={anchor:r,head:n},q(e)}else t.visualMode&&(u.lastSel={anchor:B(d.anchor),head:B(d.head),visualBlock:t.visualBlock,visualLine:t.visualLine});var S,L,T,A,O +;if(t.visualMode){if(S=D(d.head,d.anchor),L=W(d.head,d.anchor),T=t.visualLine||u.linewise,O=G(e,{anchor:S,head:L},A=t.visualBlock?"block":T?"line":"char"),T){var E=O.ranges;if("block"==A)for(var P=0;P0&&o&&m(o);o=i.pop())n.line--,n.ch=0;o?(n.line--,n.ch=K(e,n.line)):n.ch=0}}(e,S,L),O=G(e,{anchor:S,head:L},A="char",!l.inclusive||T)}e.setSelections(O.ranges,O.primary),t.lastMotion=null,u.repeat=o,u.registerName=f,u.linewise=T;var R=Ge[c](e,u,O.ranges,v,n);t.visualMode&&X(e,null!=R),R&&e.setCursor(R)}},recordLastEdit:function(e,t,n){var r=Ke.macroModeState;r.isPlaying||(e.lastEditInputState=t,e.lastEditActionCommand=n, +r.lastInsertModeChanges.changes=[],r.lastInsertModeChanges.expectCursorActivityForChange=!1,r.lastInsertModeChanges.visualBlock=e.visualBlock?e.sel.head.line-e.sel.anchor.line:0)}},qe={moveToTopLine:function(e,t,n){var r=ge(e).top+n.repeat-1;return i(r,Y(e.getLine(r)))},moveToMiddleLine:function(e){var t=ge(e),n=Math.floor(.5*(t.top+t.bottom));return i(n,Y(e.getLine(n)))},moveToBottomLine:function(e,t,n){var r=ge(e).bottom-n.repeat+1;return i(r,Y(e.getLine(r)))},expandToLine:function(e,t,n){ +return i(t.line+n.repeat-1,1/0)},findNext:function(e,t,n){var r=se(e),i=r.getQuery();if(i){var o=!n.forward;return o=r.isReversed()?!o:o,he(e,i),pe(e,o,i,n.repeat)}},findAndSelectNextInclusive:function(t,n,r,o,a){var s=se(t),l=s.getQuery();if(l){var c=!r.forward,u=function(e,t,n,r,o){return void 0===r&&(r=1),e.operation((function(){var a=e.getCursor(),s=e.getSearchCursor(n,a),l=s.find(!t);!o.visualMode&&l&&F(s.from(),a)&&s.find(!t) +;for(var c=0;cl:f.lineu&&o.line==u?te(e,t,n,r,!0):(n.toFirstChar&&(a=Y(e.getLine(l)),r.lastHPos=a),r.lastHSPos=e.charCoords(i(l,a),"div").left,i(l,a))},moveByDisplayLines:function(e,t,n,r){var o=t +;switch(r.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:r.lastHSPos=e.charCoords(o,"div").left}var a=n.repeat;if((l=e.findPosV(o,n.forward?a:-a,"line",r.lastHSPos)).hitSide)if(n.forward)var s={top:e.charCoords(l,"div").top+8,left:r.lastHSPos},l=e.coordsChar(s,"div");else{var c=e.charCoords(i(e.firstLine(),0),"div");c.left=r.lastHSPos,l=e.coordsChar(c,"div")}return r.lastHPos=l.ch,l}, +moveByPage:function(e,t,n){var r=t,i=n.repeat;return e.findPosV(r,n.forward?i:-i,"page")},moveByParagraph:function(e,t,n){var r=n.forward?1:-1;return oe(e,t,n.repeat,r)},moveBySentence:function(e,t,n){var r=n.forward?1:-1;return function(e,t,n,r){function o(e,t){if(t.pos+t.dir<0||t.pos+t.dir>=t.line.length){if(t.ln+=t.dir,!d(e,t.ln))return t.line=null,t.ln=null,void(t.pos=null);t.line=e.getLine(t.ln),t.pos=t.dir>0?0:t.line.length-1}else t.pos+=t.dir}function a(e,t,n,r){ +var i=""===(c=e.getLine(t)),a={line:c,ln:t,pos:n,dir:r},s={ln:a.ln,pos:a.pos},l=""===a.line;for(o(e,a);null!==a.line;){if(s.ln=a.ln,s.pos=a.pos,""===a.line&&!l)return{ln:a.ln,pos:a.pos};if(i&&""!==a.line&&!m(a.line[a.pos]))return{ln:a.ln,pos:a.pos};!g(a.line[a.pos])||i||a.pos!==a.line.length-1&&!m(a.line[a.pos+1])||(i=!0),o(e,a)}var c=e.getLine(s.ln);s.pos=0;for(var u=c.length-1;u>=0;--u)if(!m(c[u])){s.pos=u;break}return s}function s(e,t,n,r){var i={line:e.getLine(t),ln:t,pos:n,dir:r},a={ +ln:i.ln,pos:null},s=""===i.line;for(o(e,i);null!==i.line;){if(""===i.line&&!s)return null!==a.pos?a:{ln:i.ln,pos:i.pos};if(g(i.line[i.pos])&&null!==a.pos&&(i.ln!==a.ln||i.pos+1!==a.pos))return a;""===i.line||m(i.line[i.pos])||(s=!1,a={ln:i.ln,pos:i.pos}),o(e,i)}var l=e.getLine(a.ln);a.pos=0;for(var c=0;c0;)l=r<0?s(e,l.ln,l.pos,r):a(e,l.ln,l.pos,r),n--;return i(l.ln,l.pos)}(e,t,n.repeat,r)}, +moveByScroll:function(e,t,n,r){var i,o=e.getScrollInfo(),a=n.repeat;a||(a=o.clientHeight/(2*e.defaultTextHeight()));var s=e.charCoords(t,"local");if(n.repeat=a,!(i=qe.moveByDisplayLines(e,t,n,r)))return null;var l=e.charCoords(i,"local");return e.scrollTo(null,o.top+l.top-s.top),i},moveByWords:function(e,t,n){return function(e,t,n,r,o,a){var s=B(t),l=[];(r&&!o||!r&&o)&&n++;for(var c=!(r&&o),u=0;u0)f.index=0;else{var m=f.lineText.length;f.index=m>0?m-1:0}f.nextCh=f.lineText.charAt(f.index)}p(f)&&(o.line=c,o.ch=f.index,t--)}return f.nextCh||f.curMoveThrough?i(c,f.index):o}(e,n.repeat,n.forward,n.selectedCharacter)||t},moveToColumn:function(e,t,n,r){var o=n.repeat;return r.lastHPos=o-1,r.lastHSPos=e.charCoords(t,"div").left,function(e,t){var n=e.getCursor().line;return N(e,i(n,t-1))}(e,o)}, +moveToEol:function(e,t,n,r){return te(e,t,n,r,!1)},moveToFirstNonWhiteSpaceCharacter:function(e,t){var n=t;return i(n.line,Y(e.getLine(n.line)))},moveToMatchedSymbol:function(e,t){for(var n,r=t,o=r.line,a=r.ch,s=e.getLine(o);a"===a?/[(){}[\]<>]/:/[(){}[\]]/;return e.findMatchingBracket(i(o,a),{bracketRegex:c}).to}return r}, +moveToStartOfLine:function(e,t){return i(t.line,0)},moveToLineOrEdgeOfDocument:function(e,t,n){var r=n.forward?e.lastLine():e.firstLine();return n.repeatIsExplicit&&(r=n.repeat-e.getOption("firstLineNumber")),i(r,Y(e.getLine(r)))},textObjectManipulation:function(t,n,r,o){var a=r.selectedCharacter;"b"==a?a="(":"B"==a&&(a="{");var s,l=!r.textObjectInner;if({"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"}[a])s=function(e,t,n,r){var o,a,s=t,l={"(":/[()]/,")":/[()]/,"[":/[[\]]/, +"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[n],c={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[n],u=e.getLine(s.line).charAt(s.ch)===c?1:0;if(o=e.scanForBracket(i(s.line,s.ch+u),-1,void 0,{bracketRegex:l}),a=e.scanForBracket(i(s.line,s.ch+u),1,void 0,{bracketRegex:l}),!o||!a)return{start:s,end:s};if(o=o.pos,a=a.pos,o.line==a.line&&o.ch>a.ch||o.line>a.line){var f=o;o=a,a=f}return r?a.ch+=1:o.ch+=1,{start:o,end:a}}(t,n,a,l);else if({"'":!0,'"':!0,"`":!0 +}[a])s=function(e,t,n,r){var o,a,s,l,c=B(t),u=e.getLine(c.line).split(""),f=u.indexOf(n);if(c.ch-1&&!o;s--)u[s]==n&&(o=s+1);else o=c.ch+1;if(o&&!a)for(s=o,l=u.length;st.lastLine()&&n.linewise&&!p?t.replaceRange("",h,c):t.replaceRange("",l,c),n.linewise&&(p||(t.setCursor(h),e.commands.newlineAndIndent(t)),l.ch=Number.MAX_VALUE),o=l}Ke.registerController.pushText(n.registerName,"change",a,n.linewise,r.length>1),Xe.enterInsertMode(t,{head:o},t.state.vim)},delete:function(e,t,n){var r,o,a=e.state.vim;if(a.visualBlock){o=e.getSelection();var s=O("",n.length);e.replaceSelections(s), +r=n[0].anchor}else{var l=n[0].anchor,c=n[0].head;t.linewise&&c.line!=e.firstLine()&&l.line==e.lastLine()&&l.line==c.line-1&&(l.line==e.firstLine()?l.ch=0:l=i(l.line-1,K(e,l.line-1))),o=e.getRange(l,c),e.replaceRange("",l,c),r=l,t.linewise&&(r=qe.moveToFirstNonWhiteSpaceCharacter(e,l))}return Ke.registerController.pushText(t.registerName,"delete",o,t.linewise,a.visualBlock),N(e,r)},indent:function(e,t,n){ +var r=e.state.vim,i=n[0].anchor.line,o=r.visualBlock?n[n.length-1].anchor.line:n[0].head.line,a=r.visualMode?t.repeat:1;t.linewise&&o--;for(var s=i;s<=o;s++)for(var l=0;lc.top?(l.line+=(s-c.top)/i, +l.line=Math.ceil(l.line),e.setCursor(l),c=e.charCoords(l,"local"),e.scrollTo(null,c.top)):e.scrollTo(null,s);else{var u=s+e.getScrollInfo().clientHeight;u=a.anchor.line?P(a.head,0,1):i(a.anchor.line,0)}else if("inplace"==o){if(r.visualMode)return}else"lastEdit"==o&&(s=ye(t)||s);t.setOption("disableInput",!1),n&&n.replace?(t.toggleOverwrite(!0),t.setOption("keyMap","vim-replace"),e.signal(t,"vim-mode-change",{mode:"replace"})):(t.toggleOverwrite(!1),t.setOption("keyMap","vim-insert"), +e.signal(t,"vim-mode-change",{mode:"insert"})),Ke.macroModeState.isPlaying||(t.on("change",Ce),e.on(t.getInputField(),"keydown",Te)),r.visualMode&&X(t),V(t,s,l)}},toggleVisualMode:function(t,n,r){var o,a=n.repeat,s=t.getCursor();r.visualMode?r.visualLine^n.linewise||r.visualBlock^n.blockwise?(r.visualLine=!!n.linewise,r.visualBlock=!!n.blockwise,e.signal(t,"vim-mode-change",{mode:"visual",subMode:r.visualLine?"linewise":r.visualBlock?"blockwise":""}),q(t)):X(t):(r.visualMode=!0, +r.visualLine=!!n.linewise,r.visualBlock=!!n.blockwise,o=N(t,i(s.line,s.ch+a-1)),r.sel={anchor:s,head:o},e.signal(t,"vim-mode-change",{mode:"visual",subMode:r.visualLine?"linewise":r.visualBlock?"blockwise":""}),q(t),re(t,r,"<",D(s,o)),re(t,r,">",W(s,o)))},reselectLastSelection:function(t,n,r){var i=r.lastSelection;if(r.visualMode&&$(t,r),i){var o=i.anchorMark.find(),a=i.headMark.find();if(!o||!a)return;r.sel={anchor:o,head:a},r.visualMode=!0,r.visualLine=i.visualLine,r.visualBlock=i.visualBlock, +q(t),re(t,r,"<",D(o,a)),re(t,r,">",W(o,a)),e.signal(t,"vim-mode-change",{mode:"visual",subMode:r.visualLine?"linewise":r.visualBlock?"blockwise":""})}},joinLines:function(e,t,n){var r,o;if(n.visualMode){if(r=e.getCursor("anchor"),H(o=e.getCursor("head"),r)){var a=o;o=r,r=a}o.ch=K(e,o.line)-1}else{var s=Math.max(t.repeat,2);r=e.getCursor(),o=N(e,i(r.line+s-1,1/0))}for(var l=0,c=r.line;c1&&(h=Array(t.repeat+1).join(h));var p,m,g=o.linewise,v=o.blockwise;if(v){h=h.split("\n"),g&&h.pop();for(var y=0;ye.lastLine()&&e.replaceRange("\n",i(L,0)),K(e,L)u.length&&(o=u.length),a=i(l.line,o)}if("\n"==s)r.visualMode||t.replaceRange("",l,a),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(t);else{var f=t.getRange(l,a);if(f=f.replace(/[^\n]/g,s),r.visualBlock){ +var d=new Array(t.getOption("tabSize")+1).join(" ");f=(f=t.getSelection()).replace(/\t/g,d).replace(/[^\n]/g,s).split("\n"),t.replaceSelections(f)}else t.replaceRange(f,l,a);r.visualMode?(l=H(c[0].anchor,c[0].head)?c[0].anchor:c[0].head,t.setCursor(l),X(t,!1)):t.setCursor(P(a,0,-1))}},incrementNumberToken:function(e,t){for(var n,r,o,a,s=e.getCursor(),l=e.getLine(s.line),c=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi;null!==(n=c.exec(l))&&(o=(r=n.index)+n[0].length,!(s.ch=1)return!0}else e.nextCh===e.reverseSymb&&e.depth-- +;return!1}},section:{init:function(e){e.curMoveThrough=!0,e.symb=(e.forward?"]":"[")===e.symb?"{":"}"},isComplete:function(e){return 0===e.index&&e.nextCh===e.symb}},comment:{isComplete:function(e){var t="*"===e.lastCh&&"/"===e.nextCh;return e.lastCh=e.nextCh,t}},method:{init:function(e){e.symb="m"===e.symb?"{":"}",e.reverseSymb="{"===e.symb?"}":"{"},isComplete:function(e){return e.nextCh===e.symb}},preprocess:{init:function(e){e.index=0},isComplete:function(e){if("#"===e.nextCh){ +var t=e.lineText.match(/#(\w+)/)[1];if("endif"===t){if(e.forward&&0===e.depth)return!0;e.depth++}else if("if"===t){if(!e.forward&&0===e.depth)return!0;e.depth--}if("else"===t&&0===e.depth)return!0}return!1}}};y("pcre",!0,"boolean"),ae.prototype={getQuery:function(){return Ke.query},setQuery:function(e){Ke.query=e},getOverlay:function(){return this.searchOverlay},setOverlay:function(e){this.searchOverlay=e},isReversed:function(){return Ke.isReversed},setReversed:function(e){Ke.isReversed=e}, +getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(e){this.annotate=e}};var Qe={"\\n":"\n","\\r":"\r","\\t":"\t"},Ze={"\\/":"/","\\\\":"\\","\\n":"\n","\\r":"\r","\\t":"\t","\\&":"&"},et="(Javascript regexp)",tt=0,nt=function(){this.buildCommandMap_()};nt.prototype={processCommand:function(e,t,n){var r=this;e.operation((function(){e.curOp.isVimOp=!0,r._processCommand(e,t,n)}))},_processCommand:function(t,n,r){ +var i=t.state.vim,o=Ke.registerController.getRegister(":"),a=o.toString();i.visualMode&&X(t);var s=new e.StringStream(n);o.setText(n);var l,c,u=r||{};u.input=n;try{this.parseInput_(t,s,u)}catch(e){throw ue(t,e),e}if(u.commandName){if(l=this.matchCommand_(u.commandName)){if(c=l.name,l.excludeFromCommandHistory&&o.setText(a),this.parseCommandArgs_(s,u,l),"exToKey"==l.type){for(var f=0;f@~])/) +;return n.commandName=r?r[1]:t.match(/.*/)[0],n},parseLineSpec_:function(e,t){var n=t.match(/^(\d+)/);if(n)return parseInt(n[1],10)-1;switch(t.next()){case".":return this.parseLineSpecOffset_(t,e.getCursor().line);case"$":return this.parseLineSpecOffset_(t,e.lastLine());case"'":var r=t.next(),i=ve(e,e.state.vim,r);if(!i)throw new Error("Mark not set");return this.parseLineSpecOffset_(t,i.line);case"-":case"+":return t.backUp(1),this.parseLineSpecOffset_(t,e.getCursor().line);default: +return void t.backUp(1)}},parseLineSpecOffset_:function(e,t){var n=e.match(/^([+-])?(\d+)/);if(n){var r=parseInt(n[2],10);"-"==n[1]?t-=r:t+=r}return t},parseCommandArgs_:function(e,t,n){if(!e.eol()){t.argString=e.match(/.*/)[0];var r=n.argDelimiter||/\s+/,i=j(t.argString).split(r);i.length&&i[0]&&(t.args=i)}},matchCommand_:function(e){for(var t=e.length;t>0;t--){var n=e.substring(0,t);if(this.commandMap_[n]){var r=this.commandMap_[n];if(0===r.name.indexOf(e))return r}}return null}, +buildCommandMap_:function(){this.commandMap_={};for(var e=0;e
";if(n){n=n.join("") +;for(var o=0;o")}else for(var a in r){var s=r[a].toString();s.length&&(i+='"'+a+" "+s+"
")}ue(e,i)},sort:function(t,n){function r(e,t){var n;o&&(n=e,e=t,t=n),a&&(e=e.toLowerCase(),t=t.toLowerCase());var r=l&&g.exec(e),i=l&&g.exec(t);return r?(r=parseInt((r[1]+r[2]).toLowerCase(),v))-(i=parseInt((i[1]+i[2]).toLowerCase(),v)):e1)return"Invalid arguments";l=(i?"decimal":u&&"hex")||f&&"octal"} +r[2]&&(c=new RegExp(r[2].substr(1,r[2].length-2),a?"i":""))}}();if(u)ue(t,u+": "+n.argString);else{var f=n.line||t.firstLine(),d=n.lineEnd||n.line||t.lastLine();if(f!=d){var h=i(f,0),p=i(d,K(t,d)),m=t.getRange(h,p).split("\n"),g=c||("decimal"==l?/(-?)([\d]+)/:"hex"==l?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==l?/([0-7]+)/:null),v="decimal"==l?10:"hex"==l?16:"octal"==l?8:null,y=[],b=[];if(l||c)for(var k=0;k");if(r){var d=0,h=function(){if(d=n&&e<=s:e==n);)if(r||!m||a.from().line!=m.line)return t.scrollIntoView(a.from(),30),t.setSelection(a.from(),a.to()),m=a.from(),void(p=!1);var e,n,s;p=!0}function h(e){if(e&&e(),t.focus(),m){t.setCursor(m);var n=t.state.vim;n.exMode=!1,n.lastHPos=n.lastHSPos=m.ch}c&&c()}t.state.vim.exMode=!0;var p=!1,m=a.from();if(d(),!p)return n?void fe(t,{prefix:"replace with "+l+" (y/n/a/q/l)",onKeyDown:function(n,r,i){switch(e.e_stop(n),e.keyName(n)){case"Y": +f(),d();break;case"N":d();break;case"A":var o=c;c=void 0,t.operation(u),c=o;break;case"L":f();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":h(i)}return p&&h(i),!0}}):(u(),void(c&&c()));ue(t,"No matches for "+s.source)}(t,f,d,p,m,y,h,u,n.callback)}else ue(t,"No previous substitute regular expression")},redo:e.commands.redo,undo:e.commands.undo,write:function(t){e.commands.save?e.commands.save(t):t.save&&t.save()},nohlsearch:function(e){me(e)},yank:function(e){ +var t=B(e.getCursor()).line,n=e.getLine(t);Ke.registerController.pushText("0","yank",n,!0,!0)},delmarks:function(t,n){if(n.argString&&j(n.argString))for(var r=t.state.vim,i=new e.StringStream(j(n.argString));!i.eol();){i.eatSpace();var o=i.pos;if(!i.match(/[a-zA-Z]/,!1))return void ue(t,"Invalid argument: "+n.argString.substring(o));var a=i.next();if(i.match("-",!0)){if(!i.match(/[a-zA-Z]/,!1))return void ue(t,"Invalid argument: "+n.argString.substring(o));var s=a,l=i.next() +;if(!(h(s)&&h(l)||p(s)&&p(l)))return void ue(t,"Invalid argument: "+s+"-");var c=s.charCodeAt(0),u=l.charCodeAt(0);if(c>=u)return void ue(t,"Invalid argument: "+n.argString.substring(o));for(var f=0;f<=u-c;f++){var d=String.fromCharCode(c+f);delete r.marks[d]}}else delete r.marks[a]}else ue(t,"Argument required")}},it=new nt;return e.keyMap.vim={attach:a,detach:o,call:c},y("insertModeEscKeysTimeout",200,"number"),e.keyMap["vim-insert"]={fallthrough:["default"],attach:a,detach:o,call:c}, +e.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:a,detach:o,call:c},x(),Ve}()}(n(4538),n(8334),n(3489),n(2446))},2641:(e,t,n)=>{!function(e){"use strict";const t=e.keyMap,n=e.commands,r=e.Pos;n.selectNextOccurrence=n.selectNextOccurrence||function(t){const n=t.getCursor("from");let i=t.getCursor("to"),o=t.state.selectNextOccurrenceFindFullWord==t.doc.sel;if(0==e.cmpPos(n,i)){const i=function(t,n){let i=n.ch,o=i,a=t.getLine(n.line) +;for(;i&&e.isWordChar(a.charAt(i-1));)--i;for(;o0&&t.lengthi.line&&e==o.line&&0==o.ch||n.push({anchor:e==i.line?i:r(e,0),head:e==o.line?o:r(e)})}e.setSelections(n,0)};const i=t.default==t.macDefault?"Cmd":"Ctrl";t.vscode={fallthrough:"default","Shift-Tab":"indentLess",[`Shift-${i}-K`]:"deleteLine",[`${i}-K ${i}-0`]:"foldAll",[`${i}-K ${i}-J`]:"unfoldAll", +[`${i}-H`]:"replace",[`${i}-L`]:"selectLine",[`Shift-${i}-L`]:"selectAllOccurrences","Shift-Alt-I":"splitSelectionByLine",[`Shift-${i}-H`]:"replaceAll",[`Shift-${i}-I`]:"reindentall",[`${i}-W`]:"close",F3:"findNext","Shift-F3":"findPrev",[`Shift-${i}-7`]:"toggleCommentIndented",[`${i}-D`]:"selectNextOccurrence",[`${i}-Z`]:"undo",[`Shist-${i}-Z`]:"redo",[`${i}-A`]:"selectAll",[`${i}-S`]:"save",F8:"nextProblem","Shift-F8":"prevProblem"},n[t.vscode[`Shift-${i}-A`]="toggleBlockComment"]=function(e){ +e.toggleComment({blockComment:!0})}}(n(4538))},8813:(e,t,n)=>{!function(e){"use strict";var t=e.keyMap.windows={fallthrough:"default"},n=e.commands;t["Shift-Alt-F"]="reindentall",t["Ctrl-Q"]="close",t.F3="findNext",t["Shift-F3"]="findPrev",t.F4="findPrev",t["Ctrl-R"]="replace",t["Ctrl-J"]="jump",t["Ctrl-D"]="deleteLine",t["Ctrl-M"]="goToBracket",t["Ctrl-K"]="toggleCommentIndented",n[t["Shift-Ctrl-K"]="toggleBlockComment"]=function(e){e.toggleComment({blockComment:!0})}, +n[t["Shift-Ctrl-D"]="duplicateLine"]=function(e){var t=e.getCursor().line;e.replaceRange(e.getLine(t)+"\n",{line:t,ch:0})},t["Ctrl-Alt-F2"]="toggleBookmark",t["Ctrl-F2"]="selectBookmarks",t["Shift-Ctrl-F2"]="clearBookmarks",t.F2="nextBookmark",t["Shift-F2"]="prevBookmark",t.F8="nextProblem",t["Shift-F8"]="prevProblem"}(n(4538))},4538:function(e){e.exports=function(){"use strict";function e(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function t(e){ +for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function n(e,n){return t(e).appendChild(n)}function r(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}function d(e,t){for(var n=0;n=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}function p(e){for(;Fo.length<=e;)Fo.push(m(Fo)+" ");return Fo[e]}function m(e){return e[e.length-1]}function g(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||Ho.test(e))}function k(e,t){ +return t?!!(t.source.indexOf("\\w")>-1&&b(e))||t.test(e):b(e)}function w(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function C(e){return e.charCodeAt(0)>=768&&Do.test(e)}function x(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function M(e,t,n){var r;Wo=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:Wo=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:Wo=i)}return null!=r?r:Wo}function L(e,t){var n=e.order;return null==n&&(n=e.order=zo(e.text,t)),n}function T(e,t){return e._handlers&&e._handlers[t]||Ko}function A(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=d(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}} +function O(e,t){var n=T(e,t);if(n.length)for(var r=[].slice.call(arguments,2),i=0;i0} +function I(e){e.prototype.on=function(e,t){jo(this,e,t)},e.prototype.off=function(e,t){A(this,e,t)}}function R(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function B(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function F(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function H(e){R(e),B(e)}function D(e){return e.target||e.srcElement}function W(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)), +yo&&e.ctrlKey&&1==t&&(t=3),t}function z(e){if(null==Ao){var t=r("span","​");n(e,r("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ao=t.offsetWidth<=1&&t.offsetHeight>2&&!(oo&&ao<8))}var i=Ao?r("span","​"):r("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function K(e){if(null!=Oo)return Oo;var r=n(e,document.createTextNode("AخA")),i=Co(r,0,1).getBoundingClientRect(),o=Co(r,1,2).getBoundingClientRect() +;return t(e),!(!i||i.left==i.right)&&(Oo=o.right-i.right<3)}function j(e,t){arguments.length>2&&(t.dependencies=[].slice.call(arguments,2)),Go[e]=t}function U(e){if("string"==typeof e&&Xo.hasOwnProperty(e))e=Xo[e];else if(e&&"string"==typeof e.name&&Xo.hasOwnProperty(e.name)){var t=Xo[e.name];"string"==typeof t&&(t={name:t}),(e=y(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return U("application/xml") +;if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return U("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function _(e,t){t=U(t);var n=Go[t.name];if(!n)return _(e,"text/plain");var r=n(e,t);if(Yo.hasOwnProperty(t.name)){var i=Yo[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}function V(e,t){ +u(t,Yo.hasOwnProperty(e)?Yo[e]:Yo[e]={})}function $(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function q(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function G(e,t,n){return!e.startState||e.startState(t,n)}function X(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.") +;for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?re(n,X(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?re(e.line,t):n<0?re(e.line,0):e}(t,X(e,t.line).text.length)}function fe(e,t){for(var n=[],r=0;re&&i.splice(l,1,e,i[l+1],r),l+=2,c=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength&&$(e.doc.mode,r.state),o=de(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function pe(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Zo(r,!0,t);var o=function(e,t,n){ +for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var l=X(o,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof Qo?c.lookAhead:0)<=o.modeFrontier))return s;var u=f(l.text,null,e.options.tabSize);(null==i||r>u)&&(i=s-1,r=u)}return i}(e,t,n),a=o>r.first&&X(r,o-1).stateAfter,s=a?Zo.fromSaved(r,a,o):new Zo(r,G(r.mode),o);return r.iter(o,t,(function(n){me(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&rt.start)return o} +throw new Error("Mode "+e.name+" failed to advance stream.")}function ye(e,t,n,r){var i,o,a=e.doc,s=a.mode,l=X(a,(t=ue(a,t)).line),c=pe(e,t.line,n),u=new Jo(l.text,e.options.tabSize,c);for(r&&(o=[]);(r||u.pose.options.maxHighlightLength?(s=!1,a&&me(e,t,r,f.pos),f.pos=t.length,l=null):l=be(ve(n,f,r.state,d),o),d){var h=d[0].name;h&&(l="m-"+(l?h+" "+l:h))} +if(!s||u!=l){for(;c=t:o.to>t);(r||(r=[])).push(new we(a,o.from,s?null:o.to))}}return r}(n,i,a),l=function(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&s)for(var k=0;kt)&&(!n||Ne(n,o.marker)<0)&&(n=o.marker)}return n}function Be(e,t,n,r,i){var o=X(e,t),a=na&&o.markedSpans;if(a)for(var s=0;s=0&&f<=0||u<=0&&f>=0)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ie(c.to,n)>=0:ie(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ie(c.from,r)<=0:ie(c.from,r)<0)))return!0}}}function Fe(e){for(var t;t=Pe(e);)e=t.find(-1,!0).line;return e}function He(e,t){var n=X(e,t),r=Fe(n);return n==r?t:Z(r)}function De(e,t){if(t>e.lastLine())return t;var n,r=X(e,t) +;if(!We(e,r))return t;for(;n=Ie(r);)r=n.find(1,!0).line;return Z(r)+1}function We(e,t){var n=na&&t.markedSpans;if(n)for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}function _e(e){e.parent=null,Le(e)}function Ve(e,t){ +if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?aa:oa;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function $e(e,t){var n=i("span",null,null,so?"padding-right: .1px":null),r={pre:i("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var a=o?t.rest[o-1]:t.line,s=void 0;r.pos=0,r.addToken=Ge,K(e.display.measure)&&(s=L(a,e.doc.direction))&&(r.addToken=Xe(r.addToken,s)), +r.map=[],Je(a,r,he(e,a,t!=e.display.externalMeasured&&Z(a))),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=l(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=l(a.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(z(e.display.measure))),0==o?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(so){var c=r.content.lastChild +;(/\bcm-tab\b/.test(c.className)||c.querySelector&&c.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return O(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=l(r.pre.className,r.textClass||"")),r}function qe(e){var t=r("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Ge(e,t,n,i,o,a,s){if(t){var l,c=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e +;for(var n=t,r="",i=0;ic&&f.from<=c);d++);if(f.to>=u)return e(n,r,i,o,a,s,l);e(n,r.slice(0,f.to-c),i,o,null,s,l),o=null,r=r.slice(f.to-c),c=f.to}}}function Ye(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t, +e.trailingSpace=!1}function Je(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,l,c,u,f,d,h=i.length,p=0,m=1,g="",v=0;;){if(v==p){l=c=u=s="",d=null,f=null,v=1/0;for(var y=[],b=void 0,k=0;kp||C.collapsed&&w.to==p&&w.from==p)){if(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,c=""),C.className&&(l+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css), +C.startStyle&&w.from==p&&(u+=" "+C.startStyle),C.endStyle&&w.to==v&&(b||(b=[])).push(C.endStyle,w.to),C.title&&((d||(d={})).title=C.title),C.attributes)for(var x in C.attributes)(d||(d={}))[x]=C.attributes[x];C.collapsed&&(!f||Ne(f.marker,C)<0)&&(f=w)}else w.from>p&&v>w.from&&(v=w.from)}if(b)for(var S=0;S=h)break;for(var L=Math.min(h,v);;){if(g){var T=p+g.length;if(!f){var A=T>L?g.slice(0,L-p):g;t.addToken(t,A,a?a+l:l,u,p+A.length==v?c:"",s,d)}if(T>=L){g=g.slice(L-p),p=L;break}p=T,u=""}g=i.slice(o,o=n[m++]),a=Ve(n[m++],t.cm.options)}}else for(var O=1;On)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Ct(e,t,n,r){return Mt(e,St(e,t),n,r)}function xt(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&t2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0), +(s=function(e,t,i,o){var a,s=Lt(t.map,i,o),l=s.node,c=s.start,u=s.end,f=s.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;c&&C(t.line.text.charAt(s.coverStart+c));)--c;for(;s.coverStart+u1}(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,o=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*o,bottom:t.bottom*o}}(e.display.measure,a))}else{var h;c>0&&(f=o="right"), +a=e.options.lineWrapping&&(h=l.getClientRects()).length>1?h["right"==o?h.length-1:0]:l.getBoundingClientRect()}if(oo&&ao<9&&!c&&(!a||!a.left&&!a.right)){var p=l.parentNode.getClientRects()[0];a=p?{left:p.left,right:p.left+Gt(e.display),top:p.top,bottom:p.bottom}:ca}for(var m=a.top-t.rect.top,g=a.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,b=0;bt)&&(i=(o=l-s)-1,t>=l&&(a="right")),null!=i){if(r=e[c+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n), +"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],a="left";if("right"==n&&i==l-s)for(;c=0&&(n=e[i]).left==n.right;i--);return n}function At(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null, +e.rest))for(var t=0;t=r.text.length?(c=r.text.length,u="before"):c<=0&&(c=0,u="after"),!l)return a("before"==u?c-1:c,"before"==u);var f=M(l,c,u),d=Wo,h=s(c,f,"before"==u);return null!=d&&(h.other=s(c,d,"before"!=u)),h}function Dt(e,t){var n=0;t=ue(e.doc,t),e.options.lineWrapping||(n=Gt(e.display)*t.ch);var r=X(e.doc,t.line),i=Ke(r)+mt(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Wt(e,t,n,r,i){var o=re(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function zt(e,t,n){var r=e.doc +;if((n+=e.display.viewOffset)<0)return Wt(r.first,0,null,-1,-1);var i=ee(r,n),o=r.first+r.size-1;if(i>o)return Wt(r.first+r.size-1,X(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=X(r,i);;){var s=_t(e,a,i,t,n),l=Re(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==i)return c;a=X(r,i=c.line)}}function Kt(e,t,n,r){r-=It(t);var i=t.text.length,o=S((function(t){return Mt(e,n,t-1).bottom<=r}),i,0);return{begin:o,end:i=S((function(t){return Mt(e,n,t).top>r}),o,i)}} +function jt(e,t,n,r){return n||(n=St(e,t)),Kt(e,t,n,Rt(e,t,Mt(e,n,r),"line").top)}function Ut(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function _t(e,t,n,r,i){i-=Ke(t);var o=St(e,t),a=It(t),s=0,l=t.text.length,c=!0,u=L(t,e.doc.direction);if(u){var f=(e.options.lineWrapping?$t:Vt)(e,t,n,o,u,r,i);s=(c=1!=f.level)?f.from:f.to-1,l=c?f.to:f.from-1}var d,h,p=null,m=null,g=S((function(t){var n=Mt(e,o,t);return n.top+=a,n.bottom+=a,!!Ut(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=t,m=n),!0) +}),s,l),v=!1;if(m){var y=r-m.left=k.bottom?1:0}return Wt(n,g=x(t.text,g,1),h,v,r-d)}function Vt(e,t,n,r,i,o,a){var s=S((function(s){var l=i[s],c=1!=l.level;return Ut(Ht(e,re(n,c?l.to:l.from,c?"before":"after"),"line",t,r),o,a,!0)}),0,i.length-1),l=i[s] +;if(s>0){var c=1!=l.level,u=Ht(e,re(n,c?l.from:l.to,c?"after":"before"),"line",t,r);Ut(u,o,a,!0)&&u.top>a&&(l=i[s-1])}return l}function $t(e,t,n,r,i,o,a){var s=Kt(e,t,r,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,f=null,d=0;d=c||h.to<=l)){var p=Mt(e,r,1!=h.level?Math.min(c,h.to)-1:Math.max(l,h.from)).right,m=pm)&&(u=h,f=m)}}return u||(u=i[i.length-1]),u.fromc&&(u={ +from:u.from,to:c,level:u.level}),u}function qt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==ia){ia=r("pre",null,"CodeMirror-line-like");for(var i=0;i<49;++i)ia.appendChild(document.createTextNode("x")),ia.appendChild(r("br"));ia.appendChild(document.createTextNode("x"))}n(e.measure,ia);var o=ia.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),t(e.measure),o||1}function Gt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth +;var t=r("span","xxxxxxxxxx"),i=r("pre",[t],"CodeMirror-line-like");n(e.measure,i);var o=t.getBoundingClientRect(),a=(o.right-o.left)/10;return a>2&&(e.cachedCharWidth=a),a||10}function Xt(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:Yt(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r, +wrapperWidth:t.wrapper.clientWidth}}function Yt(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Jt(e){var t=qt(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Gt(e.display)-3);return function(i){if(We(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(l=X(e.doc,c.line).text).length==c.ch){var u=f(l,l.length,e.options.tabSize)-l.length;c=re(c.line,Math.max(0,Math.round((o-vt(e.display).left)/Gt(e.display))-u))}return c}function en(e,t){ +if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)na&&He(e.doc,t)i.viewFrom?rn(e):(i.viewFrom+=r, +i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)rn(e);else if(t<=i.viewFrom){var o=on(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):rn(e)}else if(n>=i.viewTo){var a=on(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):rn(e)}else{var s=on(e,t,t,-1),l=on(e,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(Ze(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):rn(e)}var c=i.externalMeasured +;c&&(n=i.lineN&&t=r.viewTo)){var o=r.view[en(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==d(a,n)&&a.push(n)}}}function rn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function on(e,t,n,r){ +var i,o=en(e,t),a=e.display.view;if(!na||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,l=0;l0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;He(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function an(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||s.to().linet||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}(m,n||0,null==r?p:r,(function(e,t,s,h){ +var g="ltr"==s,v=o(e,g?"left":"right"),y=o(t-1,g?"right":"left"),b=null==n&&0==e,k=null==r&&t==p,w=0==h,C=!m||h==m.length-1;if(y.top-v.top<=3){var x=(d?k:b)&&C,S=(d?b:k)&&w?u:(g?v:y).left,M=x?f:(g?y:v).right;i(S,v.top,M-S,v.bottom)}else{var L,T,A,O;g?(L=d&&b&&w?u:v.left,T=d?f:a(e,s,"before"),A=d?u:a(t,s,"after"),O=d&&k&&C?f:y.right):(L=d?a(e,s,"before"):u,T=!d&&b&&w?f:v.right,A=!d&&k&&C?u:y.left,O=d?a(t,s,"after"):f),i(L,v.top,T-L,v.bottom),v.bottom0?t.blinker=setInterval((function(){e.hasFocus()||gn(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden" +}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function hn(e){e.state.focused||(e.display.input.focus(),mn(e))}function pn(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,gn(e))}),100)}function mn(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(O(e,"focus",e,t),e.state.focused=!0, +s(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),so&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),dn(e))}function gn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(O(e,"blur",e,t),e.state.focused=!1,Mo(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function vn(e){ +for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r.005||u<-.005)&&(Q(i.line,a),yn(i.line),i.rest))for(var f=0;fe.display.sizerWidth){ +var d=Math.ceil(s/Gt(e.display));d>e.display.maxLineLength&&(e.display.maxLineLength=d,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function yn(e){if(e.widgets)for(var t=0;t=a&&(o=ee(t,Ke(X(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function kn(e,t){var n=e.display,r=qt(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=kt(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+gt(n),l=t.tops-r +;if(t.topi+o){var u=Math.min(t.top,(c?s:t.bottom)-o);u!=i&&(a.scrollTop=u)}var f=e.options.fixedGutter?0:n.gutters.offsetWidth,d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-f,h=bt(e)-n.gutters.offsetWidth,p=t.right-t.left>h;return p&&(t.right=t.left+h),t.left<10?a.scrollLeft=0:t.lefth+d-3&&(a.scrollLeft=t.right+(p?0:10)-h),a}function wn(e,t){null!=t&&(Sn(e), +e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Cn(e){Sn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function xn(e,t,n){null==t&&null==n||Sn(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Sn(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Mn(e,Dt(e,t.from),Dt(e,t.to),t.margin))}function Mn(e,t,n,r){var i=kn(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r, +right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});xn(e,i.scrollLeft,i.scrollTop)}function Ln(e,t){Math.abs(e.doc.scrollTop-t)<2||(to||Gn(e,{top:t}),Tn(e,t,!0),to&&Gn(e),_n(e,100))}function Tn(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function An(e,t,n,r){ +t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,Jn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function On(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+gt(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth, +clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+yt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function Nn(e,t){t||(t=On(e));var n=e.display.barWidth,r=e.display.barHeight;En(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&vn(e),En(e,On(e)),n=e.display.barWidth,r=e.display.barHeight}function En(e,t){ +var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="", +r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function Pn(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Mo(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new da[e.options.scrollbarStyle]((function(t){ +e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),jo(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?An(e,t):Ln(e,t)}),e),e.display.scrollbars.addClass&&s(e.display.wrapper,e.display.scrollbars.addClass)}function In(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null, +cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++ha},t=e.curOp,sa?sa.ops.push(t):t.ownsGroup=sa={ops:[t],delayedCallbacks:[]}}function Rn(e){var t=e.curOp;t&&function(e){var t=e.ownsGroup;if(t)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new pa(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Fn(e){e.updatedDisplay=e.mustUpdate&&$n(e.cm,e.update)}function Hn(e){var t=e.cm,n=t.display;e.updatedDisplay&&vn(t),e.barMeasure=On(t), +n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ct(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+yt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-bt(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Dn(e){var t=e.cm +;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!po){var a=r("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-mt(e.display))+"px;\n height: "+(t.bottom-t.top+yt(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(o),e.display.lineSpace.removeChild(a)}} +}(t,function(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?re(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?re(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=Ht(e,t),l=n&&n!=t?Ht(e,n):s,c=kn(e,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),u=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=c.scrollTop&&(Ln(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)), +null!=c.scrollLeft&&(An(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(a=!0)),!a)break}return i}(t,ue(i,e.scrollToPos.from),ue(i,e.scrollToPos.to),e.scrollToPos.margin));var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var s=0;s=e.display.viewTo)){var n=+new Date+e.options.workTime,r=pe(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?$(t.mode,r.state):null,l=de(e,o,r,!0);s&&(r.state=s),o.styles=l.styles;var c=o.styleClasses,u=l.classes +;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var f=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),d=0;!f&&dn)return _n(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line), +i.length&&zn(e,(function(){for(var t=0;t=r.viewFrom&&n.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==an(e))return!1;Qn(e)&&(rn(e),n.dims=Xt(e));var s=i.first+i.size,l=Math.max(n.visible.from-e.options.viewportMargin,i.first),c=Math.min(s,n.visible.to+e.options.viewportMargin) +;r.viewFromc&&r.viewTo-c<20&&(c=Math.min(s,r.viewTo)),na&&(l=He(e.doc,l),c=De(e.doc,c));var u=l!=r.viewFrom||c!=r.viewTo||r.lastWrapHeight!=n.wrapperHeight||r.lastWrapWidth!=n.wrapperWidth;(function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Ze(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Ze(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,en(e,n)))),r.viewTo=n})(e,l,c),r.viewOffset=Ke(X(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var f=an(e);if(!u&&0==f&&!n.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var h=function(e){if(e.hasFocus())return null;var t=a();if(!t||!o(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection() +;r.anchorNode&&r.extend&&o(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return f>4&&(r.lineDiv.style.display="none"),function(e,n,r){function i(t){var n=t.nextSibling;return so&&yo&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var o=e.display,a=e.options.lineNumbers,s=o.lineDiv,l=s.firstChild,c=o.view,u=o.viewFrom,f=0;f-1&&(p=!1),nt(e,h,u,r)),p&&(t(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(ne(e.options,u)))),l=h.node.nextSibling}else{var m=ct(e,h,u,r);s.insertBefore(m,l)}u+=h.size}for(;l;)l=i(l)}(e,r.updateLineNumbers,n.dims),f>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(e){ +if(e&&e.activeElt&&e.activeElt!=a()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&o(document.body,e.anchorNode)&&o(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(h),t(r.cursorDiv),t(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,u&&(r.lastWrapHeight=n.wrapperHeight, +r.lastWrapWidth=n.wrapperWidth,_n(e,400)),r.updateLineNumbers=null,!0}function qn(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=bt(e))r&&(t.visible=bn(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+gt(e.display)-kt(e),n.top)}),t.visible=bn(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!$n(e,t))break;vn(e);var i=On(e);sn(e),Nn(e,i),Yn(e,i),t.force=!1}t.signal(e,"update",e), +e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Gn(e,t){var n=new pa(e,t);if($n(e,n)){vn(e),qn(e,n);var r=On(e);sn(e),Nn(e,r),Yn(e,r),n.finish()}}function Xn(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Yn(e,t){e.display.sizer.style.minHeight=t.docHeight+"px", +e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+yt(e)+"px"}function Jn(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=Yt(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;aa.clientWidth,l=a.scrollHeight>a.clientHeight;if(r&&s||i&&l){if(i&&yo&&so)e:for(var c=t.target,u=o.view;c!=a;c=c.parentNode)for(var f=0;f0:l>=0){ +var c=le(s.from(),a.from()),u=se(s.to(),a.to()),f=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new ya(f?u:c,f?c:u))}}return new va(t,n)}function sr(e,t){return new va([new ya(e,t||e)],0)}function lr(e){return e.text?re(e.from.line+e.text.length-1,m(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function cr(e,t){if(ie(e,t.from)<0)return e;if(ie(e,t.to)<=0)return lr(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch +;return e.line==t.to.line&&(r+=lr(t).ch-t.to.ch),re(n,r)}function ur(e,t){for(var n=[],r=0;r1&&e.remove(s.line+1,p-1),e.insert(s.line+1,y)}et(e,"change",e,t)}function gr(e,t,n){!function e(r,i,o){if(r.linked)for(var a=0;as-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(wr(e.done), +m(e.done)):e.done.length&&!m(e.done).ranges?m(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),m(e.done)):void 0}(i,i.lastOp==r)))a=m(o.changes),0==ie(t.from,t.to)&&0==ie(t.from,a.to)?a.to=lr(t):o.changes.push(kr(e,t));else{var l=m(i.done);for(l&&l.ranges||xr(e.sel,i.done),o={changes:[kr(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration, +i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||O(e,"historyAdded")}function xr(e,t){var n=m(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Sr(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Mr(e){if(!e)return null;for(var t,n=0;n-1&&(m(s)[f]=c[f],delete c[f])}}}return r}function Ar(e,t,n,r){if(r){var i=e.anchor;if(n){var o=ie(t,i)<0;o!=ie(n,i)<0?(i=t,t=n):o!=ie(t,n)<0&&(t=n)}return new ya(i,t)}return new ya(n||t,t)}function Or(e,t,n,r,i){ +null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Rr(e,new va([Ar(e.sel.primary(),t,n,i)],0),r)}function Nr(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:s.to>t.ch))){if(i&&(O(l,"beforeCursorEnter"),l.explicitlyCleared)){ +if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var f=l.find(r<0?1:-1),d=void 0;if((r<0?u:c)&&(f=Kr(e,f,-r,f&&f.line==t.line?o:null)),f&&f.line==t.line&&(d=ie(f,n))&&(r<0?d<0:d>0))return Wr(e,f,t,r,i)}var h=l.find(r<0?-1:1);return(r<0?c:u)&&(h=Kr(e,h,r,h.line==t.line?o:null)),h?Wr(e,h,t,r,i):null}}return t}function zr(e,t,n,r,i){var o=r||1;return Wr(e,t,n,o,i)||!i&&Wr(e,t,n,o,!0)||Wr(e,t,n,-o,i)||!i&&Wr(e,t,n,-o,!0)||(e.cantEdit=!0,re(e.first,0))}function Kr(e,t,n,r){ +return n<0&&0==t.ch?t.line>e.first?ue(e,re(t.line-1)):null:n>0&&t.ch==(r||X(e,t.line)).text.length?t.line0)){var u=[l,1],f=ie(c.from,s.from),h=ie(c.to,s.to);(f<0||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:s.from}),(h>0||!a.inclusiveRight&&!h)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-3}}return i}(e,t.from,t.to) +;if(r)for(var i=r.length-1;i>=0;--i)Vr(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Vr(e,t)}}function Vr(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ie(t.from,t.to)){var n=ur(e,t);Cr(e,t,n,e.cm?e.cm.curOp.id:NaN),Gr(e,t,n,Se(e,t));var r=[];gr(e,(function(e,n){n||-1!=d(r,e.history)||(Qr(e.history,t),r.push(e.history)),Gr(e,t,null,Se(e,t))}))}}function $r(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){ +for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,c=0;c=0;--p){var g=h(p);if(g)return g.v}}}}function qr(e,t){if(0!=t&&(e.first+=t, +e.sel=new va(g(e.sel.ranges,(function(e){return new ya(re(e.anchor.line+t,e.anchor.ch),re(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){tn(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:re(o,X(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Y(e,t.from,t.to),n||(n=ur(e,t)),e.cm?function(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=Z(Fe(X(r,o.line))),r.iter(l,a.line+1,(function(e){if(e==i.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&E(e),mr(r,t,n,Jt(e)), +e.options.lineWrapping||(r.iter(l,o.line+t.text.length,(function(e){var t=je(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=X(e,r).stateAfter;if(i&&(!(i instanceof Qo)||r+i.lookAhead0||0==s&&!1!==a.clearWhenEmpty)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=i("span",[a.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){ +if(Be(e,t.line,t,n,a)||t.line!=n.line&&Be(e,n.line,t,n,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");na=!0}a.addToHistory&&Cr(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l,c=t.line,f=e.cm;if(e.iter(c,n.line+1,(function(e){f&&a.collapsed&&!f.options.lineWrapping&&Fe(e)==f.display.maxLine&&(l=!0),a.collapsed&&c!=t.line&&Q(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e) +}(e,new we(a,c==t.line?t.ch:null,c==n.line?n.ch:null)),++c})),a.collapsed&&e.iter(t.line,n.line+1,(function(t){We(e,t)&&Q(t,0)})),a.clearOnEnter&&jo(a,"beforeCursorEnter",(function(){return a.clear()})),a.readOnly&&(ta=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++ka,a.atomic=!0),f){if(l&&(f.curOp.updateMaxLine=!0), +a.collapsed)tn(f,t.line,n.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var d=t.line;d<=n.line;d++)nn(f,d,"text");a.atomic&&Hr(f.doc),et(f,"markerAdded",f,a)}return a}function ii(e){return e.findMarks(re(e.first,0),e.clipPos(re(e.lastLine())),(function(e){return e.parent}))}function oi(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];gr(n.primary.doc,(function(e){return r.push(e)}));for(var i=0;i-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{ +var u=e.dataTransfer.getData("Text");if(u){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),Br(t.doc,sr(n,n)),f)for(var h=0;h=0;t--)Xr(e.doc,"",r[t].from,r[t].to,"+delete");Cn(e)}))}function yi(e,t,n){var r=x(e.text,t+n,n);return r<0||r>e.text.length?null:r} +function bi(e,t,n){var r=yi(e,t.ch,n);return null==r?null:new re(t.line,r,n<0?"after":"before")}function ki(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=L(n,t.doc.direction);if(o){var a,s=i<0?m(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=St(t,n);a=i<0?n.text.length-1:0;var u=Mt(t,c,a).top;a=S((function(e){return Mt(t,c,e).top==u}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=yi(n,a,1))}else a=i<0?s.to:s.from;return new re(r,a,l)}} +return new re(r,i<0?n.text.length:0,i<0?"before":"after")}function wi(e,t){var n=X(e.doc,t),r=Fe(n);return r!=n&&(t=Z(r)),ki(!0,e,r,t,1)}function Ci(e,t){var n=wi(e,t.line),r=X(e.doc,n.line),i=L(r,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(n.ch,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return re(n.line,a?0:o,n.sticky)}return n}function xi(e,t,n){if("string"==typeof t&&!(t=Ra[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{ +e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Po}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function Si(e,t,n,r){var i=e.state.keySeq;if(i){if(hi(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ba.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),Mi(e,i+" "+t,n,r))return!0}return Mi(e,t,n,r)}function Mi(e,t,n,r){var i=function(e,t,n){for(var r=0;r-1&&(ie((i=s.ranges[i]).from(),t)<0||t.xRel>0)&&(ie(i.to(),t)>0||t.xRel<0)?function(e,t,n,r){ +var i=e.display,o=!1,a=Kn(e,(function(t){so&&(i.scroller.draggable=!1),e.state.draggingText=!1,A(i.wrapper.ownerDocument,"mouseup",a),A(i.wrapper.ownerDocument,"mousemove",s),A(i.scroller,"dragstart",l),A(i.scroller,"drop",a),o||(R(t),r.addNew||Or(e.doc,n,null,null,r.extend),so&&!fo||oo&&9==ao?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),s=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10 +},l=function(){return o=!0};so&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),jo(i.wrapper.ownerDocument,"mouseup",a),jo(i.wrapper.ownerDocument,"mousemove",s),jo(i.scroller,"dragstart",l),jo(i.scroller,"drop",a),pn(e),setTimeout((function(){return i.input.focus()}),20)}(e,r,t,o):function(e,t,n,r){function i(t){var o=++y,p=Zt(e,t,!0,"rectangle"==r.unit);if(p)if(0!=ie(p,g)){e.curOp.focus=a(),function(t){if(0!=ie(g,t))if(g=t, +"rectangle"==r.unit){for(var i=[],o=e.options.tabSize,a=f(X(l,n.line).text,n.ch,o),s=f(X(l,t.line).text,t.ch,o),p=Math.min(a,s),m=Math.max(a,s),v=Math.min(n.line,t.line),y=Math.min(e.lastLine(),Math.max(n.line,t.line));v<=y;v++){var b=X(l,v).text,k=h(b,p,o);p==m?i.push(new ya(re(v,k),re(v,k))):b.length>k&&i.push(new ya(re(v,k),re(v,h(b,m,o))))}i.length||i.push(new ya(n,n)),Rr(l,ar(e,d.ranges.slice(0,u).concat(i),u),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{ +var w,C=c,x=Ei(e,t,r.unit),S=C.anchor;ie(x.anchor,S)>0?(w=x.head,S=le(C.from(),x.anchor)):(w=x.anchor,S=se(C.to(),x.head));var T=d.ranges.slice(0);T[u]=function(e,t){var n=t.anchor,r=t.head,i=X(e.doc,n.line);if(0==ie(n,r)&&n.sticky==r.sticky)return t;var o=L(i);if(!o)return t;var a=M(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{ +var u=M(o,r.ch,r.sticky),f=u-a||(r.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?f<0:f>0}var d=o[c+(l?-1:0)],h=l==(1==d.level),p=h?d.from:d.to,m=h?"after":"before";return n.ch==p&&n.sticky==m?t:new ya(new re(n.line,p,m),r)}(e,new ya(ue(l,S),w)),Rr(l,ar(e,T,u),Ro)}}(p);var m=bn(s,l);(p.line>=m.to||p.linev.bottom?20:0;b&&setTimeout(Kn(e,(function(){y==o&&(s.scroller.scrollTop+=b,i(t))})),50)}} +function o(t){e.state.selectingText=!1,y=1/0,t&&(R(t),s.input.focus()),A(s.wrapper.ownerDocument,"mousemove",b),A(s.wrapper.ownerDocument,"mouseup",k),l.history.lastSelOrigin=null}var s=e.display,l=e.doc;R(t);var c,u,d=l.sel,p=d.ranges;if(r.addNew&&!r.extend?(u=l.sel.contains(n),c=u>-1?p[u]:new ya(n,n)):(c=l.sel.primary(),u=l.sel.primIndex),"rectangle"==r.unit)r.addNew||(c=new ya(n,n)),n=Zt(e,t,!0,!0),u=-1;else{var m=Ei(e,n,r.unit);c=r.extend?Ar(c,m.anchor,m.head,r.extend):m} +r.addNew?-1==u?(u=p.length,Rr(l,ar(e,p.concat([c]),u),{scroll:!1,origin:"*mouse"})):p.length>1&&p[u].empty()&&"char"==r.unit&&!r.extend?(Rr(l,ar(e,p.slice(0,u).concat(p.slice(u+1)),0),{scroll:!1,origin:"*mouse"}),d=l.sel):Er(l,u,c,Ro):(u=0,Rr(l,new va([c],0),Ro),d=l.sel);var g=n,v=s.wrapper.getBoundingClientRect(),y=0,b=Kn(e,(function(e){0!==e.buttons&&W(e)?i(e):o(e)})),k=Kn(e,o);e.state.selectingText=k,jo(s.wrapper.ownerDocument,"mousemove",b),jo(s.wrapper.ownerDocument,"mouseup",k)}(e,r,t,o) +}(t,r,o,e):D(e)==n.scroller&&R(e):2==i?(r&&Or(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(So?t.display.input.onContextMenu(e):pn(t)))}}function Ei(e,t,n){if("char"==n)return new ya(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new ya(re(t.line,0),ue(e.doc,re(t.line+1,0)));var r=n(e,t);return new ya(r.from,r.to)}function Pi(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1} +if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&R(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!P(e,n))return F(t);o-=s.top-a.viewOffset;for(var l=0;l=i)return O(e,n,e,ee(e.doc,o),e.display.gutterSpecs[l].className,t),F(t)}}function Ii(e,t){return Pi(e,t,"gutterClick",!0)}function Ri(e,t){pt(e.display,t)||function(e,t){ +return!!P(e,"gutterContextMenu")&&Pi(e,t,"gutterContextMenu",!1)}(e,t)||N(e,t,"contextmenu")||So||e.display.input.onContextMenu(t)}function Bi(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Nt(e)}function Fi(e,t,n){if(!t!=!(n&&n!=Da)){var r=e.display.dragFunctions,i=t?jo:A;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over), +i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Hi(e){e.options.lineWrapping?(s(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Mo(e.display.wrapper,"CodeMirror-wrap"),Ue(e)),Qt(e),tn(e),Nt(e),setTimeout((function(){return Nn(e)}),100)}function Di(e,t){var i=this;if(!(this instanceof Di))return new Di(e,t);this.options=t=t?u(t):{},this.usercommands={},u(Wa,t,!1);var o=t.value +;"string"==typeof o?o=new Sa(o,t.mode,null,t.lineSeparator,t.direction):t.mode&&(o.modeOption=t.mode),this.doc=o;var a=new Di.inputStyles[t.inputStyle](this),s=this.display=new nr(e,o,a,t);for(var l in s.wrapper.CodeMirror=this,Bi(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Pn(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1, +highlight:new To,keySeq:null,specialChars:null},t.autofocus&&!vo&&s.input.focus(),oo&&ao<11&&setTimeout((function(){return i.display.input.reset(!0)}),20),function(e){function t(){o.activeTouch&&(a=setTimeout((function(){return o.activeTouch=null}),1e3),(s=o.activeTouch).end=+new Date)}function i(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}var o=e.display;jo(o.scroller,"mousedown",Kn(e,Ni)),jo(o.scroller,"dblclick",oo&&ao<11?Kn(e,(function(t){if(!N(e,t)){ +var n=Zt(e,t);if(n&&!Ii(e,t)&&!pt(e.display,t)){R(t);var r=e.findWordAt(n);Or(e.doc,r.anchor,r.head)}}})):function(t){return N(e,t)||R(t)}),jo(o.scroller,"contextmenu",(function(t){return Ri(e,t)})),jo(o.input.getField(),"contextmenu",(function(t){o.scroller.contains(t.target)||Ri(e,t)}));var a,s={end:0};jo(o.scroller,"touchstart",(function(t){if(!N(e,t)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(t)&&!Ii(e,t)){o.input.ensurePolled(), +clearTimeout(a);var n=+new Date;o.activeTouch={start:n,moved:!1,prev:n-s.end<=300?s:null},1==t.touches.length&&(o.activeTouch.left=t.touches[0].pageX,o.activeTouch.top=t.touches[0].pageY)}})),jo(o.scroller,"touchmove",(function(){o.activeTouch&&(o.activeTouch.moved=!0)})),jo(o.scroller,"touchend",(function(n){var r=o.activeTouch;if(r&&!pt(o,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var a,s=e.coordsChar(o.activeTouch,"page") +;a=!r.prev||i(r,r.prev)?new ya(s,s):!r.prev.prev||i(r,r.prev.prev)?e.findWordAt(s):new ya(re(s.line,0),ue(e.doc,re(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),R(n)}t()})),jo(o.scroller,"touchcancel",t),jo(o.scroller,"scroll",(function(){o.scroller.clientHeight&&(Ln(e,o.scroller.scrollTop),An(e,o.scroller.scrollLeft,!0),O(e,"scroll",e))})),jo(o.scroller,"mousewheel",(function(t){return or(e,t)})),jo(o.scroller,"DOMMouseScroll",(function(t){return or(e,t)})), +jo(o.wrapper,"scroll",(function(){return o.wrapper.scrollTop=o.wrapper.scrollLeft=0})),o.dragFunctions={enter:function(t){N(e,t)||H(t)},over:function(t){N(e,t)||(function(e,t){var i=Zt(e,t);if(i){var o=document.createDocumentFragment();cn(e,i,o),e.display.dragCursor||(e.display.dragCursor=r("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),n(e.display.dragCursor,o)}}(e,t),H(t))},start:function(t){ +return function(e,t){if(oo&&(!e.state.draggingText||+new Date-Ma<100))H(t);else if(!N(e,t)&&!pt(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!fo)){var n=r("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",uo&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0), +uo&&n.parentNode.removeChild(n)}}(e,t)},drop:Kn(e,ai),leave:function(t){N(e,t)||si(e)}};var l=o.input.getField();jo(l,"keyup",(function(t){return Ai.call(e,t)})),jo(l,"keydown",Kn(e,Ti)),jo(l,"keypress",Kn(e,Oi)),jo(l,"focus",(function(t){return mn(e,t)})),jo(l,"blur",(function(t){return gn(e,t)}))}(this),function(){var e;La||(jo(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,li(ci)}),100))})),jo(window,"blur",(function(){return li(gn)})),La=!0)}(),In(this), +this.curOp.forceUpdate=!0,vr(this,o),t.autofocus&&!vo||this.hasFocus()?setTimeout((function(){i.hasFocus()&&!i.state.focused&&mn(i)}),20):gn(this),za)za.hasOwnProperty(l)&&za[l](this,t[l],Da);Qn(this),t.finishInit&&t.finishInit(this);for(var c=0;c150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?f(X(o,t-1).text,null,a):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var d="",h=0 +;if(e.options.indentWithTabs)for(var m=Math.floor(c/a);m;--m)h+=a,d+="\t";if(ha,l=_o(t),c=null +;if(s&&r.ranges.length>1)if(ja&&ja.text.join("\n")==t){if(r.ranges.length%ja.text.length==0){c=[];for(var u=0;u=0;d--){var h=r.ranges[d],p=h.from(),v=h.to() +;h.empty()&&(n&&n>0?p=re(p.line,p.ch-n):e.state.overwrite&&!s?v=re(v.line,Math.min(X(o,v.line).text.length,v.ch+m(l).length)):s&&ja&&ja.lineWise&&ja.text.join("\n")==l.join("\n")&&(p=v=re(p.line,0)));var y={from:p,to:v,text:c?c[d%c.length]:l,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};_r(e.doc,y),et(e,"inputRead",e,y)}t&&!s&&Ui(e,t),Cn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=f),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ji(e,t){ +var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||zn(t,(function(){return Ki(t,n,0,null,"paste")})),!0}function Ui(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){ +for(var s=0;s-1){a=Wi(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(X(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Wi(e,i.head.line,"smart"));a&&et(e,"electricInput",e,i.head.line)}}}function _i(e){for(var t=[],n=[],r=0;r0?0:-1));a=isNaN(u)?null:new re(t.line,Math.max(0,Math.min(l.text.length,t.ch+n*(u>=55296&&u<56320?2:1))),-n)}else a=i?function(e,t,n,r){var i=L(t,e.doc.direction);if(!i)return bi(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=M(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&d>=u.begin)){var h=f?"before":"after";return new re(n.line,d,h)}}var p=function(e,t,r){for(var o=function(e,t){return t?new re(n.line,l(e,1),"before"):new re(n.line,e,"after")};e>=0&&e0==(1!=a.level),c=s?r.begin:l(r.end,-1);if(a.from<=c&&c0?u.end:l(u.begin,-1);return null==g||r>0&&g==t.text.length||!(m=p(r>0?0:i.length-1,r,c(g)))?null:m}(e.cm,l,t,n):bi(l,t,n);if(null==a){if(o||(s=t.line+c)=e.first+e.size||(t=new re(s,t.ch,t.sticky),!(l=X(e,s))))return!1;t=ki(i,e.cm,l,t.line,c)}else t=a;return!0} +var a=t,s=n,l=X(e,t.line),c=i&&"rtl"==e.direction?-n:n;if("char"==r||"codepoint"==r)o();else if("column"==r)o(!0);else if("word"==r||"group"==r)for(var u=null,f="group"==r,d=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(n<0)||o(!h);h=!1){var p=l.text.charAt(t.ch)||"\n",m=k(p,d)?"w":f&&"\n"==p?"n":!f||/\s/.test(p)?null:"p";if(!f||h||m||(m="s"),u&&u!=m){n<0&&(n=1,o(),t.sticky="after");break}if(m&&(u=m),n>0&&!o(!h))break}var g=zr(e,t,a,s,!0);return oe(a,g)&&(g.hitSide=!0),g}function Gi(e,t,n,r){ +var i,o,a=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*qt(e.display),3);i=(n>0?t.bottom:t.top)+n*c}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=zt(e,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}function Xi(e,t){var n=xt(e,t.line);if(!n||n.hidden)return null;var r=X(e.doc,t.line),i=wt(n,r,t.line),o=L(r,e.doc.direction),a="left" +;o&&(a=M(o,t.ch)%2?"right":"left");var s=Lt(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function Yi(e,t){return t&&(e.bad=!0),e}function Ji(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return Yi(e.clipPos(re(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i=15&&(uo=!1,so=!0);var Co,xo=yo&&(lo||uo&&(null==wo||wo<12.11)),So=to||oo&&ao>=9,Mo=function(t,n){var r=t.className,i=e(n).exec(r);if(i){var o=r.slice(i.index+i[0].length);t.className=r.slice(0,i.index)+(o?i[1]+o:"")}};Co=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0), +r.moveEnd("character",n),r.moveStart("character",t),r};var Lo=function(e){e.select()};mo?Lo=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:oo&&(Lo=function(e){try{e.select()}catch(e){}});var To=function(){this.id=null,this.f=null,this.time=0,this.handler=c(this.onTimeout,this)};To.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},To.prototype.set=function(e,t){this.f=t;var n=+new Date+e +;(!this.id||n=this.string.length},Jo.prototype.sol=function(){ +return this.pos==this.lineStart},Jo.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Jo.prototype.next=function(){if(this.post},Jo.prototype.eatSpace=function(){ +for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Jo.prototype.skipToEnd=function(){this.pos=this.string.length},Jo.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Jo.prototype.backUp=function(e){this.pos-=e},Jo.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e} +;if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Jo.prototype.current=function(){return this.string.slice(this.start,this.pos)},Jo.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Jo.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Jo.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var Qo=function(e,t){this.state=e,this.lookAhead=t +},Zo=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Zo.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Zo.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""), +size:this.baseTokens[this.baseTokenPos]-e}},Zo.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Zo.fromSaved=function(e,t,n){return t instanceof Qo?new Zo(e,$(e.mode,t.state),n,t.lookAhead):new Zo(e,$(e.mode,t),n)},Zo.prototype.save=function(e){var t=!1!==e?$(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Qo(t,this.maxLookAhead):t};var ea=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null, +this.state=n},ta=!1,na=!1,ra=function(e,t,n){this.text=e,Te(this,t),this.height=n?n(this):1};ra.prototype.lineNo=function(){return Z(this)},I(ra);var ia,oa={},aa={},sa=null,la=null,ca={left:0,right:0,top:0,bottom:0},ua=function(e,t,n){this.cm=n;var i=this.vert=r("div",[r("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=r("div",[r("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=o.tabIndex=-1,e(i),e(o),jo(i,"scroll",(function(){ +i.clientHeight&&t(i.scrollTop,"vertical")})),jo(o,"scroll",(function(){o.clientWidth&&t(o.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,oo&&ao<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ua.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0) +;this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0" +;return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},ua.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ua.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")}, +ua.prototype.zeroWidthHack=function(){var e=yo&&!ho?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new To,this.disableVert=new To},ua.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,(function r(){var i=e.getBoundingClientRect() +;("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}))},ua.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var fa=function(){};fa.prototype.update=function(){return{bottom:0,right:0}},fa.prototype.setScrollLeft=function(){},fa.prototype.setScrollTop=function(){},fa.prototype.clear=function(){};var da={native:ua,null:fa +},ha=0,pa=function(e,t,n){var r=e.display;this.viewport=t,this.visible=bn(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=bt(e),this.force=n,this.dims=Xt(e),this.events=[]};pa.prototype.signal=function(e,t){P(e,t)&&this.events.push(arguments)},pa.prototype.finish=function(){for(var e=0;e=0&&ie(e,r.to())<=0)return n}return-1};var ya=Di.Range=function(e,t){this.anchor=e,this.head=t} +;ya.prototype.from=function(){return le(this.anchor,this.head)},ya.prototype.to=function(){return se(this.anchor,this.head)},ya.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},ei.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n1||!(this.children[0]instanceof ei))){var s=[];this.collapse(s),this.children=[new ei(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&tn(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Hr(e.doc)), +e&&et(e,"markerCleared",e,this,r,i),t&&Rn(e),this.parent&&this.parent.clear()}},wa.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i=0;l--)_r(this,r[l]);s?Ir(this,s):this.cm&&Cn(this.cm)})),undo:Un((function(){$r(this,"undo")})),redo:Un((function(){$r(this,"redo")})), +undoSelection:Un((function(){$r(this,"undo",!0)})),redoSelection:Un((function(){$r(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)} +return t},findMarks:function(e,t,n){e=ue(this,e),t=ue(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n})),ue(this,re(n,t))},indexFromPos:function(e){var t=(e=ue(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to0)i=new re(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),re(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=X(e.doc,i.line-1).text;a&&(i=new re(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),re(i.line-1,a.length-1),i,"+transpose"))}n.push(new ya(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return zn(e,(function(){ +for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;re&&0==ie(t,this.pos)&&n==this.button};var Da={toString:function(){return"CodeMirror.Init"}},Wa={},za={};Di.defaults=Wa,Di.optionHandlers=za;var Ka=[];Di.defineInitHook=function(e){return Ka.push(e)};var ja=null,Ua=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new To,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ua.prototype.init=function(e){function t(e){ +for(var t=e.target;t;t=t.parentNode){if(t==a)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function n(e){if(t(e)&&!N(o,e)){if(o.somethingSelected())zi({lineWise:!1,text:o.getSelections()}),"cut"==e.type&&o.replaceSelection("",null,"cut");else{if(!o.options.lineWiseCopyCut)return;var n=_i(o);zi({lineWise:!0,text:n.text}),"cut"==e.type&&o.operation((function(){o.setSelections(n.ranges,0,Io),o.replaceSelection("",null,"cut")}))}if(e.clipboardData){ +e.clipboardData.clearData();var r=ja.text.join("\n");if(e.clipboardData.setData("Text",r),e.clipboardData.getData("Text")==r)return void e.preventDefault()}var s=$i(),l=s.firstChild;o.display.lineSpace.insertBefore(s,o.display.lineSpace.firstChild),l.value=ja.text.join("\n");var c=document.activeElement;Lo(l),setTimeout((function(){o.display.lineSpace.removeChild(s),c.focus(),c==a&&i.showPrimarySelection()}),50)}}var r=this,i=this,o=i.cm,a=i.div=e.lineDiv +;Vi(a,o.options.spellcheck,o.options.autocorrect,o.options.autocapitalize),jo(a,"paste",(function(e){!t(e)||N(o,e)||ji(e,o)||ao<=11&&setTimeout(Kn(o,(function(){return r.updateFromDOM()})),20)})),jo(a,"compositionstart",(function(e){r.composing={data:e.data,done:!1}})),jo(a,"compositionupdate",(function(e){r.composing||(r.composing={data:e.data,done:!1})})),jo(a,"compositionend",(function(e){r.composing&&(e.data!=r.composing.data&&r.readFromDOMSoon(),r.composing.done=!0)})), +jo(a,"touchstart",(function(){return i.forceCompositionEnd()})),jo(a,"input",(function(){r.composing||r.readFromDOMSoon()})),jo(a,"copy",n),jo(a,"cut",n)},Ua.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ua.prototype.prepareSelection=function(){var e=ln(this.cm,!1);return e.focus=document.activeElement==this.div,e},Ua.prototype.showSelection=function(e,t){ +e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ua.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ua.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line=t.display.viewFrom&&Xi(t,r)||{node:s[0].measure.map[2],offset:0},c=i.liner.firstLine()&&(a=re(a.line-1,X(r.doc,a.line-1).length)),s.ch==X(r.doc,s.line).text.length&&s.linei.viewTo-1)return!1 +;a.line==i.viewFrom||0==(e=en(r,a.line))?(t=Z(i.view[0].line),n=i.view[0].node):(t=Z(i.view[e].line),n=i.view[e-1].node.nextSibling);var l,c,u=en(r,s.line);if(u==i.view.length-1?(l=i.viewTo-1,c=i.lineDiv.lastChild):(l=Z(i.view[u+1].line)-1,c=i.view[u+1].node.previousSibling),!n)return!1;for(var f=r.doc.splitLines(function(e,t,n,r,i){function o(){c&&(l+=u,f&&(l+=u),c=f=!1)}function a(e){e&&(o(),l+=e)}function s(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void a(n) +;var l,d=t.getAttribute("cm-marker");if(d){var h=e.findMarks(re(r,0),re(i+1,0),(g=+d,function(e){return e.id==g}));return void(h.length&&(l=h[0].find(0))&&a(Y(e.doc,l.from,l.to).join(u)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;p&&o();for(var m=0;m1&&d.length>1;)if(m(f)==m(d))f.pop(),d.pop(),l--;else{if(f[0]!=d[0])break;f.shift(),d.shift(),t++}for(var h=0,p=0,g=f[0],v=d[0],y=Math.min(g.length,v.length);ha.ch&&b.charCodeAt(b.length-p-1)==k.charCodeAt(k.length-p-1);)h--,p++;f[f.length-1]=b.slice(0,b.length-p).replace(/^\u200b+/,""),f[0]=f[0].slice(h).replace(/\u200b+$/,"");var C=re(t,h),x=re(l,d.length?m(d).length-p:0);return f.length>1||f[0]||ie(C,x)?(Xr(r.doc,f,C,x,"+input"),!0):void 0}, +Ua.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ua.prototype.reset=function(){this.forceCompositionEnd()},Ua.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ua.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null} +e.updateFromDOM()}),80))},Ua.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||zn(this.cm,(function(){return tn(e.cm)}))},Ua.prototype.setUneditable=function(e){e.contentEditable="false"},Ua.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Kn(this.cm,Ki)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ua.prototype.readOnlyChanged=function(e){ +this.div.contentEditable=String("nocursor"!=e)},Ua.prototype.onContextMenu=function(){},Ua.prototype.resetPosition=function(){},Ua.prototype.needsContentAttribute=!0;var _a=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new To,this.hasSelection=!1,this.composing=null};_a.prototype.init=function(e){function t(e){if(!N(i,e)){if(i.somethingSelected())zi({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=_i(i);zi({lineWise:!0,text:t.text +}),"cut"==e.type?i.setSelections(t.ranges,null,Io):(r.prevInput="",o.value=t.text.join("\n"),Lo(o))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}var n=this,r=this,i=this.cm;this.createField(e);var o=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),mo&&(o.style.width="0px"),jo(o,"input",(function(){oo&&ao>=9&&n.hasSelection&&(n.hasSelection=null),r.poll()})),jo(o,"paste",(function(e){N(i,e)||ji(e,i)||(i.state.pasteIncoming=+new Date,r.fastPoll())})),jo(o,"cut",t), +jo(o,"copy",t),jo(e.scroller,"paste",(function(t){if(!pt(e,t)&&!N(i,t)){if(!o.dispatchEvent)return i.state.pasteIncoming=+new Date,void r.focus();var n=new Event("paste");n.clipboardData=t.clipboardData,o.dispatchEvent(n)}})),jo(e.lineSpace,"selectstart",(function(t){pt(e,t)||R(t)})),jo(o,"compositionstart",(function(){var e=i.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}})), +jo(o,"compositionend",(function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)}))},_a.prototype.createField=function(){this.wrapper=$i(),this.textarea=this.wrapper.firstChild},_a.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},_a.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=ln(e);if(e.options.moveInputWithCursor){ +var i=Ht(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},_a.prototype.showSelection=function(e){var t=this.cm.display;n(t.cursorDiv,e.cursors),n(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")}, +_a.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&Lo(this.textarea),oo&&ao>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",oo&&ao>=9&&(this.hasSelection=null))}},_a.prototype.getField=function(){return this.textarea},_a.prototype.supportsTouch=function(){return!1},_a.prototype.focus=function(){ +if("nocursor"!=this.cm.options.readOnly&&(!vo||a()!=this.textarea))try{this.textarea.focus()}catch(e){}},_a.prototype.blur=function(){this.textarea.blur()},_a.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},_a.prototype.receivedFocus=function(){this.slowPoll()},_a.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},_a.prototype.fastPoll=function(){ +var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},_a.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Vo(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1 +;if(oo&&ao>=9&&this.hasSelection===i||yo&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,s=Math.min(r.length,i.length);a1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i, +e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},_a.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},_a.prototype.onKeyPress=function(){oo&&ao>=9&&(this.hasSelection=null),this.fastPoll()},_a.prototype.onContextMenu=function(e){function t(){if(null!=a.selectionStart){var e=i.somethingSelected(),t="​"+(e?a.value:"");a.value="⇚",a.value=t,r.prevInput=e?"":"​", +a.selectionStart=1,a.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function n(){if(r.contextMenuPending==n&&(r.contextMenuPending=!1,r.wrapper.style.cssText=f,a.style.cssText=u,oo&&ao<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=l),null!=a.selectionStart)){(!oo||oo&&ao<9)&&t();var e=0,s=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&"​"==r.prevInput?Kn(i,jr)(i):e++<10?o.detectingSelectAll=setTimeout(s,500):(o.selForContextMenu=null,o.input.reset())} +;o.detectingSelectAll=setTimeout(s,200)}}var r=this,i=r.cm,o=i.display,a=r.textarea;r.contextMenuPending&&r.contextMenuPending();var s=Zt(i,e),l=o.scroller.scrollTop;if(s&&!uo){i.options.resetSelectionOnContextMenu&&-1==i.doc.sel.contains(s)&&Kn(i,Rr)(i.doc,sr(s),Io);var c,u=a.style.cssText,f=r.wrapper.style.cssText,d=r.wrapper.offsetParent.getBoundingClientRect();if(r.wrapper.style.cssText="position: static", +a.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-d.top-5)+"px; left: "+(e.clientX-d.left-5)+"px;\n z-index: 1000; background: "+(oo?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",so&&(c=window.scrollY),o.input.focus(),so&&window.scrollTo(null,c),o.input.reset(),i.somethingSelected()||(a.value=r.prevInput=" "),r.contextMenuPending=n, +o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),oo&&ao>=9&&t(),So){H(e);var h=function(){A(window,"mouseup",h),setTimeout(n,20)};jo(window,"mouseup",h)}else setTimeout(n,50)}},_a.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},_a.prototype.setUneditable=function(){},_a.prototype.needsContentAttribute=!1,function(e){function t(t,r,i,o){e.defaults[t]=r,i&&(n[t]=o?function(e,t,n){n!=Da&&i(e,t,n)}:i)} +var n=e.optionHandlers;e.defineOption=t,e.Init=Da,t("value","",(function(e,t){return e.setValue(t)}),!0),t("mode",null,(function(e,t){e.doc.modeOption=t,dr(e)}),!0),t("indentUnit",2,dr,!0),t("indentWithTabs",!1),t("smartIndent",!0),t("tabSize",4,(function(e){hr(e),Nt(e),tn(e)}),!0),t("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(re(r,o))}r++})) +;for(var i=n.length-1;i>=0;i--)Xr(e.doc,t,n[i],re(n[i].line,n[i].ch+t.length))}})),t("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Da&&e.refresh()})),t("specialCharPlaceholder",qe,(function(e){return e.refresh()}),!0),t("electricChars",!0),t("inputStyle",vo?"contenteditable":"textarea",(function(){ +throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),t("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),t("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),t("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),t("rtlMoveVisually",!ko),t("wholeLineUpdateBefore",!0),t("theme","default",(function(e){Bi(e),tr(e)}),!0),t("keyMap","default",(function(e,t,n){var r=gi(t),i=n!=Da&&gi(n) +;i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),t("extraKeys",null),t("configureMouse",null),t("lineWrapping",!1,Hi,!0),t("gutters",[],(function(e,t){e.display.gutterSpecs=Zn(t,e.options.lineNumbers),tr(e)}),!0),t("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Yt(e.display)+"px":"0",e.refresh()}),!0),t("coverGutterNextToScrollbar",!1,(function(e){return Nn(e)}),!0),t("scrollbarStyle","native",(function(e){Pn(e),Nn(e), +e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),t("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=Zn(e.options.gutters,t),tr(e)}),!0),t("firstLineNumber",1,tr,!0),t("lineNumberFormatter",(function(e){return e}),tr,!0),t("showCursorWhenSelecting",!1,sn,!0),t("resetSelectionOnContextMenu",!0),t("lineWiseCopyCut",!0),t("pasteLinesPerSelection",!0),t("selectionsMayTouch",!1),t("readOnly",!1,(function(e,t){"nocursor"==t&&(gn(e), +e.display.input.blur()),e.display.input.readOnlyChanged(t)})),t("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),t("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),t("dragDrop",!0,Fi),t("allowDropFileTypes",null),t("cursorBlinkRate",530),t("cursorScrollMargin",0),t("cursorHeight",1,sn,!0),t("singleCursorHeightPerLine",!0,sn,!0),t("workTime",100),t("workDelay",100),t("flattenSpans",!0,hr,!0),t("addModeClass",!1,hr,!0), +t("pollInterval",100),t("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),t("historyEventDelay",1250),t("viewportMargin",10,(function(e){return e.refresh()}),!0),t("maxHighlightLength",1e4,hr,!0),t("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),t("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),t("autofocus",null),t("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),t("phrases",null)}(Di), +function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&Kn(this,t[e])(this,n,i),O(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](gi(e))},removeKeyMap:function(e){ +for(var t=this.state.keyMaps,n=0;nn&&(Wi(this,i.head.line,e,!0), +n=i.head.line,r==this.doc.sel.primIndex&&Cn(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&Er(this.doc,r,new ya(o,c[r].to()),Io)}}})),getTokenAt:function(e,t){return ye(this,e,t)},getLineTokens:function(e,t){return ye(this,re(e),t,!0)},getTokenTypeAt:function(e){e=ue(this.doc,e) +;var t,n=he(this,X(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]o&&(e=o,i=!0),r=X(this.doc,e)}else r=e;return Rt(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-Ke(r):0)},defaultTextHeight:function(){return qt(this.display)},defaultCharWidth:function(){return Gt(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o,a,s=this.display,l=(e=Ht(this,ue(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute", +t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),s.sizer.appendChild(t),"over"==r)l=e.top;else if("above"==r||"near"==r){var u=Math.max(s.wrapper.clientHeight,this.doc.height),f=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>u)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=u&&(l=e.bottom),c+t.offsetWidth>f&&(c=f-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="", +"right"==i?(c=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),n&&(null!=(a=kn(o=this,{left:c,top:l,right:c+t.offsetWidth,bottom:l+t.offsetHeight})).scrollTop&&Ln(o,a.scrollTop),null!=a.scrollLeft&&An(o,a.scrollLeft))},triggerOnKeyDown:jn(Ti),triggerOnKeyPress:jn(Oi),triggerOnKeyUp:Ai,triggerOnMouseDown:jn(Ni),setCommand:function(e,t){this.usercommands[e]=t,Ra[e]||(Ra[e]=function(t){ +var n=t.usercommands[e];n?n.apply(t,arguments):console.log("cm: unable to find user command!")})},execCommand:function(e){if(Ra.hasOwnProperty(e))return Ra[e].call(null,this)},triggerElectric:jn((function(e){Ui(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=ue(this.doc,e),a=0;a0&&a(t.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&Qt(this),O(this,"refresh",this)})),swapDoc:jn((function(e){var t=this.doc;return t.cm=null, +this.state.selectingText&&this.state.selectingText(),vr(this,e),Nt(this),this.display.input.reset(),xn(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,et(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&{}.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){ +return this.display.gutters}},I(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}(Di);var Va="iter insert remove copy getEditor constructor".split(" ");for(var $a in Sa.prototype)Sa.prototype.hasOwnProperty($a)&&d(Va,$a)<0&&(Di.prototype[$a]=function(e){return function(){return e.apply(this.doc,arguments)}}(Sa.prototype[$a]));return I(Sa), +Di.inputStyles={textarea:_a,contenteditable:Ua},Di.defineMode=function(e){Di.defaults.mode||"null"==e||(Di.defaults.mode=e),j.apply(this,arguments)},Di.defineMIME=function(e,t){Xo[e]=t},Di.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Di.defineMIME("text/plain","null"),Di.defineExtension=function(e,t){Di.prototype[e]=t},Di.defineDocExtension=function(e,t){Sa.prototype[e]=t},Di.fromTextArea=function(e,t){function n(){e.value=l.getValue()} +if((t=t?u(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r=a();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}var i;if(e.form&&(jo(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var s=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=s}}catch(e){}}t.finishInit=function(r){r.save=n,r.getTextArea=function(){return e}, +r.toTextArea=function(){r.toTextArea=isNaN,n(),e.parentNode.removeChild(r.getWrapperElement()),e.style.display="",e.form&&(A(e.form,"submit",n),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var l=Di((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return l},function(e){e.off=A,e.on=jo,e.wheelEventPixels=ir,e.Doc=Sa,e.splitLines=_o,e.countColumn=f,e.findColumn=h,e.isWordChar=b,e.Pass=Po,e.signal=O,e.Line=ra, +e.changeEnd=lr,e.scrollbarModel=da,e.Pos=re,e.cmpPos=ie,e.modes=Go,e.mimeModes=Xo,e.resolveMode=U,e.getMode=_,e.modeExtensions=Yo,e.extendMode=V,e.copyState=$,e.startState=G,e.innerMode=q,e.commands=Ra,e.keyMap=Ea,e.keyName=mi,e.isModifierKey=hi,e.lookupKey=di,e.normalizeKeyMap=fi,e.StringStream=Jo,e.SharedTextMarker=Ca,e.TextMarker=wa,e.LineWidget=ba,e.e_preventDefault=R,e.e_stopPropagation=B,e.e_stop=H,e.addClass=s,e.contains=o,e.rmClass=Mo,e.keyNames=Ta}(Di),Di.version="5.58.1",Di}()}, +4633:(e,t,n)=>{const r=n(4538);var i={jump:function(e){var t=prompt(r.I18N.getMessage("Jump_to_line"),"");t&&!isNaN(Number(t-1))&&e.setCursor(Number(t-1)),e.focus()},macro:function(e){var t=prompt(r.I18N.getMessage("Insert_constructor")+":","");t&&e.replaceSelection("function "+t+"() {\n \n}\n\n"+t+".prototype = {\n \n};\n")},reindentall:function(e){for(var t,n=0;n<=e.lineCount();n++)(t=e.getLineTokens(n))&&t[0]&&"quasi"==t[0].state.lastType||e.indentLine(n,"smart")}} +;for(var o in i)i.hasOwnProperty(o)&&(r.commands[o]=i[o]);e.exports=function(e,t,n,i,o){r.I18N=r.I18N||{getMessage:n};var a=document.createElement("div");a.setAttribute("class","CodeMirror-editor"+(t.readonly?" readonly":"")),a.setAttribute("style","font-size:"+((t.fontSize||100)/100).toFixed(2)+"em;"),e.appendChild(a),this.wrapper=a;var s={nextTheme:function(){if(t.themeOptions){var e=t.themeOptions.all,n=e.indexOf(t.theme||"default")||0;++n>=e.length&&(n=0);var r=t.theme=e[n];c(r), +t.themeOptions.onChange&&t.themeOptions.onChange(r)}}};t.theme=t.theme||"default";var l=new r(a,t);this.mirror=l,Object.keys(s).forEach((function(e){l.setCommand(e,s[e])})),i&&Object.keys(i).forEach((function(e){l.setCommand(e,i[e])})),o&&Object.keys(o).forEach((function(e){l.on(e,o[e])})),this.refresh=function(){l.refresh.call(l)};var c=function(e){"default"==e&&-1!=(document.documentElement.getAttribute("class")||"").split(" ").indexOf("dark")&&(e="monokai"),l.setOption("theme",e)};c(t.theme)} +},4825:(e,t,n)=>{!function(e){"use strict";function t(e){for(var t={},n=0;n*\/]/.test(n)?r(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?r("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?r(null,n):e.match(/[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/.test(e.current().toLowerCase())&&(t.tokenize=a),r("variable callee","variable")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),r("property","word")):r(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/), +r("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?r("variable-2","variable-definition"):r("variable-2","variable")):e.match(/^\w+-/)?r("meta","meta"):void 0}function o(e){return function(t,n){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return(i==e||!o&&")"!=e)&&(n.tokenize=null),r("string","string")}}function a(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=o(")"),r(null,"(")} +function s(e,t,n){this.type=e,this.indent=t,this.prev=n}function l(e,t,n,r){return e.context=new s(n,t.indentation()+(!1===r?0:g),e.context),n}function c(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function u(e,t,n){return P[n.context.type](e,t,n)}function f(e,t,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return u(e,t,n)}function d(e){var t=e.current().toLowerCase();m=T.hasOwnProperty(t)?"atom":L.hasOwnProperty(t)?"keyword":"variable"}var h=n.inline +;n.propertyKeywords||(n=e.resolveMode("text/css"));var p,m,g=t.indentUnit,v=n.tokenHooks,y=n.documentTypes||{},b=n.mediaTypes||{},k=n.mediaFeatures||{},w=n.mediaValueKeywords||{},C=n.propertyKeywords||{},x=n.nonStandardPropertyKeywords||{},S=n.fontProperties||{},M=n.counterDescriptors||{},L=n.colorKeywords||{},T=n.valueKeywords||{},A=n.allowNested,O=n.lineComment,N=!0===n.supportsAtComponent,E=!1!==t.highlightNonStandardPropertyKeywords,P={top:function(e,t,n){if("{"==e)return l(n,t,"block") +;if("}"==e&&n.context.prev)return c(n);if(N&&/@component/i.test(e))return l(n,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return l(n,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return l(n,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return l(n,t,"at") +;if("hash"==e)m="builtin";else if("word"==e)m="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return l(n,t,"interpolation");if(":"==e)return"pseudo";if(A&&"("==e)return l(n,t,"parens")}return n.context.type},block:function(e,t,n){if("word"==e){var r=t.current().toLowerCase();return C.hasOwnProperty(r)?(m="property","maybeprop"):x.hasOwnProperty(r)?(m=E?"string-2":"property","maybeprop"):A?(m=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(m+=" error", +"maybeprop")}return"meta"==e?"block":A||"hash"!=e&&"qualifier"!=e?P.top(e,t,n):(m="error","block")},maybeprop:function(e,t,n){return":"==e?l(n,t,"prop"):u(e,t,n)},prop:function(e,t,n){if(";"==e)return c(n);if("{"==e&&A)return l(n,t,"propBlock");if("}"==e||"{"==e)return f(e,t,n);if("("==e)return l(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)d(t);else if("interpolation"==e)return l(n,t,"interpolation")}else m+=" error" +;return"prop"},propBlock:function(e,t,n){return"}"==e?c(n):"word"==e?(m="property","maybeprop"):n.context.type},parens:function(e,t,n){return"{"==e||"}"==e?f(e,t,n):")"==e?c(n):"("==e?l(n,t,"parens"):"interpolation"==e?l(n,t,"interpolation"):("word"==e&&d(t),"parens")},pseudo:function(e,t,n){return"meta"==e?"pseudo":"word"==e?(m="variable-3",n.context.type):u(e,t,n)},documentTypes:function(e,t,n){return"word"==e&&y.hasOwnProperty(t.current())?(m="tag",n.context.type):P.atBlock(e,t,n)}, +atBlock:function(e,t,n){if("("==e)return l(n,t,"atBlock_parens");if("}"==e||";"==e)return f(e,t,n);if("{"==e)return c(n)&&l(n,t,A?"block":"top");if("interpolation"==e)return l(n,t,"interpolation");if("word"==e){var r=t.current().toLowerCase() +;m="only"==r||"not"==r||"and"==r||"or"==r?"keyword":b.hasOwnProperty(r)?"attribute":k.hasOwnProperty(r)?"property":w.hasOwnProperty(r)?"keyword":C.hasOwnProperty(r)?"property":x.hasOwnProperty(r)?E?"string-2":"property":T.hasOwnProperty(r)?"atom":L.hasOwnProperty(r)?"keyword":"error"}return n.context.type},atComponentBlock:function(e,t,n){return"}"==e?f(e,t,n):"{"==e?c(n)&&l(n,t,A?"block":"top",!1):("word"==e&&(m="error"),n.context.type)},atBlock_parens:function(e,t,n){ +return")"==e?c(n):"{"==e||"}"==e?f(e,t,n,2):P.atBlock(e,t,n)},restricted_atBlock_before:function(e,t,n){return"{"==e?l(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(m="variable","restricted_atBlock_before"):u(e,t,n)},restricted_atBlock:function(e,t,n){return"}"==e?(n.stateArg=null,c(n)):"word"==e?(m="@font-face"==n.stateArg&&!S.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==n.stateArg&&!M.hasOwnProperty(t.current().toLowerCase())?"error":"property", +"maybeprop"):"restricted_atBlock"},keyframes:function(e,t,n){return"word"==e?(m="variable","keyframes"):"{"==e?l(n,t,"top"):u(e,t,n)},at:function(e,t,n){return";"==e?c(n):"{"==e||"}"==e?f(e,t,n):("word"==e?m="tag":"hash"==e&&(m="builtin"),"at")},interpolation:function(e,t,n){return"}"==e?c(n):"{"==e||";"==e?f(e,t,n):("word"==e?m="variable":"variable"!=e&&"("!=e&&")"!=e&&(m="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:h?"block":"top",stateArg:null, +context:new s(h?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||i)(e,t);return n&&"object"==typeof n&&(p=n[1],n=n[0]),m=n,"comment"!=p&&(t.state=P[t.state](p,e,t)),m},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),i=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev), +n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(i=Math.max(0,n.indent-g)):i=(n=n.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:O,fold:"brace"}})) +;var r=["domain","regexp","url","url-prefix"],i=t(r),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],a=t(o),s=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme"],l=t(s),c=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light"],u=t(c),f=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],d=t(f),h=["border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],p=t(h),m=t(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),g=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),v=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],y=t(v),b=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],k=t(b),w=r.concat(o).concat(s).concat(c).concat(f).concat(h).concat(v).concat(b) +;e.registerHelper("hintWords","css",w),e.defineMIME("text/css",{documentTypes:i,mediaTypes:a,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:g,colorKeywords:y,valueKeywords:k,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=n,n(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:a,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:y,valueKeywords:k, +fontProperties:m,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{ +mediaTypes:a,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:y,valueKeywords:k,fontProperties:m,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(e,t)):["operator","operator"]},"@":function(e){ +return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:i,mediaTypes:a,mediaFeatures:l,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:g, +colorKeywords:y,valueKeywords:k,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=n,n(e,t))}},name:"css",helperType:"gss"})}(n(4538))},5299:(e,t,n)=>{!function(e){"use strict";e.defineMode("diff",(function(){var e={"+":"positive","-":"negative","@":"meta"};return{token:function(t){var n=t.string.search(/[\t ]+?$/);if(!t.sol()||0===n)return t.skipToEnd(),("error "+(e[t.string.charAt(0)]||"")).replace(/ $/,"");var r=e[t.peek()]||t.skipToEnd() +;return-1===n?t.skipToEnd():t.pos=n,r}}})),e.defineMIME("text/x-diff","diff")}(n(4538))},8650:(e,t,n)=>{!function(e){"use strict";function t(e,t){return new RegExp((t?"^":"")+"","i")}function n(e,t){for(var n in e)for(var r=t[n]||(t[n]=[]),i=e[n],o=i.length-1;o>=0;o--)r.unshift(i[o])}var r={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]], +style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]},i={};e.defineMode("htmlmixed",(function(o,a){function s(n,r){var a,u=l.token(n,r.htmlState),f=/\btag\b/.test(u);if(f&&!/[<>\s\/]/.test(n.current())&&(a=r.htmlState.tagName&&r.htmlState.tagName.toLowerCase())&&c.hasOwnProperty(a))r.inTag=a+" ";else if(r.inTag&&f&&/>$/.test(n.current())){var d=/^([\S]+) (.*)/.exec(r.inTag);r.inTag=null +;var h=">"==n.current()&&function(e,t){for(var n=0;n-1?e.backUp(r.length-i):r.match(/<\/?$/)&&(e.backUp(r.length),e.match(t,!1)||e.match(r)),n}(e,g,t.localMode.token(e,t.localState))},r.localMode=p,r.localState=e.startState(p,l.indent(r.htmlState,"",""))}else r.inTag&&(r.inTag+=n.current(),n.eol()&&(r.inTag+=" "));return u}var l=e.getMode(o,{name:"xml",htmlMode:!0,multilineTagIndentFactor:a.multilineTagIndentFactor,multilineTagIndentPastTag:a.multilineTagIndentPastTag}),c={},u=a&&a.tags,f=a&&a.scriptTypes;if(n(r,c),u&&n(u,c), +f)for(var d=f.length-1;d>=0;d--)c.script.unshift(["type",f[d].matches,f[d].mode]);return{startState:function(){return{token:s,inTag:null,localMode:null,localState:null,htmlState:e.startState(l)}},copyState:function(t){var n;return t.localState&&(n=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:n,htmlState:e.copyState(l,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n,r){ +return!t.localMode||/^\s*<\//.test(n)?l.indent(t.htmlState,n,r):t.localMode.indent?t.localMode.indent(t.localState,n,r):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||l}}}}),"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}(n(4538),n(7055),n(9521),n(4825))},9521:(e,t,n)=>{!function(e){"use strict";e.defineMode("javascript",(function(t,n){function r(e,t,n){return Be=e,Fe=n,t}function i(e,t){var n,s=e.next() +;if('"'==s||"'"==s)return t.tokenize=(n=s,function(e,t){var o,a=!1;if(We&&"@"==e.peek()&&e.match(Ve))return t.tokenize=i,r("jsonld-keyword","meta");for(;null!=(o=e.next())&&(o!=n||a);)a=!a&&"\\"==o;return a||(t.tokenize=i),r("string","string")}),t.tokenize(e,t);if("."==s&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return r("number","number");if("."==s&&e.match(".."))return r("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(s))return r(s);if("="==s&&e.eat(">"))return r("=>","operator") +;if("0"==s&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return r("number","number");if(/\d/.test(s))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),r("number","number");if("/"==s)return e.eat("*")?(t.tokenize=o,o(e,t)):e.eat("/")?(e.skipToEnd(),r("comment","comment")):Re(e,t,1)?(function(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/), +r("regexp","string-2")):(e.eat("="),r("operator","operator",e.current()));if("`"==s)return t.tokenize=a,a(e,t);if("#"==s&&"!"==e.peek())return e.skipToEnd(),r("meta","meta");if("#"==s&&e.eatWhile(je))return r("variable","property");if("<"==s&&e.match("!--")||"-"==s&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),r("comment","comment");if(_e.test(s))return">"==s&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=s&&"="!=s||e.eat("="):/[<>*+\-|&?]/.test(s)&&(e.eat(s), +">"==s&&e.eat(s))),"?"==s&&e.eat(".")?r("."):r("operator","operator",e.current());if(je.test(s)){e.eatWhile(je);var l=e.current();if("."!=t.lastType){if(Ue.propertyIsEnumerable(l)){var c=Ue[l];return r(c.type,c.style,l)}if("async"==l&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return r("async","keyword",l)}return r("variable","variable",l)}}function o(e,t){for(var n,o=!1;n=e.next();){if("/"==n&&o){t.tokenize=i;break}o="*"==n}return r("comment","comment")}function a(e,t){ +for(var n,o=!1;null!=(n=e.next());){if(!o&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=i;break}o=!o&&"\\"==n}return r("quasi","string-2",e.current())}function s(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(Ke){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,o=!1,a=n-1;a>=0;--a){var s=e.string.charAt(a),l=$e.indexOf(s);if(l>=0&&l<3){if(!i){++a;break}if(0==--i){"("==s&&(o=!0);break} +}else if(l>=3&&l<6)++i;else if(je.test(s))o=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;if(e.string.charAt(a-1)==s&&"\\"!=e.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(t.fatArrowAt=a)}}function l(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function c(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return!0}function u(){ +for(var e=arguments.length-1;e>=0;e--)Ge.cc.push(arguments[e])}function f(){return u.apply(null,arguments),!0}function d(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function h(e,t){var r=Ge.state;if(Ge.marked="function"==t?"deffunc":"argument"==t?"defarg":"def",r.context)if("var"==r.lexical.info&&r.context&&r.context.block){var i=p(e,r.context);if(null!=i)return void(r.context=i)}else if(!d(e,r.localVars))return void(r.localVars=new v(e,r.localVars)) +;n.globalVars&&!d(e,r.globalVars)&&(r.globalVars=new v(e,r.globalVars))}function p(e,t){if(t){if(t.block){var n=p(e,t.prev);return n?n==t.prev?t:new g(n,t.vars,!0):null}return d(e,t.vars)?t:new g(t.prev,new v(e,t.vars),!1)}return null}function m(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function g(e,t,n){this.prev=e,this.vars=t,this.block=n}function v(e,t){this.name=e,this.next=t}function y(){Ge.state.context=new g(Ge.state.context,Ge.state.localVars,!1), +Ge.state.localVars=Xe}function b(){Ge.state.context=new g(Ge.state.context,Ge.state.localVars,!0),Ge.state.localVars=null}function k(){Ge.state.localVars=Ge.state.context.vars,Ge.state.context=Ge.state.context.prev}function w(e,t){var n=function(){var n=Ge.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new l(r,Ge.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function C(){var e=Ge.state +;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function x(e){return function t(n){return n==e?f():";"==e||"}"==n||")"==n||"]"==n?u():f(t)}}function S(e,t){ +return"var"==e?f(w("vardef",t),oe,x(";"),C):"keyword a"==e?f(w("form"),A,S,C):"keyword b"==e?f(w("form"),S,C):"keyword d"==e?Ge.stream.match(/^\s*$/,!1)?f():f(w("stat"),N,x(";"),C):"debugger"==e?f(x(";")):"{"==e?f(w("}"),b,$,C,k):";"==e?f():"if"==e?("else"==Ge.state.lexical.info&&Ge.state.cc[Ge.state.cc.length-1]==C&&Ge.state.cc.pop()(),f(w("form"),A,S,C,fe)):"function"==e?f(me):"for"==e?f(w("form"),de,S,C):"class"==e||Ke&&"interface"==t?(Ge.marked="keyword", +f(w("form","class"==e?e:t),ke,C)):"variable"==e?Ke&&"declare"==t?(Ge.marked="keyword",f(S)):Ke&&("module"==t||"enum"==t||"type"==t)&&Ge.stream.match(/^\s*\w/,!1)?(Ge.marked="keyword","enum"==t?f(Pe):"type"==t?f(ve,x("operator"),J,x(";")):f(w("form"),ae,x("{"),w("}"),$,C,C)):Ke&&"namespace"==t?(Ge.marked="keyword",f(w("form"),L,S,C)):Ke&&"abstract"==t?(Ge.marked="keyword", +f(S)):f(w("stat"),W):"switch"==e?f(w("form"),A,x("{"),w("}","switch"),b,$,C,C,k):"case"==e?f(L,x(":")):"default"==e?f(x(":")):"catch"==e?f(w("form"),y,M,S,C,k):"export"==e?f(w("stat"),Se,C):"import"==e?f(w("stat"),Le,C):"async"==e?f(S):"@"==t?f(L,S):u(w("stat"),L,x(";"),C)}function M(e){if("("==e)return f(ye,x(")"))}function L(e,t){return O(e,t,!1)}function T(e,t){return O(e,t,!0)}function A(e){return"("!=e?u():f(w(")"),N,x(")"),C)}function O(e,t,n){if(Ge.state.fatArrowAt==Ge.stream.start){ +var r=n?F:B;if("("==e)return f(y,w(")"),_(ye,")"),C,x("=>"),r,k);if("variable"==e)return u(y,ae,x("=>"),r,k)}var i=n?P:E;return qe.hasOwnProperty(e)?f(i):"function"==e?f(me,i):"class"==e||Ke&&"interface"==t?(Ge.marked="keyword",f(w("form"),be,C)):"keyword c"==e||"async"==e?f(n?T:L):"("==e?f(w(")"),N,x(")"),C,i):"operator"==e||"spread"==e?f(n?T:L):"["==e?f(w("]"),Ee,C,i):"{"==e?V(K,"}",null,i):"quasi"==e?u(I,i):"new"==e?f(function(e){return function(t){ +return"."==t?f(e?D:H):"variable"==t&&Ke?f(ne,e?P:E):u(e?T:L)}}(n)):"import"==e?f(L):f()}function N(e){return e.match(/[;\}\)\],]/)?u():u(L)}function E(e,t){return","==e?f(N):P(e,t,!1)}function P(e,t,n){var r=0==n?E:P,i=0==n?L:T +;return"=>"==e?f(y,n?F:B,k):"operator"==e?/\+\+|--/.test(t)||Ke&&"!"==t?f(r):Ke&&"<"==t&&Ge.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?f(w(">"),_(J,">"),C,r):"?"==t?f(L,x(":"),i):f(i):"quasi"==e?u(I,r):";"!=e?"("==e?V(T,")","call",r):"."==e?f(z,r):"["==e?f(w("]"),N,x("]"),C,r):Ke&&"as"==t?(Ge.marked="keyword",f(J,r)):"regexp"==e?(Ge.state.lastType=Ge.marked="operator",Ge.stream.backUp(Ge.stream.pos-Ge.stream.start-1),f(i)):void 0:void 0}function I(e,t){ +return"quasi"!=e?u():"${"!=t.slice(t.length-2)?f(I):f(L,R)}function R(e){if("}"==e)return Ge.marked="string-2",Ge.state.tokenize=a,f(I)}function B(e){return s(Ge.stream,Ge.state),u("{"==e?S:L)}function F(e){return s(Ge.stream,Ge.state),u("{"==e?S:T)}function H(e,t){if("target"==t)return Ge.marked="keyword",f(E)}function D(e,t){if("target"==t)return Ge.marked="keyword",f(P)}function W(e){return":"==e?f(C,S):u(E,x(";"),C)}function z(e){if("variable"==e)return Ge.marked="property",f()} +function K(e,t){return"async"==e?(Ge.marked="property",f(K)):"variable"==e||"keyword"==Ge.style?(Ge.marked="property","get"==t||"set"==t?f(j):(Ke&&Ge.state.fatArrowAt==Ge.stream.start&&(n=Ge.stream.match(/^\s*:\s*/,!1))&&(Ge.state.fatArrowAt=Ge.stream.pos+n[0].length),f(U))):"number"==e||"string"==e?(Ge.marked=We?"property":Ge.style+" property",f(U)):"jsonld-keyword"==e?f(U):Ke&&m(t)?(Ge.marked="keyword",f(K)):"["==e?f(L,q,x("]"),U):"spread"==e?f(T,U):"*"==t?(Ge.marked="keyword", +f(K)):":"==e?u(U):void 0;var n}function j(e){return"variable"!=e?u(U):(Ge.marked="property",f(me))}function U(e){return":"==e?f(T):"("==e?u(me):void 0}function _(e,t,n){function r(i,o){if(n?n.indexOf(i)>-1:","==i){var a=Ge.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),f((function(n,r){return n==t||r==t?u():u(e)}),r)}return i==t||o==t?f():n&&n.indexOf(";")>-1?u(e):f(x(t))}return function(n,i){return n==t||i==t?f():u(e,r)}}function V(e,t,n){ +for(var r=3;r"),J):void 0}function Q(e){if("=>"==e)return f(J)}function Z(e,t){return"variable"==e||"keyword"==Ge.style?(Ge.marked="property",f(Z)):"?"==t||"number"==e||"string"==e?f(Z):":"==e?f(J):"["==e?f(x("variable"),G,x("]"),Z):"("==e?u(ge,Z):void 0} +function ee(e,t){return"variable"==e&&Ge.stream.match(/^\s*[?:]/,!1)||"?"==t?f(ee):":"==e?f(J):"spread"==e?f(ee):u(J)}function te(e,t){return"<"==t?f(w(">"),_(J,">"),C,te):"|"==t||"."==e||"&"==t?f(J):"["==e?f(J,x("]"),te):"extends"==t||"implements"==t?(Ge.marked="keyword",f(J)):"?"==t?f(J,x(":"),J):void 0}function ne(e,t){if("<"==t)return f(w(">"),_(J,">"),C,te)}function re(){return u(J,ie)}function ie(e,t){if("="==t)return f(J)}function oe(e,t){return"enum"==t?(Ge.marked="keyword", +f(Pe)):u(ae,q,ce,ue)}function ae(e,t){return Ke&&m(t)?(Ge.marked="keyword",f(ae)):"function"==e?(h(t,e),f()):"variable"==e?(h(t,")"!=Ge.state.lexical.type||Ge.state.lexical.prev&&"form"==Ge.state.lexical.prev.type?null:"argument"),f()):"spread"==e?f(ae):"["==e?V(le,"]"):"{"==e?V(se,"}"):void 0}function se(e,t){return"variable"!=e||Ge.stream.match(/^\s*:/,!1)?("variable"==e&&(Ge.marked="property"),"spread"==e?f(ae):"}"==e?u():"["==e?f(L,x("]"),x(":"),se):f(x(":"),ae,ce)):(h(t),f(ce))} +function le(){return u(ae,ce)}function ce(e,t){if("="==t)return f(T)}function ue(e){if(","==e)return f(oe)}function fe(e,t){if("keyword b"==e&&"else"==t)return f(w("form","else"),S,C)}function de(e,t){return"await"==t?f(de):"("==e?f(w(")"),he,C):void 0}function he(e){return"var"==e?f(oe,pe):"variable"==e?f(pe):u(pe)}function pe(e,t){return")"==e?f():";"==e?f(pe):"in"==t||"of"==t?(Ge.marked="keyword",f(L,pe)):u(L,pe)}function me(e,t){return"*"==t?(Ge.marked="keyword", +f(me)):"variable"==e?(h(t,"function"),f(me)):"("==e?f(y,w(")"),_(ye,")"),C,X,S,k):Ke&&"<"==t?f(w(">"),_(re,">"),C,me):void 0}function ge(e,t){return"*"==t?(Ge.marked="keyword",f(ge)):"variable"==e?(h(t),f(ge)):"("==e?f(y,w(")"),_(ye,")"),C,X,k):Ke&&"<"==t?f(w(">"),_(re,">"),C,ge):void 0}function ve(e,t){return"keyword"==e||"variable"==e?(Ge.marked="type",f(ve)):"<"==t?f(w(">"),_(re,">"),C):void 0}function ye(e,t){return"@"==t&&f(L,ye),"spread"==e?f(ye):Ke&&m(t)?(Ge.marked="keyword", +f(ye)):Ke&&"this"==e?f(q,ce):u(ae,q,ce)}function be(e,t){return"variable"==e?ke(e,t):we(e,t)}function ke(e,t){if("variable"==e)return h(t),f(we)}function we(e,t){return"<"==t?f(w(">"),_(re,">"),C,we):"extends"==t||"implements"==t||Ke&&","==e?("implements"==t&&(Ge.marked="keyword"),f(Ke?J:L,we)):"{"==e?f(w("}"),Ce,C):void 0}function Ce(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||Ke&&m(t))&&Ge.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(Ge.marked="keyword", +f(Ce)):"variable"==e||"keyword"==Ge.style?(Ge.marked="property",f(xe,Ce)):"number"==e||"string"==e?f(xe,Ce):"["==e?f(L,q,x("]"),xe,Ce):"*"==t?(Ge.marked="keyword",f(Ce)):Ke&&"("==e?u(ge,Ce):";"==e||","==e?f(Ce):"}"==e?f():"@"==t?f(L,Ce):void 0}function xe(e,t){if("?"==t)return f(xe);if(":"==e)return f(J,ce);if("="==t)return f(T);var n=Ge.state.lexical.prev;return u(n&&"interface"==n.info?ge:me)}function Se(e,t){return"*"==t?(Ge.marked="keyword",f(Ne,x(";"))):"default"==t?(Ge.marked="keyword", +f(L,x(";"))):"{"==e?f(_(Me,"}"),Ne,x(";")):u(S)}function Me(e,t){return"as"==t?(Ge.marked="keyword",f(x("variable"))):"variable"==e?u(T,Me):void 0}function Le(e){return"string"==e?f():"("==e?u(L):u(Te,Ae,Ne)}function Te(e,t){return"{"==e?V(Te,"}"):("variable"==e&&h(t),"*"==t&&(Ge.marked="keyword"),f(Oe))}function Ae(e){if(","==e)return f(Te,Ae)}function Oe(e,t){if("as"==t)return Ge.marked="keyword",f(Te)}function Ne(e,t){if("from"==t)return Ge.marked="keyword",f(L)}function Ee(e){ +return"]"==e?f():u(_(T,"]"))}function Pe(){return u(w("form"),ae,x("{"),w("}"),_(Ie,"}"),C,C)}function Ie(){return u(ae,ce)}function Re(e,t,n){return t.tokenize==i&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}var Be,Fe,He=t.indentUnit,De=n.statementIndent,We=n.jsonld,ze=n.json||We,Ke=n.typescript,je=n.wordCharacters||/[\w$\xa1-\uffff]/,Ue=function(){function e(e){return{ +type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("keyword d"),o=e("operator"),a={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:e("new"),delete:r,void:r,throw:r,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a, +NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:r,export:e("export"),import:e("import"),extends:r,await:r}}(),_e=/[+\-*&%=<>!?|~^@]/,Ve=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,$e="([{}])",qe={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},Ge={state:null,column:null,marked:null,cc:null},Xe=new v("this",new v("arguments",null));return k.lex=!0,C.lex=!0,{startState:function(e){var t={tokenize:i, +lastType:"sof",cc:[],lexical:new l((e||0)-He,0,"block",!1),localVars:n.localVars,context:n.localVars&&new g(null,null,!1),indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),s(e,t)),t.tokenize!=o&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==Be?n:(t.lastType="operator"!=Be||"++"!=Fe&&"--"!=Fe?Be:"incdec", +function(e,t,n,r,i){var o=e.cc;for(Ge.state=e,Ge.stream=i,Ge.marked=null,Ge.cc=o,Ge.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():ze?L:S)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return Ge.marked?Ge.marked:"variable"==n&&c(e,r)?"variable-2":t}}(t,n,Be,Fe,e))},indent:function(t,r){if(t.tokenize==o||t.tokenize==a)return e.Pass;if(t.tokenize!=i)return 0;var s,l=r&&r.charAt(0),c=t.lexical;if(!/^\s*else\b/.test(r))for(var u=t.cc.length-1;u>=0;--u){ +var f=t.cc[u];if(f==C)c=c.prev;else if(f!=fe)break}for(;("stat"==c.type||"form"==c.type)&&("}"==l||(s=t.cc[t.cc.length-1])&&(s==E||s==P)&&!/^[,\.=+\-*:?[\(]/.test(r));)c=c.prev;De&&")"==c.type&&"stat"==c.prev.type&&(c=c.prev);var d=c.type,h=l==d;return"vardef"==d?c.indented+("operator"==t.lastType||","==t.lastType?c.info.length+1:0):"form"==d&&"{"==l?c.indented:"form"==d?c.indented+He:"stat"==d?c.indented+(function(e,t){ +return"operator"==e.lastType||","==e.lastType||_e.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,r)?De||He:0):"switch"!=c.info||h||0==n.doubleIndentSwitch?c.align?c.column+(h?0:1):c.indented+(h?0:He):c.indented+(/^(?:case|default)\b/.test(r)?He:2*He)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:ze?null:"/*",blockCommentEnd:ze?null:"*/",blockCommentContinue:ze?null:" * ",lineComment:ze?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:ze?"json":"javascript", +jsonldMode:We,jsonMode:ze,expressionAllowed:Re,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=L&&t!=T||e.cc.pop()}}})),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}), +e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(n(4538))},7055:(e,t,n)=>{!function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0}, +implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0 +},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(r,i){function o(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next() +;return"<"==r?e.eat("!")?e.eat("[")?e.match("CDATA[")?n(s("atom","]]>")):null:e.match("--")?n(s("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(l(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=s("meta","?>"),"meta"):(w=e.eat("/")?"closeTag":"openTag",t.tokenize=a,"tag bracket"):"&"==r?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)} +function a(e,t){var n,r,i=e.next();if(">"==i||"/"==i&&e.eat(">"))return t.tokenize=o,w=">"==i?"endTag":"selfcloseTag","tag bracket";if("="==i)return w="equals",null;if("<"==i){t.tokenize=o,t.state=d,t.tagName=t.tagStart=null;var s=t.tokenize(e,t);return s?s+" tag error":"tag error"}return/[\'\"]/.test(i)?(t.tokenize=(n=i,r=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=a;break}return"string"},r.isInAttribute=!0,r),t.stringStartCol=e.column(), +t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function s(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=o;break}n.next()}return e}}function l(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=l(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=o;break}return n.tokenize=l(e-1),n.tokenize(t,n)}}return"meta"}}function c(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n, +(S.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function u(e){e.context&&(e.context=e.context.prev)}function f(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!S.contextGrabbers.hasOwnProperty(n)||!S.contextGrabbers[n].hasOwnProperty(t))return;u(e)}}function d(e,t,n){return"openTag"==e?(n.tagStart=t.column(),h):"closeTag"==e?p:d}function h(e,t,n){return"word"==e?(n.tagName=t.current(),C="tag", +v):S.allowMissingTagName&&"endTag"==e?(C="tag bracket",v(e,0,n)):(C="error",h)}function p(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&S.implicitlyClosed.hasOwnProperty(n.context.tagName)&&u(n),n.context&&n.context.tagName==r||!1===S.matchClosing?(C="tag",m):(C="tag error",g)}return S.allowMissingTagName&&"endTag"==e?(C="tag bracket",m(e,0,n)):(C="error",g)}function m(e,t,n){return"endTag"!=e?(C="error",m):(u(n),d)}function g(e,t,n){return C="error",m(e,0,n)} +function v(e,t,n){if("word"==e)return C="attribute",y;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||S.autoSelfClosers.hasOwnProperty(r)?f(n,r):(f(n,r),n.context=new c(n,r,i==n.indented)),d}return C="error",v}function y(e,t,n){return"equals"==e?b:(S.allowMissing||(C="error"),v(e,0,n))}function b(e,t,n){return"string"==e?k:"word"==e&&S.allowUnquoted?(C="string",v):(C="error",v(e,0,n))}function k(e,t,n){ +return"string"==e?k:v(e,0,n)}var w,C,x=r.indentUnit,S={},M=i.htmlMode?t:n;for(var L in M)S[L]=M[L];for(var L in i)S[L]=i[L];return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:d,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;w=null;var n=t.tokenize(e,t);return(n||w)&&"comment"!=n&&(C=null,t.state=t.state(w||n,e,t), +C&&(n="error"==C?n+" error":C)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+x;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=a&&t.tokenize!=o)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==S.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+x*(S.multilineTagIndentFactor||1);if(S.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:S.htmlMode?"html":"xml",helperType:S.htmlMode?"html":"xml",skipAttribute:function(e){e.state==b&&(e.state=v)}, +xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)n.tagName&&t.push(n.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n(4538))}},n={};e.d=(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})}, +e.o=(e,t)=>({}.hasOwnProperty.call(e,t)),e.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";const t=e(4538),n=e(4633);e(9521),e(4825),e(8650),e(5299),e(3489),e(8190),e(7270),e(8334),e(5043),e(3773),e(8095),e(2172),e(2446),e(4698),e(6531),e(2073),e(3660),e(2048),e(1598),e(2714),e(7297),e(3170),e(7440),e(7544),e(4333),e(2498),e(3495),e(672),e(4514),e(8813),e(2641), +e(1626),e(9573),e(4174),window.MirrorFrame=n,window.CodeMirror=t})()})(); \ No newline at end of file diff --git a/backend/neko/tampermonkey-seed/Default/Extensions/dhdgffkkebhmkfjojejmpbldmpobfkfo/5.5.0_0/extension.js b/backend/neko/tampermonkey-seed/Default/Extensions/dhdgffkkebhmkfjojejmpbldmpobfkfo/5.5.0_0/extension.js new file mode 100644 index 0000000..41668a2 --- /dev/null +++ b/backend/neko/tampermonkey-seed/Default/Extensions/dhdgffkkebhmkfjojejmpbldmpobfkfo/5.5.0_0/extension.js @@ -0,0 +1,939 @@ +(()=>{function e(i){var r=n[i];if(void 0!==r)return r.exports;var s=n[i]={exports:{}};return t[i](s,s.exports,e),s.exports}var t={2672:e=>{e.exports={meta:{type:"suggestion",docs:{description:"aligns attributes in the metadata",category:"Stylistic Issues"},schema:[{type:"integer",minimum:1,default:2}],messages:{spaceMetadata:"The metadata is not spaced"},fixable:"code"},create:e=>{const t=e.options[0]||2,n=e.getSourceCode(),i=n.getAllComments();let r=!1,s=!1,o=[],a={},l={} +;for(const e of i.filter((e=>"Line"===e.type)))s||(r&&"==/UserScript=="===e.value.trim()?(l=e.loc.end,s=!0):r||"==UserScript=="!==e.value.trim()?r&&e.value.trim().startsWith("@")&&o.push({key:e.value.trim().slice(1).split(/\s/)[0],space:/^\S*(\s+)/.exec(e.value.trim().slice(1))[1].length,line:e.loc.start.line,comment:e}):(a=e.loc.start,r=!0));if(0===Object.keys(l).length&&(l=n.getLocFromIndex(n.getText().length)),0===o.length)return{};const c=Math.max(...o.map((e=>e.key.length)))+t +;return(o.map((e=>e.space)).sort()[0]e.key.length+e.space)).find((e=>e!==c)))&&e.report({loc:{start:a,end:l},messageId:"spaceMetadata",fix:function(e){const t=[];for(const i of o)if(i.key.length+i.space!==c){const r=/^(.*?@\S*)/.exec(n.getLines()[i.line-1])[1].length;t.push(e.replaceTextRange([n.getIndexFromLoc({line:i.line,column:r}),n.getIndexFromLoc({line:i.line,column:r+i.space})]," ".repeat(c-i.key.length)))}return t}}),{}}}},3316:(e,t,n)=>{const i=n(2598) +;e.exports=i("include",!1,(({attrVal:e,context:t})=>{e.val.startsWith("/")&&t.report({loc:{start:{line:e.loc.start.line,column:0},end:e.loc.end},messageId:"avoidRegExpInclude"})}),{avoidRegExpInclude:"Using a regular expression at '@include' can cause performance issues. Use a regular @include or @match instead."})},8039:e=>{e.exports={meta:{type:"suggestion",docs:{description:"ensure userscripts end with .user.js",category:"Best Practices"},schema:[{enum:["always","never"]}],messages:{ +filenameExtension:"Rename '{{ oldFilename }}' to '{{ newFilename }}'"}},create:e=>{const t=e.getFilename();return""===t||""===t?{}:{Program(){(!t.endsWith(".user.js")&&(!e.options[0]||"always"===e.options[0])||t.endsWith(".user.js")&&"never"===e.options[0])&&e.report({loc:{column:0,line:1},messageId:"filenameExtension",data:{newFilename:t.replace("always"===e.options[0]?/.js$/:/.user.js$/,"always"===e.options[0]?".user.js":".js"),oldFilename:t}})}}}}},70:(e,t,n)=>{ +const i=n(2598),r=["addElement","addStyle","addValueChangeListener","cookie","deleteValue","deleteValues","download","getResourceText","getResourceURL","getTab","getTabs","getValue","getValues","info","listValues","log","notification","openInTab","registerMenuCommand","removeValueChangeListener","saveTab","setClipboard","setValue","setValues","unregisterMenuCommand","webRequest","xmlhttpRequest"].map((e=>`GM_${e}`)),s=["addElement","addStyle","addValueChangeListener","cookie","deleteValue","deleteValues","download","getResourceText","getResourceUrl","getTab","getTabs","getValue","getValues","info","listValues","log","notification","openInTab","registerMenuCommand","removeValueChangeListener","saveTab","setClipboard","setValue","setValues","unregisterMenuCommand","webRequest","xmlHttpRequest"].map((e=>`GM.${e}`)),o=new Set([...r,...s,"none","unsafeWindow","window.close","window.focus","window.onurlchange"]) +;e.exports=i("grant",!1,(({attrVal:e,context:t})=>{const n=e.val;o.has(n)||t.report({loc:{start:{line:e.loc.start.line,column:0},end:e.loc.end},messageId:"grantHasInvalidArgument",data:{argument:n}})}),{grantHasInvalidArgument:"'{{ argument }}' is not a valid @grant argument"})},8754:(e,t,n)=>{ +const i=n(2598),r=new Set(["antifeature","author","connect","contributor","contributors","copyright","defaulticon","description","developer","downloadURL","exclude","grant","history","homepage","homepageURL","icon","icon64","icon64URL","iconURL","include","license","match","name","namespace","nocompat","noframes","require","resource","run-at","run-in","sandbox","source","supportURL","tag","unwrap","updateURL","version","website"].map((e=>`@${e}`))),s=["name","description","antifeature"].map((e=>new RegExp(`^@${e}(:\\S+)?$`))) +;e.exports=i("headers",!1,(({attrVal:e,context:t})=>{const n=t.options[0],i=new Set((n&&n.allowed||[]).map((e=>`@${e}`)));for(const n of e){const e=`@${n.key}`;r.has(e)||i.has(e)||s.some((t=>t.test(e)))||t.report({loc:{start:{line:n.loc.start.line,column:0},end:n.loc.end},messageId:"invalidHeader",data:{header:e}})}}),{invalidHeader:"'{{ header }}' is not a valid userscript header"},!1,/./,!0,[{type:"object",properties:{allowed:{type:"array"}},additionalProperties:!1}])},1763:e=>{e.exports={ +meta:{type:"suggestion",docs:{description:"ensure userscripts have valid metadata",category:"Possible Errors"},messages:{metadataRequired:"Add metadata to the userscript",moveMetadataToTop:"Move the metadata to the top of the file",noClosingMetadata:"Closing metadata comment not found",noCodeBetween:"Code found between in metadata",attributeNotStartsWithAtTheRate:"Attributes should begin with @"},schema:[{type:"object",properties:{top:{enum:["required","optional"],default:"required"}}, +additionalProperties:!1}]},create:e=>{const t=e.getSourceCode(),n=t.getAllComments(),i=t.lines;let r=!1,s=!1;for(const[t,n]of i.entries()){if(s)continue;const i={start:{line:t+1,column:0},end:{line:t+1,column:n.length}};r&&!n.trim().startsWith("//")&&n.trim()?e.report({loc:i,messageId:"noCodeBetween" +}):r&&n.trim().startsWith("//")&&"==/UserScript=="===n.trim().slice(2).trim()?s=!0:!r&&n.trim().startsWith("//")&&"==UserScript=="===n.trim().slice(2).trim()?r=!0:r&&!n.trim().slice(2).trim().startsWith("@")&&n.trim().slice(2).trim()&&e.report({loc:i,messageId:"attributeNotStartsWithAtTheRate"})}return{Program(t){0!==n.length&&n.find((e=>"==UserScript=="===e.value.trim()&&"Line"===e.type))?(n.find((e=>"==/UserScript=="===e.value.trim()&&"Line"===e.type))||e.report({ +loc:n.find((e=>"==UserScript=="===e.value.trim()&&"Line"===e.type)).loc,messageId:"noClosingMetadata"}),e.options[0]&&e.options[0].top&&"required"!==e.options[0].top||"==UserScript=="===n[0].value.trim()&&1===n[0].loc.start.line||e.report({loc:n.find((e=>"==UserScript=="===e.value.trim()&&"Line"===e.type)).loc,messageId:"moveMetadataToTop"})):e.report({node:t,messageId:"metadataRequired"})}}}}},4350:e=>{e.exports={meta:{type:"suggestion",docs:{ +description:"ensure atributes are prefixed by one space",category:"Possible Errors"},messages:{attributeNotPrefixedBySpace:"Attributes should be prefixed by one space"},schema:[]},create:e=>{const t=e.getSourceCode().lines;let n=!1,i=!1;for(const[r,s]of t.entries()){if(i)continue;const t=s.trim() +;n&&t.startsWith("//")&&"==/UserScript=="===t.slice(2).trim()?i=!0:!n&&t.startsWith("//")&&"==UserScript=="===t.slice(2).trim()?n=!0:n&&t.slice(2).trim().startsWith("@")&&t.startsWith("//")&&(!t.startsWith("// ")||t.startsWith("// "))&&e.report({loc:{start:{line:r+1,column:0},end:{line:r+1,column:s.length}},messageId:"attributeNotPrefixedBySpace"})}return{}}}},230:(e,t,n)=>{const i=n(2598);e.exports=i("description",!0,(({attrVal:e,context:t})=>{let n=[] +;for(let i of e)n.includes(i.key)?t.report({loc:i.loc,messageId:"multipleDescriptions"}):n.push(i.key)}),{multipleDescriptions:"Include only one description for each language"},!1,/^description(:\S+)?$/,!0)},8295:(e,t,n)=>{const i=n(2598),r=/^name(:\S+)?$/;e.exports=i("name",!0,(({attrVal:e,context:t,metadata:n})=>{let i=[];for(let n of e)i.includes(n.key)?t.report({loc:n.loc,messageId:"multipleNames"}):i.push(n.key);const s=Object.values(n) +;if(s.find(((e,t)=>0!==t&&r.test(e[0]?e[0].key:e.key)&&!r.test(s[t-1][0]?s[t-1][0].key:s[t-1].key)))){const n=t.getSourceCode(),i=n.getAllComments(),r=i.find((e=>"==/UserScript=="===e.value.trim()&&"Line"===e.type));t.report({loc:{start:i.find((e=>"==UserScript=="===e.value.trim()&&"Line"===e.type)).loc.start,end:r?r.loc.end:{line:n.lines.length,column:0}},messageId:"nameAtBeginning",fix:function(n){let i=[];for(let r of e){Array.isArray(r)||(r=[r]) +;for(let e of r)i.push(n.removeRange(e.comment.range.map(((n,i)=>0===i?n-t.getSourceCode().lines[e.loc.start.line-1].split("//")[0].length-1:n))))}return i.push(n.insertTextAfterRange(t.getSourceCode().getAllComments().find((e=>"==UserScript=="===e.value.trim())).range,e.sort(((e,t)=>"name"===e.key?-1:"name"===t.key?1:0)).map((e=>`\n${t.getSourceCode().lines[e.loc.start.line-1].split("//")[0]}//${e.comment.value}`)).join(""))),i}})}}),{multipleNames:"Include only one name for each language", +nameAtBeginning:"The names should be at the beginning of the metadata"},!0,r,!0)},3880:(e,t,n)=>{const i=n(2598);e.exports=i("version",!0,(({attrVal:e,index:t,context:n})=>{t>0&&n.report({loc:e.loc,messageId:"multipleVersions"}),/^([^\s.]+)(\.[^\s.]+)*$/.test(e.val)||n.report({loc:{start:{line:e.loc.start.line,column:/^(\s*\/\/\s*)/.exec(n.getSourceCode().lines[e.comment.loc.start.line])[1].length-1},end:e.loc.end},messageId:"invalidVersion"})}),{multipleVersions:"Include only one version", +invalidVersion:"Invalid version"})},2215:(e,t,n)=>{const i=n(2598),r=["downloadURL","updateURL"];e.exports=i(r,!1,(({attrVal:e,metadata:t,context:n,keyName:i})=>{const s=r.find((e=>e!==i));t[s]||n.report({loc:e.loc,messageId:"missingAttribute",data:{attribute:s},fix:function(t){return t.insertTextAfterRange(e.comment.range,`\n${n.getSourceCode().lines[e.comment.loc.start.line-1].replace(/^(\s*\/\/\s*@)\S*/,"$1"+s)}`)}})}),{ +missingAttribute:"Didn't find attribute '{{ attribute }}' in the metadata"},!0)},1933:(e,t,n)=>{const i=n(2598),r=["homepage","homepageURL"];e.exports=i(r,!1,(({attrVal:e,metadata:t,context:n,keyName:i})=>{const s=r.find((e=>e!==i));t[s]||n.report({loc:e.loc,messageId:"missingAttribute",data:{attribute:s},fix:function(t){return t.insertTextAfterRange(e.comment.range,`\n${n.getSourceCode().lines[e.comment.loc.start.line-1].replace(/^(\s*\/\/\s*@)\S*/,"$1"+s)}`)}})}),{ +missingAttribute:"Didn't find attribute '{{ attribute }}' in the metadata"},!0)},2598:e=>{e.exports=function(e,t,n=!1,i={},r=!1,s=new RegExp("^("+("string"==typeof e?e:e.join("|"))+")$"),o=!1,a){return"string"==typeof e&&(e=[e]),{meta:{type:"suggestion",docs:{description:`${t?"require "+(n?"and validate ":""):"validate "}${e.join(" and ")} in the metadata for userscripts`,category:"Best Practices"},schema:t?[{enum:["required","optional"],default:"required"}]:a||void 0,messages:{ +missingAttribute:`Didn't find attribute '${e}' in the metadata`,...i},fixable:r?"code":void 0},create:e=>{const i=e.getSourceCode().getAllComments();let r=!1,a=!1,l=!1,c={};for(const e of i.filter((e=>"Line"===e.type)))if(!l)if(r&&"==/UserScript=="===e.value.trim())l=!0;else if(r||"==UserScript=="!==e.value.trim()){if(r&&e.value.trim().startsWith("@")){const t=e.value.trim().slice(1).split(/[\t ]/)[0],n={val:e.value.trim().slice(1).split(/[\t ]/).slice(1).join(" ").trim(),loc:e.loc,comment:e, +key:t};if(c[t]){Array.isArray(c[t])||(c[t]=[c[t]]),c[t].push(n);continue}c[t]=n}}else r=!0,a=!0;const d=Object.keys(c);if(!t||!a||e.options[0]&&"required"!==e.options[0]||d.find((e=>s.test(e)))){if(n&&d.find((e=>s.test(e))))if(o){const t=[];for(const e in d)s.test(d[e])&&t.push(+e);const i=t.map((e=>c[d[e]])).reduce(((e,t)=>Array.isArray(t)?[...e,...t]:[...e,t]),[]);n({attrVal:i,index:[...i.keys()],indexMatch:t.reduce(((e,t)=>Array.isArray(c[d[t]])?[...e,...c[d[t]].map((()=>d))]:[...e,t]),[]), +metadata:c,context:e,keyName:t.map((e=>d[e]))})}else for(const t in d)if(s.test(d[t]))if(Array.isArray(c[d[t]]))for(const[i,r]of c[d[t]].entries())n({attrVal:r,index:i,indexMatch:t,metadata:c,context:e,keyName:d[t]});else n({attrVal:c[d[t]],index:0,indexMatch:t,metadata:c,context:e,keyName:d[t]})}else e.report({loc:i.find((e=>"==UserScript=="===e.value.trim()&&"Line"===e.type)).loc,messageId:"missingAttribute"});return{}}}}},2462:(e,t,n)=>{e.exports=function e(t,n,i){function r(o){if(!n[o]){ +if(!t[o]){if(s)return s(o,!0);var a=new Error("Cannot find module '"+o+"'");throw a.code="MODULE_NOT_FOUND",a}var l=n[o]={exports:{}};t[o][0].call(l.exports,(function(e){return r(t[o][1][e]||e)}),l,l.exports,e,t,n,i)}return n[o].exports}for(var s=void 0,o=0;o>2,a=(3&t)<<4|n>>4,l=h>1?(15&n)<<2|r>>6:64,c=h>2?63&r:64,d.push(s.charAt(o)+s.charAt(a)+s.charAt(l)+s.charAt(c));return d.join("")},n.decode=function(e){var t,n,i,o,a,l,c=0,d=0;if("data:"===e.substr(0,5))throw new Error("Invalid base64 input, it looks like a data url.") +;var u,A=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(e.charAt(e.length-1)===s.charAt(64)&&A--,e.charAt(e.length-2)===s.charAt(64)&&A--,A%1!=0)throw new Error("Invalid base64 input, bad content length.");for(u=r.uint8array?new Uint8Array(0|A):new Array(0|A);c>4,n=(15&o)<<4|(a=s.indexOf(e.charAt(c++)))>>2,i=(3&a)<<6|(l=s.indexOf(e.charAt(c++))),u[d++]=t,64!==a&&(u[d++]=n),64!==l&&(u[d++]=i);return u}},{"./support":30, +"./utils":32}],2:[function(e,t){"use strict";function n(e,t,n,i,r){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=i,this.compressedContent=r}var i=e("./external"),r=e("./stream/DataWorker"),s=e("./stream/DataLengthProbe"),o=e("./stream/Crc32Probe");s=e("./stream/DataLengthProbe"),n.prototype={getContentWorker:function(){var e=new r(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new s("data_length")),t=this +;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new r(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},n.createWorkerFrom=function(e,t,n){ +return e.pipe(new o).pipe(new s("uncompressedSize")).pipe(t.compressWorker(n)).pipe(new s("compressedSize")).withStreamInfo("compression",t)},t.exports=n},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){"use strict";var i=e("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},n.DEFLATE=e("./flate")},{ +"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t){"use strict";var n=e("./utils"),i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==n.getTypeOf(e)?function(e,t,n){var r=i,s=0+n;e^=-1;for(var o=0;o>>8^r[255&(e^t[o])];return-1^e}(0|t,e,e.length):function(e,t,n){var r=i,s=0+n;e^=-1;for(var o=0;o>>8^r[255&(e^t.charCodeAt(o))];return-1^e +}(0|t,e,e.length):0}},{"./utils":32}],5:[function(e,t,n){"use strict";n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t){"use strict";var n;n="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:n}},{lie:37}],7:[function(e,t,n){"use strict";function i(e,t){a.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t, +this.meta={}}var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,s=e("pako"),o=e("./utils"),a=e("./stream/GenericWorker"),l=r?"uint8array":"array";n.magic="\b\0",o.inherits(i,a),i.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(l,e.data),!1)},i.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)}, +i.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},i.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new i("Deflate",e)},n.uncompressWorker=function(){return new i("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t){"use strict";function n(e,t,n,i){ +r.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=i,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}var i=e("../utils"),r=e("../stream/GenericWorker"),s=e("../utf8"),o=e("../crc32"),a=e("../signature"),l=function(e,t){var n,i="";for(n=0;n>>=8;return i},c=function(e,t,n,r,c,d){ +var u,A,h=e.file,p=e.compression,f=d!==s.utf8encode,m=i.transformTo("string",d(h.name)),g=i.transformTo("string",s.utf8encode(h.name)),_=h.comment,b=i.transformTo("string",d(_)),v=i.transformTo("string",s.utf8encode(_)),w=g.length!==h.name.length,y=v.length!==_.length,k="",R="",x="",C=h.dir,E=h.date,G={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(G.crc32=e.crc32,G.compressedSize=e.compressedSize,G.uncompressedSize=e.uncompressedSize);var Z=0;t&&(Z|=8),f||!w&&!y||(Z|=2048);var S,B,T=0,I=0 +;C&&(T|=16),"UNIX"===c?(I=798,T|=(B=S=h.unixPermissions,S||(B=C?16893:33204),(65535&B)<<16)):(I=20,T|=63&(h.dosPermissions||0)),u=E.getUTCHours(),u<<=6,u|=E.getUTCMinutes(),u<<=5,u|=E.getUTCSeconds()/2,A=E.getUTCFullYear()-1980,A<<=4,A|=E.getUTCMonth()+1,A<<=5,A|=E.getUTCDate(),w&&(R=l(1,1)+l(o(m),4)+g,k+="up"+l(R.length,2)+R),y&&(x=l(1,1)+l(o(b),4)+v,k+="uc"+l(x.length,2)+x);var U="";return U+="\n\0",U+=l(Z,2),U+=p.magic,U+=l(u,2),U+=l(A,2),U+=l(G.crc32,4),U+=l(G.compressedSize,4), +U+=l(G.uncompressedSize,4),U+=l(m.length,2),U+=l(k.length,2),{fileRecord:a.LOCAL_FILE_HEADER+U+m+k,dirRecord:a.CENTRAL_FILE_HEADER+l(I,2)+U+l(b.length,2)+"\0\0\0\0"+l(T,4)+l(r,4)+m+k+b}},d=function(e){return a.DATA_DESCRIPTOR+l(e.crc32,4)+l(e.compressedSize,4)+l(e.uncompressedSize,4)};i.inherits(n,r),n.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length, +r.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-i-1))/n:100}}))},n.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=c(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},n.prototype.closedSource=function(e){this.accumulate=!1 +;var t=this.streamFiles&&!e.file.dir,n=c(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:d(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},n.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t0?e.substring(0,t):""},f=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},m=function(e,t){ +return t=void 0!==t?t:a.createFolders,e=f(e),this.files[e]||h.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]},g={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,n,i;for(t in this.files)this.files.hasOwnProperty(t)&&(i=this.files[t],(n=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(n,i))},filter:function(e){var t=[];return this.forEach((function(n,i){ +e(n,i)&&t.push(i)})),t},file:function(e,t,i){if(1===arguments.length){if(n(e)){var r=e;return this.filter((function(e,t){return!t.dir&&r.test(e)}))}var s=this.files[this.root+e];return s&&!s.dir?s:null}return e=this.root+e,h.call(this,e,t,i),this},folder:function(e){if(!e)return this;if(n(e))return this.filter((function(t,n){return n.dir&&e.test(t)}));var t=this.root+e,i=m.call(this,t),r=this.clone();return r.root=i.name,r},remove:function(e){e=this.root+e;var t=this.files[e] +;if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var n=this.filter((function(t,n){return n.name.slice(0,e.length)===e})),i=0;i=0;--s)if(this.data[s]===t&&this.data[s+1]===n&&this.data[s+2]===i&&this.data[s+3]===r)return s-this.zero;return-1},n.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),i=e.charCodeAt(2),r=e.charCodeAt(3),s=this.readData(4);return t===s[0]&&n===s[1]&&i===s[2]&&r===s[3]},n.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[] +;var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=n},{"../utils":32,"./DataReader":18}],18:[function(e,t){"use strict";function n(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}var i=e("../utils");n.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return i.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4) +;return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=n},{"../utils":32}],19:[function(e,t){"use strict";function n(e){i.call(this,e)}var i=e("./Uint8ArrayReader");e("../utils").inherits(n,i),n.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=n},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t){"use strict";function n(e){ +i.call(this,e)}var i=e("./DataReader");e("../utils").inherits(n,i),n.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},n.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},n.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},n.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=n},{"../utils":32,"./DataReader":18}], +21:[function(e,t){"use strict";function n(e){i.call(this,e)}var i=e("./ArrayReader");e("../utils").inherits(n,i),n.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=n},{"../utils":32,"./ArrayReader":17}],22:[function(e,t){"use strict" +;var n=e("../utils"),i=e("../support"),r=e("./ArrayReader"),s=e("./StringReader"),o=e("./NodeBufferReader"),a=e("./Uint8ArrayReader");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),"string"!==t||i.uint8array?"nodebuffer"===t?new o(e):i.uint8array?new a(n.transformTo("uint8array",e)):new r(n.transformTo("array",e)):new s(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){"use strict" +;n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t){"use strict";function n(e){i.call(this,"ConvertWorker to "+e),this.destType=e}var i=e("./GenericWorker"),r=e("../utils");r.inherits(n,i),n.prototype.processChunk=function(e){this.push({data:r.transformTo(this.destType,e.data),meta:e.meta})},t.exports=n},{"../utils":32, +"./GenericWorker":28}],25:[function(e,t){"use strict";function n(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}var i=e("./GenericWorker"),r=e("../crc32");e("../utils").inherits(n,i),n.prototype.processChunk=function(e){this.streamInfo.crc32=r(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=n},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t){"use strict";function n(e){r.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)} +var i=e("../utils"),r=e("./GenericWorker");i.inherits(n,r),n.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}r.prototype.processChunk.call(this,e)},t.exports=n},{"../utils":32,"./GenericWorker":28}],27:[function(e,t){"use strict";function n(e){r.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0, +t.data=e,t.max=e&&e.length||0,t.type=i.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}var i=e("../utils"),r=e("./GenericWorker");i.inherits(n,r),n.prototype.cleanUp=function(){r.prototype.cleanUp.call(this),this.data=null},n.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},n.prototype._tickAndRepeat=function(){this._tickScheduled=!1, +this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},n.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)} +return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=n},{"../utils":32,"./GenericWorker":28}],28:[function(e,t){"use strict";function n(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush() +;try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){ +if(this._listeners[e])for(var n=0;n "+e:e}},t.exports=n},{}],29:[function(e,t){"use strict";function n(e,t,n){var o=t;switch(t){case"blob":case"arraybuffer":o="uint8array";break +;case"base64":o="string"}try{this._internalType=o,this._outputType=t,this._mimeType=n,i.checkSupport(o),this._worker=e.pipe(new r(o)),e.lock()}catch(e){this._worker=new s("error"),this._worker.error(e)}}var i=e("../utils"),r=e("./ConvertWorker"),s=e("./GenericWorker"),o=e("../base64"),a=e("../support"),l=e("../external"),c=null;if(a.nodestream)try{c=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}n.prototype={accumulate:function(e){return t=this,n=e,new l.Promise((function(e,r){ +var s=[],a=t._internalType,l=t._outputType,c=t._mimeType;t.on("data",(function(e,t){s.push(e),n&&n(t)})).on("error",(function(e){s=[],r(e)})).on("end",(function(){try{var t=function(e,t,n){switch(e){case"blob":return i.newBlob(i.transformTo("arraybuffer",t),n);case"base64":return o.encode(t);default:return i.transformTo(e,t)}}(l,function(e,t){var n,i=0,r=null,s=0;for(n=0;n=252?6:d>=248?5:d>=240?4:d>=224?3:d>=192?2:1;c[254]=c[254]=1,n.utf8encode=function(e){ +return o.nodebuffer?a.newBufferFrom(e,"utf-8"):function(e){var t,n,i,r,s,a=e.length,l=0;for(r=0;r>>6, +t[s++]=128|63&n):n<65536?(t[s++]=224|n>>>12,t[s++]=128|n>>>6&63,t[s++]=128|63&n):(t[s++]=240|n>>>18,t[s++]=128|n>>>12&63,t[s++]=128|n>>>6&63,t[s++]=128|63&n);return t}(e)},n.utf8decode=function(e){return o.nodebuffer?s.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,n,i,r,o=e.length,a=new Array(2*o);for(n=0,t=0;t4)a[n++]=65533,t+=r-1;else{for(i&=2===r?31:3===r?15:7;r>1&&t1?a[n++]=65533:i<65536?a[n++]=i:(i-=65536,a[n++]=55296|i>>10&1023,a[n++]=56320|1023&i)}return a.length!==n&&(a.subarray?a=a.subarray(0,n):a.length=n),s.applyFromCharCode(a)}(e=s.transformTo(o.uint8array?"uint8array":"array",e))},s.inherits(i,l),i.prototype.processChunk=function(e){var t=s.transformTo(o.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var i=t;(t=new Uint8Array(i.length+this.leftOver.length)).set(this.leftOver,0), +t.set(i,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var r=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+c[e[n]]>t?n:t}(t),a=t;r!==t.length&&(o.uint8array?(a=t.subarray(0,r),this.leftOver=t.subarray(r,t.length)):(a=t.slice(0,r),this.leftOver=t.slice(r,t.length))),this.push({data:n.utf8decode(a),meta:e.meta})},i.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({ +data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=i,s.inherits(r,l),r.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=r},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){"use strict";function i(e){return e}function r(e,t){for(var n=0;n1;)try{return A.stringifyByChunk(e,i,t)}catch(e){t=Math.floor(t/2)}return A.stringifyByChar(e)}function o(e,t){for(var n=0;n1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e0)this.isSignature(t,s.CENTRAL_FILE_HEADER)||(this.reader.zero=i);else if(i<0)throw new Error("Corrupted zip: missing "+Math.abs(i)+" bytes.")},prepareReader:function(e){this.reader=i(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}}, +t.exports=n},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(e,t){"use strict";function n(e,t){this.options=e,this.loadOptions=t}var i=e("./reader/readerFor"),r=e("./utils"),s=e("./compressedObject"),o=e("./crc32"),a=e("./utf8"),l=e("./compressions"),c=e("./support");n.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,n;if(e.skip(22), +this.fileNameLength=e.readInt(2),n=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(n),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in l)if(l.hasOwnProperty(t)&&l[t].magic===e)return l[t];return null +}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+r.pretty(this.compressionMethod)+" unknown (inner file : "+r.transformTo("string",this.fileName)+")");this.decompressed=new s(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4), +this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)}, +processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===e&&(this.dosPermissions=63&this.externalFileAttributes),3===e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=i(this.extraFields[1].value) +;this.uncompressedSize===r.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===r.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===r.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===r.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,n,i,r=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+40?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var n=s.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==u)throw new Error(l[n]);if(t.header&&s.deflateSetHeader(this.strm,t.header),t.dictionary){var r +;if(r="string"==typeof t.dictionary?a.string2buf(t.dictionary):"[object ArrayBuffer]"===d.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(n=s.deflateSetDictionary(this.strm,r))!==u)throw new Error(l[n]);this._dict_set=!0}}function r(e,t){var n=new i(t);if(n.push(e,!0),n.err)throw n.msg||l[n.err];return n.result}var s=e("./zlib/deflate"),o=e("./utils/common"),a=e("./utils/strings"),l=e("./zlib/messages"),c=e("./zlib/zstream"),d={}.toString,u=0,A=-1,h=0,p=8 +;i.prototype.push=function(e,t){var n,i,r=this.strm,l=this.options.chunkSize;if(this.ended)return!1;i=t===~~t?t:!0===t?4:0,"string"==typeof e?r.input=a.string2buf(e):"[object ArrayBuffer]"===d.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(0===r.avail_out&&(r.output=new o.Buf8(l),r.next_out=0,r.avail_out=l),1!==(n=s.deflate(r,i))&&n!==u)return this.onEnd(n),this.ended=!0,!1 +;0!==r.avail_out&&(0!==r.avail_in||4!==i&&2!==i)||("string"===this.options.to?this.onData(a.buf2binstring(o.shrinkBuf(r.output,r.next_out))):this.onData(o.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||0===r.avail_out)&&1!==n);return 4===i?(n=s.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===u):2!==i||(this.onEnd(u),r.avail_out=0,!0)},i.prototype.onData=function(e){this.chunks.push(e)},i.prototype.onEnd=function(e){ +e===u&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Deflate=i,n.deflate=r,n.deflateRaw=function(e,t){return(t=t||{}).raw=!0,r(e,t)},n.gzip=function(e,t){return(t=t||{}).gzip=!0,r(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,n){"use strict";function i(e){if(!(this instanceof i))return new i(e) +;this.options=o.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var n=s.inflateInit2(this.strm,t.windowBits) +;if(n!==l.Z_OK)throw new Error(c[n]);this.header=new u,s.inflateGetHeader(this.strm,this.header)}function r(e,t){var n=new i(t);if(n.push(e,!0),n.err)throw n.msg||c[n.err];return n.result}var s=e("./zlib/inflate"),o=e("./utils/common"),a=e("./utils/strings"),l=e("./zlib/constants"),c=e("./zlib/messages"),d=e("./zlib/zstream"),u=e("./zlib/gzheader"),A={}.toString;i.prototype.push=function(e,t){var n,i,r,c,d,u,h=this.strm,p=this.options.chunkSize,f=this.options.dictionary,m=!1 +;if(this.ended)return!1;i=t===~~t?t:!0===t?l.Z_FINISH:l.Z_NO_FLUSH,"string"==typeof e?h.input=a.binstring2buf(e):"[object ArrayBuffer]"===A.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new o.Buf8(p),h.next_out=0,h.avail_out=p),(n=s.inflate(h,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&f&&(u="string"==typeof f?a.string2buf(f):"[object ArrayBuffer]"===A.call(f)?new Uint8Array(f):f,n=s.inflateSetDictionary(this.strm,u)), +n===l.Z_BUF_ERROR&&!0===m&&(n=l.Z_OK,m=!1),n!==l.Z_STREAM_END&&n!==l.Z_OK)return this.onEnd(n),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&n!==l.Z_STREAM_END&&(0!==h.avail_in||i!==l.Z_FINISH&&i!==l.Z_SYNC_FLUSH)||("string"===this.options.to?(r=a.utf8border(h.output,h.next_out),c=h.next_out-r,d=a.buf2string(h.output,r),h.next_out=c,h.avail_out=p-c,c&&o.arraySet(h.output,h.output,r,c,0),this.onData(d)):this.onData(o.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(m=!0) +}while((h.avail_in>0||0===h.avail_out)&&n!==l.Z_STREAM_END);return n===l.Z_STREAM_END&&(i=l.Z_FINISH),i===l.Z_FINISH?(n=s.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===l.Z_OK):i!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),h.avail_out=0,!0)},i.prototype.onData=function(e){this.chunks.push(e)},i.prototype.onEnd=function(e){e===l.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}, +n.Inflate=i,n.inflate=r,n.inflateRaw=function(e,t){return(t=t||{}).raw=!0,r(e,t)},n.ungzip=r},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,n){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(e){for(var t=[].slice.call(arguments,1);t.length;){var n=t.shift();if(n){ +if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])}}return e},n.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var r={arraySet:function(e,t,n,i,r){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+i),r);else for(var s=0;s=252?6:l>=248?5:l>=240?4:l>=224?3:l>=192?2:1;a[254]=a[254]=1,n.string2buf=function(e){var t,n,i,s,o,a=e.length,l=0 +;for(s=0;s>>6,t[o++]=128|63&n):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|63&n):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63, +t[o++]=128|n>>>6&63,t[o++]=128|63&n);return t},n.buf2binstring=function(e){return i(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n4)c[r++]=65533,n+=o-1;else{for(s&=2===o?31:3===o?15:7;o>1&&n1?c[r++]=65533:s<65536?c[r++]=s:(s-=65536,c[r++]=55296|s>>10&1023, +c[r++]=56320|1023&s)}return i(c,r)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+a[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t){"use strict";t.exports=function(e,t,n,i){for(var r=65535&e|0,s=e>>>16&65535|0,o=0;0!==n;){n-=o=n>2e3?2e3:n;do{s=s+(r=r+t[i++]|0)|0}while(--o);r%=65521,s%=65521}return r|s<<16|0}},{}],44:[function(e,t){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2, +Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t){"use strict";var n=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}() +;t.exports=function(e,t,i,r){var s=n,o=r+i;e^=-1;for(var a=r;a>>8^s[255&(e^t[a])];return-1^e}},{}],46:[function(e,t,n){"use strict";function i(e,t){return e.msg=R[t],t}function r(e){return(e<<1)-(e>4?9:0)}function s(e){for(var t=e.length;--t>=0;)e[t]=0}function o(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(v.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n, +0===t.pending&&(t.pending_out=0))}function a(e,t){w._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,o(e.strm)}function l(e,t){e.pending_buf[e.pending++]=t}function c(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function d(e,t){ +var n,i,r=e.max_chain_length,s=e.strstart,o=e.prev_length,a=e.nice_match,l=e.strstart>e.w_size-P?e.strstart-(e.w_size-P):0,c=e.window,d=e.w_mask,u=e.prev,A=e.strstart+z,h=c[s+o-1],p=c[s+o];e.prev_length>=e.good_match&&(r>>=2),a>e.lookahead&&(a=e.lookahead);do{if(c[(n=t)+o]===p&&c[n+o-1]===h&&c[n]===c[s]&&c[++n]===c[s+1]){s+=2,n++;do{}while(c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&so){if(e.match_start=t,o=i,i>=a)break;h=c[s+o-1],p=c[s+o]}}}while((t=u[t&d])>l&&0!=--r);return o<=e.lookahead?o:e.lookahead}function u(e){var t,n,i,r,s,o,a,l,c,d,u=e.w_size;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=u+(u-P)){v.arraySet(e.window,e.window,u,u,0),e.match_start-=u,e.strstart-=u,e.block_start-=u,t=n=e.hash_size;do{i=e.head[--t],e.head[t]=i>=u?i-u:0}while(--n);t=n=u;do{i=e.prev[--t],e.prev[t]=i>=u?i-u:0}while(--n);r+=u}if(0===e.strm.avail_in)break;if(o=e.strm, +a=e.window,l=e.strstart+e.lookahead,c=r,d=void 0,(d=o.avail_in)>c&&(d=c),n=0===d?0:(o.avail_in-=d,v.arraySet(a,o.input,o.next_in,d,l),1===o.state.wrap?o.adler=y(o.adler,a,d,l):2===o.state.wrap&&(o.adler=k(o.adler,a,d,l)),o.next_in+=d,o.total_in+=d,d),e.lookahead+=n,e.lookahead+e.insert>=O)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<=O&&(e.ins_h=(e.ins_h<=O)if(i=w._tr_tally(e,e.strstart-e.match_start,e.match_length-O),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=O){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=O&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=O-1)),e.prev_length>=O&&e.match_length<=e.prev_length){ +r=e.strstart+e.lookahead-O,i=w._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-O),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=r&&(e.ins_h=(e.ins_h<15&&(a=2,r-=16),s<1||s>U||n!==I||r<8||r>15||t<0||t>9||o<0||o>B)return i(e,G);8===r&&(r=9);var l=new f;return e.state=l,l.strm=e,l.wrap=a,l.gzhead=null, +l.w_bits=r,l.w_size=1<e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(u(e),0===e.lookahead&&t===x)return q;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+n +;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,a(e,!1),0===e.strm.avail_out))return q;if(e.strstart-e.block_start>=e.w_size-P&&(a(e,!1),0===e.strm.avail_out))return q}return e.insert=0,t===C?(a(e,!0),0===e.strm.avail_out?W:Y):(e.strstart>e.block_start&&(a(e,!1),e.strm.avail_out),q) +})),new p(4,4,8,4,A),new p(4,5,16,8,A),new p(4,6,32,32,A),new p(4,4,16,16,h),new p(8,16,32,32,h),new p(8,16,128,128,h),new p(8,32,128,256,h),new p(32,128,258,1024,h),new p(32,258,258,4096,h)],n.deflateInit=function(e,t){return _(e,t,I,15,8,0)},n.deflateInit2=_,n.deflateReset=g,n.deflateResetKeep=m,n.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?G:(e.state.gzhead=t,E):G},n.deflate=function(e,t){var n,d,A,h;if(!e||!e.state||t>5||t<0)return e?i(e,G):G;if(d=e.state, +!e.output||!e.input&&0!==e.avail_in||d.status===H&&t!==C)return i(e,0===e.avail_out?-5:G);if(d.strm=e,n=d.last_flush,d.last_flush=t,d.status===N)if(2===d.wrap)e.adler=0,l(d,31),l(d,139),l(d,8),d.gzhead?(l(d,(d.gzhead.text?1:0)+(d.gzhead.hcrc?2:0)+(d.gzhead.extra?4:0)+(d.gzhead.name?8:0)+(d.gzhead.comment?16:0)),l(d,255&d.gzhead.time),l(d,d.gzhead.time>>8&255),l(d,d.gzhead.time>>16&255),l(d,d.gzhead.time>>24&255),l(d,9===d.level?2:d.strategy>=2||d.level<2?4:0),l(d,255&d.gzhead.os), +d.gzhead.extra&&d.gzhead.extra.length&&(l(d,255&d.gzhead.extra.length),l(d,d.gzhead.extra.length>>8&255)),d.gzhead.hcrc&&(e.adler=k(e.adler,d.pending_buf,d.pending,0)),d.gzindex=0,d.status=69):(l(d,0),l(d,0),l(d,0),l(d,0),l(d,0),l(d,9===d.level?2:d.strategy>=2||d.level<2?4:0),l(d,3),d.status=Q);else{var p=I+(d.w_bits-8<<4)<<8;p|=(d.strategy>=2||d.level<2?0:d.level<6?1:6===d.level?2:3)<<6,0!==d.strstart&&(p|=32),p+=31-p%31,d.status=Q,c(d,p),0!==d.strstart&&(c(d,e.adler>>>16),c(d,65535&e.adler)), +e.adler=1}if(69===d.status)if(d.gzhead.extra){for(A=d.pending;d.gzindex<(65535&d.gzhead.extra.length)&&(d.pending!==d.pending_buf_size||(d.gzhead.hcrc&&d.pending>A&&(e.adler=k(e.adler,d.pending_buf,d.pending-A,A)),o(e),A=d.pending,d.pending!==d.pending_buf_size));)l(d,255&d.gzhead.extra[d.gzindex]),d.gzindex++;d.gzhead.hcrc&&d.pending>A&&(e.adler=k(e.adler,d.pending_buf,d.pending-A,A)),d.gzindex===d.gzhead.extra.length&&(d.gzindex=0,d.status=73)}else d.status=73 +;if(73===d.status)if(d.gzhead.name){A=d.pending;do{if(d.pending===d.pending_buf_size&&(d.gzhead.hcrc&&d.pending>A&&(e.adler=k(e.adler,d.pending_buf,d.pending-A,A)),o(e),A=d.pending,d.pending===d.pending_buf_size)){h=1;break}h=d.gzindexA&&(e.adler=k(e.adler,d.pending_buf,d.pending-A,A)),0===h&&(d.gzindex=0,d.status=91)}else d.status=91;if(91===d.status)if(d.gzhead.comment){A=d.pending +;do{if(d.pending===d.pending_buf_size&&(d.gzhead.hcrc&&d.pending>A&&(e.adler=k(e.adler,d.pending_buf,d.pending-A,A)),o(e),A=d.pending,d.pending===d.pending_buf_size)){h=1;break}h=d.gzindexA&&(e.adler=k(e.adler,d.pending_buf,d.pending-A,A)),0===h&&(d.status=V)}else d.status=V;if(d.status===V&&(d.gzhead.hcrc?(d.pending+2>d.pending_buf_size&&o(e), +d.pending+2<=d.pending_buf_size&&(l(d,255&e.adler),l(d,e.adler>>8&255),e.adler=0,d.status=Q)):d.status=Q),0!==d.pending){if(o(e),0===e.avail_out)return d.last_flush=-1,E}else if(0===e.avail_in&&r(t)<=r(n)&&t!==C)return i(e,-5);if(d.status===H&&0!==e.avail_in)return i(e,-5);if(0!==e.avail_in||0!==d.lookahead||t!==x&&d.status!==H){var f=2===d.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(u(e),0===e.lookahead)){if(t===x)return q;break}if(e.match_length=0, +n=w._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(a(e,!1),0===e.strm.avail_out))return q}return e.insert=0,t===C?(a(e,!0),0===e.strm.avail_out?W:Y):e.last_lit&&(a(e,!1),0===e.strm.avail_out)?q:X}(d,t):3===d.strategy?function(e,t){for(var n,i,r,s,o=e.window;;){if(e.lookahead<=z){if(u(e),e.lookahead<=z&&t===x)return q;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=O&&e.strstart>0&&(i=o[r=e.strstart-1])===o[++r]&&i===o[++r]&&i===o[++r]){s=e.strstart+z +;do{}while(i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&re.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=O?(n=w._tr_tally(e,1,e.match_length-O),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=w._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(a(e,!1),0===e.strm.avail_out))return q}return e.insert=0,t===C?(a(e,!0), +0===e.strm.avail_out?W:Y):e.last_lit&&(a(e,!1),0===e.strm.avail_out)?q:X}(d,t):b[d.level].func(d,t);if(f!==W&&f!==Y||(d.status=H),f===q||f===W)return 0===e.avail_out&&(d.last_flush=-1),E;if(f===X&&(1===t?w._tr_align(d):5!==t&&(w._tr_stored_block(d,0,0,!1),3===t&&(s(d.head),0===d.lookahead&&(d.strstart=0,d.block_start=0,d.insert=0))),o(e),0===e.avail_out))return d.last_flush=-1,E}return t!==C?E:d.wrap<=0?1:(2===d.wrap?(l(d,255&e.adler),l(d,e.adler>>8&255),l(d,e.adler>>16&255), +l(d,e.adler>>24&255),l(d,255&e.total_in),l(d,e.total_in>>8&255),l(d,e.total_in>>16&255),l(d,e.total_in>>24&255)):(c(d,e.adler>>>16),c(d,65535&e.adler)),o(e),d.wrap>0&&(d.wrap=-d.wrap),0!==d.pending?E:1)},n.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==N&&69!==t&&73!==t&&91!==t&&t!==V&&t!==Q&&t!==H?i(e,G):(e.state=null,t===Q?i(e,-3):E):G},n.deflateSetDictionary=function(e,t){var n,i,r,o,a,l,c,d,A=t.length;if(!e||!e.state)return G +;if(2===(o=(n=e.state).wrap)||1===o&&n.status!==N||n.lookahead)return G;for(1===o&&(e.adler=y(e.adler,t,A,0)),n.wrap=0,A>=n.w_size&&(0===o&&(s(n.head),n.strstart=0,n.block_start=0,n.insert=0),d=new v.Buf8(n.w_size),v.arraySet(d,t,A-n.w_size,n.w_size,0),t=d,A=n.w_size),a=e.avail_in,l=e.next_in,c=e.input,e.avail_in=A,e.next_in=0,e.input=t,u(n);n.lookahead>=O;){i=n.strstart,r=n.lookahead-(O-1);do{n.ins_h=(n.ins_h<>>=v=b>>>24,p-=v,0==(v=b>>>16&255))C[s++]=65535&b;else{if(!(16&v)){if(0==(64&v)){b=f[(65535&b)+(h&(1<>>=v,p-=v),p<15&&(h+=x[i++]<>>=v=b>>>24,p-=v,!(16&(v=b>>>16&255))){if(0==(64&v)){b=m[(65535&b)+(h&(1<l){e.msg="invalid distance too far back",n.mode=30;break e}if(h>>>=v,p-=v,y>(v=s-o)){if((v=y-v)>d&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(k=0,R=A,0===u){if(k+=c-v,v2;)C[s++]=R[k++],C[s++]=R[k++],C[s++]=R[k++],w-=3;w&&(C[s++]=R[k++],w>1&&(C[s++]=R[k++]))}else{k=s-y;do{C[s++]=C[k++],C[s++]=C[k++],C[s++]=C[k++],w-=3}while(w>2);w&&(C[s++]=C[k++],w>1&&(C[s++]=C[k++]))}break}}break}}while(i>3,h&=(1<<(p-=w<<3))-1,e.next_in=i,e.next_out=s,e.avail_in=i>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function r(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new h.Buf16(320), +this.work=new h.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function s(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=y,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new h.Buf32(x),t.distcode=t.distdyn=new h.Buf32(C),t.sane=1,t.back=-1,v):w}function o(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,s(e)):w}function a(e,t){var n,i +;return e&&e.state?(i=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?w:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,o(e))):w}function l(e,t){var n,i;return e?(i=new r,e.state=i,i.window=null,(n=a(e,t))!==v&&(e.state=null),n):w}function c(e){if(E){var t;for(u=new h.Buf32(512),A=new h.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(g(_,e.lens,0,288,u,0,e.work,{bits:9}), +t=0;t<32;)e.lens[t++]=5;g(b,e.lens,0,32,A,0,e.work,{bits:5}),E=!1}e.lencode=u,e.lenbits=9,e.distcode=A,e.distbits=5}function d(e,t,n,i){var r,s=e.state;return null===s.window&&(s.wsize=1<=s.wsize?(h.arraySet(s.window,t,n-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((r=s.wsize-s.wnext)>i&&(r=i),h.arraySet(s.window,t,n-i,r,s.wnext),(i-=r)?(h.arraySet(s.window,t,n-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=r, +s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,n.check=f(n.check,P,2,0),A=0,x=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&A)<<8)+(A>>8))%31){ +e.msg="incorrect header check",n.mode=R;break}if(8!=(15&A)){e.msg="unknown compression method",n.mode=R;break}if(x-=4,M=8+(15&(A>>>=4)),0===n.wbits)n.wbits=M;else if(M>n.wbits){e.msg="invalid window size",n.mode=R;break}n.dmax=1<>8&1),512&n.flags&&(P[0]=255&A,P[1]=A>>>8&255,n.check=f(n.check,P,2,0)),A=0,x=0,n.mode=3;case 3:for(;x<32;){if(0===l)break e;l--,A+=r[o++]<>>8&255,P[2]=A>>>16&255,P[3]=A>>>24&255,n.check=f(n.check,P,4,0)),A=0,x=0,n.mode=4;case 4:for(;x<16;){if(0===l)break e;l--,A+=r[o++]<>8),512&n.flags&&(P[0]=255&A,P[1]=A>>>8&255,n.check=f(n.check,P,2,0)),A=0,x=0,n.mode=5 +;case 5:if(1024&n.flags){for(;x<16;){if(0===l)break e;l--,A+=r[o++]<>>8&255,n.check=f(n.check,P,2,0)),A=0,x=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((G=n.length)>l&&(G=l),G&&(n.head&&(M=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),h.arraySet(n.head.extra,r,o,G,M)),512&n.flags&&(n.check=f(n.check,r,G,o)),l-=G,o+=G,n.length-=G),n.length))break e +;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===l)break e;G=0;do{M=r[o+G++],n.head&&M&&n.length<65536&&(n.head.name+=String.fromCharCode(M))}while(M&&G>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=k;break;case 10:for(;x<32;){if(0===l)break e;l--,A+=r[o++]<>>=7&x,x-=7&x,n.mode=27;break}for(;x<3;){if(0===l)break e;l--,A+=r[o++]<>>=1)){case 0:n.mode=14;break;case 1:if(c(n),n.mode=20,6===t){A>>>=2,x-=2;break e}break;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=R}A>>>=2,x-=2;break;case 14:for(A>>>=7&x,x-=7&x;x<32;){if(0===l)break e;l--,A+=r[o++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=R;break} +if(n.length=65535&A,A=0,x=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(G=n.length){if(G>l&&(G=l),G>u&&(G=u),0===G)break e;h.arraySet(s,r,o,G,a),l-=G,o+=G,u-=G,a+=G,n.length-=G;break}n.mode=k;break;case 17:for(;x<14;){if(0===l)break e;l--,A+=r[o++]<>>=5,x-=5,n.ndist=1+(31&A),A>>>=5,x-=5,n.ncode=4+(15&A),A>>>=4,x-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=R;break}n.have=0,n.mode=18;case 18:for(;n.have>>=3,x-=3}for(;n.have<19;)n.lens[N[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,D={bits:n.lenbits},j=g(0,n.lens,0,19,n.lencode,0,n.work,D),n.lenbits=D.bits,j){e.msg="invalid code lengths set",n.mode=R;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,I=65535&z,!((B=z>>>24)<=x);){if(0===l)break e;l--,A+=r[o++]<>>=B,x-=B,n.lens[n.have++]=I;else{ +if(16===I){for(O=B+2;x>>=B,x-=B,0===n.have){e.msg="invalid bit length repeat",n.mode=R;break}M=n.lens[n.have-1],G=3+(3&A),A>>>=2,x-=2}else if(17===I){for(O=B+3;x>>=B)),A>>>=3,x-=3}else{for(O=B+7;x>>=B)),A>>>=7,x-=7}if(n.have+G>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=R;break}for(;G--;)n.lens[n.have++]=M}} +if(n.mode===R)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=R;break}if(n.lenbits=9,D={bits:n.lenbits},j=g(_,n.lens,0,n.nlen,n.lencode,0,n.work,D),n.lenbits=D.bits,j){e.msg="invalid literal/lengths set",n.mode=R;break}if(n.distbits=6,n.distcode=n.distdyn,D={bits:n.distbits},j=g(b,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,D),n.distbits=D.bits,j){e.msg="invalid distances set",n.mode=R;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(l>=6&&u>=258){ +e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=l,n.hold=A,n.bits=x,m(e,E),a=e.next_out,s=e.output,u=e.avail_out,o=e.next_in,r=e.input,l=e.avail_in,A=n.hold,x=n.bits,n.mode===k&&(n.back=-1);break}for(n.back=0;T=(z=n.lencode[A&(1<>>16&255,I=65535&z,!((B=z>>>24)<=x);){if(0===l)break e;l--,A+=r[o++]<>U)])>>>16&255,I=65535&z,!(U+(B=z>>>24)<=x);){if(0===l)break e;l--,A+=r[o++]<>>=U,x-=U,n.back+=U} +if(A>>>=B,x-=B,n.back+=B,n.length=I,0===T){n.mode=26;break}if(32&T){n.back=-1,n.mode=k;break}if(64&T){e.msg="invalid literal/length code",n.mode=R;break}n.extra=15&T,n.mode=22;case 22:if(n.extra){for(O=n.extra;x>>=n.extra,x-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;T=(z=n.distcode[A&(1<>>16&255,I=65535&z,!((B=z>>>24)<=x);){if(0===l)break e;l--,A+=r[o++]<>U)])>>>16&255,I=65535&z,!(U+(B=z>>>24)<=x);){if(0===l)break e;l--,A+=r[o++]<>>=U,x-=U,n.back+=U}if(A>>>=B,x-=B,n.back+=B,64&T){e.msg="invalid distance code",n.mode=R;break}n.offset=I,n.extra=15&T,n.mode=24;case 24:if(n.extra){for(O=n.extra;x>>=n.extra,x-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=R;break}n.mode=25;case 25: +if(0===u)break e;if(G=E-u,n.offset>G){if((G=n.offset-G)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=R;break}G>n.wnext?(G-=n.wnext,Z=n.wsize-G):Z=n.wnext-G,G>n.length&&(G=n.length),S=n.window}else S=s,Z=a-n.offset,G=n.length;G>u&&(G=u),u-=G,n.length-=G;do{s[a++]=S[Z++]}while(--G);0===n.length&&(n.mode=21);break;case 26:if(0===u)break e;s[a++]=n.length,u--,n.mode=21;break;case 27:if(n.wrap){for(;x<32;){if(0===l)break e;l--,A|=r[o++]<=1&&0===L[C];C--);if(E>C&&(E=C),0===C)return c[d++]=20971520,c[d++]=20971520,A.bits=1,0;for(x=1;x0&&(0===e||1!==C))return-1;for(F[1]=0,k=1;k<15;k++)F[k+1]=F[k]+L[k];for(R=0;R852||2===e&&B>592)return 1;for(;;){b=k-Z,u[R]<_?(v=0,w=u[R]):u[R]>_?(v=M[j+u[R]],w=I[U+u[R]]):(v=96,w=0),h=1<>Z)+(p-=h)]=b<<24|v<<16|w|0}while(0!==p);for(h=1<>=1;if(0!==h?(T&=h-1,T+=h):T=0,R++,0==--L[k]){if(k===C)break;k=t[a+u[R]]}if(k>E&&(T&m)!==f){for(0===Z&&(Z=E),g+=x,S=1<<(G=k-Z);G+Z852||2===e&&B>592)return 1;c[f=T&m]=E<<24|G<<16|g-d|0}}return 0!==T&&(c[g+T]=k-Z<<24|64<<16|0),A.bits=E,0}},{"../utils/common":41}],51:[function(e,t){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,t,n){"use strict";function i(e){for(var t=e.length;--t>=0;)e[t]=0}function r(e,t,n,i,r){this.static_tree=e,this.extra_bits=t, +this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=e&&e.length}function s(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function o(e){return e<256?O[e]:O[256+(e>>>7)]}function a(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function l(e,t,n){e.bi_valid>Z-n?(e.bi_buf|=t<>Z-e.bi_valid,e.bi_valid+=n-Z):(e.bi_buf|=t<>>=1,n<<=1}while(--t>0);return n>>>1}function u(e,t,n){var i,r,s=new Array(G+1),o=0;for(i=1;i<=G;i++)s[i]=o=o+n[i-1]<<1;for(r=0;r<=t;r++){var a=e[2*r+1];0!==a&&(e[2*r]=d(s[a]++,a))}}function A(e){var t;for(t=0;t8?a(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0, +e.bi_valid=0}function p(e,t,n,i){var r=2*t,s=2*n;return e[r]>1;n>=1;n--)f(e,s,n);r=l;do{n=e.heap[1], +e.heap[1]=e.heap[e.heap_len--],f(e,s,1),i=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=i,s[2*r]=s[2*n]+s[2*i],e.depth[r]=(e.depth[n]>=e.depth[i]?e.depth[n]:e.depth[i])+1,s[2*n+1]=s[2*i+1]=r,e.heap[1]=r++,f(e,s,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,i,r,s,o,a,l=t.dyn_tree,c=t.max_code,d=t.stat_desc.static_tree,u=t.stat_desc.has_stree,A=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,p=t.stat_desc.max_length,f=0;for(s=0;s<=G;s++)e.bl_count[s]=0 +;for(l[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;np&&(s=p,f++),l[2*i+1]=s,i>c||(e.bl_count[s]++,o=0,i>=h&&(o=A[i-h]),a=l[2*i],e.opt_len+=a*(s+o),u&&(e.static_len+=a*(d[2*i+1]+o)));if(0!==f){do{for(s=p-1;0===e.bl_count[s];)s--;e.bl_count[s]--,e.bl_count[s+1]+=2,e.bl_count[p]--,f-=2}while(f>0);for(s=p;0!==s;s--)for(i=e.bl_count[s];0!==i;)(r=e.heap[--n])>c||(l[2*r+1]!==s&&(e.opt_len+=(s-l[2*r+1])*l[2*r],l[2*r+1]=s),i--)}}(e,t),u(s,c,e.bl_count)} +function _(e,t,n){var i,r,s=-1,o=t[1],a=0,l=7,c=4;for(0===o&&(l=138,c=3),t[2*(n+1)+1]=65535,i=0;i<=n;i++)r=o,o=t[2*(i+1)+1],++a>=7;i0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1 +;for(t=32;t=3&&0===e.bl_tree[2*M[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),r=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=r&&(r=s)):r=s=n+5,n+4<=r&&-1!==t?v(e,t,n,i):4===e.strategy||s===r?(l(e,2+(i?1:0),3),m(e,j,D)):(l(e,4+(i?1:0),3),function(e,t,n,i){var r;for(l(e,t-257,5),l(e,n-1,5), +l(e,i-4,4),r=0;r>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(z[n]+k+1)]++,e.dyn_dtree[2*o(t)]++),e.last_lit===e.lit_bufsize-1}, +n._tr_align=function(e){l(e,2,3),c(e,S,j),function(e){16===e.bi_valid?(a(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t){"use strict" +;t.exports="function"==typeof setImmediate?setImmediate:function(){var e=[].slice.apply(arguments);e.splice(1,0,0),setTimeout.apply(null,e)}},{}]},{},[10])(10)}},n={};e.n=t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},e.d=(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){ +if("object"==typeof window)return window}}(),e.o=(e,t)=>({}.hasOwnProperty.call(e,t)),(()=>{"use strict";function t(e,t){return null===e||void 0===e&&t?"":void 0===e?void 0:`${e}`}function n(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(Sr.isArrayBuffer(e)||Sr.isArrayBufferView(e)){var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(e){for(var i=0;i=64;){for(a=0;a<16;++a)t[a]=n.getInt32();for(;a<64;++a)i=((i=t[a-2])>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,r=((r=t[a-15])>>>7|r<<25)^(r>>>18|r<<14)^r>>>3,t[a]=i+t[a-7]+r+t[a-16]|0;for(l=e.h0,c=e.h1,d=e.h2,u=e.h3,A=e.h4,h=e.h5,p=e.h6,f=e.h7, +a=0;a<64;++a)s=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),o=l&c|d&(l^c),i=f+((A>>>6|A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7))+(p^A&(h^p))+Ur[a]+t[a],f=p,p=h,h=A,A=u+i|0,u=d,d=c,c=l,l=i+(r=s+o)|0;e.h0=e.h0+l|0,e.h1=e.h1+c|0,e.h2=e.h2+d|0,e.h3=e.h3+u|0,e.h4=e.h4+A|0,e.h5=e.h5+h|0,e.h6=e.h6+p|0,e.h7=e.h7+f|0,m-=64}}let r;Object.fromEntries?r=Object.fromEntries:(r=e=>[...e].reduce(((e,[t,n])=>(e[t]=n,e)),{}),Object.fromEntries=r),Object.defineProperties(Promise.prototype,{done:{value:function(e){ +return this.then(((...t)=>e.apply(this,t)))},configurable:!0,enumerable:!0,writable:!1},fail:{value:function(e){return this.then((()=>{}),((...t)=>e.apply(this,t)))},configurable:!0,enumerable:!0,writable:!1},always:{value:function(e){return this.then(((...t)=>e.apply(this,t)),((...t)=>e.apply(this,t)))},configurable:!0,enumerable:!0,writable:!1}}) +;const s=Promise,{AbortController:o,FileReader:a,TextDecoder:l,atob:c,btoa:d,clearInterval:u,clearTimeout:A,crypto:h,decodeURIComponent:p,encodeURIComponent:f,escape:m,location:g,setInterval:_,setTimeout:b,unescape:v}=self;let{fetch:w}=self;g.origin,g.host;const{addEventListener:y,removeEventListener:k}=self,R=y,{DOMParser:x,Notification:C,Image:E,Worker:G,alert:Z,confirm:S,document:B,screen:T,webkitNotifications:I,navigation:U,showOpenFilePicker:L}=self;let F;try{F=self.localStorage}catch(e){} +const M=F;let{XMLHttpRequest:j}=self;const{clients:D}=self,O=(e,t)=>{null==t&&(t=[]);const n=new RegExp("(\\"+["/",".","+","?","|","(",")","[","]","{","}","\\"].concat(t).join("|\\")+")","g");return e.replace(n,"\\$1")},z=e=>O(e,["*"]),P={"&":"&","<":"<",">":">",'"':""","\\":"\"},N=e=>(({}.toString.apply(e).match(/\s([a-z|A-Z]+)/)||[])[1]),V=(e,t)=>{const n=N(e);if("Array"===n||"NodeList"===n){for(let n=0;n{let r;if(Array.isArray(n)){const e={};n.forEach((t=>{e[t]=!0})),r=e}else r=n;return V(r||e,((n,s)=>{if(!r||r.hasOwnProperty(s)){let n;const o=e[s],a=N(o);if("Undefined"==a)return;if(r&&i&&(n=N(r[s]))&&n!==a&&("Array"===n||"Object"===n))return;"Object"==a?(t[s]={},Q(o,t[s],r?r[s]:null)):"Array"==a?(t[s]=[],Q(o,t[s])):t[s]=o}})),t +},H=(e,t)=>{let n=!0;if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return e===t;for(const[i,r]of Object.entries(t))if(void 0!==r&&(n=void 0!==e[i]&&(null===r?null===e[i]:r instanceof RegExp?!!`${e[i]}`.match(r):"object"==typeof r?H(e[i],r):e[i]===r),!n))break;return n},q=(e,t,n)=>{void 0===n&&(n="-");const i=t?/[:<>|~?*\x00-\x1F\uFDD0-\uFDEF"]/g:/[:<>|~?*\x00-\x1F\uFDD0-\uFDEF"\/\\]|^[.]|[.]$/g +;return!t&&/^((CON|PRN|AUX|NUL|CLOCK\$|COM[1-9]|LPT[1-9])(\..*)?|device(\..*)?|desktop.ini|thumbs.db)$/i.test(e)?(n||"_")+e.replace(i,n):e.replace(i,n)},X=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})),W=(e,t)=>{const n=[];for(let i=0,r=e.length;i{let t,n,i=e.length;for(;0!==i;)n=Math.floor(Math.random()*i),i-=1,t=e[i],e[i]=e[n],e[n]=t;return e},J="display: none;" +;let K=0;const $=[],ee=()=>{const e=["debug"],t=["log"],n=["warn","info"],i=["error"],r=[...e,...t,...n,...i],s=i;K>=80&&s.push(...e),K>=60&&s.push(...t),K>=30&&s.push(...n),r.forEach((e=>te[e]=s.includes(e)?console[e].bind(console):()=>{}))},te={set:e=>{K=e,$.forEach((e=>{e(te,K)})),ee()},get:()=>K,get verbose(){return(te.debug||(()=>{})).bind(console)},debug:()=>{},log:()=>{},warn:()=>{},info:()=>{},error:()=>{},addChangeListener:e=>{$.push(e)}};ee();const ne=e=>v(f(e)),ie=e=>p(m(e)),re=e=>{ +let t="";for(let n=0;nc(e),oe=(e,t)=>{try{let n;n="object"==typeof t?t.encoding:t,n&&"utf-8"==n.toLowerCase()&&(e=ne(e));const i=new Uint8Array(e.length);for(let t=0;tnew Promise(((n,i)=>{const r=t&&t.encoding?"text/plain":"binary/octet-stream",s=new Blob([e],{type:r}),o=new a;o.onload=e=>{ +e.target?n(e.target.result):i(new Error("Could not convert array to string!"))},t&&t.encoding?o.readAsText(s,t.encoding):o.readAsBinaryString(s)})),le=(e,t)=>{const n=(e,t)=>e<>>32-t,i=(e,t)=>{const n=2147483648&e,i=2147483648&t,r=1073741824&e,s=1073741824&t,o=(1073741823&e)+(1073741823&t);return r&s?2147483648^o^n^i:r|s?1073741824&o?3221225472^o^n^i:1073741824^o^n^i:o^n^i},r=(e,t,r,s,o,a,l)=>(e=i(e,i(i(((e,t,n)=>e&t|~e&n)(t,r,s),o),l)), +i(n(e,a),t)),s=(e,t,r,s,o,a,l)=>(e=i(e,i(i(((e,t,n)=>e&n|t&~n)(t,r,s),o),l)),i(n(e,a),t)),o=(e,t,r,s,o,a,l)=>(e=i(e,i(i(((e,t,n)=>e^t^n)(t,r,s),o),l)),i(n(e,a),t)),a=(e,t,r,s,o,a,l)=>(e=i(e,i(i(((e,t,n)=>t^(e|~n))(t,r,s),o),l)),i(n(e,a),t)),l=e=>{let t,n,i="",r="";for(n=0;n<=3;n++)t=e>>>8*n&255,r="0"+t.toString(16),i+=r.substr(r.length-2,2);return i};let c,d,u,A,h,p,f,m,g,_=[];for(t&&"utf-8"==t.toLowerCase()&&(e=ne(e)),_=(e=>{let t;const n=e.length,i=n+8,r=16*((i-i%64)/64+1),s=Array(r-1) +;let o=0,a=0;for(;a>>29,s})(e),p=1732584193,f=4023233417,m=2562383102,g=271733878,c=0;c<_.length;c+=16)d=p,u=f,A=m,h=g,p=r(p,f,m,g,_[c+0],7,3614090360),g=r(g,p,f,m,_[c+1],12,3905402710),m=r(m,g,p,f,_[c+2],17,606105819),f=r(f,m,g,p,_[c+3],22,3250441966),p=r(p,f,m,g,_[c+4],7,4118548399),g=r(g,p,f,m,_[c+5],12,1200080426),m=r(m,g,p,f,_[c+6],17,2821735955), +f=r(f,m,g,p,_[c+7],22,4249261313),p=r(p,f,m,g,_[c+8],7,1770035416),g=r(g,p,f,m,_[c+9],12,2336552879),m=r(m,g,p,f,_[c+10],17,4294925233),f=r(f,m,g,p,_[c+11],22,2304563134),p=r(p,f,m,g,_[c+12],7,1804603682),g=r(g,p,f,m,_[c+13],12,4254626195),m=r(m,g,p,f,_[c+14],17,2792965006),f=r(f,m,g,p,_[c+15],22,1236535329),p=s(p,f,m,g,_[c+1],5,4129170786),g=s(g,p,f,m,_[c+6],9,3225465664),m=s(m,g,p,f,_[c+11],14,643717713),f=s(f,m,g,p,_[c+0],20,3921069994),p=s(p,f,m,g,_[c+5],5,3593408605), +g=s(g,p,f,m,_[c+10],9,38016083),m=s(m,g,p,f,_[c+15],14,3634488961),f=s(f,m,g,p,_[c+4],20,3889429448),p=s(p,f,m,g,_[c+9],5,568446438),g=s(g,p,f,m,_[c+14],9,3275163606),m=s(m,g,p,f,_[c+3],14,4107603335),f=s(f,m,g,p,_[c+8],20,1163531501),p=s(p,f,m,g,_[c+13],5,2850285829),g=s(g,p,f,m,_[c+2],9,4243563512),m=s(m,g,p,f,_[c+7],14,1735328473),f=s(f,m,g,p,_[c+12],20,2368359562),p=o(p,f,m,g,_[c+5],4,4294588738),g=o(g,p,f,m,_[c+8],11,2272392833),m=o(m,g,p,f,_[c+11],16,1839030562), +f=o(f,m,g,p,_[c+14],23,4259657740),p=o(p,f,m,g,_[c+1],4,2763975236),g=o(g,p,f,m,_[c+4],11,1272893353),m=o(m,g,p,f,_[c+7],16,4139469664),f=o(f,m,g,p,_[c+10],23,3200236656),p=o(p,f,m,g,_[c+13],4,681279174),g=o(g,p,f,m,_[c+0],11,3936430074),m=o(m,g,p,f,_[c+3],16,3572445317),f=o(f,m,g,p,_[c+6],23,76029189),p=o(p,f,m,g,_[c+9],4,3654602809),g=o(g,p,f,m,_[c+12],11,3873151461),m=o(m,g,p,f,_[c+15],16,530742520),f=o(f,m,g,p,_[c+2],23,3299628645),p=a(p,f,m,g,_[c+0],6,4096336452), +g=a(g,p,f,m,_[c+7],10,1126891415),m=a(m,g,p,f,_[c+14],15,2878612391),f=a(f,m,g,p,_[c+5],21,4237533241),p=a(p,f,m,g,_[c+12],6,1700485571),g=a(g,p,f,m,_[c+3],10,2399980690),m=a(m,g,p,f,_[c+10],15,4293915773),f=a(f,m,g,p,_[c+1],21,2240044497),p=a(p,f,m,g,_[c+8],6,1873313359),g=a(g,p,f,m,_[c+15],10,4264355552),m=a(m,g,p,f,_[c+6],15,2734768916),f=a(f,m,g,p,_[c+13],21,1309151649),p=a(p,f,m,g,_[c+4],6,4149444226),g=a(g,p,f,m,_[c+11],10,3174756917),m=a(m,g,p,f,_[c+2],15,718787259), +f=a(f,m,g,p,_[c+9],21,3951481745),p=i(p,d),f=i(f,u),m=i(m,A),g=i(g,h);return(l(p)+l(f)+l(m)+l(g)).toLowerCase()},ce=e=>{let t;t=e.split(",")[0].includes("base64")?c(e.split(",")[1]):v(e.split(",")[1]);const n=e.split(",")[0].split(":")[1].split(";")[0];return new Blob([oe(t)],{type:n})},de=e=>new Promise((t=>{const n=new a;n.onload=e=>{var n;t((null===(n=e.target)||void 0===n?void 0:n.result)||void 0)},n.readAsDataURL(e)})),ue=async(e,t)=>new Promise((n=>{const i=new a;i.onload=()=>{ +n(i.result||"")},i.onerror=e=>{te.warn(`unable to decode data ${e}`),n(void 0)},t?i.readAsText(e,t):i.readAsBinaryString(e)})),Ae=(e,t)=>re(e+"_"+t).replace(/[^0-9a-zA-Z_-]/g,""),he=e=>{const t={};let n=window.location.search.replace(/^\?/,"");const i=window.location.hash.replace(/^#/,"");n?e&&i&&(n=n+"&"+i):n=i;const r=n.split("&");let s;for(let e=0;e{ +setTimeout((()=>{alert(e)}),1)},fe=(e,t,n,i,r,s)=>{let o;try{let a=e+"_"+Ae(n,i);if(null!=r&&(a+="_"+r),o=document.getElementById(a),o&&s){const t=document.createElement(e);t.setAttribute("id",a);const n=o.parentNode;n.insertBefore(t,o),n.removeChild(o),o=t}else o?o.inserted=!0:(o=document.createElement(e),o.setAttribute("id",a));t&&o.setAttribute("class",t),o.__removeChild||(o.__removeChild=o.removeChild,o.removeChild=e=>{delete e.inserted,o.__removeChild(e)}), +o.__appendChild||(o.__appendChild=o.appendChild,o.appendChild=(e,t)=>{"Array"!==N(e)&&(e=[e]),e.forEach((e=>{(!e.parentElement&&!e.inserted||t)&&o.__appendChild(e)}))}),o.__insertBefore||(o.__insertBefore=o.insertBefore,o.insertBefore=(e,t)=>{e.parentElement||e.inserted||o.__insertBefore(e,t)})}catch(e){console.log("options: Error:"+e.message)}return o},me=(e,t,n,i,r)=>fe(e,null,t,n,i,r),ge=globalThis;let _e,be,ve,we,ye,{chrome:ke,browser:Re}=ge;const xe=()=>{if(void 0!==be)return be;try{ +be=-1!=navigator.userAgent.indexOf("Mac OS X")}catch(e){}return be};we=()=>{if(void 0!==_e)return _e;try{const e=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);e&&(_e=parseInt(e[2]))}catch(e){}return _e},ye=()=>{if(void 0!==ve)return ve;try{ve=-1!=navigator.userAgent.search(/Android|Mobile/)}catch(e){}return ve},we();const Ce={CLOSE_ALLOWED:!0,MIN_DELAY:xe()?150:0},Ee={DEFAULT:"storage.local",SECURE:!1,NO_WARNING:!1},Ge=["chrome-extension:"];[].concat(["chrome"]);const Ze=e=>{ +window.setTimeout((()=>location.reload()),e||0)},Se=(()=>{const e={getInternalPathRegexp:function(e,t){const n=new RegExp("(\\"+["/",".","+","?","|","(",")","[","]","{","}","\\"].join("|\\")+")","g"),i=Ge[0]+"//"+Se.id+"/";return new RegExp(i.replace(n,"\\$1")+"([a-zA-Z"+(e?"\\/":"")+"]*)"+(t||"").replace(n,"\\$1"))},getInternalPageRegexp:function(){return Se.getInternalPathRegexp(!1,".html")},getPlatformInfo:e=>ke.runtime.getPlatformInfo(e),getBrowserInfo:e=>{e({name:"Chrome",version:`${we()}`, +vendor:"unknown"})}};return Object.defineProperty(e,"lastError",{get:()=>ke.runtime.lastError,enumerable:!0}),Object.defineProperty(e,"id",{get:()=>ke.runtime.id,enumerable:!0}),Object.defineProperty(e,"short_id",{get:()=>e.id.replace(/[^0-9a-zA-Z]/g,"").substr(0,4),enumerable:!0}),e})(),Be=(()=>{let e;return Object.defineProperties({},{inIncognitoContext:{get:()=>(void 0===e&&(e=ke.extension.inIncognitoContext),e),set:t=>{e=t},enumerable:!0},...Object.getOwnPropertyDescriptors({ +getURL:function(e){return ke.runtime.getURL(e)},sendMessage:(e,t)=>ke.runtime.sendMessage(e,t),onMessage:{addListener:e=>ke.runtime.onMessage.addListener(e)},connect:e=>ke.runtime.connect({name:e}),urls:{prepareForReport:function(e){return e}}})})})(),Te=e=>{const t=(()=>{let e,t;const n=[],i=[],r=e=>{i.push(e),s()},s=()=>{if(void 0!==e){let n;for(;i.length;)n=i.shift(),void 0!==n.state&&n.state!==e||"function"==typeof n.f&&n.f.call(o,t)}},o={promise:()=>o,done:e=>(r({state:!0,f:e}),o), +fail:e=>(r({state:!1,f:e}),o),always:e=>(r({f:e}),o),progress:e=>(e&&n.push(e),o),then:(e,n,i)=>Te((r=>{const s=(e,n)=>(...i)=>{const s=e?e(t):void 0,o=s&&"function"==typeof s.promise?s.promise():null,a=s&&"function"==typeof s.then?s:null;if(o)o.done((e=>r.resolve(e))).fail(((...e)=>r.reject(e[0]))).progress(((...e)=>r.notify(...e)));else if(a)a.then(((...e)=>r.resolve(...e)),(e=>r.reject(e)));else{const t=e?[s]:i;r[n](t[0])}};o.done(s(e,"resolve")),o.fail(s(n,"reject")), +o.progress(s(i,"notify"))})).promise(),each:e=>{const t=Te();return o.then((n=>{const i=Array.isArray(n)?n:[n];Te.when(i.map((t=>e(t)))).then(t.resolve)})),t.promise()},iterate:e=>{const t=Te();return o.then((n=>{const i=(Array.isArray(n)?n:[n]).map((t=>()=>e(t)));Te.onebyone(i,!0).done((e=>{t.resolve(e)})).fail(t.reject)})),t.promise()}};return{get:()=>o,try_resolve:n=>(void 0===e&&(e=!0,t=n),s(),o),try_reject:n=>(void 0===e&&(e=!1,t=n),s(),o),do_notify:e=>((e=>{n.forEach((t=>t(e)))})(e),o)} +})(),n={promise:()=>t.get(),resolve:e=>t.try_resolve(e),reject:e=>t.try_reject(e),notify:e=>t.do_notify(e),consume:e=>(e&&e.promise?e.promise().done((e=>n.resolve(e))).fail(((...e)=>n.reject(e[0]))).progress((e=>n.notify(e))):e&&e.then?e.then((e=>n.resolve(e)),((...e)=>n.reject(e[0]))):te.warn("promise: incompatible object given to consume()",e),n.promise())};return e&&e(n),n};Te.Pledge=(...e)=>{const t=Te();return t.resolve(...e),t.promise()},Te.Breach=(...e)=>{const t=Te() +;return t.reject(e[0]),t.promise()},Te.onebyone=(e,t=!0)=>{const n=[],i=Te();let r=0;const s=()=>{if(r{n.push(e),s()})).fail((()=>{if(n.push(null),t)return i.reject();s()})):o&&o.then?o.then((e=>{n.push(e),s()}),(()=>{if(n.push(null),t)return i.reject();s()})):(n.push(o),s())}else i.resolve(n)};return s(),i.promise()},Te.or=e=>{let t;const n=Te(),i=()=>{e.length?(t=e.shift(), +t&&Te.Pledge().then(t).done(n.resolve).fail(i)):n.reject()};return i(),n.promise()},Te.sidebyside=e=>{e=Array.isArray(e)?e:[e];const t=Te();let n=e.length;return n?e.forEach((e=>{e&&e.promise&&e.promise().always((()=>{0==--n&&t.resolve()}))})):t.resolve(),t.promise()},Te.when=e=>{e=Array.isArray(e)?e:[e];const t=Te();let n=e.length;const i=[];return n?e.forEach((e=>{let r;if(e&&e.promise)r=e.promise();else{if(!e.then)return void te.warn("promise: incompatible object given to when()",e);r=e} +r.fail((()=>{t.reject(),n=-1})).done((e=>{i.push(e),0==--n&&t.resolve(i)}))})):t.resolve(i),t.promise()},Te.all=e=>Te.when(e).then((()=>{})),Te.from=e=>{const t=Te();return e.then(t.resolve,t.reject),t.promise()},Te.heal=e=>e instanceof Array?Te.all(e.map((e=>Te.from(e).then((()=>{}),(()=>Te.Pledge()))))):Te.from(e).then((()=>{}),(()=>{}));let Ie=[];const Ue={},Le={},Fe=(e,t)=>{const n="string"==typeof e?[e]:e,i=()=>{n.every((e=>!!Me[e]))?t():Ie.push(i)};n.forEach((e=>{ +if(void 0===Me[e]&&void 0===Ue[e]){const t=b((()=>{Le[e]||(delete Ue[e],je(e),Oe(Be.getURL(e+".js"),(()=>{De(e)})))}),0);Ue[e]=()=>{A(t),delete Ue[e]}}})),i()},Me={},je=e=>{Le[e]=!0},De=e=>{if(!Me[e]){let t;Me[e]=!0,delete Le[e],(t=Ue[e])&&t(),(()=>{const e=Ie;Ie=[];for(const t of e)t()})()}},Oe=(e,t)=>{let n=1;const i=()=>{0==--n&&t&&t()};("string"==typeof e?[e]:e).forEach((e=>{n++;try{!function(e,t){{const n=document.createElement("script");n.setAttribute("src",e),t&&(n.onload=()=>t(!0), +n.onerror=()=>t(!1)),(document.head||document.body||document.documentElement||document).appendChild(n)}}(e,(t=>{t||te.warn("registry: self.load "+e+" failed! "),i()}))}catch(t){te.warn("registry: self.load "+e+" failed! ",t),i()}})),i()};class ze{constructor(){this.events={}}on(e,t,n){const i=void 0===n||Array.isArray(n)?n:[n],{events:r}=this;let s=r[e];return s||(s=[],r[e]=s),s.push({listener:t,filter:i}),()=>this.off(e,t)}once(e,t,n){ +const i=void 0===n||Array.isArray(n)?n:[n],r=this.on(e,((...e)=>(r(),t.bind(this)(...e))),i);return r}off(e,t){const n=this.events[e];n&&(this.events[e]=n.filter((e=>e.listener!==t)))}has(e,t){const n=this.events[e];return!!n&&n.some((e=>e.listener===t))}emit(e,...t){const n=this.events[e];if(n)for(const e of n){const{listener:n,filter:i}=e;if((!i||H(t,i))&&!0===n(...t))return!0}return!1}listening(e,t){const n=this.events[e];if(n){if(t){const e=Array.isArray(t)?t:[t] +;return n.filter((t=>!t.filter||H(t.filter,e))).length}return n.length}return 0}}const Pe=e=>new s((t=>He(t,e)));let Ne=0;const Ve=(e,t)=>{const n=Date.now();if(Ne+eb((()=>{Ne=Date.now(),e()}),t||0)))},Qe=async function(e,...t){await Ve(1e3),e.apply(this,t)},He=function(e,t){return t?b.apply(this,[e,t]):(Qe.apply(this,[e]),0)},qe=e=>{const t=[],n=[],i=()=>{let r;if(n.length{let e;(e=n.indexOf(t))>-1&&n.splice(e,1),i()})),r.p.consume(t)}};return{add:function(e){const n=Te();return t.push({fn:e,p:n}),i(),n.promise()}}},Xe=e=>{const t={},{retimeout_on_get:n,timeout:i,check_interval:r,auto_remove_mutex:s}=Object.assign({retimeout_on_get:!1,timeout:300,check_interval:120},e||{});let o;const a=()=>{l(),o=b(d,1e3*r)},l=()=>{o&&A(o),o=null},c=e=>{const n=t[e];if(delete t[e],n){ +const{d:t,value:i}=n;return t.resolve([e,i]),i}},d=()=>{o=null;const e=Date.now()-1e3*i,n=Object.entries(t).filter((([t,n])=>n.ts{n.forEach((([e,t])=>{const n=t&&t.d;n&&n.resolve([e,t.value]),c(e)})),s&&s.release(),a()})):a()};return i&&a(),{set:(e,n)=>{const i=Te();return t[e]={value:n,ts:Date.now(),d:i},i.promise()},get:(e,i)=>{const r=t[e];return r?(n&&(r.ts=Date.now()),r.value):i},remove:c,removeAll:()=>{Object.keys(t).map((e=>c(e)))}}} +;class We{constructor(e=1){if(this.waiting=[],e<0)throw new Error("Count must not be negative");this._count=e}acquire(){if(this._count>0)return this._count--,Te.Pledge();{const e=Te();return this.waiting.push(e.resolve),e.promise()}}release(){if(this.waiting.length>0){const e=this.waiting.shift();e&&e(void 0)}else this._count++}get count(){return this._count}}const Ye=new We(1),Je=new ze,Ke={};let $e=[];Je.on("download",(({id:e,url:t,error:n})=>{const i=Ke[e] +;i?(i.state=n?"interrupted":"complete",$e.forEach((t=>{t({id:e,state:{current:i.state}})})),b((()=>{delete Ke[e]}),6e4)):console.warn("download event for unknown id",e,t)}));const et={notDetermined:void 0,denied:"denied",authorized:"granted",provisional:"granted"};let tt=[],nt=[],it=[],rt=et.notDetermined;Je.on("notification",(({id:e,clicked:t,error:n})=>{n?console.warn("notifications: error",e,n):(t&&tt.forEach((function(t){t(e)})),nt.forEach((function(t){t(e)})))})), +Je.on("permission",(({permission:e})=>{rt=et[e],it.forEach((function(e){e(rt)}))}));let st=!0;(async()=>{await null,st=!1})();const ot=Object.defineProperties({},{...Object.getOwnPropertyDescriptors(Be),...Object.getOwnPropertyDescriptors({onConnect:{addListener:function(e){return ke.runtime.onUserScriptConnect?ke.runtime.onUserScriptConnect.addListener(e):console.error("chrome.runtime.onUserScriptConnect is not available!"),ke.runtime.onConnect.addListener(e)}},onConnectExternal:{ +addListener:function(e){return ke.runtime.onConnectExternal.addListener(e)}},onMessageExternal:{addListener:function(e){return ke.runtime.onMessageExternal.addListener(e)}},onMessage:{...Be.onMessage,addDynamicListener:e=>{const t=(t,n,i)=>e(t,n,i);ke.runtime.onUserScriptMessage?ke.runtime.onUserScriptMessage.addListener(t):console.error("chrome.runtime.onUserScriptMessage is not available!"),Be.onMessage.addListener(t)},addListener:e=>ot.onMessage.addDynamicListener(e)}}),inIncognitoContext:{ +get:function(){return Be.inIncognitoContext}},manifest:{get:function(){return ke.runtime.getManifest()}}}),at=Object.defineProperties({},{...Object.getOwnPropertyDescriptors(Se),...Object.getOwnPropertyDescriptors({onInstalled:{addListener:function(e){ke.runtime.onInstalled&&ke.runtime.onInstalled.addListener(e)}},onUpdateAvailable:{addListener:function(e){ke.runtime.onUpdateAvailable&&ke.runtime.onUpdateAvailable.addListener(e)}},setUninstallURL:e=>{ +ke.runtime.setUninstallURL&&ke.runtime.setUninstallURL(e)},getContexts:async e=>{if("getContexts"in ke.runtime)return await ke.runtime.getContexts(e)}})}),lt={onActivated:{addListener:function(e){return ke.tabs.onActivated.addListener(e)},addDynamicListener:function(e){return ke.tabs.onActivated.addListener(e)},removeListener:function(e){return ke.tabs.onActivated.removeListener(e)}},onUpdated:{addListener:function(e){return ke.tabs.onUpdated.addListener(e)},addDynamicListener:function(e){ +return ke.tabs.onUpdated.addListener(e)},removeListener:function(e){return ke.tabs.onUpdated.removeListener(e)}},onReplaced:{addListener:function(e){if(ke.tabs.onReplaced)return ke.tabs.onReplaced.addListener(e)},addDynamicListener:function(e){if(ke.tabs.onReplaced)return ke.tabs.onReplaced.addListener(e)},removeListener:function(e){return ke.tabs.onReplaced.removeListener(e)}},onRemoved:{addListener:function(e){return ke.tabs.onRemoved.addListener(e)},addDynamicListener:function(e){ +return ke.tabs.onRemoved.addListener(e)},removeListener:function(e){return ke.tabs.onRemoved.removeListener(e)}},executeScript:function(e,t,n){return ke.tabs.executeScript(e,t,n)},create:function(e,t){let{url:n,active:i,index:r,openerTabId:s,windowId:o,parent:a,incognito:l}=e;const c={url:n,active:i,index:r,openerTabId:s,windowId:o};a&&(void 0!==(s=a.id)&&(s<0?console.warn(`tabs.create: openerTabId lower than 0 is not supported -> ${s}!`):c.openerTabId=s), +void 0!==(o=a.windowId)&&(c.windowId=o)),l&&ct.supported?ct.getAll({windowTypes:["normal"]},(e=>{let n;return e.some((e=>e.incognito?n=e.id:null)),void 0===n?ke.windows.create({url:c.url,incognito:!0},t):(c.windowId=n,ke.tabs.create(c,t))})):ke.tabs.create(c,t)},update:function(e,t,n){return ke.tabs.update(e,t,n)},remove:function(e,t){return ke.tabs.remove(e,t)},highlight:function(e,t){if(!e||!e.tabs)return void(t&&t());const n=e.tabs instanceof Array?e.tabs:[e.tabs];if(!ke.tabs.highlight){ +const e=n.pop();return ke.tabs.update(e,{active:!0},(()=>{t&&t()}))}{const e=[];let i;const r=()=>{if(!n.length)return ke.tabs.highlight({windowId:i,tabs:e},(()=>{ke.windows.update(i,{focused:!0},(()=>{t&&t()}))}));{const t=n.pop();ke.tabs.get(t,(t=>{void 0===i&&(i=t.windowId),t.windowId===i&&e.push(t.index),r()}))}};r()}},getSelected:function(e,t){let n=1;const i=()=>lt.query({active:!0,lastFocusedWindow:!0,...e?{windowId:e}:{}},(e=>{ke.runtime.lastError&&n-- >0?b(i,1):t&&t(e[0])}));return i() +},get:function(e,t){return ke.tabs.get(e,t)},query:function(e,t){return ke.tabs.query(e,(e=>t(e||[])))},sendMessage:function(e,t,n,i){return"function"==typeof n&&(i=n,n={}),ke.tabs.sendMessage(e,t,n,i)}},ct=ke&&ke.windows&&ke.windows.getAll?{supported:!0,getAll:function(e,t){ke.windows.getAll?ke.windows.getAll(e,(e=>t(e||[]))):t([])},update:function(e,t,n){return ke.windows.update(e,t,n)},get:function(e,t,n){return ke.windows.get(e,t,n)}}:{supported:!1 +},dt=(ke&&ke.webRequest&&ke.webRequest.OnBeforeSendHeadersOptions&&ke.webRequest.OnBeforeSendHeadersOptions.hasOwnProperty("EXTRA_HEADERS"),!ke||ke.webNavigation,ke&&ke.webNavigation&&(ke.webNavigation.onHistoryStateUpdated||ke.webNavigation.onReferenceFragmentUpdated)||console.warn("webNavigation onReferenceFragmentUpdated or onHistoryStateUpdated not supported, onurlchange will not work!"),ke&&ke.action, +ke&&ke.declarativeContent&&ke.declarativeContent.onPageChanged&&(ke.declarativeContent.PageStateMatcher,ke.declarativeContent.RequestContentScript),Re&&Re.contentScripts&&Re.contentScripts.register,Re&&Re.userScripts&&Re.userScripts.register,(()=>{const e=ke;e&&e.scripting&&e.scripting.executeScript})(),ke&&ke.declarativeNetRequest&&ke.declarativeNetRequest.updateSessionRules&&ke.declarativeNetRequest.getSessionRules,(()=>{const e=Re||ke;e&&e.storage&&e.storage.session})(), +!!ke&&ke.storage.managed,{cache:{},isAllowed:function(e){return ke.extension.isAllowedFileSchemeAccess?ke.extension.isAllowedFileSchemeAccess(e):e(!1)},get:async function(e,t,n){try{const n=await w(e),i=await n.blob();t(await new Response(i).arrayBuffer())}catch(e){n(e.message)}}}),ut=(Object.defineProperties({},{...Object.getOwnPropertyDescriptors({isDefaultStoreId:e=>!(void 0!==e),getIdFromStoreId:()=>{}}),...Object.getOwnPropertyDescriptors({getAll:function(e,t){return ke.cookies.getAll(e,t) +},remove:function(e,t){return ke.cookies.remove(e,t)},set:function(e,t){return ke.cookies.set(e,t)}})}),ke&&ke.commands&&ke.commands.onCommand,(()=>{const e=ke&&ke.notifications;e&&e.getPermissionLevel&&e.onPermissionLevelChanged&&e.onClicked})(),ke&&ke.contextMenus&&ke.contextMenus.create&&ke.contextMenus.update&&ke.contextMenus.remove,(()=>{const e=ke&&ke.permissions&&!!ke.permissions.getAll;return e?{supported:e,getAll:t=>{if(e)return ke.permissions.getAll(t);t&&t({permissions:[],origins:[]}) +},contains:(t,n)=>{if(e)return ke.permissions.contains(t,n);n&&n(!1)},request:(t,n)=>{if(e)return ke.permissions.request(t,n);n&&n(!1)},remove:(t,n)=>{if(e)return ke.permissions.remove(t,n);n&&n(!1)},onAdded:{addListener:t=>{if(e&&ke.permissions.onAdded)return ke.permissions.onAdded.addListener(t)}},onRemoved:{addListener:t=>{if(e&&ke.permissions.onRemoved)return ke.permissions.onRemoved.addListener(t)}}}:{supported:!1}})()),At={native_support:!0,getMessage:function(...e){ +return ke.i18n.getMessage(...e)},getUILanguage:function(){return ke.i18n.getUILanguage?ke.i18n.getUILanguage():navigator.language},getAcceptLanguages:function(e){return ke.i18n.getAcceptLanguages?ke.i18n.getAcceptLanguages(e):e([])}};!ke||!ke.alarms||ke.alarms.create;let ht=!1;(async()=>{try{M&&(Ee.NO_WARNING="nowarning"===M.getItem("#brokenprofile"))}catch(e){console.warn("prep: error at storage type detection",e)}dt.isAllowed((e=>{ht=e}))})();const pt="en";let ft={},mt={},gt=null +;const _t=[],bt=async e=>{const t=`_locales/${e}/messages.json`,n=await(e=>{let t;const n=Be.getURL(e);return Te((async({resolve:i})=>{try{if(j){const r=new j;j.onlyasync?(r.open("GET",n),r.onload=()=>{i(r.responseText)},r.onerror=()=>{i()},r.send(null)):(r.open("GET",n,!1),r.send(null),t=r.responseText,t||te.warn("registry: content of "+e+" is null!"),i(t))}else i(await w(n).then((e=>e.text())))}catch(e){te.log("getRaw:"+e),i()}})).promise()})(t);try{if(n)return JSON.parse(n)}catch(e){} +te.warn("i18n: parsing locale "+e+" failed!")},vt=async e=>{e=e.concat(pt);let t=-1,n=null;const i=async()=>{if(t++,te?e.replace(/-/g,"_").split("_").map(((e,t)=>t?e.toUpperCase():e.toLowerCase())).join("_"):e,yt=(e,t)=>{let n,i +;return t=t||(gt?[gt,gt.split("_")[0]].concat(_t).filter((e=>e)):_t),V(t,((t,r)=>{const s=Number(r);if(V(e,((e,r)=>{const o=Number(r),a=wt(e),l=a.split(/_/)[0];if(a==t)return i=o,!1;l==t&&(void 0===n||se.value)),Rt=!(void 0===At)&&At.native_support,xt=(e,...t)=>{let n;return gt&&(n=ft[e]||mt[e])?((e,t)=>{let n,i=e.message;return n=1==t.length&&Array.isArray(t[0])?t[0]:t,e.placeholders&&Object.entries(e.placeholders).forEach((([e,t])=>{try{const r=Number(t.content.replace(/^\$/,""))-1;let s;r{const n=[],i=e=>{for(let t=0;t{let n;const i=e[t];if(e){let r=e[t+"_i18n"]||{};i&&(r={en:i,...r});const s=yt(Object.keys(r));void 0!==s&&(n=r[s])}return n||i},Et=async e=>{let t=e;if("null"===e&&(t=null),t&&(t=wt(t)), +!t&&Rt)gt=t;else if(t!==gt)return vt([t,..._t,gt].filter((e=>e))).then((t=>{gt=t,gt!=e&&te.log("i18n: retrieving locale "+t+" failed!")}))},Gt=yt,Zt=(e,t)=>{for(let n=0,i=e.length;n{const n=document.querySelectorAll(t);let i=e.parentNode;for(;i&&!Zt(n,i);)i=i.parentNode;return i},Bt=e=>e&&void 0!==e.nodeType,Tt=e=>e&&void 0!==e.tagName,It=(...e)=>{const n=e.length>1?e:e[0];if(null==n?void 0:n.queryHelper)return n +;if("function"==typeof n)return"loading"!=window.document.readyState?n(null):window.addEventListener("DOMContentLoaded",n),It([]);if("string"==typeof n){let e=[];if("<"==n.trim()[0]){let t=n;try{if(-1!=t.indexOf("]*>[^<]*<\/script>/g,i=/([^\r\n\t\f\v= '"]+)(?:=(["'])?((?:.(?!\2?\s+(?:\S+)=|\2))+.)\2?)?/g,r=t.match(n);r&&r.length&&(t=t.replace(n,""),r.forEach((t=>{const n=t.match(i);if(!n||!n.length)return;const r={};if(n.slice(1,-1).forEach((e=>{ +const t=e.split("="),n=t.shift()||e;r[n]=(t.join("=")||"").replace(/^"|"$/g,"")})),!r.src)return void console.error(`ssjq: unable to parse "${t}"`,r);const s=document.createElement("script");["src","async"].forEach((e=>{void 0!==r[e]&&s.setAttribute(e,r[e])})),e.push(s)})))}const n=/^<([^>]+)>$/.exec(t);n&&2==n.length&&(t=`${t}`);const i=(new DOMParser).parseFromString(t,"text/html"),r=[].slice.call(i.body.children);e=r.concat(e)}catch(t){console.error(`ssjq: ${t}`),e=[]} +}else{const t=document.querySelectorAll(n);e=[].slice.call(t)}return It(e)}if(Array.isArray(n)){const e=[].concat(...n.map((e=>Array.isArray(e)?e:"string"==typeof e?It(e):[e])).filter((e=>e))),i={},r=Object.assign(e,{queryHelper:!0,append:(...t)=>(t.forEach((t=>{const n=e[0];Bt(n)&&It(t).forEach((e=>n.appendChild(It(e)[0])))})),It(e)),appendTo:t=>{const n=It(t);return e.filter(Bt).forEach((e=>n.append(e))),It(e)},insertBefore:t=>{const n=[...e];if(e.length){ +const i=It(t)[0],r=null==i?void 0:i.parentNode;r&&e.forEach((e=>{const t=It(e)[0];t&&(r.insertBefore(t,i),n.push(t))}))}return It(n)},remove:()=>(e.filter(Bt).forEach((e=>{var t;return null===(t=e.parentNode)||void 0===t?void 0:t.removeChild(e)})),It([])),replaceWith:t=>{const n=e[0];if(n){const e=(e=>e&&e.queryHelper)(n)?n[0]:n,i=It(t),r=i.shift();return void 0!==r&&Tt(e)&&(e.replaceWith(r),i.forEach((e=>{var t;null===(t=r.parentNode)||void 0===t||t.insertBefore(e,r.nextSibling)}))),It(e)} +return It(e)},prevAll:t=>{var n;const i=e[0];if(!i)return It([]);const r=null===(n=It(i).parent())||void 0===n?void 0:n.children(t);if(!r||!r.length)return It([]);const s=[];for(let e=0;e{var n;const i=e[0];if(!i)return It([]);const r=null===(n=It(i).parent())||void 0===n?void 0:n.children(t);if(!r||!r.length)return It([]);const s=[];let o=!1;for(let e=0;e{const n=t.trim().split(" ");return e.filter(Tt).forEach((e=>n.forEach((t=>e.classList.add(t))))),It(e)},removeClass:t=>{const n=t.trim().split(" ");return e.filter(Tt).forEach((e=>n.forEach((t=>e.classList.remove(t))))),It(e)},toggleClass:(t,n)=>(t.trim().split(" ").forEach((t=>{!0===n?r.addClass(t):!1===n?r.removeClass(t):e.filter(Tt).forEach((e=>e.classList.toggle(t)))})),It(e)),hasClass:t=>!!e.filter((e=>Tt(e)&&e.classList.contains(t))).length,is:t=>{const n=e[0] +;if(n&&Tt(n))return":visible"==t?"none"!==window.getComputedStyle(n).display:":checked"==t?1==n.checked:void 0},attr:(t,n)=>{if(e.length){const i=(t,n)=>{null===n?e.filter(Tt).forEach((e=>e.removeAttribute(t))):e.filter(Tt).forEach((e=>e.setAttribute(t,n.toString())))};if("string"==typeof t){if(void 0===n){const n=e[0];return Tt(n)&&n.getAttribute(t)||void 0}i(t,n)}else for(const e of Object.keys(t))i(e,t[e])}return It(e)},prop:(t,n)=>{if(e.length){const i=(t,n)=>{ +null===n?e.filter(Tt).forEach((e=>{delete e[t],e.removeAttribute(t)})):e.forEach((e=>e[t]=n))};if("string"==typeof t){if(void 0===n)return e[0][t];i(t,n)}else for(const e of Object.keys(t))i(e,t[e])}return It(e)},text:n=>void 0===n?e.length?e.filter(Tt).map((e=>"textarea"==e.type?e.value:e.innerText)).join(""):void 0:(e.length&&null!=n&&e.filter(Tt).forEach((e=>{"textarea"==e.type?e.value=`${n}`:e.innerText=t(n)})),It(e)),html:n=>{if(e.length){ +if(void 0===n)return e.filter(Tt).map((e=>e.innerHTML)).join("");e.filter(Tt).forEach((e=>e.innerHTML=t(n)))}return It(e)},closest:t=>{const n=[];for(const i of e){const e=Tt(i)&&St(i,t);e&&n.push(e)}return It(n)},parent:()=>{const t=e[0];return Tt(t)?It(t.parentNode):It([])},children:t=>{const n=e[0];if(Tt(n))if(t){if(n.querySelectorAll){const e=n.querySelectorAll(t);return It([].slice.call(e))}}else if(n.children)return It([].slice.call(n.children));return It([])},find:t=>{let n=[] +;return e.forEach((e=>{It(e).children(t).forEach((e=>{const i=It(e).find(t).toArray();n=[...n,e,...i]}))})),It(n)},each:t=>(e.forEach(((e,n)=>t(n,e))),It(e)),not:t=>{const n=It(t);return It(e.filter((e=>-1===n.indexOf(It(e)[0]))))},first:()=>It(e.slice(0,1)),toArray:()=>[...e],bind:(t,n)=>(t.split(" ").forEach((t=>{(i[t]||(i[t]=[])).push(n),e.forEach((e=>e.addEventListener(t,n)))})),It(e)),unbind:t=>(t.split(" ").forEach((t=>{i[t]&&(i[t].forEach((n=>{e.forEach((e=>{e.removeEventListener(t,n)})) +})),i[t]=[])})),It(e)),value:n=>{if(void 0===n){let t;return e.slice().reverse().some((e=>{if(!e.disabled)if("checkbox"==e.type){if(1==e.checked)return t=e.value,!0}else{if("radio"!=e.type)return t=e.value,!0;if(1==e.checked)return t=e.value,!0}})),t}{const i=e.length?e[e.length-1]:void 0;return i&&("checkbox"==i.type?i.value==n&&(i.checked=!0):"select-one"==i.type?i.value=t(n):((e=>e&&void 0!==e.type)(i)&&"text"==i.type&&(i.value=t(n)),i.setAttribute("value",t(n)))),It(e)}},data:(n,i)=>{ +const r=e[0];return Tt(r)&&r.dataset?void 0===i?r.dataset[n]:(null===i?delete r.dataset[n]:r.dataset[n]=t(i),It(e)):void 0===i?It(e):void 0},offset:()=>{const t=e[0];return Tt(t)&&(null==t?void 0:t.getBoundingClientRect())||{left:-1,top:-1,right:-1,bottom:-1,x:-1,y:-1,height:-1,width:-1}},height:()=>{const t=e[0];return t&&((e=>e&&void 0!==e.document)(t)?window.innerHeight:t.offsetHeight)||0},scrollTop:()=>{const t=e[0];return t&&(t.scrollTop||t.pageYOffset)||0},get:t=>e[t], +on:(t,n)=>(t.split(" ").forEach((t=>e.forEach((e=>null==e?void 0:e.addEventListener(t,n))))),It(e)),off:(t,n)=>(t.split(" ").forEach((t=>e.forEach((e=>null==e?void 0:e.removeEventListener(t,n))))),It(e)),trigger:(t,n)=>{const i=new Event(t,{bubbles:!0,cancelable:!0});return n&&Object.assign(i,n),e.forEach((e=>{if(["focus","blur"].includes(t)){const n=e[t];"function"==typeof n&&n.apply(e,[])}e.dispatchEvent(i)})),It(e)},toggle:t=>(e.forEach((e=>{const n=It(e) +;(void 0===t?n.is(":visible"):!t)?n.hide():n.show()})),It(e)),hide:()=>(e.filter(Tt).forEach((e=>{var t;const n=null===(t=null==e?void 0:e.style)||void 0===t?void 0:t.display;n&&-1==n.indexOf("none")&&(e.backuped_display=n),It(e).attr("style","display: none !important")})),It(e)),fadeOut:async t=>new Promise((n=>{e.filter(Tt).forEach((e=>{e.style.opacity="1",e.style.transition=`opacity ${t||150}ms`,setTimeout((()=>{e.style.opacity="0"}),1)})),setTimeout((()=>{e.filter(Tt).forEach((e=>{ +e.style.transition="",e.style.opacity=""})),r.hide(),n(It(e))}),(t||150)+1)})),show:()=>(e.filter(Tt).forEach((e=>{e.style.display=e.backuped_display||""})),It(e)),fadeIn:async t=>new Promise((n=>{e.filter(Tt).forEach((e=>{e.style.opacity="0",e.style.transition=`opacity ${t||150}ms`,setTimeout((()=>{e.style.opacity="1"}),1)})),r.show(),setTimeout((()=>{e.filter(Tt).forEach((e=>{e.style.transition="",e.style.opacity=""})),n(It(e))}),(t||150)+1)})),animate:(t,n)=>new Promise((i=>{const r=e[0] +;r.current_action&&window.clearInterval(r.current_action),r.current_action=window.setInterval((()=>{if(void 0!==t.scrollTop){const n=r===window?document.documentElement:r,s=n.scrollTop;n.scrollTop{if(void 0!==t.height){ +const n=It(e).get(0);n&&n.style&&(n.style.height=`${t.height}px`)}})),i(It(e))}),void 0===n?100:n)})),serialize:()=>{if(1==e.length&&(t=e[0])&&"FORM"==t.tagName)return It(e[0]).find("input, textarea, select, button").map((e=>{const t=e.name,n=It(e).value();if("string"==typeof t&&"string"==typeof n)return`${t}=${encodeURIComponent(n)}`})).filter((e=>"string"==typeof e)).join("&");var t}});return r}return It(void 0===n||null==n?[]:[n])};let Ut=null,Lt=null;const Ft=(e,t)=>{t||(t={}) +;const n="ct",i="0",r=me("div",n,i,"p"),s=fe("div","curbg",n,i,"c"),o=fe("div",t.fixed?"curmiddle_fixed":"curmiddle_relative",n,i,"d");r.inserted||(r.setAttribute("class","curouter hide"),r.setAttribute("style","z-index: 10000"));const a=((e,t,n,i)=>{i||(i="");const r=fe("table","curtable",t,n,"table"+i),s=fe("tr","",t,n,"tr2"+i),o=fe("td","curtableoutertd",t,n,"td1"+i),a=fe("td","curtableinner",t,n,"td2"+i),l=fe("td","curtableoutertd",t,n,"td3"+i);return s.appendChild(o),s.appendChild(a), +s.appendChild(l),r.appendChild(s),e&&a.appendChild(e),r})(e,n,i);return o.appendChild(a),r.appendChild(o),r.appendChild(s),r.show=()=>{r.setAttribute("class","curouter block")},r.hide=()=>{r.setAttribute("class","curouter hide")},r.remove=()=>{r.parentNode&&r.parentNode.removeChild(r)},r.setText=e=>{r.text=e},r.print=e=>{r.text&&(r.text.textContent=e)},document.body.appendChild(r),r},Mt=()=>{const e=document.createElement("div");e.setAttribute("class","curcontainer") +;const t=document.createElement("div");t.setAttribute("class","curwaithead");const n=document.createElement("div");return n.setAttribute("class","curwaitmsg"),e.appendChild(t),e.appendChild(n),{head:t,outer:e,inner:n}},jt={wait:e=>{if(document.body){if(void 0===e&&(e=xt("Please_wait___")),null===Lt){Ut&&(Ut.remove(),Ut=null);const t=e=>{const t=Mt(),n=t.inner,i=document.createElement("div");return i.textContent=e,i.setAttribute("class","curtext"), +It(n).append(It('
')).append(i),{all:t.outer,text:i}};Lt=0;const n=t(e);return Ut=Ft(n.all,{fixed:!0}),Ut.setText(n.text),Ut.show(),!0}return 0===Lt&&(void 0===e&&(e=xt("Please_wait___")),Ut)?(e&&Ut.print(e),Ut.show(),!0):void 0}},hide:()=>{0===Lt&&(Ut&&Ut.hide(),Lt=null)},dialog:(e,t)=>{if(!document.body)return;if(1===Lt)return!1;if(null!==Lt)return;Ut&&(Ut.remove(),Ut=null),Lt=1;const n=Mt() +;if(n.inner.appendChild(e),Ut=Ft(n.outer),Ut.show(),t){const e=document.createElement("div");e.setAttribute("class","curclose"),n.head.appendChild(e),e.addEventListener("click",(()=>t())),Ut.addEventListener("keydown",(e=>{27==e.keyCode&&(t(),e.preventDefault())}),!0),Ut.setAttribute("tabindex",0)}return!0},hideDialog:()=>{1===Lt&&(Ut&&Ut.hide(),Lt=null)}};let Dt=null,Ot=2;const zt=(e,t)=>{let n=e,i=t;const r=()=>{null!=Dt&&window.clearTimeout(Dt),Dt=null},s=e=>{e&&(r(),n&&(n(e),n=null))} +;Dt=window.setTimeout((()=>{if(r(),Ot-- >0&&n&&i)return zt(n,i),void(n=i=null);i&&i()}),5e3);const o={method:"ping"};try{ot.sendMessage(o,s)}catch(e){}},Pt=zt,Nt=[{name:xt("Default"),layout:"default",value:"default"},{name:xt("Default_Light"),layout:"default",theme:"light",value:"default#light"},{name:xt("Default_Dark"),layout:"default",theme:"dark",value:"default#dark"},{name:xt("Default_Darker"),layout:"default",theme:"darker", +footer:'Theme by narcolepticinsomniac from the Stylus project.',value:"default#darker"}],Vt={default:xt("Default"),monokai:"Monokai",solarized:"Solarized","mdn-like":"MDN-like",eclipse:"Eclipse",railscasts:"RailsCasts",zenburn:"ZenBurn",claude:"Claude"},Qt={ +unknown:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wKDBcWHLi+jYAAACAASURBVHja7X13nBRV9v15r6p7egIgElUkioCCIqBgxEVEBRMyiJJBUbKAuKvwVUQJKoqooCAGoiKiElVkBRPq7sqKGUHSkNOQplOFd39/vNDVQxB/MiO49n5mB3uqq6vq3ffeveeeey7w1+uv11+vv15/vf5HX+x4nEQIwT3PywGQDSCbMWYTkQAgjtd3/GkHgDEIIcAYO9rfmHqOHoAYgKht2wWcc/F7v98+Hjfh+35OIpGoK4SoZ1lWXcZYaSKKA3D/MgD5IqLf83GLMZYhhMgXQvxkWdb3kUjkewAHTggDEEKEPc+rLIS4gHN+Kef8dAAFRPSHGMDhZtMfOHjHdE2/8h02gAwA2z3PixDRASJaczzuzT5Oz8gmolKc87LhcLhsKBQ6VQhRAoD/19z/fYZGRGCMWZxz2/M83/f9ckRUCoB1whgAEXHGWAZjLNOyrAjnHJzzEIDQX8P622Z84feVAYBzDiFENmMsE0AGEfETxgAYYyAiwRgTyvmDEOI3n+NoD+t4L+uFzxf8Dj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2RjRDNjwvdGl0bGU+PGRlZnM+PHBhdGggZD0iTTAgNS42MjNBNS42MjMgNS42MjMgMCAwIDEgNS42MjMgMGgxMi43NTRBNS42MjMgNS42MjMgMCAwIDEgMjQgNS42MjN2MTIuNzU0QTUuNjIzIDUuNjIzIDAgMCAxIDE4LjM3NyAyNEg1LjYyM0E1LjYyMyA1LjYyMyAwIDAgMSAwIDE4LjM3N1Y1LjYyM3oiIGlkPSJhIi8+PC9kZWZzPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PG1hc2sgaWQ9ImIiIGZpbGw9IiNmZmYiPjx1c2UgeGxpbms6aHJlZj0iI2EiLz48L21hc2s+PHVzZSBmaWxsLW9wYWNpdHk9IjAiIGZpbGw9IiNGRkYiIHhsaW5rOmhyZWY9IiNhIi8+PHBhdGggZmlsbD0iIzJFQ0M3MSIgbWFzaz0idXJsKCNiKSIgZD0iTTExLjI1IDB2MTQuNjI1SDBWMHoiLz48cGF0aCBmaWxsPSIjRTc0QzNDIiBtYXNrPSJ1cmwoI2IpIiBkPSJNMjQgMHY3Ljg3NUgxMi43NVYweiIvPjxwYXRoIGZpbGw9IiNGMzlDMTIiIG1hc2s9InVybCgjYikiIGQ9Ik0xMS4yNSAxNi4xMjVWMjRIMHYtNy44NzV6Ii8+PHBhdGggZmlsbD0iIzM0OThEQiIgbWFzaz0idXJsKCNiKSIgZD0iTTI0IDkuNTYzdjE0LjYyNEgxMi43NVY5LjU2M3oiLz48L2c+PC9zdmc+" +},Ht='',qt=[[100,56,22,"#272727"],[120,48,6,"#272727"],[76,48,22,"#272727"],[48,56,22,"#272727"],[84,28,11,"#272727"],[56,36,11,"#272727"],[100,32,11,"#272727"],[132,44,22,"#272727"],[152,132,22,"#1a1a1a",.5902],[116,32,11,"#272727"],[36,44,11,"#272727"],[128,144,22,"#1a1a1a",.2601],[132,36,6,"#272727"],[8,144,22,"#1a1a1a",.5728],[12,112,22,"#1a1a1a",.3512],[4,116,6,"#1a1a1a",.2],[108,24,6,"#272727"],[84,40,6,"#272727"],[64,116,22,"#1a1a1a",.0345],[56,28,6,"#272727"],[96,128,22,"#1a1a1a",.0749],[32,156,22,"#1a1a1a",.5441],[60,156,22,"#1b1b1b",.6994],[148,112,11,"#1a1a1a",.0029],[44,20,11,"#262626"],[124,60,6,"#272727"],[0,124,11,"#1a1a1a",.1999],[28,56,11,"#272727"],[72,144,11,"#1b1b1b",.4494],[76,72,22,"#272727"],[96,120,6,"#1a1a1a",.0066],[84,108,6,"#1d1d1d"],[12,104,6,"#1c1c1c"],[148,104,6,"#1a1a1a",.0687],[76,20,6,"#252525"],[68,104,11,"#1b1b1b",.0739],[0,96,11,"#1a1a1a",.2],[20,44,11,"#262626"],[144,92,11,"#1e1e1e",.9215],[160,124,6,"#1a1a1a",.6605],[0,80,11,"#1b1b1b",.2],[8,4,22,"#1d1d1d",.2362],[16,72,22,"#232323"],[92,160,21,"#1c1c1c",.6],[144,32,11,"#262626"],[12,44,6,"#202020"],[4,72,6,"#1b1b1b",.2],[52,12,6,"#202020"],[0,48,11,"#1b1b1b",.2],[44,0,11,"#1b1b1b",.1986],[144,24,6,"#242424"],[120,84,22,"#202020",.5576],[144,8,11,"#1c1c1c",.6423],[156,36,22,"#202020",.7486],[68,84,6,"#252525"],[156,64,22,"#202020",.7619],[0,60,11,"#1b1b1b",.2],[112,88,6,"#212121"],[52,84,11,"#212121"],[44,92,6,"#1c1c1c",.7096],[148,68,6,"#272727"],[100,88,11,"#222222"],[136,8,6,"#1c1c1c",.9155],[84,4,22,"#212121",.8095],[108,4,11,"#1d1d1d",.6],[76,8,6,"#1c1c1c"],[164,96,16,"#1b1b1b",.5],[148,168,13,"#1a1a1a",.0081],[168,20,12,"#1b1b1b",.0081],[64,28,6,"#272727"],[72,40,6,"#272727"],[44,32,11,"#272727"],[56,20,6,"#252525"],[40,60,6,"#272727"],[84,156,6,"#1d1d1d"],[156,100,6,"#1d1d1d"],[28,104,6,"#1a1a1a",.0182],[136,68,11,"#272727"],[40,72,6,"#272727"],[160,16,6,"#1a1a1a",.091],[120,12,11,"#222222"],[32,4,11,"#1c1c1c",.4571],[140,168,7,"#1a1a1a",.4414],[28,32,11,"#272727"],[4,136,6,"#1a1a1a",.1155],[108,44,11,"#272727"],[116,156,11,"#1a1a1a",.5235],[100,108,11,"#1a1a1a",.0313],[20,36,6,"#232323"],[92,104,6,"#1e1e1e"],[88,140,6,"#1b1b1b"],[12,36,6,"#1e1e1e"],[64,4,11,"#1d1d1d",.6],[88,128,6,"#1b1b1b"],[36,16,6,"#212121"],[16,56,11,"#242424"],[124,76,6,"#272727"],[68,92,6,"#202020"],[164,112,9,"#1a1a1a"],[4,40,6,"#1a1a1a",.1416],[48,48,6,"#272727"],[68,20,6,"#252525"],[128,28,6,"#272727"],[136,28,6,"#272727"],[152,160,6,"#1a1a1a",.9558],[128,68,6,"#272727"],[136,20,6,"#242424"],[144,84,6,"#242424"],[124,4,6,"#1a1a1a",.2],[164,88,9,"#1c1c1c"],[128,168,13,"#1a1a1a",.3226],[112,168,13,"#1a1a1a",.3333],[36,96,6,"#1b1b1b",.3675],[96,152,6,"#1c1c1c"],[24,96,6,"#1e1e1e"],[156,88,6,"#212121"],[104,80,6,"#272727"],[24,168,7,"#1b1b1b",.001],[100,48,6,"#272727"],[112,96,6,"#1b1b1b",.4376],[164,156,16,"#1a1a1a",7e-4],[52,96,11,"#1b1b1b",.0114],[44,12,6,"#1f1f1f"],[44,80,6,"#252525"],[76,28,6,"#272727"],[64,48,6,"#272727"],[116,24,6,"#272727"],[8,28,6,"#1a1a1a",.2598],[168,124,7,"#1a1a1a",.6667],[108,152,6,"#1a1a1a",.1464],[100,100,6,"#1d1d1d",.9972],[88,120,6,"#1a1a1a"],[20,104,6,"#1b1b1b",.992],[16,96,6,"#1e1e1e"],[16,28,6,"#1f1f1f"],[76,96,6,"#202020"],[156,24,11,"#1e1e1e",.9831],[4,108,6,"#1a1a1a",.2],[84,96,6,"#232323"],[92,112,6,"#1b1b1b"],[92,96,6,"#222222"],[108,16,6,"#232323"],[148,76,6,"#262626"],[92,40,6,"#272727"],[88,148,6,"#1d1d1d"],[56,48,6,"#272727"],[12,136,6,"#1a1a1a"],[32,24,6,"#242424"],[20,136,6,"#1a1a1a",.0281],[56,4,6,"#1a1a1a",.2],[156,0,17,"#1a1a1a",7e-4],[32,148,9,"#1a1a1a",.0045],[84,168,9,"#1b1b1b",.5],[112,80,9,"#252525"],[130,5,6,"#1b1b1b",.398],[130,10,6,"#1e1e1e"],[155,10,6,"#1a1a1a",.0019],[30,15,6,"#1f1f1f"],[60,15,6,"#222222"],[65,15,6,"#232323"],[70,15,6,"#232323"],[75,15,6,"#222222"],[115,15,6,"#232323"],[130,15,6,"#222222"],[135,15,6,"#212121"],[155,15,6,"#1b1b1b",.6529],[130,20,6,"#252525"],[150,20,6,"#202020"],[25,25,6,"#222222"],[70,25,6,"#272727"],[95,25,6,"#272727"],[100,25,6,"#272727"],[150,25,6,"#222222"],[70,30,6,"#272727"],[95,30,6,"#272727"],[110,30,6,"#272727"],[5,35,6,"#1a1a1a",.1598],[70,35,6,"#272727"],[75,35,6,"#272727"],[95,35,6,"#272727"],[110,35,6,"#272727"],[30,45,6,"#272727"],[70,45,6,"#272727"],[125,45,6,"#272727"],[10,50,6,"#1e1e1e"],[15,50,6,"#222222"],[30,50,6,"#272727"],[70,50,6,"#272727"],[125,50,6,"#272727"],[10,55,6,"#1e1e1e"],[40,55,6,"#272727"],[70,55,6,"#272727"],[125,55,6,"#272727"],[10,60,6,"#1e1e1e"],[70,60,6,"#272727"],[10,65,6,"#1e1e1e"],[40,65,6,"#272727"],[70,65,6,"#272727"],[10,70,6,"#1e1e1e"],[70,70,6,"#272727"],[10,75,6,"#1e1e1e"],[70,75,6,"#272727"],[130,75,6,"#272727"],[10,80,6,"#1e1e1e"],[110,80,6,"#262626"],[115,80,6,"#262626"],[10,85,6,"#1d1d1d"],[40,85,6,"#222222"],[45,85,6,"#222222"],[150,85,6,"#232323"],[5,90,6,"#1b1b1b",.4],[10,90,6,"#1d1d1d"],[10,95,6,"#1c1c1c"],[30,95,6,"#1c1c1c",.9914],[155,95,6,"#1f1f1f"],[105,100,6,"#1b1b1b",.5139],[155,105,6,"#1b1b1b",.9544],[85,115,6,"#1b1b1b"],[85,135,6,"#1b1b1b"],[90,135,6,"#1b1b1b"],[30,150,6,"#1a1a1a",.0362],[90,155,6,"#1e1e1e"],[150,155,6,"#1a1a1a"],[155,155,6,"#1a1a1a"],[55,160,6,"#1a1a1a",.7636],[55,165,6,"#1b1b1b"],[85,165,6,"#1c1c1c"],[55,170,6,"#1a1a1a",.4],[85,170,6,"#1b1b1b",.4]],Xt={ +images:{origin:e=>Qt["gst"==e?"gh":e]||Qt.unknown,brand:e=>"data:image/svg+xml,"+encodeURI({tampermonkey:`${Ht}`,tampermonkey2:`\n\n ${Ht}\n ${qt.map((e=>{const[t,n,i,r,s]=e +;return``}))}\n`, +monkey:"\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n", +webdav:"", +yandex:"", +firefox:"", +chrome:"", +onedrive:"Artboard 1", +gdrive:"", +dropbox:"", +instagram:"", +facebook:"", +edge:'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', +android:'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', +safari:'\n', +apple:'\n\n' +}[e]).replace(/#|%20|%0A/g,(e=>"#"==e?"%23":" ")),empty:"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="},getLayouts:()=>Nt.map((e=>{const{name:t,theme:n,layout:i}=e;return{name:t,value:n?[i,n].join("#"):i}})),getLayoutByValue:e=>{let t;return Nt.some((n=>{if(n.value===e)return t=n,!0})),t},getEditorThemes:()=>Object.keys(Vt).map((e=>({name:Vt[e]||e,value:e})))},Wt=(()=>{const e=M;let t,n;return{cache:function(){const t=document.documentElement,n=location.pathname +;if(e&&t&&n)try{const i=JSON.parse(e.getItem("background")||"{}");i[n]={class:t.getAttribute("class")},e.setItem("background",JSON.stringify(i))}catch(e){}},reset:function(){n=!0;const e=document.documentElement;"string"==typeof t&&e&&e.setAttribute("class",t)},restore:function(){if(n)return;const i=location.pathname;if(e&&i)try{let n;const r=e.getItem("background");if(r&&(n=JSON.parse(r))&&(n=n[i])&&n.class){const e=document.documentElement;if(!e)return;t=e.getAttribute("class")||"", +t.split(" ").includes(n.class)||e.setAttribute("class",t+" "+n.class)}}catch(e){}}}})(),{getLayoutByValue:Yt}=Xt;let Jt;const Kt=e=>{const t=()=>{e(),Wt.restore()};en?document.body?t():window.addEventListener("DOMContentLoaded",t):($t=$t||[]).push((()=>{Kt(e)})),Jt&&(window.clearTimeout(Jt),Jt=void 0)};let $t,en=!1;const tn=e=>{en=!0,$t&&($t.forEach((e=>{e()})),$t=void 0),Pt((t=>{if(t&&t.pong){let e,n=t.config.layout +;window.matchMedia("(prefers-color-scheme: dark)").matches&&!n.includes("#")&&(n+="#dark");const i=Yt(n);if(!i)return void te.warn(`Unknown layout ${n}`);const{theme:r,footer:s}=i;r&&"light"!==r?(s&&window.setTimeout((()=>{const e=document.querySelectorAll(".footer")[0];e&&(e.innerHTML=s)}),0),e=r):e="default";const o="chromium",a="page_"+location.pathname.substr(1).split(".")[0].replace(/[^a-z0-9]/gi,"_");Wt.reset(),document.documentElement.classList.add(ye()?"mobile":"desktop",e,o,a), +window.setTimeout(Wt.cache,500)}e.suc&&e.suc()}),e.fail) +},nn="aaa\naarp\nabb\nabbott\nabogado\nac\nacademy\naccenture\naccountant\naccountants\naco\nactive\nactor\nad\nadac\nads\nadult\nae\naeg\naero\naf\nafl\nag\nagency\nai\naig\nairforce\nairtel\nal\nalibaba\nalipay\nallfinanz\nalsace\nam\namica\namsterdam\nan\nanalytics\nandroid\nao\napartments\napp\napple\naq\naquarelle\nar\naramco\narchi\narmy\narpa\narte\nas\nasia\nassociates\nat\nattorney\nau\nauction\naudi\naudio\nauthor\nauto\nautos\naw\nax\naxa\naz\nazure\nba\nbaidu\nband\nbank\nbar\nbarcelona\nbarclaycard\nbarclays\nbargains\nbauhaus\nbayern\nbb\nbbc\nbbva\nbcn\nbd\nbe\nbeats\nbeer\nbentley\nberlin\nbest\nbet\nbf\nbg\nbh\nbharti\nbi\nbible\nbid\nbike\nbing\nbingo\nbio\nbiz\nbj\nbl\nblack\nblackfriday\nbloomberg\nblue\nbm\nbms\nbmw\nbn\nbnl\nbnpparibas\nbo\nboats\nboehringer\nbom\nbond\nboo\nbook\nboots\nbosch\nbostik\nbot\nboutique\nbq\nbr\nbradesco\nbridgestone\nbroadway\nbroker\nbrother\nbrussels\nbs\nbt\nbudapest\nbugatti\nbuild\nbuilders\nbusiness\nbuy\nbuzz\nbv\nbw\nby\nbz\nbzh\nca\ncab\ncafe\ncal\ncall\ncamera\ncamp\ncancerresearch\ncanon\ncapetown\ncapital\ncar\ncaravan\ncards\ncare\ncareer\ncareers\ncars\ncartier\ncasa\ncash\ncasino\ncat\ncatering\ncba\ncbn\ncc\ncd\nceb\ncenter\nceo\ncern\ncf\ncfa\ncfd\ncg\nch\nchanel\nchannel\nchat\ncheap\nchloe\nchristmas\nchrome\nchurch\nci\ncipriani\ncircle\ncisco\ncitic\ncity\ncityeats\nck\ncl\nclaims\ncleaning\nclick\nclinic\nclinique\nclothing\ncloud\nclub\nclubmed\ncm\ncn\nco\ncoach\ncodes\ncoffee\ncollege\ncologne\ncom\ncommbank\ncommunity\ncompany\ncompare\ncomputer\ncomsec\ncondos\nconstruction\nconsulting\ncontact\ncontractors\ncooking\ncool\ncoop\ncorsica\ncountry\ncoupons\ncourses\ncr\ncredit\ncreditcard\ncreditunion\ncricket\ncrown\ncrs\ncruises\ncsc\ncu\ncuisinella\ncv\ncw\ncx\ncy\ncymru\ncyou\ncz\ndabur\ndad\ndance\ndate\ndating\ndatsun\nday\ndclk\nde\ndealer\ndeals\ndegree\ndelivery\ndell\ndeloitte\ndelta\ndemocrat\ndental\ndentist\ndesi\ndesign\ndev\ndiamonds\ndiet\ndigital\ndirect\ndirectory\ndiscount\ndj\ndk\ndm\ndnp\ndo\ndocs\ndog\ndoha\ndomains\ndoosan\ndownload\ndrive\ndubai\ndurban\ndvag\ndz\nearth\neat\nec\nedeka\nedu\neducation\nee\neg\neh\nemail\nemerck\nenergy\nengineer\nengineering\nenterprises\nepson\nequipment\ner\nerni\nes\nesq\nestate\net\neu\neurovision\neus\nevents\neverbank\nexchange\nexpert\nexposed\nexpress\nfage\nfail\nfairwinds\nfaith\nfamily\nfan\nfans\nfarm\nfashion\nfast\nfeedback\nferrero\nfi\nfilm\nfinal\nfinance\nfinancial\nfirestone\nfirmdale\nfish\nfishing\nfit\nfitness\nfj\nfk\nflickr\nflights\nflorist\nflowers\nflsmidth\nfly\nfm\nfo\nfoo\nfootball\nford\nforex\nforsale\nforum\nfoundation\nfox\nfr\nfresenius\nfrl\nfrogans\nfrontier\nfund\nfurniture\nfutbol\nfyi\nga\ngal\ngallery\ngallup\ngame\ngarden\ngb\ngbiz\ngd\ngdn\nge\ngea\ngent\ngenting\ngf\ngg\nggee\ngh\ngi\ngift\ngifts\ngives\ngiving\ngl\nglass\ngle\nglobal\nglobo\ngm\ngmail\ngmo\ngmx\ngn\ngold\ngoldpoint\ngolf\ngoo\ngoog\ngoogle\ngop\ngot\ngov\ngp\ngq\ngr\ngrainger\ngraphics\ngratis\ngreen\ngripe\ngroup\ngs\ngt\ngu\ngucci\nguge\nguide\nguitars\nguru\ngw\ngy\nhamburg\nhangout\nhaus\nhdfcbank\nhealth\nhealthcare\nhelp\nhelsinki\nhere\nhermes\nhiphop\nhitachi\nhiv\nhk\nhm\nhn\nhockey\nholdings\nholiday\nhomedepot\nhomes\nhonda\nhorse\nhost\nhosting\nhoteles\nhotmail\nhouse\nhow\nhr\nhsbc\nht\nhu\nhyundai\nibm\nicbc\nice\nicu\nid\nie\nifm\niinet\nil\nim\nimmo\nimmobilien\nin\nindustries\ninfiniti\ninfo\ning\nink\ninstitute\ninsurance\ninsure\nint\ninternational\ninvestments\nio\nipiranga\niq\nir\nirish\nis\niselect\nist\nistanbul\nit\nitau\niwc\njaguar\njava\njcb\nje\njetzt\njewelry\njlc\njll\njm\njmp\njo\njobs\njoburg\njot\njoy\njp\njprs\njuegos\nkaufen\nkddi\nke\nkfh\nkg\nkh\nki\nkia\nkim\nkinder\nkitchen\nkiwi\nkm\nkn\nkoeln\nkomatsu\nkp\nkpn\nkr\nkrd\nkred\nkw\nky\nkyoto\nkz\nla\nlacaixa\nlamborghini\nlamer\nlancaster\nland\nlandrover\nlanxess\nlasalle\nlat\nlatrobe\nlaw\nlawyer\nlb\nlc\nlds\nlease\nleclerc\nlegal\nlexus\nlgbt\nli\nliaison\nlidl\nlife\nlifeinsurance\nlifestyle\nlighting\nlike\nlimited\nlimo\nlincoln\nlinde\nlink\nlive\nliving\nlixil\nlk\nloan\nloans\nlol\nlondon\nlotte\nlotto\nlove\nlr\nls\nlt\nltd\nltda\nlu\nlupin\nluxe\nluxury\nlv\nly\nma\nmadrid\nmaif\nmaison\nmakeup\nman\nmanagement\nmango\nmarket\nmarketing\nmarkets\nmarriott\nmba\nmc\nmd\nme\nmed\nmedia\nmeet\nmelbourne\nmeme\nmemorial\nmen\nmenu\nmeo\nmf\nmg\nmh\nmiami\nmicrosoft\nmil\nmini\nmk\nml\nmm\nmma\nmn\nmo\nmobi\nmobily\nmoda\nmoe\nmoi\nmom\nmonash\nmoney\nmontblanc\nmormon\nmortgage\nmoscow\nmotorcycles\nmov\nmovie\nmovistar\nmp\nmq\nmr\nms\nmt\nmtn\nmtpc\nmtr\nmu\nmuseum\nmutuelle\nmv\nmw\nmx\nmy\nmz\nna\nnadex\nnagoya\nname\nnatura\nnavy\nnc\nne\nnec\nnet\nnetbank\nnetwork\nneustar\nnew\nnews\nnexus\nnf\nng\nngo\nnhk\nni\nnico\nnikon\nninja\nnissan\nnl\nno\nnokia\nnorton\nnowruz\nnp\nnr\nnra\nnrw\nntt\nnu\nnyc\nnz\nobi\noffice\nokinawa\nom\nomega\none\nong\nonl\nonline\nooo\noracle\norange\norg\norganic\norigins\nosaka\notsuka\novh\npa\npage\npamperedchef\npanerai\nparis\npars\npartners\nparts\nparty\npe\npet\npf\npg\nph\npharmacy\nphilips\nphoto\nphotography\nphotos\nphysio\npiaget\npics\npictet\npictures\npid\npin\nping\npink\npizza\npk\npl\nplace\nplay\nplaystation\nplumbing\nplus\npm\npn\npohl\npoker\nporn\npost\npr\npraxi\npress\npro\nprod\nproductions\nprof\npromo\nproperties\nproperty\nprotection\nps\npt\npub\npw\npwc\npy\nqa\nqpon\nquebec\nquest\nracing\nre\nread\nrealtor\nrealty\nrecipes\nred\nredstone\nredumbrella\nrehab\nreise\nreisen\nreit\nren\nrent\nrentals\nrepair\nreport\nrepublican\nrest\nrestaurant\nreview\nreviews\nrexroth\nrich\nricoh\nrio\nrip\nro\nrocher\nrocks\nrodeo\nroom\nrs\nrsvp\nru\nruhr\nrun\nrw\nrwe\nryukyu\nsa\nsaarland\nsafe\nsafety\nsakura\nsale\nsalon\nsamsung\nsandvik\nsandvikcoromant\nsanofi\nsap\nsapo\nsarl\nsas\nsaxo\nsb\nsbs\nsc\nsca\nscb\nschaeffler\nschmidt\nscholarships\nschool\nschule\nschwarz\nscience\nscor\nscot\nsd\nse\nseat\nsecurity\nseek\nselect\nsener\nservices\nseven\nsew\nsex\nsexy\nsfr\nsg\nsh\nsharp\nshell\nshia\nshiksha\nshoes\nshow\nshriram\nsi\nsingles\nsite\nsj\nsk\nski\nskin\nsky\nskype\nsl\nsm\nsmile\nsn\nsncf\nso\nsoccer\nsocial\nsoftbank\nsoftware\nsohu\nsolar\nsolutions\nsony\nsoy\nspace\nspiegel\nspreadbetting\nsr\nsrl\nss\nst\nstada\nstar\nstarhub\nstatefarm\nstatoil\nstc\nstcgroup\nstockholm\nstorage\nstudio\nstudy\nstyle\nsu\nsucks\nsupplies\nsupply\nsupport\nsurf\nsurgery\nsuzuki\nsv\nswatch\nswiss\nsx\nsy\nsydney\nsymantec\nsystems\nsz\ntab\ntaipei\ntaobao\ntatamotors\ntatar\ntattoo\ntax\ntaxi\ntc\ntci\ntd\nteam\ntech\ntechnology\ntel\ntelefonica\ntemasek\ntennis\ntf\ntg\nth\nthd\ntheater\ntheatre\ntickets\ntienda\ntiffany\ntips\ntires\ntirol\ntj\ntk\ntl\ntm\ntmall\ntn\nto\ntoday\ntokyo\ntools\ntop\ntoray\ntoshiba\ntours\ntown\ntoyota\ntoys\ntp\ntr\ntrade\ntrading\ntraining\ntravel\ntravelers\ntravelersinsurance\ntrust\ntrv\ntt\ntube\ntui\ntushu\ntv\ntvs\ntw\ntz\nua\nubs\nug\nuk\num\nunicom\nuniversity\nuno\nuol\nus\nuy\nuz\nva\nvacations\nvana\nvc\nve\nvegas\nventures\nverisign\nversicherung\nvet\nvg\nvi\nviajes\nvideo\nvillas\nvin\nvip\nvirgin\nvision\nvista\nvistaprint\nviva\nvlaanderen\nvn\nvodka\nvolkswagen\nvote\nvoting\nvoto\nvoyage\nvu\nwales\nwalter\nwang\nwanggou\nwatch\nwatches\nweather\nweatherchannel\nwebcam\nweber\nwebsite\nwed\nwedding\nweir\nwf\nwhoswho\nwien\nwiki\nwilliamhill\nwin\nwindows\nwine\nwme\nwolterskluwer\nwork\nworks\nworld\nws\nwtc\nwtf\nxbox\nxerox\nxin\n测试\nकॉम\nपरीक्षा\n佛山\n慈善\n集团\n在线\n한국\n点看\nคอม\nভারত\n八卦\n‏موقع‎\nবাংলা\n公益\n公司\n移动\n我爱你\nмосква\nиспытание\nқаз\nонлайн\nсайт\n联通\nсрб\nбел\n‏קום‎\n时尚\n테스트\n淡马锡\nорг\nनेट\n삼성\nசிங்கப்பூர்\n商标\n商店\n商城\nдети\nмкд\n‏טעסט‎\nею\nポイント\n新闻\n工行\n‏كوم‎\n中文网\n中信\n中国\n中國\n娱乐\n谷歌\nభారత్\nලංකා\n购物\n測試\nભારત\nभारत\n‏آزمایشی‎\nபரிட்சை\n网店\nसंगठन\n餐厅\n网络\nком\nукр\n香港\n诺基亚\nδοκιμή\n飞利浦\n‏إختبار‎\n台湾\n台灣\n手表\n手机\nмон\n‏الجزائر‎\n‏عمان‎\n‏ارامكو‎\n‏ایران‎\n‏امارات‎\n‏بازار‎\n‏پاکستان‎\n‏الاردن‎\n‏موبايلي‎\n‏بھارت‎\n‏المغرب‎\n‏السعودية‎\n‏سودان‎\n‏همراه‎\n‏عراق‎\n‏مليسيا‎\n澳門\n닷컴\n政府\n‏شبكة‎\n‏بيتك‎\nგე\n机构\n组织机构\n健康\nไทย\n‏سورية‎\nрус\nрф\n珠宝\n‏تونس‎\n大拿\nみんな\nグーグル\nελ\n世界\nਭਾਰਤ\n网址\n닷넷\nコム\n游戏\nvermögensberater\nvermögensberatung\n企业\n信息\n‏مصر‎\n‏قطر‎\n广东\nஇலங்கை\nஇந்தியா\nհայ\n新加坡\n‏فلسطين‎\nテスト\n政务\nxperia\nxxx\nxyz\nyachts\nyahoo\nyamaxun\nyandex\nye\nyodobashi\nyoga\nyokohama\nyoutube\nyt\nza\nzara\nzero\nzip\nzm\nzone\nzuerich\nzw".split("\n").join("|"),rn="ac.cn\nac.jp\nac.uk\nad.jp\nah.cn\naichi.jp\nakita.jp\naomori.jp\nasn.au\nbj.cn\nchiba.jp\nco.cc\nco.ck\nco.fk\nco.gg\nco.im\nco.in\nco.ir\nco.je\nco.jp\nco.kr\nco.ma\ncom.ac\ncom.af\ncom.ag\ncom.ai\ncom.al\ncom.ar\ncom.au\ncom.aw\ncom.az\ncom.ba\ncom.bb\ncom.bh\ncom.bi\ncom.bm\ncom.bo\ncom.br\ncom.bs\ncom.bt\ncom.by\ncom.bz\ncom.ci\ncom.cm\ncom.cn\ncom.co\ncom.cu\ncom.cw\ncom.cy\ncom.de\ncom.dm\ncom.do\ncom.dz\ncom.ec\ncom.ee\ncom.eg\ncom.es\ncom.et\ncom.fr\ncom.ge\ncom.gh\ncom.gi\ncom.gl\ncom.gn\ncom.gp\ncom.gr\ncom.gt\ncom.gu\ncom.gy\ncom.hk\ncom.hn\ncom.hr\ncom.ht\ncom.im\ncom.io\ncom.iq\ncom.is\ncom.jo\ncom.kg\ncom.ki\ncom.km\ncom.kp\ncom.ky\ncom.kz\ncom.la\ncom.lb\ncom.lc\ncom.lk\ncom.lr\ncom.lv\ncom.ly\ncom.mg\ncom.mk\ncom.ml\ncom.mo\ncom.ms\ncom.mt\ncom.mu\ncom.mv\ncom.mw\ncom.mx\ncom.my\ncom.na\ncom.nf\ncom.ng\ncom.ni\ncom.nr\ncom.om\ncom.pa\ncom.pe\ncom.pf\ncom.ph\ncom.pk\ncom.pl\ncom.pr\ncom.ps\ncom.pt\ncom.py\ncom.qa\ncom.re\ncom.ro\ncom.ru\ncom.rw\ncom.sa\ncom.sb\ncom.sc\ncom.sd\ncom.se\ncom.sg\ncom.sh\ncom.sl\ncom.sn\ncom.so\ncom.st\ncom.sv\ncom.sy\ncom.tj\ncom.tm\ncom.tn\ncom.to\ncom.tr\ncom.tt\ncom.tw\nco.mu\ncom.ua\ncom.ug\ncom.uy\ncom.uz\ncom.vc\ncom.ve\ncom.vi\ncom.vn\ncom.vu\ncom.ws\ncom.zm\nconf.au\nco.nz\nco.rw\nco.th\nco.tj\nco.tt\nco.tv\nco.tz\nco.ug\nco.uk\nco.us\nco.ve\nco.yu\nco.za\nco.zm\nco.zw\ncq.cn\ncsiro.au\nde.net\ndk.org\ned.jp\nedu.au\nedu.cn\nedu.uk\nehime.jp\neu.org\nfukui.jp\nfukuoka.jp\nfukushima.jp\ngb.net\ngd.cn\ngifu.jp\ngo.jp\ngov.au\ngov.cn\ngov.jp\ngov.uk\ngr.jp\ngs.cn\ngunma.jp\ngx.cn\ngz.cn\nhb.cn\nhe.cn\nhi.cn\nhiroshima.jp\nhk.cn\nhl.cn\nhn.cn\nhokkaido.jp\nhyogo.jp\nibaraki.jp\nid.au\ninfo.au\nishikawa.jp\niwate.jp\njl.cn\njs.cn\nkagawa.jp\nkagoshima.jp\nkanagawa.jp\nkanazawa.jp\nkawasaki.jp\nkitakyushu.jp\nkobe.jp\nkochi.jp\nkumamoto.jp\nkyoto.jp\nlg.jp\nln.cn\nltd.uk\nmatsuyama.jp\nme.uk\nmie.jp\nmiyagi.jp\nmiyazaki.jp\nmo.cn\nmod.uk\nnagano.jp\nnagasaki.jp\nnagoya.jp\nnara.jp\nne.jp\nnet.au\nnet.cn\nnet.jp\nnet.uk\nnhs.uk\nnic.uk\nniigata.jp\nnm.cn\nnx.cn\noita.jp\nokayama.jp\nokinawa.jp\norg.au\norg.cn\norg.jp\norg.uk\nor.jp\nosaka.jp\notc.au\noz.au\nplc.uk\npolice.uk\nqh.cn\nsaga.jp\nsaitama.jp\nsapporo.jp\nsc.cn\nsch.uk\nsendai.jp\nsh.cn\nshiga.jp\nshimane.jp\nshizuoka.jp\nsn.cn\nsx.cn\ntakamatsu.jp\ntelememo.au\ntj.cn\ntochigi.jp\ntokushima.jp\ntokyo.jp\ntottori.jp\ntoyama.jp\ntw.cn\nuk.net\nutsunomiya.jp\nwakayama.jp\nxj.cn\nxz.cn\nyamagata.jp\nyamaguchi.jp\nyamanashi.jp\nyn.cn\nyokohama.jp\nzj.cn".split("\n").join("|"),sn=(".("+[nn,rn].join("|")+")").replace(/\./gi,"\\."),on=Xe({ +timeout:180,check_interval:120,retimeout_on_get:!0}),an=e=>e.split("").map((e=>{const t=e.toLowerCase(),n=e.toUpperCase();return t!=n?"["+t+n+"]":e})).join(""),ln="://",cn=(e,t)=>{let{scheme:n,host:i,path:r}=(e=>{let t,n,i,r;const s="/",o=e.replace(/\$$/,"").split(ln);o.length<2?(t="",n=e):(t=o[0].replace(/^\^/,""),n=o.slice(1).join(ln));const a=n.split(s);if(r=a.length<2?"/":s+a.slice(1).join(s),i=a[0], +"http*"===t||t.match(/\*|http|https|file|ftp/)||(te.warn('uri: override scheme "'+t+'" with "*"'),t="*"),"file"===t)i="";else{const e=i,t=i.match(/\*$|(\*\.)?[^/*]+/);i=(t?t[0]:"").replace(/:[0-9]*$/,""),i!==e&&te.warn('uri: override host "'+e+'" with "'+i+'"')}return r&&r.substr(0,1)===s||(te.warn('uri: prefix path "'+r+'" with "/"'),r=s+r),{scheme:t,host:i,path:r}})(e);return n="http*"===n?"https?":O(n).replace(/\*/gi,"[^:/#?]*"),i=O(i).replace(/\*\\\./gi,"(*\\.)?").replace(/\*/gi,"[^#?/]*"), +r=O(r).replace(/\*/gi,".*"),i=i.replace(new RegExp(O(".tld")+"$"),sn),t?(n=n.toLowerCase(),i=i.toLowerCase()):(n=an(n),i=an(i)),i+="(:[0-9]{1,5})?","^"+n+O(ln)+i+r+"$"},dn=["protocol","hostname","origin"],un=["port"],An=["pathname"],hn=["search","hash"];let pn;const fn={protocol:"",scheme:"",origin:"",pathname:"",hostname:"",port:void 0,search:"",hash:""},mn=(e,t,n)=>{let i=Object.assign({},fn);if(null==e);else if(["data:","view-source:"].some((t=>e.startsWith(t)))){i.origin="null" +;const t=e.indexOf(":");i.protocol=e.substr(0,t+1),i.pathname=e.substr(t+1)}else{let r,s;try{r=new URL(e)}catch(t){try{const t="http:";s=X(),r=new URL(e||"/",`${t}//${s}/${s}`)}catch(e){s=void 0}}if(r){let{protocol:o,origin:a,pathname:l,hostname:c,port:d,search:u,hash:A,username:h,password:p}=r;if(s&&(o=a="",c===s&&(c=""),l=l.replace(`/${s}`,"")),n){const t=e.indexOf("?"),n=e.indexOf("#");-1!==t&&""===u&&(-1===n||n>t)&&(u="?"),-1!==n&&""===A&&(A="#")}if(i={protocol:o,origin:a,pathname:l, +hostname:c,port:parseInt(d)||void 0,search:u,hash:A,username:h,password:p},!t&&o){if(0!==e.toLowerCase().indexOf(o))if(e.startsWith("//"))i.origin="",i.protocol="";else{if(!["/","?","#"].includes(e[0]))return mn("/"+e);pn=pn||mn("",!0),[...hn,...An].forEach((e=>{pn[e]===i[e]&&(i[e]="")})),dn.forEach((e=>{i[e]=""})),un.forEach((e=>{i[e]=void 0}))}["tampermonkey:"].includes(i.protocol)&&(i.pathname=((i.hostname?"/"+i.hostname:"")+(i.pathname||"")).replace(/^\/+/,"/"),i.hostname="")}}} +return 0===i.port&&(i.port=void 0),Object.defineProperties(i,{domain:{get:function(){const e=i.hostname.split("."),t=e.pop();let n=`${e.pop()}.${t}`;return _n(n)&&(n=`${e.pop()}.${n}`),n}},scheme:{get:function(){return i.protocol.replace(/:$/,"")}}}),i};let gn;const _n=e=>(gn=gn||new RegExp("^("+rn.replace(/\./g,"\\.")+")$"),!!e.match(gn)),bn=(e,t)=>{if(null==e)return;const n=`${e}+${!!t}`;let i=on.get(n);return i||(i=mn(e,!1,t),on.set(n,i),i) +},vn=e=>Object.entries(e).map((([e,t])=>void 0===t?null:f(e)+"="+f(t))).filter((e=>e)).join("&"),wn="mtm_visitor",yn="default",kn="pageview",Rn="script_update",xn="script",Cn="cloud",En="deploy",Gn="event",Zn="pageview",Sn="ping",Bn="https://a.tampermonkey.net/matomo.php",Tn=M;let In,Un,Ln,Fn=null;const Mn=()=>({url:Bn,siteId:4,tracker:{[yn]:{enabled:Wn(4,1)},[xn]:{enabled:!0},[Rn]:{enabled:Wn(4,10)},[Cn]:{enabled:Wn(4,5e-4)},[En]:{enabled:!0}}}),jn=()=>({url:Bn,siteId:5,tracker:{[yn]:{ +enabled:Wn(5,10)},[xn]:{enabled:!0},[Rn]:{enabled:Wn(5,10)},[Cn]:{enabled:Wn(5,.001)},[En]:{enabled:!0}}}),Dn=()=>({url:Bn,siteId:6,tracker:{[yn]:{enabled:Wn(6,50)},[xn]:{enabled:!0},[Rn]:{enabled:Wn(6,10)},[Cn]:{enabled:Wn(6,.01)},[En]:{enabled:!0}}}),On=()=>({url:Bn,siteId:7,tracker:{[yn]:{enabled:!0},[xn]:{enabled:!0},[Rn]:{enabled:Wn(7,10)},[Cn]:{enabled:Wn(7,.01)},[En]:{enabled:!0}}}),zn={default:jn,gcal:jn,iikm:Mn,fcmf:Mn,saap:On,swgx:On,fire:Dn,firb:Dn,dhdg:()=>({url:Bn,siteId:3,tracker:{ +[yn]:{enabled:Wn(3,1)},[xn]:{enabled:!0},[Rn]:{enabled:Wn(3,10)},[Cn]:{enabled:Wn(3,5e-4)},[En]:{enabled:!0}}}),mfdh:jn,heif:()=>({url:"http://a.userscript.grobilan:8081/matomo.php",siteId:2,tracker:{[yn]:{enabled:!0}}})};let Pn;const Nn=[{msg:"a disconnected port"},{msg:"Function.prototype.apply: Arguments list has wrong type",url:"event_bindings"},{msg:"Script error."}],Vn=e=>[...Array(e)].map((()=>Math.floor(16*Math.random()).toString(16))).join(""),Qn=e=>{if(!Tn)return +;const t=[e.uuid,e.createTs,e.visitCount,e.currentVisitTs,e.lastVisitTs].join(".");Tn.setItem(wn,t)},Hn=e=>{const t=e||yn,n=Pn.tracker[t]||Pn.tracker[yn];return n.enabled?{url:Pn.url,siteId:Pn.siteId,options:n}:null},qn=Vn(6),Xn=async(e,t,n)=>{if(!e)return;const i=(()=>{if(!Tn)return;const e=Tn.getItem(wn);if(!e)return;const t=e.split(".");if(t.length>=5){t.unshift("0");const[e,n,i,r,s,o]=t;return{createdNow:!1,newVisitor:e,uuid:n,createTs:i,visitCount:r,currentVisitTs:s,lastVisitTs:o}} +})()||(()=>{const e=Math.floor(Date.now()/1e3).toString(),t={createdNow:!0,newVisitor:"1",uuid:Vn(16),createTs:e,visitCount:"0",currentVisitTs:e,lastVisitTs:""};return Qn(t),t})();let r;const s=new Date,o={idsite:e.siteId,rec:1,action_name:B?B.title:g.href||Se.short_id,url:g.href,_id:i.uuid,rand:Vn(4),apiv:1,h:s.getHours(),m:s.getMinutes(),s:s.getSeconds(),cookie:1,pv_id:qn},a={...o,_idts:Number(i.createTs),_idvc:Number(i.visitCount),_viewts:Number(i.lastVisitTs), +res:T?`${T.width}x${T.height}`:"0x0"};if(t==Zn){const e=Un?{gt_ms:Un}:{},t={...o,...a,...e,new_visit:1};Qn((e=>{const t=Math.floor(Date.now()/1e3).toString();return e.newVisitor="0",e.visitCount=(Number(e.visitCount)+1).toString(),e.lastVisitTs=e.currentVisitTs,e.currentVisitTs=t,e})(i)),r=t}else if(t==Gn){if(!n)return;r={...o,ca:1,e_c:n.category,e_a:n.action,e_n:n.name,e_v:n.value}}else{if(t!=Sn)return;r={...o,...a,ping:1}}r=Object.assign(o,r);const l=`${e.url}?${vn(r)}`;if(B){ +const e=B.createElement("img");e.src=l,e.onload=()=>{var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)},e.onerror=()=>{var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)},(B.body||B.head||B.documentElement).appendChild(e)}else try{await w(l)}catch(e){te.warn("stats:",e)}},Wn=(e,t)=>{let n=100*Math.random()null===Fn&&Yn?Yn.promise():Te.Pledge(!!Fn);let Kn;const $n=(e,t)=>{Kn=`${(null==t?void 0:t.version)||""} `;const n=Se.short_id;Pn=(zn[n]||zn[yn])(),R("error",(t=>{const{message:n,filename:i,lineno:r,colno:s,error:o}=t;((t,n,i,r,s)=>{let o="";if(s)try{o=s.stack||""}catch(e){}ii(t.toString(),Kn+e+"@"+Be.urls.prepareForReport(n||""),[i+":"+r,o].join(";"))})(n,i,r,s,o)}));const i=t=>{let n="";try{n=t.stack}catch(e){} +ii("CSP violation of "+t.effectiveDirective,Kn+e+"@"+Be.urls.prepareForReport(t.documentURI),[t.sourceFile," -> ",t.lineNumber+":"+t.columnNumber,n].join(";"))};B?B.addEventListener("securitypolicyviolation",(e=>i(e))):R("securitypolicyviolation",(e=>i(e))),(null==t?void 0:t.started)&&(Un=Date.now()-t.started.getTime())},ei=e=>{Fn=e,Yn&&(Yn.resolve(Fn),Yn=void 0),Fn?ti():Ln&&(u(Ln),Ln=void 0)},ti=()=>{In&&(Xn(Hn(kn),Zn),In=!1),Ln=_((()=>Xn(Hn(kn),Sn)),864e5)},ni=async(e,t,n)=>{ +if(!await Jn())return;let i="",r="";"init"===t?(r="Initialized",i=e):"error"===t&&(r="Error",i=e+" -> "+n),Xn(Hn(Cn),Gn,{category:"Cloud",action:r,name:i})},ii=async(e,t,n)=>{if(!await Jn())return;void 0===n&&(t+=" "+g.href,n="");let i=!1;for(const n of Nn){if(!n.msg&&!n.url)return;n.msg&&-1==e.indexOf(n.msg)||n.url&&-1==t.indexOf(n.url)||(i=!0)}i||Xn(Hn("error"),Gn,{category:"Error",action:e,name:t+":"+n})};var ri=e(2462),si=e.n(ri);const oi=(()=>{let e,t,n=!1;const i=()=>{const e=Te() +;return t=e,e};return{write:()=>{const t=Te();return n=!1,e=new(si()),t.resolve(e),t.promise()},open:r=>{const s=i();return n=!0,si().loadAsync(r).then((t=>{e=t,s.resolve(e)}),(e=>{t&&t.reject(e),s.reject(e)})),s.promise()},entries:()=>{const t=i(),n=e.files,r=Object.keys(n).map((e=>{const t=n[e];if(t&&!t.dir)return{filename:t.name}})).filter((e=>e));return t.resolve(r),t.promise()},get:t=>{const n=i(),r=e.file(t.filename);return r?r.async("arraybuffer").then((e=>{n.resolve(e)})):n.resolve(), +n.promise()},put:(t,n,r)=>{const s=i();try{e.file(t,n,{date:r?new Date(r):void 0}),s.resolve()}catch(e){s.reject(e)}return s.promise()},end:()=>{const t=i();return n?t.reject():e.generateAsync({type:"blob",compression:"DEFLATE",comment:"Created by Tampermonkey"}).then((e=>t.resolve(e)),(e=>t.reject(e))),t.promise()}}})(),ai=function(e,t){const n=Te();return Te.Pledge().then((()=>oi.write())).then((()=>{const t=Te(),i={},r=(e,t)=>{let n=[e,t].join(".");if(i[n]){let s;do{s=e+" ("+i[n]+")", +n=[s,t].join("."),i[n]++}while(i[n]);return r(s,t)}return i[n]=1,n},s=e.length,o=()=>{if(!e.length)return t.resolve();const i=e.shift();if(!i)return t.resolve();const a=i.meta.name.replace(/[\\/$*?|]/g,"-"),l=r(a,"user.js"),c=r(a,"options.json"),d=r(a,"storage.json"),u={options:i.options,settings:i.settings,meta:i.meta},A=JSON.stringify(u),h=i.storage?JSON.stringify(i.storage):null;n.notify("Zip: "+Math.floor((s-e.length)/s*100)+"%"), +oi.put(l,i.source,i.meta.modified).then((()=>oi.put(c,A))).then((()=>h?oi.put(d,h):Te.Pledge())).then((()=>{if(!i.resources.length&&!i.requires.length)return Te.Pledge();const e=[];return["resources","requires"].forEach((t=>{const n=i[t];n&&n.length&&n.forEach((n=>{if(void 0===n.source)return;const i=n.meta.name.replace(/[\\/$*?|]/g,"-"),r=le(t+n.meta.url),s=[l,r,i].join("-"),o=JSON.stringify(n.meta),a=oe(n.source,{encoding:"resources"==t?void 0:"UTF-8" +}),c=oi.put(s,a).then((()=>oi.put(s+"."+t+".json",o)));e.push(c)}))})),Te.when(e)})).fail((()=>{te.log("porter: add to zip failed")})).always((async()=>{await Ve(1e3),o()}))};return o(),t.promise()})).then((()=>t?oi.put("Tampermonkey.global.json",JSON.stringify(t)):Te.Pledge())).then((()=>oi.end())).done((e=>{n.resolve(e)})).fail((()=>{n.reject()})),n.promise()},li=function(e,t){const n=Te(),i={created_by:"Tampermonkey",version:"1",scripts:[],settings:t};return e.forEach((e=>{const t={ +name:e.meta.name,options:e.options,storage:e.storage,enabled:e.settings.enabled,position:e.settings.position,file_url:e.meta.file_url,uuid:e.meta.uuid,source:re(ne(e.source))};["resources","requires"].forEach((n=>{const i=e[n];if(!i||!i.length)return;const r=t[n]=[];i.forEach((e=>{if(void 0===e.source)return;const t=e.meta,n=re(ne(e.source));r.push({meta:t,source:n})}))})),i.scripts.push(t)})),n.resolve(JSON.stringify(i)),n.promise()} +;var ci=e(8039),di=e.n(ci),ui=e(70),Ai=e.n(ui),hi=e(8754),pi=e.n(hi),fi=e(1763),mi=e.n(fi),gi=e(8295),_i=e.n(gi),bi=e(230),vi=e.n(bi),wi=e(3880),yi=e.n(wi),ki=e(4350),Ri=e.n(ki),xi=e(1933),Ci=e.n(xi),Ei=e(2215),Gi=e.n(Ei),Zi=e(2672),Si=e.n(Zi),Bi=e(3316),Ti=e.n(Bi);const Ii={rules:{"userscripts/filename-user":di(),"userscripts/no-invalid-grant":Ai(),"userscripts/no-invalid-headers":pi(),"userscripts/no-invalid-metadata":mi(),"userscripts/require-name":_i(),"userscripts/require-description":vi(), +"userscripts/require-version":yi(),"userscripts/require-attribute-space-prefix":Ri(),"userscripts/use-homepage-and-url":Ci(),"userscripts/use-download-and-update-url":Gi(),"userscripts/align-attributes":Si(),"userscripts/avoid-regexp-include":Ti()}};let Ui;const Li=we();let Fi=!0,Mi=!!G;if(M){let e;try{e=M.getItem("lint_worker")||""}catch(e){}"false"==e&&(Mi=!1)}Ui=Li>=94?2022:Li>=86?2021:Li>=83?2020:Li>=64?2018:Li>=59?2017:Li>=47?2015:5,Li<77||Li>100?(Fi=!1, +te.warn("hint: disable inline ESLint config due to web worker CSP issues","https://bugs.chromium.org/p/chromium/issues/detail?id=777076","https://bugs.chromium.org/p/chromium/issues/detail?id=159303")):Mi||(Fi=!1,te.warn("hint: disable inline ESLint config because web workers are unavailable and this extension's CSP doesn't allow unsafe eval, which is required for ESLint's dynamic reconfigration"));const ji={"userscripts/no-invalid-grant":1,"userscripts/no-invalid-headers":1, +"userscripts/no-invalid-metadata":[2,{top:"optional"}],"userscripts/require-name":[2,"required"],"userscripts/require-description":[1,"required"],"userscripts/require-version":[1,"required"],"userscripts/require-attribute-space-prefix":1,"userscripts/use-homepage-and-url":0,"userscripts/use-download-and-update-url":1,"userscripts/avoid-regexp-include":1},Di={env:{es6:Ui>=2015,browser:!0},parserOptions:{ecmaVersion:Ui,sourceType:"script",ecmaFeatures:{globalReturn:!0},allowAwaitOutsideFunction:!0 +},rules:{curly:[1,"multi-line"],"dot-location":0,"dot-notation":[1,{allowKeywords:!0}],"no-caller":1,"no-case-declarations":2,"no-div-regex":0,"no-empty-pattern":2,"no-eq-null":0,"no-eval":1,"no-extra-bind":1,"no-fallthrough":1,"no-implicit-globals":2,"no-implied-eval":1,"no-lone-blocks":1,"no-loop-func":1,"no-multi-spaces":1,"no-multi-str":1,"no-native-reassign":1,"no-octal-escape":2,"no-octal":2,"no-proto":1,"no-redeclare":2,"no-return-assign":1,"no-sequences":1,"no-undef":1, +"no-useless-call":1,"no-useless-concat":1,"no-with":1} +},Oi={},zi=["uneval","unsafeWindow","GM_info","GM","GM_addStyle","GM_addElement","GM_cookie","GM_deleteValue","GM_listValues","GM_getValue","GM_download","GM_log","GM_registerMenuCommand","GM_unregisterMenuCommand","GM_openInTab","GM_setValue","GM_addValueChangeListener","GM_removeValueChangeListener","GM_xmlhttpRequest","GM_webRequest","GM_getTab","GM_saveTab","GM_getTabs","GM_setClipboard","GM_notification","GM_getResourceText","GM_getResourceURL"];let Pi;const Ni={};let Vi +;const Qi=e=>e.map((e=>{const{message:t}=e;if(!Fi){let n;t&&((n=t.match(/Configuration for rule "([^"]+)"[\s\S]*evaluate a string as JavaScript[\s\S]*/))||(n=t.match(/Configuration for rule "([^"]+)" is invalid:[\s\S]*call to Function\(\) blocked by CSP/)))&&(e.message=`Rule "${n[1]}": ESLint inline configuration is not supported by this browser.`,e.severity=1)}return e})).filter((e=>e)),Hi={},qi=e=>{const t=null==e?void 0:e.keys,n={keys:t,default:()=>[],set:(e,t)=>(e.push(t),e)} +;return(null==t?void 0:t.length)&&t.forEach((e=>Hi[e]=n)),n},Xi=e=>{const t=null==e?void 0:e.keys,n={keys:t,default:()=>null,set:(t,n,i)=>{const r=(null==e?void 0:e.convert)?e.convert(n,i):n;return null===t?r:t}};return(null==t?void 0:t.length)&&t.forEach((e=>Hi[e]=n)),n},Wi=e=>{const t=null==e?void 0:e.keys,n={default:()=>null,set:()=>!0};return(null==t?void 0:t.length)&&t.forEach((e=>Hi[e]=n)),n},Yi=e=>{const t=null==e?void 0:e.keys,n={keys:t,default:()=>({}),set:(t,n,i,r)=>{ +r=r?wt(r):"default";const s=(null==e?void 0:e.convert)?e.convert(n,i):n;return t[r]=t[r]||s,t}};return(null==t?void 0:t.length)&&t.forEach((e=>Hi[e]=n)),n},Ji={name:Yi({convert:e=>null==e?void 0:e.replace(/\s\s+/g," ")}),version:Xi({convert:e=>(null==e?void 0:e.replace(/\s/g,""))||e}),grants:qi({keys:["grant"]}),icon:Xi({keys:["icon","iconURL","iconUrl","defaulticon"]}),icon64:Xi({keys:["icon64","iconURL64"]}),supportURL:Xi({keys:["supportURL","supportUrl"]}),fileURL:Xi(),downloadURL:Xi({ +keys:["downloadURL","downloadUrl"]}),updateURL:Xi({keys:["updateURL","updateUrl"]}),namespace:Xi({convert:e=>""===e?null:e}),author:Xi(),copyright:Xi(),homepage:Xi({keys:["homepage","homepageURL","homepageUrl","website","source"]}),description:Yi(),includes:qi({keys:["include"]}),excludes:qi({keys:["exclude"]}),matches:qi({keys:["match"]}),requires:qi({keys:["require"]}),resources:(e=>{const t=null==e?void 0:e.keys,n={keys:t,default:()=>({}),set:(t,n,i)=>{const r=n.match(/^(\S*)\s+(.*)/) +;if(r&&void 0===t[r[1]]){const n=(null==e?void 0:e.convert)?e.convert(r[2],i):r[2];t[r[1]]=n}return t}};return(null==t?void 0:t.length)&&t.forEach((e=>Hi[e]=n)),n})({keys:["resource"]}),sandbox:Xi({keys:["sandbox","inject-into"],convert:(e,t)=>null!==e&&"inject-into"===t?{auto:"DOM",content:"DOM",page:null}[e]||null:e}),tags:qi({keys:["tag"]}),noframes:Wi(),unwrap:Wi(),connects:qi({keys:["connect","connect-src","domain"]}),webRequest:qi(),"run-at":Xi(),"run-in":qi(),antifeatures:(e=>{ +const t=null==e?void 0:e.keys,n={keys:t,default:()=>({}),set:(t,n,i,r)=>{var s;r=r?wt(r):"default";const o=n.match(/^(\S*)\s+(.*)/);if(o){const n=t[s=o[1]]||(t[s]={}),a=(null==e?void 0:e.convert)?e.convert(o[2],i):o[2];n[r]=a}return t}};return(null==t?void 0:t.length)&&t.forEach((e=>Hi[e]=n)),n})({keys:["antifeature"]})},Ki={};Object.entries(Ji).forEach((([e,t])=>{t.keys?t.keys.forEach((t=>{Ki[t]=e})):Ki[e]=e}));const $i=(()=>{const e=e=>{const t=e.split(".") +;return t.slice(0,3).concat([t.slice(3).join(".")]).concat([0,0,0,0]).slice(0,4).map((e=>{const t=e.toString().match(/((?:-?[0-9]+)?)([^0-9]*)((?:[0-9]+)?)(.*)/);return t?[Number(t[1]),t[2],Number(t[3]),t[4]]:[]})).reduce(((e,t)=>e.concat(t)))},t=(n,i)=>{const r=Array.isArray(n)?n:e(n),s=Array.isArray(i)?i:e(i);for(let e=0;e<16;e++){const n=r[e],i=s[e];if(e%2==1){if(!n&&i)return t.eNEWER;if(n&&!i)return t.eOLDER;const e=n.match(/\w/g)||[],r=i.match(/\w/g)||[] +;for(let n=0;nr[n].charCodeAt(0))return t.eNEWER;if(e[n].charCodeAt(0)r.length)return t.eNEWER;if(e.lengthNumber(i))return t.eNEWER;if(Number(n)t||e.match(new RegExp(n))),null);if(t&&3==t.length)return{id:t[2],token:"uso",meta_url:!0,url:"http://userscripts-mirror.org/scripts/show/"+t[2],code_url:"http://userscripts-mirror.org/scripts/review/"+t[2],issue_url:"http://contactbyweb.com/userscripts-mirror"}}updates(e){return!1}},new class{constructor(){ +this.regexps=["https?://greasyfork\\.org/(?:[^/]+/)?scripts/([^/-]+).*/code.*\\.user\\.js","https?://update.greasyfork\\.org/(?:[^/]+/)?scripts/([^/-]+).*/.*\\.user\\.js"],this.domains=["greasyfork.org","update.greasyfork.org"]}test(e){const t=this.regexps.reduce(((t,n)=>t||e.match(new RegExp(n))),null);if(t&&2==t.length){const e=t[1];return{id:e,token:"gf",meta_url:!0,url:"https://greasyfork.org/scripts/"+e,issue_url:"https://greasyfork.org/scripts/"+e+"/feedback", +code_url:"https://greasyfork.org/scripts/"+e+"/code"}}}async converts(e){let t,n=e;if(n){const e=n.description.trim();e===er?n.description="":e===tr&&(n=null,t="deleted by hoster")}return{script:n,warning:t}}updates(e){const t=new RegExp("https?://greasyfork\\.org/scripts/[^/]+/code/.*\\.user\\.js.*version=[0-9]+.*"),n=new RegExp("https?://update\\.greasyfork\\.org/scripts/[^/]+/[^/]+/[^/]+\\.user\\.js");return!e.match(n)&&!e.match(t)}},new class{constructor(){ +this.regexps=["https?://sleazyfork\\.org/(?:[^/]+/)?scripts/([^/-]+).*/code.*\\.user\\.js","https?://update.sleazyfork\\.org/(?:[^/]+/)?scripts/([^/-]+).*/.*\\.user\\.js"],this.domains=["sleazyfork.org","update.sleazyfork.org"]}test(e){const t=this.regexps.reduce(((t,n)=>t||e.match(new RegExp(n))),null);if(t&&2==t.length){const e=t[1];return{id:e,token:"sf",meta_url:!0,url:"https://sleazyfork.org/scripts/"+e,issue_url:"https://sleazyfork.org/scripts/"+e+"/feedback", +code_url:"https://sleazyfork.org/scripts/"+e+"/code"}}}async converts(e){let t,n=e;if(n){const e=n.description.trim();e===er?n.description="":e===tr&&(n=null,t="deleted by hoster")}return{script:n,warning:t}}updates(e){const t=new RegExp("https?://sleazyfork\\.org/scripts/([^/]+)/code/.*\\.user\\.js.*version=[0-9]+.*"),n=new RegExp("https?://update\\.sleazyfork\\.org/scripts/[^/]+/[^/]+/[^/]+\\.user\\.js");return!e.match(n)&&!e.match(t)}},new class{constructor(){ +this.regexps=["https?://openuserjs\\.org/install/([^/]+)+/(.+?)(?:\\.min)?\\.user\\.js"],this.domains=["openuserjs.org"]}test(e){const t=this.regexps.reduce(((t,n)=>t||e.match(new RegExp(n))),null);if(t&&3==t.length)return t.shift(),{id:t.join("/"),token:"ouj",meta_header:!0,url:"https://openuserjs.org/scripts/"+t[0]+"/"+t[1],issue_url:"https://openuserjs.org/scripts/"+t[0]+"/"+t[1]+"/issues",code_url:"https://openuserjs.org/scripts/"+t[0]+"/"+t[1]+"/source"}}async converts(e){const t=e +;return t&&t.description.trim()===er&&(t.description=""),{script:t,warning:void 0}}updates(e){return!0}},new class{constructor(){ +this.regexps=["https?://raw\\.githubusercontent\\.com/([^/]+)/([^/]+)/[^/]+/(.*)\\.user\\.js","https?://github\\.com/([^/]+)/([^/]+)/raw/[^/]+/(.*)\\.user\\.js","https?://raw.github\\.com/([^/]+)/([^/]+)/[^/]+/(.*)\\.user\\.js","https?://github\\.com/([^/]+)/([^/]+)/releases/latest/download/(.*)\\.user\\.js","https?://github\\.com/([^/]+)/([^/]+)/releases/download/[^/]+/(.*)\\.user\\.js","https?://(([^\\.]+).github\\.io)/(.*)\\.user\\.js"], +this.domains=["github.com","githubusercontent.com","github.io"]}test(e){let t;const n=this.regexps.slice(0,-1).reduce(((t,n)=>t||e.match(new RegExp(n))),null),i=this.regexps.slice(-1).reduce(((t,n)=>t||e.match(new RegExp(n))),null);if(n&&4==n.length||i&&4==i.length){let e;if(n){n.shift();const[i,r,s]=n;e=[i,r].join("/"),t=[i,r].concat(r==s?[]:s).join("/")}else{if(!i)throw new Error("Should never happen!");{i.shift();const[n,r,s]=i;e=[r,n].join("/"),t=[r,n].concat(n==s?[]:s).join("/")}}return{ +id:t,token:"gh",url:"https://github.com/"+e,issue_url:"https://github.com/"+e+"/issues"}}}updates(e){return!0}},new class{constructor(){this.regexps=["https?://gist\\.github\\.com/([^/]+)/([^/]+)/raw/(.*/)?.*\\.user\\.js","https?://gist\\.githubusercontent\\.com/([^/]+)/([^/]+)/raw/(.*/)?.*\\.user\\.js"],this.domains=["gist.github.com","gist.githubusercontent.com"]}test(e){const t=this.regexps.reduce(((t,n)=>t||e.match(new RegExp(n))),null);if(t&&4==t.length){const e=t[1],n=t[2],i=`${e}/${n}` +;if(n&&i)return{id:i,token:"gst",url:`https://gist.github.com/${i}`,issue_url:`https://gist.github.com/${i}#new_comment_field`,code_url:`https://gist.github.com/${i}`}}}updates(e){const t=this.regexps.reduce(((t,n)=>t||e.match(new RegExp(n))),null);return!(!t||null!=t[3])}},new class{constructor(){this.regexps=["https?://gitlab\\.com/([^/]+)(?:/([^/]+))?/([^/-]{1,1}[^/]+)/?(?:-/)?(snippets/[^/]+/)?(raw|wikis)/(?:[^/]+/)?(.*?)\\.user\\.js"],this.domains=["gitlab.com"]}test(e){ +const t=this.regexps.reduce(((t,n)=>t||e.match(new RegExp(n))),null);if(t&&7==t.length){const[,e,n,i,,,r]=t,s=[e].concat([n,i].filter((e=>e))).join("/");return{id:[s].concat(i==r?[]:r).join("/"),token:"gl",url:"https://gitlab.com/"+s,issue_url:"https://gitlab.com/"+s+"/issues"}}}updates(e){return!0}},new class{constructor(){this.regexps=["https?://bitbucket\\.org/([^/]+)/([^/]+)/raw/[^/]+/(.*)\\.user\\.js","https?://bitbucket\\.org/([^/]+)/([^/]+)/downloads/(.*)\\.user\\.js"], +this.domains=["bitbucket.org"]}test(e){const t=this.regexps.reduce(((t,n)=>t||e.match(new RegExp(n))),null);if(t&&4==t.length){t.shift();const[e,n,i]=t,r=[e,n].concat(n==i?[]:i).join("/"),s=[e,n].join("/");return{id:r,token:"bb",url:"https://bitbucket.org/"+s,issue_url:"https://bitbucket.org/"+s+"/issues"}}}updates(e){return!0}},new class{constructor(){this.regexps=["https?://userstyles\\.org/styles/userjs/([^/]+)/.*\\.user\\.js"],this.domains=["userstyles.org"]}test(e){ +const t=this.regexps.reduce(((t,n)=>t||e.match(new RegExp(n))),null);if(t&&2==t.length)return t.shift(),{id:t[0],token:"usty",url:"https://userstyles.org/styles/"+t[0],issue_url:"https://forum.userstyles.org/post/discussion?Discussion/StyleID="+t[0]}}async converts(e){let t,n,i,r;const s=[{tag:"includes",re:/(?: \|\| \(new RegExp\("\^)([^$]+)(?:\$"\)\)\.test\(document\.location\.href\))/g,idx:1,value:e=>"/^"+e.replace(/\\\\(.)/g,"\\$1")+"$/"},{tag:"includes", +re:/(?: \|\| \(document\.location\.href\.indexOf\(")([^"]+)"(?:\) == 0\))/g,idx:1,value:e=>e+"*"},{tag:"matches",re:/(?: \|\| \(document\.domain == ")([^"]+)"(?: \|\| document\.domain\.substring\(document\.domain\.indexOf\("[^"]+"\) \+ 1\) == "[^"]+"\))/g,idx:1,value:e=>"*."+e}],o=new RegExp("(?:if \\(false)("+s.map((e=>"(?:"+e.re.source+")")).join("|")+")+","g") +;return e.textContent&&0===e.includes.length&&0===e.matches.length&&0===e.excludes.length&&e.options&&e.options.override&&e.options.override.orig_includes&&0===e.options.override.orig_includes.length&&e.options.override.orig_matches&&0===e.options.override.orig_matches.length&&(n=e.textContent.match(o))&&(n.forEach((t=>{s.forEach((n=>{for(;i=n.re.exec(t);)if(i.length>n.idx){const t=n.value(i[n.idx]);e.options.override["orig_"+n.tag].push(t),e[n.tag].push(t),r=!0}}))})),r&&(t="includes added")), +0===e.grant.length&&(e.grant.push("GM_addStyle"),t="includes added"),{script:e,info:t}}updates(e){return!0}},new class{constructor(){this.regexps=["https://static\\.iitc\\.me/build/release/(plugins/)?(.*)\\.user\\.js","https://iitc\\.app/build/release/(plugins/)?(.*)\\.user\\.js","https?://socialfixer\\.com/socialfixer\\.user\\.js","https?://www\\.fbpurity\\.com/.*\\.user\\.js"],this.domains=["static.iitc.me","iitc.app","socialfixer.com","fbpurity.com"]}test(e){ +const[t,n,i,r]=this.regexps,s=e.match(new RegExp(t));if(s&&3===s.length){s.shift();const[e,t]=s,n="iitc-project/ingress-intel-total-conversion";return{id:[n].concat(e?[e,t]:[]).join("/").replace(/\/\//g,"/"),token:"gh",url:"https://github.com/"+n,issue_url:"https://github.com/"+n+"/issues"}}const o=e.match(new RegExp(n));if(o&&3===o.length){o.shift();const[e,t]=o,n="IITC-CE/ingress-intel-total-conversion";return{id:[n].concat(e?[e,t]:[]).join("/").replace(/\/\//g,"/"),token:"gh", +url:"https://github.com/"+n,issue_url:"https://github.com/"+n+"/issues"}}return e.match(new RegExp(i))?{id:"socialfixer",token:"web",url:"http://socialfixer.com",issue_url:"https://www.facebook.com/groups/SocialFixerUsersSupport/"}:e.match(new RegExp(r))?{id:"fbpurity",token:"web",url:"https://www.fbpurity.com/",issue_url:"https://www.facebook.com/fluffbustingpurity"}:void 0}updates(e){return!0}},function(e){e[e.OBJ_URL=1]="OBJ_URL",e[e.BLOB=2]="BLOB",e[e.BINARY=4]="BINARY", +e[e.DATA_URI=8]="DATA_URI"}(nr||(nr={}));const ir=nr.OBJ_URL+0+nr.BINARY+nr.DATA_URI,rr=e=>void 0!==e.objUrl,sr=e=>void 0!==e.blob,or=e=>void 0!==e.dataUri,ar=e=>void 0!==e.binary;class lr{constructor(e,t){if(rr(e)){this.objUrl=e.objUrl.url,this.type=e.objUrl.type;const t=e.objUrl.revoke;t&&(lr.objUrlDisposers[this.objUrl]=t)}else if(sr(e))this.blob=e.blob;else if(or(e))this.dataUri=e.dataUri;else{if(!ar(e))throw new Error("incompatible TransferableData");this.binary=e.binary,this.type=e.type} +this.kinds=t||ir}async dispose(){if(this.objUrl){const e=lr.objUrlDisposers,t=e[this.objUrl];t?(delete e[this.objUrl],await t()):URL.revokeObjectURL(this.objUrl)}}async toTransferableData(){if(this.kinds&nr.OBJ_URL){if(!this.objUrl&&(!this.blob&&this.dataUri&&(this.blob=ce(this.dataUri)),this.blob&&(this.objUrl=URL.createObjectURL(this.blob)),!this.objUrl))throw new Error("incomplete Transferable");return{objUrl:{url:this.objUrl,type:this.type}}}if(this.kinds&nr.BLOB){ +if(!this.blob&&(this.objUrl?this.blob=await w(this.objUrl).then((e=>e.blob())):this.dataUri&&(this.blob=ce(this.dataUri)),!this.blob))throw new Error("incomplete Transferable");return{blob:this.blob}}if(this.kinds&nr.BINARY){if(void 0===this.binary){let e=this.blob;if(!e&&this.objUrl&&(e=await w(this.objUrl).then((e=>e.blob()))),e&&(this.binary=await ue(e),this.type=this.type||e.type),void 0===this.binary)throw new Error("incomplete Transferable")}return{binary:this.binary, +type:this.type||"application/octet-stream"}}if(this.kinds&nr.DATA_URI){if(!this.dataUri){let e=this.blob;if(!e&&this.objUrl&&(e=await w(this.objUrl).then((e=>e.blob()))),e&&(this.dataUri=await de(e)),!this.dataUri)throw new Error("incomplete Transferable")}return{dataUri:this.dataUri}}throw new Error("incompatible Transferable")}get tryObjectUrl(){return this.objUrl}get tryBlob(){return this.blob}get tryDataUri(){return this.dataUri}get tryBinary(){return this.binary}async toBlob(){ +if(this.blob)return this.blob;if(!this.objUrl){if(this.dataUri)return ce(this.dataUri);if(this.binary)return new Blob([oe(this.binary)],{type:this.type||"application/octet-stream"});throw new Error("incompatible Transferable")}try{return await(await w(this.objUrl)).blob()}catch(e){return}}async toDataUri(){if(this.dataUri)return this.dataUri;{const e=await this.toBlob();if(!e)throw new Error("incompatible Transferable");return await de(e)}}async toObjectUrl(){if(this.objUrl)return this.objUrl;{ +const e=await this.toBlob();if(!e)return;return this.objUrl=URL.createObjectURL(e)}}static fromTransferableData(e){return e&&(sr(e)||rr(e)||or(e)||ar(e))?new lr(e):void 0}}lr.objUrlDisposers={};const cr={};Je.on("xhr",(function(e){let t,n;void 0!==(t=e.id)&&void 0!==(n=cr[t])&&n.handle(e)&&delete cr[t]}));class dr{constructor(e){this.readyState=dr.UNSENT,this.status=0,this.statusText="",this.responseType="",this.async=!0,this.timeout=-1,this.canceled=!1,this.loaded=0,this.headers={}, +this.onreadystatechange=null,this.onredirect=null,this.onopen=null,this.onload=null,this.onloadstart=null,this.onprogress=null,this.onabort=null,this.onerror=null,this.ontimeout=null,this.upload={onprogress:null,loaded:0,total:void 0},this.open=function(e,t,n=!0,i,r){if(this.method=e,this.url=t,this.async=n,this.user=i,this.password=r,this.responseURL=t,!this.async)throw new Error("Synchronous requests are not supported");this.onopen&&this.onopen(this)},this.send=async function(e){ +this.mime_type&&(this.request_headers||(this.request_headers={}),this.request_headers["content-type"]||(this.request_headers["content-type"]=this.mime_type)),(this.user||this.password)&&(this.request_headers||(this.request_headers={}),this.request_headers.Authorization="Basic "+d((this.user||"")+":"+(this.password||"")));const t=this.method||"GET",n=this.url;if(!n)throw new Error("No URL specified");const i={method:t,url:n,headers:this.request_headers,timeout:this.timeout>0?this.timeout:void 0, +anonymous:"withCredentials"in this?!this.withCredentials:this.options&&!!this.options.anonymous},r=e=>{this.method&&"POST"==this.method.toUpperCase()&&(this.request_headers||(this.request_headers={}),this.request_headers["content-type"]||(this.request_headers["content-type"]=e))};if(e){let t,n="";if(e instanceof Blob){t=e.size;const s=await ue(e);s?(i.data=re(s),r(n)):(this.readyState=0,this.statusText="data read error",this.onerror&&this.onerror(this))}else t=e.length,n="text/plain", +i.data=re(ne(e));r(n),this.upload&&(this.upload.loaded=0,this.upload.total=t)}(async e=>{await Ye.acquire();try{let t;const n=await Promise.race([new Promise(((n,i)=>{t=b((()=>{t=void 0,i(`timeout: ${e.method}`)}),15e3)})),Re.runtime.sendNativeMessage("application",e)]);return void 0!==t&&A(t),n}catch(e){throw console.error("sendNativeMessage",e),e}finally{Ye.release()}})({method:"xhr",id:this.id,details:i}),e&&this.upload&&this.upload.onprogress&&this.upload.onprogress.apply(this,[this.upload]) +},this.abort=function(){this.canceled=!0,delete cr[this.id],this.onabort&&this.onabort(this)},this.overrideMimeType=function(e){this.mime_type=e},this.getAllResponseHeaders=function(){const e=this.headers;return Object.keys(e).map((function(t){const n=e[t];return n&&n.includes(",")?n.split(",").map((function(e){return t+":"+e.trimStart()})).join("\r\n"):t+":"+n})).join("\r\n")},this.getResponseHeader=function(e){return this.headers[e]},this.setRequestHeader=function(e,t){ +null!==t&&(this.request_headers||(this.request_headers={}),this.request_headers[e.trim().toLowerCase()]=t.trim())},this.toString=function(){return"[object XMLHttpRequest]"},this.handle=function(e){const t=e.data,n=()=>{this.onprogress&&this.onprogress(this)};if(t.timeout)this.ontimeout&&this.ontimeout.apply(this,[this]);else if(1==t.readyState&&"loaded"in t)this.upload&&this.upload.onprogress&&(this.upload.loaded=t.loaded||0,this.upload.total=t.total, +this.upload.onprogress.apply(this,[this.upload]));else if(2==t.readyState&&301==t.status)Object.assign(this,t),this.onredirect&&this.onredirect(this);else if(t.readyState!=this.readyState){if(Object.assign(this,t),this.onreadystatechange&&this.onreadystatechange(this),4==t.readyState){const e=t.status;return e>=400?this.onload&&this.onload.apply(this,[this]):e>=300||(e>=200?this.onload&&this.onload.apply(this,[this]):e>=100||0===e&&this.onerror&&this.onerror.apply(this,[this])),!0} +t.readyState>1?n():1==t.readyState&&this.onloadstart&&this.onloadstart.apply(this,[this])}else 3==t.readyState&&(Object.assign(this,t),n())},this.id=Date.now()+(Math.random()+1).toString(36).substring(7),this.options=e,cr[this.id]=this}get lengthComputable(){return null!=this.total}get target(){return this}get response(){const e=Ar(this.responseData);if(null==e)return null +;const t=this.responseType?this.responseType.toLowerCase():"",n=(this.headers?this.headers["content-type"]:null)||"binary/octet-stream";return ur(e,t,n)}get responseText(){const e=Ar(this.responseData);return null==e?null:ur(e,this.mime_type?"binary":"text")}get responseXML(){const e=Ar(this.responseData);if(null==e)return null;const t=(this.headers?this.headers["content-type"]:null)||"";return ur(e,"document",t.split(";")[0])}}dr.UNSENT=0,dr.OPENED=1,dr.HEADERS_RECEIVED=2,dr.LOADING=3, +dr.DONE=4,dr.toString=function(){return"[XMLHttpRequest]"};const ur=function(e,t,n){let i;if("arraybuffer"==t)i=oe(e);else if("blob"==t)i=new Blob([oe(e)],{type:n});else if("json"==t)i=JSON.parse(ie(e));else{if("document"==t)return"text/xml"==n&&x?(new x).parseFromString(e,n):null;if("text"==t||n&&(n.match(/charset=(utf[-_]?8)/i)||"text/html"==n))try{i=ie(e)}catch(t){i=e}else i=e}return i},Ar=e=>{try{if(void 0===e)return;return se(e)}catch(e){return void console.warn("XmlHttpRequest:",e)}} +;var hr;!function(e){e.TESTING="TESTING",e.AUDIO_PLAYBACK="AUDIO_PLAYBACK",e.IFRAME_SCRIPTING="IFRAME_SCRIPTING",e.DOM_SCRAPING="DOM_SCRAPING",e.BLOBS="BLOBS",e.DOM_PARSER="DOM_PARSER",e.USER_MEDIA="USER_MEDIA",e.DISPLAY_MEDIA="DISPLAY_MEDIA",e.WEB_RTC="WEB_RTC",e.CLIPBOARD="CLIPBOARD",e.LOCAL_STORAGE="LOCAL_STORAGE",e.WORKERS="WORKERS",e.BATTERY_STATUS="BATTERY_STATUS",e.MATCH_MEDIA="MATCH_MEDIA",e.GEOLOCATION="GEOLOCATION"}(hr||(hr={}));let pr={},fr=()=>s.resolve({done:()=>{}}) +;const mr=["internal","user-agent","accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],gr={"cache-control":"no-cache",pragma:"no-cache"},_r={"cache-control":"max-age=0, must-revalidate"},br=e=>{const t={},n={};return Object.keys(e).forEach((i=>{let r=i,s=e[i];var o;o=i.toLowerCase(), +mr.includes(o)||0===o.indexOf("proxy-")||0===o.indexOf("sec-")?n[r]=s:t[r]=s})),{...Object.keys(n).length?{forbidden:n}:{},...Object.keys(t).length?{regular:t}:{}}},vr=e=>({responseText:"",response:null,readyState:4,responseHeaders:"",status:0,statusText:"",error:e=e||"Forbidden"}),wr=e=>e&&"object"==typeof e&&"type"in e&&"value"in e,yr=e=>{if("Blob"===e.type)return new Blob([oe(e.value)]);if("File"===e.type){if(!e.name)return;return new File([oe(e.value)],e.name,{type:e.meta, +lastModified:e.lastModified||Date.now()})}if("FormData"==e.type){const t=new FormData;return e.value.forEach((({name:e,value:n})=>{const i=yr(n);void 0!==i?t.append(e,i):te.warn("Unable to un-typify value for FormData field",n)})),t}if("URLSearchParams"===e.type)return new URLSearchParams(e.value);if("Array"===e.type||"Object"===e.type){let t,n,i;"Object"===e.type?(i=Object.keys(e.value),n=e=>et{const t={};return e&&e.split("\n").forEach((e=>{const n=e.match(/^([^:]+): ?(.*)/);if(n){const e=n[1].toLowerCase();t[e]=(void 0!==t[e]?t[e]+",":"")+(n[2]||"").replace(/,/g,"%2C")}})),t},Rr=(e,t,n)=>{const i={...t||{}},r=async(e,t)=>{const n=i[e];n&&n("function"==typeof t?await t():t)},s=async(e,t)=>{i[e]&&(await r(e,t),i[e]=void 0)};if(!(n=n||{}).internal&&(o=e.url, +!["https:","http:","data:","blob"].some((e=>o.startsWith(e))))){te.warn("xhr: invalid scheme of url:",e.url);const t=vr("Invalid scheme");return s("onerror",t),void s("ondone",t)}var o;const a=void 0!==e.responseType?e.responseType.toLowerCase():void 0,l=e.redirect&&"follow"!==e.redirect,c=(e.proxy&&e.proxy.type,!pr.mozAnon&&e.anonymous||"stream"==a||l||!e.partialSize&&a||"typified"===e.data_type),d=e.fetch||!1;return c||d?Er(e,i,n,e.retries||0,s,r):Gr(e,i,n,e.retries||0,s,r) +},xr="tm-finalurl"+Se.short_id.toLowerCase(),Cr="tm-setcookie"+Se.short_id.toLowerCase(),Er=(e,t,n,i,r,s)=>{const a=x,l=!e.redirect||"follow"===e.redirect;let c,u,h,p;const f=(t,n,i)=>{const r=[];let s;const o=i||t.headers;if(o){const n=[],i=[];o.forEach(((e,t)=>{const o=t.toLowerCase();o.startsWith(Cr)?n.push(e):"set-cookie"===o?i.push(e):o===xr?s=e:r.push(o+":"+e)})),s=l?s||t.url:e.url,(n.length?n:i).forEach((e=>r.push("set-cookie:"+e)))}const a=void 0===n?4:n,c=t.status||0,d=t.statusText||"" +;return{readyState:a,responseHeaders:r.join("\r\n"),finalUrl:s,status:c,statusText:d}},m=(e,t,n)=>Object.assign(n||{},{lengthComputable:void 0!==e,loaded:e,done:e,position:e,total:t,totalSize:t}),g=e=>{let t;p&&p(),u||(h?(t=f({status:408,statusText:"Request Timeout"}),r("ontimeout")):"AbortError"==(null==e?void 0:e.name)?(t=vr("aborted"),r("onabort",t)):(t=f({status:408,statusText:(null==e?void 0:e.message)||"Request Timeout"}),r("onerror",t)),u=!0,r("ondone",t)) +},_=e.responseType?e.responseType.toLowerCase():"";if("document"==_&&!a)return void g({name:"Error",message:"response type not supported"});const v=async(e,t,i)=>{let r;if(i)r=e;else{const t=e;if(!n.no_blob&&!n.foreign_context){let e;return e=new lr({blob:t},nr.OBJ_URL),s("onpartial",{tfd:await e.toTransferableData()}),void b((()=>e.dispose()),2e4)}{const e=await ue(t);if(!e)return void te.warn("xhr: failed to convert blob to binary text");r=e}}const o=W(r,t);o.forEach(((e,t)=>{s("onpartial",{ +partial:e,index:t,length:o.length})}))};let y=!1;const k=e=>{e&&(h=!0),R?R.abort():h?g():g({name:"AbortError",message:"Aborted by user"})};let R;return(async()=>{try{const C={};C.method=e.method||"GET";const E=bn(e.url);let G,Z;if(E){let t=!1;E.username&&(e.user=e.user||E.username,t=!0),E.password&&(e.password=e.password||E.password,t=!0),G=t?(h=E,((x=x||{}).noprotocol?"":["about:"].includes(h.protocol)?h.protocol:h.protocol+"//")+(x.auth&&(h.username||h.password)?((e,t)=>{ +const n=e=>e.replace(/[^A-Za-z0-9-._~!$&'()*+,;=]/g,(e=>"%"+e.charCodeAt(0).toString(16).toUpperCase()));return n(e)+(t?":"+n(t):"")+"@"})(h.username||"",h.password)+"@":"")+h.hostname+(!x.noport&&h.port&&h.port>0?":"+h.port:"")+(x.nopath?"":x.nofile?h.pathname.replace(/\/[^/]*$/,"/"):h.pathname+(x.nosearch?"":h.search))):e.url}else G=e.url;if(e.headers){let{forbidden:t,regular:n}=br(e.headers);Z=n,t&&te.warn("xhr: setting forbidden headers in non-bg environment is not supported!",t)} +if(l||(C.redirect=e.redirect,te.warn("xhr: setting redirect in non-bg environment is not supported!",e.redirect)),e.proxy,!p){const{done:e}=await fr(G,C.method);p=()=>{e(),p=void 0}}e.nocache?C.cache="reload":e.revalidate&&(C.cache="default",Z=Z||{},Z={...Z,..._r}),e.anonymous?C.credentials="omit":C.credentials="include",e.user&&e.password&&(Z=Z||{},Z.Authorization="Basic "+d(e.user+":"+e.password)),Z&&(C.headers=new Headers(Z)), +void 0!==e.data&&null!==e.data&&(wr(e.data)&&"typified"===e.data_type?C.body=yr(e.data):"string"==typeof e.data?C.body=e.data:C.body=JSON.stringify(e.data)),R=o?new o:void 0,R&&(C.signal=R.signal),r("onloadstart",f({status:0,statusText:""},1)),w(G,C).then((async o=>{var l,d,h;let g;if(c&&(A(c),c=null),p&&p(),u)return;let b=f(o,void 0,g);if(b.status>0&&(b.status<200||b.status>=399)&&i>0)return void Er(e,t,n,i-1,r,s);const{partialSize:w,overrideMimeType:k,responseType:R}=e +;if(o.ok)if(s("onreadystatechange",f(o,2,g)),"stream"==_){const t=null===(l=o.body)||void 0===l?void 0:l.getReader();if(t)for(;;){const{done:n,value:i}=await t.read();if(i){const t=new Blob([i]);await v(t,parseInt(e.partialSize),!1)}if(n)break}}else{const t=await(async(e,t)=>{var n;const i=null===(n=e.body)||void 0===n?void 0:n.getReader();if(i){const n=[];let r=0;const o=parseInt(e.headers.get("Content-Length")||"-1");for(;;){const{done:a,value:l}=await i.read();if(l&&(n.push(l),r+=l.length, +await s("onprogress",(async()=>{const n=f(e,3,t);return m(r,o,n)}))),a)break}const a=new Uint8Array(r);let l=0;for(const e of n)a.set(e,l),l+=e.length;return a}{const n=await e.arrayBuffer();return await s("onprogress",(async()=>{const i=f(e,3,t);return m(n.byteLength,n.byteLength,i)})),new Uint8Array(n)}})(o,g),n=null===(d=o.headers)||void 0===d?void 0:d.get("Content-Type"),i=((null===(h=k||n)||void 0===h?void 0:h.toLowerCase().match(/charset=([^;]+)/))||[])[1],r=()=>new Blob([t],{ +type:k||n||"binary/octet-stream"});if(w){let t;["arraybuffer","blob"].includes(_)||void 0!==k?(b.response=r(),t=!1):(b.response=await ue(r(),i||"utf-8"),t=!0),b=await(async(t,n)=>{if(e.partialSize){const i=t.response;["response","responseText","responseXML"].forEach((e=>{delete t[e]})),!y&&i&&(y=!0,await v(i,parseInt(e.partialSize),n))}return t})(b,t)}else if(void 0!==R){let e;if("arraybuffer"==_)b.response=t.buffer;else if("blob"==_)b.response=r();else if("document"==_){ +e=(n||"text/xml").toString().split(";")[0];const t=new a,s=await ue(r(),i||"utf-8");b.response=t.parseFromString(s||"",e)}else if("json"==_){const e=await ue(r(),i||"utf-8");b.response=JSON.parse(e||"")}else te.warn("xhr: responseType",_," is not implemented!"),b.responseText=b.response=await ue(r(),i||"utf-8")}else{const e=await ue(r(),i||"utf-8");b.responseText=b.response=e}}else if(b.responseXML=void 0,"follow"!==e.redirect&&"opaqueredirect"==o.type){const e=f(o,2,g) +;e.responseText=e.response=b.responseText=b.response=void 0,e.status=b.status=301,s("onreadystatechange",e)}else{s("onreadystatechange",f(o,2,g));try{if("stream"==_){const t=await o.text(),n=new Blob([t]);await v(n,parseInt(e.partialSize),!1)}else b.responseText=b.response=await o.text()}catch(e){}}r("onreadystatechange",b),r("onload",b),r("ondone",b)})).catch((async e=>{g(e)})),void 0!==e.timeout&&null!==e.data&&(c=b((()=>{c=null,k(!0)}),e.timeout))}catch(e){p&&p();const t=e +;te.error(t.message,t.stack);const n=vr(t.message);r("onerror",n),r("ondone",n)}var h,x})(),{abort:()=>k()}},Gr=(e,t,n,i,r,s)=>{const o=e.responseType?e.responseType.toLowerCase():"";let a,l;e.anonymous&&(a=pr.mozAnon?{mozAnon:!0}:{anonymous:!0});const c=j;if(!c)throw new Error("internal error: XMLHttpRequest not available!");const d=new c(a),u=t=>{let n="",i=e.url;if(d.readyState>=2){let e;n=d.getAllResponseHeaders(),n&&(n=n.replace(/tm-finalurl[0-9a-zA-Z]*: .*[\r\n]{1,2}/i,""), +n=n.replace(/tm-setcookie[0-9a-zA-Z]+-[0-9]+:/gi,"set-cookie:")),(e=d.getResponseHeader(xr)||d.responseURL)&&(i=e)}const r={readyState:d.readyState,responseHeaders:n,finalUrl:i,status:d.readyState>=2?d.status:0,statusText:d.readyState>=2?d.statusText:""};return t&&4==d.readyState?d.responseType?(r.responseXML=void 0,r.responseText=void 0,r.responseType=d.responseType,r.response=d.response):(r.responseXML=d.responseXML||void 0,r.responseText=d.responseText, +r.response=d.response):(r.responseXML=void 0,r.responseText="",r.response=void 0),r};let A=!1;const h=async t=>{if(e.partialSize){const i=t.response,r=!["arraybuffer","blob"].includes(o);["response","responseText","responseXML"].forEach((e=>{delete t[e]})),!A&&i&&(A=!0,await(async(e,t,i)=>{let r;if(i)r=e;else{const t=e;if(!n.no_blob&&!n.foreign_context){let e;return e=new lr({blob:t},nr.OBJ_URL),s("onpartial",{tfd:await e.toTransferableData()}),void b((()=>e.dispose()),2e4)}{const e=await ue(t) +;if(!e)return void te.warn("xhr: failed to convert blob to binary text");r=e}}const o=W(r,t);o.forEach(((e,t)=>{s("onpartial",{partial:e,index:t,length:o.length})}))})(i,parseInt(e.partialSize),r))}return t},p=qe({threads:1}),f=e=>t=>p.add((()=>e(t)));return(async()=>{e.method=e.method||"GET";const{done:a}=await fr(e.url,e.method),c=async e=>{await r("ondone",e),a()},A={onload:f((async()=>{let o=u(!0) +;o.status>0&&(o.status<200||o.status>=300)&&i>0?Gr(e,t,n,i-1,r,s):(e.partialSize&&(o=await h(o)),await r("onload",o),4==o.readyState&&await c(o))})),onerror:f((async()=>{const o=u();4==o.readyState&&200!=o.status&&0!=o.status&&i>0?Gr(e,t,n,i-1,r,s):(await r("onerror",o),await c(o))})),onloadstart:f((async()=>{await s("onloadstart",(()=>u()))})),onreadystatechange:f((async()=>{await s("onreadystatechange",(async()=>{let e=u();return e=await h(e),e}))})),onredirect:f((async()=>{ +await s("onredirect",(()=>u()))})),onprogress:f((async e=>{await s("onprogress",(async()=>{let t=u();return t=await h(t),g(e,t)}))})),ontimeout:f((async()=>{const e=u();await r("ontimeout"),await c(e)})),onabort:f((async()=>{const e=vr("aborted");await r("onabort"),await c(e)}))},p={onuploadprogress:f((async e=>{await s("onuploadprogress",(async()=>g(e)))}))},m=0==Object.keys(A).concat(["ondone"]).filter((e=>!!t[e])).length;if(m)throw new Error("Synchronous XHR is not supported anymore") +;const g=(e,t)=>{let n,i,r,s,o,a;try{if(e.lengthComputable||e.total>0)n=e.loaded,i=e.total;else if(t){const r=!d.responseType||["","text"].includes(d.responseType)?d.responseText:null;let s=Number(kr(t.responseHeaders)["content-length"]||"");const o=t.readyState>2&&r?r.length:0;0==s&&(s=-1),n=e.loaded||o,i=e.total||s}s=e.lengthComputable,r=n,o=n,a=i}catch(e){}return Object.assign(t||{},{lengthComputable:s,loaded:r,done:n,position:o,total:i,totalSize:a}) +},_=["ontimeout","onload","onerror","onabort"];Object.keys(A).forEach((e=>{(t[e]||_.includes(e))&&(d[e]=A[e])}));const b={onuploadprogress:"onprogress"};d.upload&&Object.keys(p).forEach((e=>{const n=b[e];n&&t[e]&&(d.upload[n]=p[e])}));try{let t;if(d.open(e.method,e.url,!m,e.user,e.password),e.headers){const{forbidden:n,regular:i}=br(e.headers);t={...i,...n}}(e.nocache||e.revalidate)&&(t=t||{},e.nocache?t={...t,...gr}:e.revalidate&&(t={...t,..._r})),t&&Object.keys(t).forEach((e=>{try{ +d.setRequestHeader(e,t[e])}catch(n){te.warn("xhr: rejected header",e,t[e])}})),void 0!==e.overrideMimeType&&d.overrideMimeType(e.overrideMimeType),e.partialSize?["arraybuffer","blob"].includes(o)?d.responseType=e.responseType="blob":delete e.responseType:void 0!==e.responseType&&(l=e.responseType.toLowerCase(),"xml"!=l&&"headers"!=l&&"stream"!=l&&(d.responseType=l)),void 0!==e.timeout&&(d.timeout=e.timeout), +void 0!==e.data?wr(e.data)&&"typified"===e.data_type?d.send(yr(e.data)):"string"==typeof e.data?d.send(e.data):d.send(JSON.stringify(e.data)):d.send()}catch(e){const t=e;te.error(t.stack);const n=vr(t.message);r("onerror",n),await c(n)}})(),{abort:function(){d.abort()}}};var Zr={},Sr=Zr.util=Zr.util||{};Sr.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},Sr.isArrayBufferView=function(e){return e&&Sr.isArrayBuffer(e.buffer)&&void 0!==e.byteLength}, +Sr.ByteBuffer=n,Sr.ByteStringBuffer=n,Sr.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},Sr.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},Sr.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},Sr.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))}, +Sr.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var n=this.data;t>0;)1&t&&(n+=e),(t>>>=1)>0&&(e+=e);return this.data=n,this._optimizeConstructedString(t),this},Sr.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},Sr.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(Sr.encodeUtf8(e))},Sr.ByteStringBuffer.prototype.putInt16=function(e){ +return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},Sr.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},Sr.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},Sr.ByteStringBuffer.prototype.putInt16Le=function(e){ +return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},Sr.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},Sr.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},Sr.ByteStringBuffer.prototype.putInt=function(e,t){var n="" +;do{t-=8,n+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(n)},Sr.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<0);return t},Sr.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),n=2<=n&&(t-=n<<1),t},Sr.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t}, +Sr.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},Sr.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},Sr.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},Sr.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)}, +Sr.ByteStringBuffer.prototype.copy=function(){var e=Sr.createBuffer(this.data);return e.read=this.read,e},Sr.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},Sr.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},Sr.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this}, +Sr.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t0;)1&t&&(n+=e),(t>>>=1)>0&&(e+=e);return n},Sr.encodeUtf8=function(e){ +return unescape(encodeURIComponent(e))},Sr.decodeUtf8=function(e){return decodeURIComponent(escape(e))};var Br=Zr.sha256=Zr.sha256||{};Zr.md=Zr.md||{},Zr.md.algorithms=Zr.md.algorithms||{},Zr.md.sha256=Zr.md.algorithms.sha256=Br,Br.create=function(){Ir||(Tr=String.fromCharCode(128),Tr+=Zr.util.fillString(String.fromCharCode(0),64), +Ur=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298], +Ir=!0);var e=null,t=Zr.util.createBuffer(),n=new Array(64),r={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,messageLength64:[0,0],start:function(){return r.messageLength=0,r.messageLength64=[0,0],t=Zr.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},r}};return r.start(),r.update=function(s,o){return"utf8"===o&&(s=Zr.util.encodeUtf8(s)),r.messageLength+=s.length, +r.messageLength64[0]+=s.length/4294967296>>>0,r.messageLength64[1]+=s.length>>>0,t.putBytes(s),i(e,n,t),(t.read>2048||0===t.length())&&t.compact(),r},r.digest=function(){var s=Zr.util.createBuffer();s.putBytes(t.bytes()),s.putBytes(Tr.substr(0,64-(r.messageLength64[1]+8&63))),s.putInt32(r.messageLength64[0]<<3|r.messageLength64[0]>>>28),s.putInt32(r.messageLength64[1]<<3);var o={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};i(o,n,s);var a=Zr.util.createBuffer() +;return a.putInt32(o.h0),a.putInt32(o.h1),a.putInt32(o.h2),a.putInt32(o.h3),a.putInt32(o.h4),a.putInt32(o.h5),a.putInt32(o.h6),a.putInt32(o.h7),a},r};var Tr=null,Ir=!1,Ur=null;Sr.hasWideChar=function(e){for(var t=0;t>>8)return!0;return!1};const Lr=function(e,t){var n=Zr.md.sha256.create();return n.update(e,"UTF-8"==t||void 0===t&&Sr.hasWideChar(e)?"utf8":void 0),n.digest().toHex()},Fr=e=>{if(!x)throw new Error("DOMParser not available") +;return(new x).parseFromString(e,"text/xml")},Mr=e=>{var t;let n;return e&&(n=(null===(t=e.firstChild)||void 0===t?void 0:t.nextSibling)?e.firstChild.nextSibling:e.firstChild),n},jr=(e,t)=>{let n,i;if((n=e.getElementsByTagNameNS("*",t)[0])&&(i=n.firstChild))return i.nodeValue||void 0},Dr=async e=>{if(x){const t=Fr(e);let n;if(!t||!(n=Mr(t))||!n.childNodes)return;return(async e=>{const t=[],n=e.getElementsByTagNameNS("*","response");for(let e=0;e=0?l:void 0,removed:-1==l};t.push(e)}}return t})(n)}throw new Error("DOMParser not available") +},Or=async e=>{if(x){const t=Fr(e);let n;if(!t||!(n=Mr(t))||!n.childNodes)return;return(e=>jr(e,"td:cursor"))(n)}throw new Error("DOMParser not available")};let zr;const Pr=qe({threads:1}),Nr=(e,t)=>{const n=(e?e.split("/"):[]).concat(t?[t]:[]).join("/");return n?("/"==n.substr(0,1)?"":"/")+n:""};let Vr=()=>({get:()=>Te.Breach(),set:()=>Te.Breach(),delete:()=>Te.Breach(),clear:()=>Te.Breach()});const Qr=e=>{const t=(e.match(/[\dA-F]{2}/gi)||[]).map((e=>parseInt(e,16))) +;return new Uint8Array(t).buffer},Hr=e=>{const t={type:e,request:e=>{const t=()=>{const t=Te(),n=e=>{te.log("rest service: request failed",e),t.reject(e)},i=Object.assign({},e),r="headers"===i.responseType;return r&&delete i.responseType,Rr(i,{onload:e=>{if([200,201,204,207].includes(e.status)){let n;n=r?kr(e.responseHeaders):e.response,t.resolve({result:n})}else n(e)},onerror:n,ontimeout:()=>n("timed out"),onprogress:e=>t.notify(e),onuploadprogress:e=>t.notify(e)},{internal:!0}),t.promise()} +;return e.no_queue?t():Pr.add(t)},error:t=>{const n=t;let i;if(void 0!==n.status){i=n.status.toString();try{i=i+" | "+n.responseText}catch(e){}}else i=t;ni(e,"error","request: "+i)},wait:e=>(...t)=>e(...t).then((e=>e),(e=>(e=>Te.Breach(e?e.responseText||e.statusText:void 0))(e))),changes:(()=>{let e;return{listen:()=>(e||(e=Te(),t.watch&&t.watch.start()),e.promise()),notify:t=>{e.notify(t)},stop:()=>(t.watch&&t.watch.stop(),Te.Pledge())}})()};return t},qr=e=>{const t=Object.assign({},e),n=t.type +;if(void 0===n)throw new Error("Internal error");let i,r,s=[];const o=e=>{const t={client_id:d.config.client_id,redirect_uri:d.config.redirect_uri,state:r,scope:d.config.scope,refresh_token:e};return d.config.redirect_uri+"?"+vn(t)},a=e=>{let t,n;if(e&&0===e.indexOf(d.config.redirect_uri)&&(n=bn(e))&&("string"!=typeof(i=n)&&(i=i.search?i.search.substring(1):i.hash?i.hash.substring(1):""),t=i.split("&").reduce(((e,t)=>{const n=t.split("=");return e[p(n[0])]=p(n[1]),e +}),{}))&&(t.access_token||t.error)&&t.state===r)return{uid:t.uid,access_token:t.access_token,refresh_token:t.refresh_token,error:t.error};var i};let l;const c={};Object.defineProperty(c,"credentials",{get:()=>(l||(l=Vr(e.type)),l),enumerable:!1});const d=Object.assign(c,e,{...t,config:{...t.config,auth_prefix:"Bearer"},request:e=>Te((async({resolve:t,reject:n})=>{if(!e.no_auth){const t=(await d.credentials.get()).access_token;if(!t)return void n("Authentication failed");e.headers=e.headers||{}, +e.headers.Authorization=d.config.auth_prefix+" "+t}t()})).promise().then((()=>t.request(e))),oauth:{run:()=>{if(i)return i;let e=Te();const t=i=e.promise();r="!!"+n+"-"+X();const{redirect_uri:s,refresh_supported:l}=d.config,c=void 0,u=async(t,n)=>{const i=e;e=void 0,await d.credentials.set(n),null==i||i.resolve(),t&&t.close()},A=e=>Te((({resolve:t})=>{Rr({url:e,responseType:"json"},{ondone:e=>t(e)},{internal:!0})})).promise();return d.credentials.get().then((async e=>{const t=e.refresh_token +;if(l&&t){let e,i=1e3,r=4;const s=[200,400,401,403,404,405,406,408,412],a=o(t);for(;!e;)e=await A(a),e&&s.includes(e.status)||!(--r>=0)||(await Pe(i),i=Math.min(3*i,36e5),e=void 0);if(200==e.status){const t=e.response;if(t){if(!t.error&&t.access_token){const{access_token:e,refresh_token:n,basic_auth:i,uid:r}=t;return void u(null,{access_token:e,refresh_token:n,basic_auth:i,uid:r})}ni(n,"error","auth refresh token use: "+(t.error||"!access_token"))} +}else ni(n,"error",`auth refresh token use failed with status ${e.status}`)}})).then((()=>{if(!e)return;if(!l)return Te.Pledge();const t=Te(),i=zr({url:o(),filter:c});return i.promise.progress((t=>{let r;e&&(r=a(t.url))&&(r.error||!r.access_token?(ni(n,"error","auth refresh: "+(r.error||"!access_token")),d.config.refresh_supported=!1):u(i,r))})).always(t.resolve),t.promise()})).then((()=>{if(!e)return;const t=Te(),i=zr({url:d.config.request_uri+"?"+vn({response_type:d.config.response_type, +client_id:d.config.client_id,redirect_uri:d.config.redirect_uri,state:r,scope:d.config.scope}),filter:c});return i.promise.progress((t=>{let r;e&&(r=a(t.url))&&(r.error||!r.access_token?ni(n,"error","auth: "+(r.error||"!access_token")):u(i,r))})).always(t.resolve),t.promise()})).done((()=>{i=void 0,e&&e.reject("auth_failed")})),t},revoke:()=>d.credentials.get().then((e=>{const i=e.access_token;return i?(r=r||"!!"+n+"-"+X(),t.request({method:"GET",retry_auth:!1,url:`${Wr}/revoke?`+vn({token:i, +state:r})}).then((()=>d.oauth.reset()),(()=>d.oauth.reset()))):Te.Breach()})),reset:()=>d.credentials.clear()},wait:e=>t.wait(((...t)=>d.credentials.get().then((n=>{if(n.access_token)return e(...t);{const n=Te();return s.push((()=>n.consume(e(...t)))),d.oauth.run().done((()=>{s.forEach((e=>e())),s=[]})).fail((e=>{n.reject(e)})),n.promise()}}))))});return d},Xr=e=>{let t,n,i,r;const s=Te();let o,a,l,c,d,u=null,h=null +;const f=Object.assign({},e),m=e=>f.wait(((...t)=>v.init().then((()=>e(...t))))),g=(e,t)=>{const n=t||{};return n.set_current_list&&(o={}),v.request({method:"PROPFIND",url:e,headers:{"Content-Type":"text/xml; charset=UTF-8",Depth:void 0!==n.depth?n.depth:1}}).then((async e=>{const t=e.result;if(null==t)return;const i=await Dr(t);if(void 0===i)return;const r=_(i);if(n.set_current_list){const e=await Or(t);e&&(a=e),r.forEach((e=>{o[e.id]=e}))}return r +})).then((e=>void 0===e?Te.Breach("not found"):e))},_=e=>e.map((e=>{const{id:r,...s}=e,o=r.replace(new RegExp("^("+[O(n+t)+"/?",O(i+t)+"/?"].join("|")+")"),"");let a;try{a=p(o)}catch(e){a=r}return{id:o,...s,name:a}})),v=Object.assign(e,{...e,config:{...e.config,watch_interval:36e5,root:void 0,path:void 0},request:e=>(e.fetch=!0,e.anonymous=!0,f.request(e).then((e=>e),(t=>{const n=(null==t?void 0:t.status)||-1;return!t||[429,500].includes(n)?(e.backoff=2*(e.backoff||1e3), +Pe(e.backoff).then((()=>v.request(e)))):404==n?Te.Pledge(t):(v.error(t),Te.Breach(t))}))),init:()=>{if(r)return r;t=Nr(v.config.root,v.config.path),n=v.config.url||"","/"==n.slice(-1)&&(n=n.slice(0,-1));const e=bn(n);if(!e)return Te.Breach("invalid url");i=e.pathname,"/"==i.slice(-1)&&(i=i.slice(0,-1));const o=Te(),a=r=o.promise();return v.request({method:"OPTIONS",url:`${n}/`,responseType:"headers"}).done((e=>{const t=e.result;let n +;t&&(n=t["access-control-allow-methods"])&&n.includes("EDITOR")&&(d=!0)})).always((()=>{g(`${n}${t}/`,{depth:0}).done((()=>{o.resolve(),s.resolve()})).fail((()=>{const e=[];Te.onebyone(t.split("/").filter((e=>e)).map((t=>{e.push(t);const i=e.join("/");return()=>v.request({method:"MKCOL",url:`${n}/${i}/`,headers:{"Content-Type":"text/xml; charset=UTF-8"}}).then((e=>e),(e=>{if(405==((null==e?void 0:e.status)||-1))return Te.Pledge(e)}))}))).done((()=>{o.resolve(),s.resolve()})).fail((()=>{r=void 0, +o.reject()}))}))})),a},list:m((e=>g(`${n}${t}/`,{set_current_list:!0}).then((t=>{const n={};return t.map((t=>{if(!e){if(n[t.id])return;n[t.id]=!0}return{name:t.name,id:t.id,size:t.size||0,etag:t.etag,modified:t.modifiedTime,precision:1e3,removed:t.removed}})).filter((e=>e))})))),get:m((e=>{const i=e.id||e;return v.request({method:"GET",url:n+Nr(t,i),headers:{"Content-Type":"text/xml; charset=UTF-8"},responseType:"arraybuffer"}).then((e=>{const t=e.result;return new Blob([t])}))})), +put:m(((e,i,r)=>{const s=e.id||e;let o,a,l;const c={"Content-Type":"application/octet-stream"};let d=!1;return r&&r.lastModified&&(d=null===h,o=r.lastModified,l=new Date(r.lastModified).toISOString(),a=r.lastModified/1e3,(h||d)&&(c["X-OC-Mtime"]=a)),v.request({method:"PUT",url:n+Nr(t,s),headers:c,data_type:"typified",data:{type:"raw",value:i},responseType:"headers"}).then((e=>{const i=e.result;if(i&&d){let e +;h=!("accepted"!=i["x-oc-mtime"]&&(!i.date||!(e=new Date(i.date).getTime())||e!=o&&e!=Math.floor(a)))}if(!h&&!u&&l){const e=()=>{te.warn("WebDAV: no way to set file modification date! This might cause redundant up and downloads."),u=!0};return v.request({method:"PROPPATCH",url:n+Nr(t,s),headers:{"Content-Type":"text/xml; charset=UTF-8"}, +data:['','',"","",`${l}`,"","",""].join("")}).then((async t=>{const n=t.result;if(null===n)return;const i=await(async e=>{if(x){const t=Fr(e);if(!t)return;return(e=>{var t;let n,i,r,s +;if((n=e.childNodes[0])&&(i=n.getElementsByTagNameNS("*","status")[0])&&(r=null===(t=i.firstChild)||void 0===t?void 0:t.nodeValue)&&(s=r.match(/HTTP\/[0-9.]+ ([1-5][0-9][0-9])/)))return[parseInt(s[1])]})(t)}throw new Error("DOMParser not available")})(n);i&&403===i[0]&&e()}),(()=>(e(),Te.Pledge())))}}))})),delete:m((e=>{const i=e.id||e;return v.request({method:"DELETE",url:n+Nr(t,i),headers:{"Content-Type":"text/xml; charset=UTF-8"}})})),watch:{start:()=>{if(l)return;let e=100;const i=l=X() +;let r=null;const d=()=>{if(c=void 0,l)if(!1===r){const e=o;g(`${n}${t}/`,{set_current_list:!0}).then((()=>{e&&(Object.keys(e).forEach((t=>{const n=o[t],i=e[t];n?i.modifiedTime!=n.modifiedTime&&f.changes.notify({time:n.modifiedTime,name:n.name,id:n.id}):f.changes.notify({time:Date.now(),name:i.name,id:i.id,removed:!0})})),Object.keys(o).forEach((t=>{if(!e[t]){const e=o[t];f.changes.notify({time:e.modifiedTime,name:e.name,id:e.id})}})))})).fail((e=>{te.warn("WebDAV: file changes check failed",e) +})).always((()=>{c=b(d,v.config.watch_interval)}))}else((e,t)=>{const n={"Content-Type":"text/xml; charset=UTF-8",Depth:1,Timeout:90};return t&&(n.Cursor=t),v.request({method:"SUBSCRIBE",url:e,headers:n,no_queue:!0}).then((async e=>{const t=e.result;if(null===t)return Te.Pledge({changes:[],cursor:a});const n=await Dr(t);return void 0!==n?{changes:_(n),cursor:await Or(t)}:void 0})).then((e=>void 0===e?Te.Breach():e))})(`${n}${t}/`,a).then((t=>{r=!0;const n=t.changes;a=t.cursor,e=100, +n.forEach((e=>{f.changes.notify({time:e.modifiedTime,name:e.name,id:e.id,removed:e.removed})}))}),(()=>{if(null!==r)return e*=2,Pe(e);r=!1})).always(d)},u=()=>!l||l!==i;s.promise().then((()=>{u()||m((()=>u()?Te.Breach():(d(),Te.Pledge())))()}))},stop:()=>{l=void 0,c&&(A(c),c=void 0)}},getRemoteUrl:e=>{if(d)return n+Nr(t,e)+"?method=editor#bypass=true"},getRemoteDomains:()=>{var e;return[((null===(e=bn(n))||void 0===e?void 0:e.origin)||"").replace(/^.*:\/\//,"")]}});return v +},Wr="https://accounts.tampermonkey.net/e/oauth2/v1",Yr={drive:()=>{let e;M&&(e=parseInt(M.getItem("gdrive_poll_interval")||""))||(e=18e5);const t=qr(Hr("drive")),n=Object.assign({},t),i="appDataFolder";let r,s;const o=Object.assign(t,{...t,config:{...t.config,redirect_uri:`${Wr}/auth`,refresh_supported:!0,request_uri:"https://accounts.google.com/o/oauth2/v2/auth",client_id:"408438522028-3cgn3t3jas3fak7isbnfod1q4h15g2fv.apps.googleusercontent.com", +scope:"https://www.googleapis.com/auth/drive.appdata",response_type:"token",watch_interval:e},request:e=>n.request(e).then((e=>e),(t=>{const n=(null==t?void 0:t.status)||-1;return!t||[403,429,500].includes(n)?(e.backoff=2*(e.backoff||1e3),Pe(e.backoff).then((()=>o.request(e)))):[400,401].includes(n)?(te.warn("Google Drive: authentication error",t),o.credentials.delete("access_token").then((()=>{if(!e.retry_auth)return e.retry_auth=!0,o.oauth.run().fail((e=>o.error(e))).then((()=>o.request(e))) +}))):404==n?Te.Pledge(t):(o.error(t),Te.Breach(t))})),list:n.wait((e=>{let t=[];const n=Te(),r=e=>"https://www.googleapis.com/drive/v3/files?"+vn({spaces:i,pageToken:e,orderBy:"modifiedTime desc",fields:"nextPageToken, files(id, size, name, modifiedTime, md5Checksum)",pageSize:500}),s=e=>{o.request({method:"GET",url:e,headers:{"Content-Type":"application/json"}}).then((e=>{const i=e.result,o=i?JSON.parse(i):{files:[]};if(t=t.concat(o.files),o.nextPageToken)return s(r(o.nextPageToken)) +;n.resolve(t)}))};return s(r()),n.promise().then((t=>{const n={};return t.map((t=>{if(!e){if(n[t.name])return;n[t.name]=!0}return{name:t.name,size:t.size||0,id:t.id,md5:t.md5Checksum,modified:new Date(t.modifiedTime).getTime()}})).filter((e=>e))}))})),get:n.wait((e=>{const t=e.id||e;return o.request({method:"GET",url:"https://www.googleapis.com/drive/v3/files/"+t+"?"+vn({spaces:i,alt:"media"}),responseType:"arraybuffer"}).then((e=>{const t=e.result;return new Blob([t])}))})), +put:n.wait(((e,t,n)=>{const r=e,s=r.name||e,a=r.id,l=X();return Te.Pledge().then((()=>{if(t)return ue(t)})).then((e=>{const t=n&&n.lastModified?new Date(n.lastModified).toISOString():void 0,r=[];return r.push("--"+l),r.push("Content-Type: application/json"),r.push(""),r.push(JSON.stringify({name:s,parents:a?void 0:[i],modifiedTime:t})),r.push("--"+l),e&&(r.push("Content-Type: application/octet-stream"),r.push("Content-Transfer-Encoding: base64"),r.push(""),r.push(re(e)),r.push("--"+l+"--")), +r.push(""),o.request({method:a||!e?"PATCH":"POST",url:"https://www.googleapis.com/"+(e?"upload/":"")+"drive/v3/files"+(a?"/"+a:"")+"?"+vn({uploadType:"multipart"}),headers:{"Content-Type":"multipart/related; boundary="+l},data:r.join("\r\n")})}))})),delete:n.wait((e=>{const t=e.id||e;return o.request({method:"DELETE",url:"https://www.googleapis.com/drive/v3/files/"+t+"?"+vn({spaces:i}),headers:{"Content-Type":"application/json"}})})),revoke:()=>o.oauth.revoke(),compare:(e,t)=>{const n=Te();let i +;return(i=e.md5)&&i==le(t,"utf-8")?n.resolve(!0):n.resolve(!1),n.promise()},watch:{start:()=>{if(r)return;let e;r=!0;const t=()=>{s=null,r&&o.request({method:"GET",url:"https://www.googleapis.com/drive/v3/changes/?"+vn({pageToken:e,spaces:i,pageSize:1e3,includeRemoved:!0}),headers:{"Content-Type":"application/json"}}).then((t=>{const n=t.result;if(!r)return Te.Breach();const i=n?JSON.parse(n):{};if(!(e=i.newStartPageToken))return te.warn("Google Drive: watch token error",n),o.watch.stop() +;i.nextPageToken&&te.warn("Google Drive: too much changes",n),(i.changes||[]).forEach((e=>{let t;const n=e.file;"file"===e.type&&n&&(t=Date.parse(e.time),isNaN(t)&&(t=Date.now()),o.changes.notify({id:n.id,time:t,name:n.name,removed:e.removed}))}))})).fail((e=>{te.warn("Google Drive: file changes check failed",e)})).always((()=>{s=b(t,o.config.watch_interval)}))};n.wait((()=>r?o.request({method:"GET",url:"https://www.googleapis.com/drive/v3/changes/startPageToken",headers:{ +"Content-Type":"application/json"}}).then((n=>{const i=n.result,r=i?JSON.parse(i):{};if(!(e=r.startPageToken))return te.warn("Google Drive: watch token error",i),o.watch.stop();t()})):Te.Breach()))()},stop:()=>{r=!1,s&&(A(s),s=null)}},getRemoteUrl:void 0});return o},dropbox:e=>{const t=e.path||"";let n;M&&(n=parseInt(M.getItem("dropbox_poll_interval")||""))||(n=18e5);const i=qr(Hr("dropbox")),r=Object.assign({},i);let s,o,a,l,c=!0;const d=e=>{let n=[];const i=Te(),r=e=>{u.request({method:"POST", +url:"https://api.dropboxapi.com/2/files/list_folder"+(e?"/continue":""),headers:{"Content-Type":"application/json"},data:{path:e?void 0:Nr(t),cursor:e}}).then((e=>{const t=e.result,s=t?JSON.parse(t):{entries:[]};if(n=n.concat(s.entries),s.has_more&&s.cursor)return r(s.cursor);i.resolve({list:n,cursor:s.cursor})})).fail(i.reject)};return c?(c=!1,u.put(".version",new Blob([Jr])).then((()=>{r(e)})).fail(i.reject)):r(e),i.promise()},u=Object.assign(i,{...i,config:{...i.config, +redirect_uri:`${Wr}/auth`,request_uri:"https://www.dropbox.com/oauth2/authorize",client_id:"gq3auc9yym0e21y",response_type:"token",watch_interval:n?Number(n):0},request:e=>r.request(e).then((e=>e),(t=>{const n=(null==t?void 0:t.status)||-1;return!t||[500,429].includes(n)?(e.backoff=2*(e.backoff||1e3),Pe(e.backoff).then((()=>u.request(e)))):[401].includes(n)?(te.warn("Dropbox: authentication error",t),u.credentials.delete("access_token").then((()=>{if(!e.retry_auth)return e.retry_auth=!0, +u.oauth.run().fail((e=>u.error(e))).then((()=>u.request(e)))}))):(u.error(t),Te.Breach(t))})),list:r.wait((e=>d().then((t=>{const n={};return o=t.cursor,t.list.map((t=>{if(!e){if(n[t.name])return;n[t.name]=!0}return{name:t.name,size:t.size,dropbox_hash:t.content_hash,modified:new Date(t.client_modified).getTime(),precision:1e3}})).filter((e=>e))})).always((()=>{s&&o&&(s(),s=null)})))),get:r.wait((e=>{const n=e.name||e;return u.request({method:"POST", +url:"https://content.dropboxapi.com/2/files/download",headers:{"Dropbox-API-Arg":JSON.stringify({path:Nr(t,n)})},responseType:"arraybuffer"}).then((e=>{const t=e.result;return new Blob([t])}))})),put:r.wait(((e,n,i)=>{const r=e.name||e,s=i&&i.lastModified?(new Date(i.lastModified).toISOString().match(/[^:]*:[^:]*:[^:.a-zA_Z]*/)||"")[0]+"Z":void 0;return u.request({method:"POST",url:"https://content.dropboxapi.com/2/files/upload",headers:{"Dropbox-API-Arg":JSON.stringify({path:Nr(t,r), +client_modified:s,mode:"overwrite"}),"Content-Type":"application/octet-stream"},data_type:"typified",data:{type:"raw",value:n}})})),delete:r.wait((e=>{const n=e.name||e;return u.request({method:"POST",url:"https://api.dropboxapi.com/2/files/delete",headers:{"Content-Type":"application/json"},data:{path:Nr(t,n)}})})),revoke:()=>u.credentials.get().then((e=>e.access_token?r.request({method:"POST",url:"https://api.dropboxapi.com/2/auth/token/revoke"}).always((()=>u.oauth.reset())):Te.Breach())), +compare:(e,t)=>{const n=Te(),i=4194304,r=oe(t,{encoding:"utf-8"}),s=[],o=r.byteLength;let a=1;const l=async()=>{if(0==--a){let t=new ArrayBuffer(0);s.forEach((e=>{e&&(t=((e,t)=>{const n=new Uint8Array(e.byteLength+t.byteLength);return n.set(new Uint8Array(e),0),n.set(new Uint8Array(t),e.byteLength),n.buffer})(t,e))}));const i=await ae(t),r=Lr(i,"ASCII");n.resolve(r==e.dropbox_hash)}};for(let e=0,t=0;t{s.push(null),a++,ae(r.slice(t,t+Math.min(i,o-t))).then((t=>{ +const n=Lr(t,"ASCII");s[e]=Qr(n),l()}),(()=>{te.warn("Dropbox: unable to calculate SHA-256 hashes"),n.reject()}))})(e);return l(),n.promise()},watch:{start:()=>{if(a)return;a=!0;let e=0;const t=()=>{if(l=null,e=0,a)return o?void u.request({method:"POST",url:"https://notify.dropboxapi.com/2/files/list_folder/longpoll",headers:{"Content-Type":"application/json"},no_auth:!0,no_queue:!0,data:{cursor:o,timeout:180}}).then((t=>{const n=t.result;if(!a)return Te.Breach();const i=n?JSON.parse(n):{} +;return i.backoff&&(e=1e3*i.backoff),i.changes?Pe(6e4).then((()=>d(o))).then((e=>(o=e.cursor)?e.list:(te.warn("Dropbox: watch token error",n),u.watch.stop()))):null})).then((e=>{e&&e.forEach((e=>{let t;const n=e[".tag"];["file","deleted"].includes(n)&&(t=Date.parse(e.server_modified),u.changes.notify({id:e.id,time:t,name:e.name,removed:"deleted"==n}))}))})).fail((e=>{te.warn("Dropbox: file changes check failed",e)})).always((()=>{l=b(t,e+u.config.watch_interval) +})):(te.warn("Dropbox: watch token error",o),u.watch.stop())};r.wait((()=>a?(o?t():s=t,Te.Pledge()):Te.Breach()))()},stop:()=>{a=!1,l&&(A(l),l=null)}},getRemoteDomains:()=>["dropbox.com","dropboxapi.com"],getRemoteUrl:void 0});return u},onedrive:e=>{const t=e.path||"";let n,i;n=18e5;const r=qr(Hr("onedrive")),s=Object.assign({},r);let o,a;const l=e=>{const n=Te();let r=[];const s=o=>{c.request({method:"GET", +url:o||"https://api.onedrive.com/v1.0/drive/special"+(t?"/approot:"+Nr(t)+":/children":"/approot/children"),headers:{"Content-Type":"application/json"}}).then((t=>{const o=t.result,a=o?JSON.parse(o):{value:[]};if(r=r.concat(a.value.map((e=>{var t,n,i;const r=(null===(t=null==e?void 0:e.fileSystemInfo)||void 0===t?void 0:t.lastModifiedDateTime)||0,s=(null===(i=null===(n=null==e?void 0:e.file)||void 0===n?void 0:n.hashes)||void 0===i?void 0:i.sha1Hash)||void 0;return{id:e.id,name:e.name, +size:e.size,sha1:s,modified:new Date(r).getTime()}}))),a["@odata.nextLink"])return s(a["@odata.nextLink"]);e.set_current_list&&(i=r),n.resolve(r)})).fail((e=>n.reject(e)))};return s(),n.promise()},c=Object.assign(r,{...r,config:{...r.config,redirect_uri:`${Wr}/auth`,refresh_supported:!0,request_uri:"https://login.live.com/oauth20_authorize.srf",client_id:"000000004C1A3122",response_type:"token",scope:"onedrive.appfolder",watch_interval:18e5},request:e=>s.request(e).then((e=>e),(t=>{ +const n=(null==t?void 0:t.status)||-1;return!t||[429,500].includes(n)?(e.backoff=2*(e.backoff||1e3),Pe(e.backoff).then((()=>c.request(e)))):[401,403].includes(n)?(te.warn("OneDrive: authentication error",t),c.credentials.delete("access_token").then((()=>{if(!e.retry_auth)return e.retry_auth=!0,c.oauth.run().fail((e=>c.error(e))).then((()=>c.request(e)))}))):404==n?Te.Pledge(t):(c.error(t),Te.Breach(t))})),list:s.wait((()=>l({set_current_list:!0}))),get:s.wait((e=>{const n=e.name||e +;return c.request({method:"GET",url:"https://api.onedrive.com/v1.0/drive/special/approot:"+Nr(t,f(n))+":/content",responseType:"arraybuffer"}).then((e=>{const t=e.result;return new Blob([t])}))})),put:s.wait(((e,n,i)=>{const r=e.name||e,s=f(r.replace(/[#%<>:"|?*/\\]/g,"-"));return c.request({method:"PUT",url:"https://api.onedrive.com/v1.0/drive/special/approot:"+Nr(t,s)+":/content",headers:{"Content-Type":"application/octet-stream"},data_type:"typified",data:{type:"raw",value:n}}).then((e=>{ +const t=i&&i.lastModified?new Date(i.lastModified).toISOString():void 0;if(!t)return e;const n=e.result,r=JSON.parse(n);return c.request({method:"PATCH",url:"https://api.onedrive.com/v1.0/drive/items/"+r.id,headers:{"Content-Type":"application/json"},data:JSON.stringify({fileSystemInfo:{lastModifiedDateTime:t}})})}))})),delete:s.wait((e=>{const n=e.name||e;return c.request({method:"DELETE",url:"https://api.onedrive.com/v1.0/drive/special/approot:"+Nr(t,f(n))})})),revoke:()=>c.oauth.revoke(), +watch:{start:()=>{if(o)return;o=!0;const e=()=>{if(a=null,!o)return;const t=i;l({set_current_list:!0}).then((()=>{if(!t)return;const e={},n={};i.forEach((t=>{e[t.id]=t})),t.forEach((e=>{n[e.id]=e})),Object.keys(n).forEach((t=>{const i=e[t],r=n[t];i?r.modified!=i.modified&&c.changes.notify({time:i.modified,name:i.name}):c.changes.notify({time:Date.now(),name:r.name,removed:!0})})),Object.keys(e).forEach((t=>{if(!n[t]){const n=e[t];c.changes.notify({time:n.modified,name:n.name})}}))})).fail((e=>{ +te.warn("OneDrive: file changes check failed",e)})).always((()=>{a=b(e,c.config.watch_interval)}))};s.wait((()=>o?(e(),Te.Pledge()):Te.Breach()))()},stop:()=>{o=!1,a&&(A(a),a=null)}},getRemoteDomains:()=>["onedrive.live.com"],getRemoteUrl:void 0});return c},yandex:()=>{let e;e=18e5;const t=qr(Hr("yandex")),n=Xr(t),i=Object.assign({},n);let r;const s=Object.assign(n,{...t,...n,config:{...n.config,root:"/Programs/Tampermonkey",url:"https://webdav.yandex.ru",redirect_uri:`${Wr}/auth`, +refresh_supported:!0,request_uri:"https://oauth.yandex.com/authorize",client_id:"a591fcd2ccd248f0baa84222898065f4",response_type:"token",auth_prefix:"OAuth",watch_interval:18e5},init:()=>{if(r)return r;const e=Te();return r=e.promise(),s.request({method:"GET",url:"https://cloud-api.yandex.net/v1/disk/"}).done((e=>{const t=e.result,n=t?JSON.parse(t):{} +;n.total_space&&n.used_space&&(n.used_space+5e7>n.total_space?te.warn("Yandex: low disk space warning, only "+(n.total_space-n.used_space)+" bytes available"):te.log("Yandex: "+(n.total_space-n.used_space)+" bytes on disk available!"))})).always((()=>{e.consume(i.init())})),r},getRemoteDomains:()=>["disk.yandex.com"],getRemoteUrl:void 0,list:e=>i.list(e).then((e=>e.map((e=>(e.md5=e.etag,e))))),request:e=>(()=>{const t=e.headers=e.headers||{};if(t["X-Requested-With"]="XMLHttpRequest", +"PUT"==e.method&&wr(e.data)&&"raw"==e.data.type&&e.data.value){const n=Te();return ue(e.data.value).then((e=>{const n=e||"";t.Etag=le(n),t.Sha256=Lr(n,"ASCII")})).always(n.resolve),n.promise()}return Te.Pledge()})().then((()=>i.request(e))).then((e=>e),(t=>{const n=(null==t?void 0:t.status)||-1;return[401].includes(n)?(te.warn("Yandex: authentication error",t),s.credentials.delete("access_token").then((()=>{if(!e.retry_auth)return e.retry_auth=!0, +s.oauth.run().fail((e=>s.error(e))).then((()=>i.request(e)))}))):t})),compare:(e,t)=>{const n=Te();let i;return(i=e.md5)&&i==le(t,"utf-8")?n.resolve(!0):n.resolve(!1),n.promise()},revoke:()=>s.oauth.revoke()});return s},webdav:e=>{let t;t=18e5;const n=e.url;if(n){const t=n.toLowerCase();t.startsWith("webdav")?e.url=n.replace(/^webdav/i,"http"):t.startsWith("http")||(e.url=`http://${n}`)}const i=Xr((e=>{const t=Object.assign({},e);if(void 0===t.type)throw new Error("Internal error") +;const n=Object.assign(e,{...t,config:{...t.config},credentials:{get:()=>Te.Pledge({basic_auth:n.config.basic_auth}),set:()=>Te.Breach(),delete:e=>Te((({resolve:t,reject:i})=>{"basic_auth"===e?(delete n.config[e],t()):i()})).promise(),clear:()=>Te.Breach()},request:e=>Te((async({resolve:t,reject:i})=>{if(!e.no_auth){const t=(await n.credentials.get()).basic_auth;if(!t)return void i("Authentication failed");e.headers=e.headers||{},e.headers.Authorization="Basic "+t}t() +})).promise().then((()=>t.request(e))).then((e=>e),(t=>{if(!e.no_auth){const e=(null==t?void 0:t.status)||-1;[401].includes(e)&&(te.warn("basic auth: authentication error",t),n.credentials.delete("basic_auth"))}return t})),wait:e=>t.wait(((...t)=>e(...t)))});return n})(Hr("webdav")));return Object.assign(i,{...i,config:{...i.config,root:"Tampermonkey",watch_interval:18e5,...e}})}};let Jr;Object.keys(Yr);const Kr=new ze,$r=(e,t)=>window.sendMessage(e,t),es={images:{origin:Xt.images.origin, +brand:Xt.images.brand,get:function(e){return{about:"info-circle blue",bug:"bug",button_ok:"check green",cancel:"times red",check:"badge-check",clock:"clock green",cloud:"cloud",critical:"exclamation-triangle orange",contrib:"heart",db:"database grey",delete:"trash-alt",download:"spinner rotate",edit:"edit",edit_add:"plus-square",editor_cancel:"undo",enabler:"angle-right",enabler_enabled:"angle-down",error:"bell red",exit:"times",filesave:"save",filter:"filter",flag:"flag", +encrypted:"lock orange",save_to_disk:"download",help:"question-square",home:"home",import:"upload",incognito:"eye-slash",info:"info-square",no_script:"info",lock:"cog",menu_cmd:"cogs",ctx_exec:"play-circle",mobile:"mobile-alt",no:"minus-circle red",no_domain:"thumbs-down red",open:"folder-open",question_mark:"question-circle",resources:"cloud purple",script_add:"plus-square",script_cancel:"industry-alt",script_download:"file-code purple",script_search:"search",tags:"tags",track:"upload", +trash:"trash-alt",permissionless:"star-exclamation green",update:"sync",updatable:"arrow-circle-up green",utilities:"cog",web:"globe blue",windowlist:"window-restore grey",yes_domain:"thumbs-up green"}[e]||""}},formatBytes:(e,t)=>{if(0==e)return"0 Byte";const n=void 0===t?3:t,i=[e=>xt("0number0_Bytes",e),e=>xt("0number0_KB",e),e=>xt("0number0_MB",e),e=>xt("0number0_GB",e),e=>xt("0number0_TB",e)],r=Math.max(Math.min(Math.floor(Math.log(e)/Math.log(1e3)),i.length-1),0) +;return i[r]((0===t?Math.round:e=>e)(e/Math.pow(1e3,r)).toFixed(n))}},ts="monkey_clip",ns=es.images,is=new ze,rs=[{id:"L001",get question(){return xt("There_are_no_active_scripts__Do_you_want_to_search_for_userscripts_")},tags:["FirstSteps"],url:(e=>{const t=e.www;return`${e.protocol}//${t?t+".":""}${e.domain}`})({protocol:"https:",www:"www",api:"api",domain:"userscript.zone"})+"?"+vn({utm_source:"ext",utm_medium:"clip".substr(0,3),utm_campaign:Se.short_id})},{id:"Q101",get question(){ +return xt("Do_you_need_help_working_with_Tampermonkey_")},tags:["General","FirstSteps"]},{id:"Q102",get question(){return xt("Do_you_need_help_installing_new_scripts_to_Tampermonkey_")},tags:["ScriptManagement","FirstSteps"]},{id:"Q103",get question(){return xt("Would_you_like_to_know_how_to_overwrite_or_extend_a_script_s_includes_and_or_excludes_")},tags:["ScriptManagement","Customization"]},{id:"Q105",get question(){ +return xt("Do_you_need_help_syncing_all_your_installed_scripts_to_another_browser_")},tags:["ScriptManagement","Sync"]},{id:"Q106",get question(){return xt("Would_you_like_to_learn_how_to_export_and_import_your_scripts_")},tags:["ScriptManagement","Sync"]},{id:"Q204",get question(){return xt("Do_you_want_to_know_how_to_allow_Tampermonkey_access_to_local_file_URIs_")},tags:["ExtensionSettings","SecurityPrivacy"]},{id:"Q303",get question(){ +return xt("One_of_your_scripts_is_blacklisted__Would_you_like_to_know_why_")},tags:["Blacklisted"]},{id:"Q400",get question(){return xt("Do_you_need_help_viewing_and_editing_values_stored_by_a_userscript_")},tags:["ScriptManagement","Customization","ScriptSettings"]},{id:"Q402",get question(){return xt("Do_you_want_to_use_an_external_editor_to_edit_your_scripts__nWould_you_like_to_know_how_to_set_this_up_")},tags:["ScriptManagement","Customization"]},{id:"Q404",get question(){ +return xt("Are_you_unsure_about_what__sandbox_value_to_use_")},tags:["ScriptManagement","Customization"]},{id:"Q600",get question(){return xt("Do_you_need_help_finding_Tampermonkey_s_console_output_")},tags:["Troubleshooting"] +}].filter((e=>!!e)),ss=['
','
','
','','
','
',"
",`Tampermonkey Bot`,"
"] +;let os;const as=e=>{if(M)try{M.setItem(ts,JSON.stringify(e))}catch(e){console.error(e)}},ls=(()=>{let e;const t=[],n=(()=>{if(M)try{const e=M.getItem(ts);return e?JSON.parse(e):{enabled:!0,lastShown:0,shown:{}}}catch(e){console.error(e)}return{enabled:!1,lastShown:0,shown:{}}})(),i=e=>{const i=Object.keys(n.shown);return(e=>{const t=new Set;return e.forEach((e=>{rs.filter((t=>t.tags.includes(e))).forEach((e=>t.add(e)))})),Array.from(t)})(e).filter((({id:e})=>!t.includes(e)&&!i.includes(e))) +},r={init:()=>{if(!os){if(!n.enabled)return;os=It(ss.join("")).hide(),It("body").append(os),is.on("numberOfScripts",(e=>{const t=[];0!==e.count&&0!==e.enabled||t.push("FirstSteps"),e.blacklisted>0&&t.push("Blacklisted");const n=Y(i(t))[0];n&&r.show(n)})),is.on("scriptEditorOpened",(e=>{if("new-user-script"==e.uuid)return;const t=Y(i(["Customization","ScriptSettings"]))[0];t&&r.show(t)})),is.on("storageEditorOpened",(()=>{const e=Y(i(["ScriptSettings"]))[0];e&&r.show(e)})), +os.find(".header").text(xt("0name0_Your_service_bot",xt("Tam"))),os.find(".yes").on("click",(function(e){const t=this.getAttribute("href");t&&(window.open(t,"_blank"),e.preventDefault()),r.close()}));const t=os.find(".no").text(xt("Close")),s=os.find(".close").attr("title",xt("Close"));It(t,s).on("click",(t=>{t.preventDefault(),e&&(n.shown[e]={date:Date.now()},as(n)),r.close()})),os.find(".disable").text(xt("Disable")).on("click",(e=>{e.preventDefault(),n.enabled=!1,as(n),r.close()})), +window.setTimeout((()=>{const e=i(["General","Sync","ExtensionSettings","SecurityPrivacy","Troubleshooting"]),t=Y(e)[0];t&&r.show(t)}),1e3)}},show:({id:i,url:r,question:s})=>{e||n.enabled&&(n.lastShown=Date.now(),as(n),t.push(i),e=i,os.find(".help-text").text(s),os.find(".yes").attr("href",r||`https://www.tampermonkey.net/faq.php#${e}`),os.fadeIn(1e3))},close:()=>{e=void 0,os.fadeOut(1e3)}};return r})(),cs={glog(e){if(e<1)throw new Error("glog("+e+")");return cs.LOG_TABLE[e]},gexp(e){ +for(;e<0;)e+=255;for(;e>=256;)e-=255;return cs.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let e=0;e<8;e++)cs.EXP_TABLE[e]=1<=0;)t^=us.G15<=0;)t^=us.G18<>>=1;return t},getPatternPosition:e=>us.PATTERN_POSITION_TABLE[e-1],getMask(e,t,n){switch(e){case 0: +return(t+n)%2==0;case 1:return t%2==0;case 2:return n%3==0;case 3:return(t+n)%3==0;case 4:return(Math.floor(t/2)+Math.floor(n/3))%2==0;case 5:return t*n%2+t*n%3==0;case 6:return(t*n%2+t*n%3)%2==0;case 7:return(t*n%3+(t+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial(e){let t=new ds([1],0);for(let n=0;n=1&&t<10)switch(e){case 1:return 10;case 2:return 9;case 4:case 8:return 8 +;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case 1:return 12;case 2:return 11;case 4:return 16;case 8:return 10;default:throw new Error("mode:"+e)}else{if(!(t<41))throw new Error("type:"+t);switch(e){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw new Error("mode:"+e)}}},getLostPoint(e){const t=e.getModuleCount();let n=0;for(let i=0;i5&&(n+=3+s-5)}for(let i=0;i>>7-e%8&1)}put(e,t){for(let n=0;n>>t-n-1&1))}getLengthInBits(){return this.length}putBit(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}}class ps{constructor(e,t){this.totalCount=e,this.dataCount=t}static getRSBlocks(e,t){const n=this.getRsBlockTable(e,t) +;if(void 0===n)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);const i=n.length/3,r=[];for(let e=0;e=7&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=ms.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)}setupPositionProbePattern(e,t){ +for(let n=-1;n<=7;n++)if(!(e+n<=-1||this.moduleCount<=e+n))for(let i=-1;i<=7;i++)t+i<=-1||this.moduleCount<=t+i||(this.modules[e+n][t+i]=n>=0&&n<=6&&(0===i||6===i)||i>=0&&i<=6&&(0===n||6===n)||n>=2&&n<=4&&i>=2&&i<=4)}getBestMaskPattern(){let e=0,t=0;for(let n=0;n<8;n++){this.makeImpl(!0,n);const i=us.getLostPoint(this);(0===n||e>i)&&(e=i,t=n)}return t}createMovieClip(e,t,n){const i=e.createEmptyMovieClip(t,n);this.make();for(let e=0;e>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=i}for(let n=0;n<18;n++){const i=!e&&1==(t>>n&1);this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=i}} +setupTypeInfo(e,t){const n=this.errorCorrectLevel<<3|t,i=us.getBCHTypeInfo(n);for(let t=0;t<15;t++){const n=!e&&1==(i>>t&1);t<6?this.modules[t][8]=n:t<8?this.modules[t+1][8]=n:this.modules[this.moduleCount-15+t][8]=n}for(let t=0;t<15;t++){const n=!e&&1==(i>>t&1);t<8?this.modules[8][this.moduleCount-t-1]=n:t<9?this.modules[8][15-t-1+1]=n:this.modules[8][15-t-1]=n}this.modules[this.moduleCount-8][8]=!e}mapData(e,t){let n=-1,i=this.moduleCount-1,r=7,s=0 +;for(let o=this.moduleCount-1;o>0;o-=2)for(6===o&&o--;;){for(let n=0;n<2;n++)if(null==this.modules[i][o-n]){let a=!1;s>>r&1)),us.getMask(t,i,o-n)&&(a=!a),this.modules[i][o-n]=a,r--,-1===r&&(s++,r=7)}if(i+=n,i<0||this.moduleCount<=i){i-=n,n=-n;break}}}static createData(e,t,n){const i=fs.getRSBlocks(e,t),r=new hs;for(let t=0;t8*s)throw new Error("code length overflow. ("+r.getLengthInBits()+">"+8*s+")");for(r.getLengthInBits()+4<=8*s&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=8*s||(r.put(ms.PAD0,8),r.getLengthInBits()>=8*s));)r.put(ms.PAD1,8);return ms.createBytes(r,i)}static createBytes(e,t){let n=0,i=0,r=0;const s=new Array(t.length),o=new Array(t.length);for(let a=0;a=0?u.get(t):0}}let a=0;for(let e=0;e{const s=(i.uuid?i.uuid:"")+i.id;t.title=e;const o=xs({after:{image:r||"help"},name:i.name,id:s});o&&n.appendChild(o)},bs=(e,t,n,i,r,s)=>{const o=fe("i","far fa-"+e,t,n,i,!0);if(r&&(o.title=r),o.key=n,o.name=t,s){const e=o.getAttribute("class")||"";o.setAttribute("class",e+" clickable"),o.addEventListener("click",s,!0)} +return o},vs=(e,t,n)=>{const{onClick:i,onAuxClick:r,onDelete:s,disabled:o,onAdd:a,color:l,class:c}=n||{},{bg:d,fg:u,bc:A}=((e,t)=>{const n=t||(e=>Lr(e))(e).substring(0,6),i=(r=n,(299*parseInt(r.substr(0,2),16)+587*parseInt(r.substr(2,2),16)+114*parseInt(r.substr(4,2),16))/1e3>=128?"000000":"FFFFFF");var r;const s=(e=>{const t=(299*parseInt(e.substr(0,2),16)+587*parseInt(e.substr(2,2),16)+114*parseInt(e.substr(4,2),16))/1e3;return t>=220||t<=50?"6d6d6d":""})(n);return{bg:`#${n}`,fg:`#${i}`, +bc:s?`#${s}`:void 0}})(e,l),h=fe("span","tag"+(o?" disabled":"")+(c?" "+c:""),t.uuid,"tag"+t.id,e);if(h.setAttribute("style",`background-color: ${d}; color: ${u}; ${A?"border: 1px solid "+A:""}`),h.textContent=e,o&&h.setAttribute("title",xt("This_tag_is_not_part_of_the_system_tag_list_")),!h.inserted&&i&&h.addEventListener("click",i),!h.inserted&&i&&h.addEventListener("auxclick",r),a){const n=fe("i","far fa-"+gs.get("edit_add"),t.uuid,"tag_add",e);n.setAttribute("title",xt("Add_Tag_to_System")), +h.appendChild(n),n.inserted||n.addEventListener("click",a)}if(s){const n=fe("i","far fa-"+gs.get("delete"),t.uuid,"tag_delete",e);n.setAttribute("title",xt("Delete")),h.appendChild(n),n.inserted||n.addEventListener("click",s)}return h},ws=(e,t,n)=>{const i=(t.uuid?t.uuid:"")+t.id,r=me("div",t.name,i,"input");r.key=t.id;const s=me("input",t.name,i,"input",!0),o=e.split("##");s.name=t.name,s.uuid=t.uuid,s.key=t.id,s.oldvalue=t.value,s.value=null!=t.value?t.value:"", +s.type=t.password?"password":"text",s.setAttribute("spellcheck","false"),t.placeholder&&s.setAttribute("placeholder",t.placeholder),n&&!s.inserted&&s.addEventListener("change",n);const a=fe("span","optiondesc",t.name,i,"s1"),l=me("span",t.name,i,"s2");return a.textContent=o[0]+":",o.length>1&&(l.textContent=o[1]),r.appendChild(a),r.appendChild(s),r.appendChild(l),t.enabledBy&&r.setAttribute("name","enabled_by_"+t.enabledBy),{elem:r,input:s}},ys=(e,t,n,i,r)=>{ +const s=(t.uuid?t.uuid:"")+t.id,o=me("div",t.name,s,"outer_dd");o.key=t.id;const a=me("select",t.name,s,"dd",!0);let l=!1,c=t.array&&t.value?t.value.join(","):t.value;if(n&&Object.keys(n).forEach((e=>{const i=me("option",t.name,n[e].name,"dd"+s,!0);i.textContent=n[e].name.replace(/(?:&#x([a-fA-F0-9]+);|&#([0-9]+);)/g,((e,t,n)=>t?String.fromCharCode(parseInt(t,16)):String.fromCharCode(parseInt(n,10))));const r=n[e].value,o=i.value=t.array&&r?r.join(","):r;i.warning=n[e].warning,l|=!!n[e].warning, +n[e].enabledBy&&i.setAttribute("name","enabled_by_"+n[e].enabledBy),t.enabler&&n[e].enable&&i.setAttribute("enables",JSON.stringify(n[e].enable)),o==c&&(i.selected=!0),a.appendChild(i)})),a.key=t.id,a.name=t.name,a.uuid=t.uuid,a.reload=t.reload,a.warning=t.warning,a.oldvalue=t.value,a.valtype="native",a.array=t.array,a.inserted||(i&&a.addEventListener("change",i),l&&r&&a.addEventListener("change",r)),null!==e){const n=fe("span","optiondesc",t.name,s,"inner_dd");n.textContent=e+": ", +o.appendChild(n)}return o.appendChild(a),t.desc&&_s(t.desc,o,o,t),t.enabledBy&&o.setAttribute("name","enabled_by_"+t.enabledBy),{elem:o,select:a}},ks=(e,t,n)=>{const i=(t.uuid?t.uuid:"")+t.id;let r=null;return r=fe("input","button",t.name,i,"bu",!0),r.name=t.name,r.uuid=t.uuid,r.key=t.id,r.type="button",r.value=t.name,r.data=t.data,r.reload=t.reload,r.ignore=t.ignore||t.reload,r.warning=t.warning,t.enabledBy&&r.setAttribute("name","enabled_by_"+t.enabledBy), +!r.inserted&&n&&r.addEventListener("click",n),r},Rs=(e,t,n,i)=>{let r=null;return r=fe("input","button",e,t,"bu",!0),r.name=e,r.key=t,r.type="button",r.value=n,!r.inserted&&i&&r.addEventListener("click",i),r},xs=(e,t)=>{const n=(e.uuid?e.uuid:"")+e.id;let i,r,s;if(r=e.after||e.validation){if(s=e.validation?"validation":"help",t&&(s+=" clickable"),i=fe("span",s,e.name,n,s,!0),r.image){const e=bs(gs.get(r.image),n,"after_icon"),t=[];r.opacity&&t.push("opacity: "+r.opacity), +e.setAttribute("style",t.join(";")),i.appendChild(e)}i&&(t&&i.addEventListener("click",t),r.msg&&i.setAttribute("title",r.msg))}return i},Cs=e=>({"&":"&","<":"<",">":">"}[e]||e),Es={getInfoFromUrl:e=>{let t;if(-1!=e.search(/\/\^?(http(s|s\?|\.\+)?|\.\*):\/\/(\.\*)*\$?\/?$/)||-1!=e.search(/htt(ps|p):\/\/(\*\/\*|\*)*$/)||-1!=e.search(/\*:\/\/(\*\/\*|\*)*$/)||"*"==e)return{dom:"*",tld:"*"};0==e.search(/\//)?(t=e,t=t.replace(/\([^\)]*\)[\?|\+|\*|\{[^\}]*]*/g,""), +t=t.replace(/\[[^\]]*\][\?|\+|\*|\{[^\}]*]*/g,""),t=t.replace(/^\/|\/$|\^|\$|\\\?.*|#.*|\?|\(|\)|\+|\\|\.\*|/g,"")):t=e,t=t.replace(/^\*:\/\//,"http://"),0!=t.search("http")&&(t="http://"+t);const n=t.split("/");if(n.length<3)return null;const i=n[2].split(".");if(i.length<2)return null;const r=i[i.length-1].split(":")[0];let s=i[i.length-2];"*"!==s&&(s=s.replace(/\*/g,""));const o=[];for(let e=i.length-3;e>=0&&-1==i[e].search("\\*");e--)o.push(i[e]);return{tld:r,dom:s,subdom:o.reverse()}}, +getValue:e=>{let t=e.value;if("native"===e.valtype)if("undefined"===t)t=void 0;else if("null"===t)t=null;else try{t=JSON.parse(t)}catch(e){}return t},safeTagsReplace:e=>e.replace(/[&<>]/g,Cs),addClass:(e,t)=>{let n=e.getAttribute("class")||"";const i=new RegExp("[ \t]*"+t+"[ \t]*");-1==n.search(i)&&(n=(n?n+" ":"")+t),e.setAttribute("class",n)},toggleClass:(e,t)=>{let n=e.getAttribute("class")||"";const i=new RegExp("[ \t]*"+t+"[ \t]*");n=-1!=n.search(i)?n.replace(i,""):(n?n+" ":"")+t, +e.setAttribute("class",n)},setHelp:_s,createAfterIcon:xs,createEnabler:(e,t,n,i,r)=>{const s=i.append,o=i.disabled,a=i.title,l=fe("div",(o?"":"clickable ")+"enabler "+e,t,n+"_enabler",s,"wrap");l.appendChild([fe("i","far fa-toggle-on on",t,n+"toggle-on"),fe("i","far fa-toggle-on fa-flip-horizontal off greyed",t,n+"toggle-off")]),i.onf&&l.appendChild(fe("i","far fa-toggle-off fa-flip-horizontal onf",t,n+"toggle-onf")),a&&(l.title=a),l.key=n,l.uuid=t;const c="enabler_enabled" +;return o||l.addEventListener("click",(e=>(It(l).hasClass(c)?It(l).removeClass(c):It(l).addClass(c),r&&window.setTimeout((()=>{r.call(l)}),100),e.stopPropagation(),e.preventDefault(),!1)),!0),l},createImage:(e,t,n,i,r,s)=>{const o=fe("img","icon16",t,n,i,!0);if(o.setAttribute("src",e),o.key=n,r&&(o.title=r),t&&(o.name=t),s){const e=o.getAttribute("class")||"";o.setAttribute("class",e+" clickable"),o.addEventListener("click",s,!0)}return o},createIcon:bs,createFileInput:(e,t,n)=>{ +const i=fe("input","import","file",null,null,!0);return i.inserted||(i.type="file",n&&i.addEventListener("change",n)),i},createNamedSettings:(e,t,n)=>{const i=(t.uuid?t.uuid:"")+t.id,r=fe("div","settingsta",t.name,i,"named_wrapper"),s=fe("div","named",t.name,i,"named_settings"),o=[],a=me("span",t.name,i,"s1");return e&&(a.textContent=e+":"),t.desc&&_s(t.desc,a,a,t),r.appendChild(a),r.appendChild(s),r.key=t.id,t.value.forEach((e=>{ +const r=fe("div","",t.name+e.name,i,"named",!0),a=fe("div","",t.name+e.name,i,"named_label",!0);a.textContent=e.name,r.appendChild(a);const l=me("textarea",t.name+e.name,i,"textarea",!0);l.setAttribute("spellcheck","false"),l.name=t.name,l.key=t.id,l.named_name=e.name,l.uuid=t.uuid,l.named=!0,l.oldvalue=e.value||"",l.value=e.value||"",n&&!l.inserted&&l.addEventListener("change",n),r.appendChild(l),s.appendChild(r),o.push(l)})),{elem:r,textareas:o,label:a}},createTextarea:(e,t,n)=>{ +const i=(t.uuid?t.uuid:"")+t.id,r=me("div",t.name,i,"textarea");r.key=t.id;const s=fe("textarea","settingsta",t.name,i,"textarea",!0);s.setAttribute("spellcheck","false"),s.name=t.name,s.key=t.id,s.uuid=t.uuid,s.json=t.json,s.array=t.array,s.oldvalue=t.value,void 0===t.value||null===t.value?s.value="":t.array?s.value=t.value.join("\n"):t.json?s.value=JSON.stringify(t.value,null,4):s.value=t.value,n&&!s.inserted&&s.addEventListener("change",n);const o=me("span",t.name,i,"s1") +;return e&&(o.textContent=e+":"),t.desc&&_s(t.desc,o,o,t),r.appendChild(o),r.appendChild(s),{elem:r,textarea:s,label:o}},createTag:vs,createTagEditor:(e,t,n,i)=>{const{onTagClick:r,onChange:s,onTagAdd:o,tagsToAdd:a}=i||{},l=(t.uuid?t.uuid:"")+t.id,c=fe("div",t.name,l,"tag_editor");c.key=t.id;const d=fe("textarea","hidden",t.name,l,"textarea",!0);d.setAttribute("spellcheck","false"),d.name=t.name,d.key=t.id,d.uuid=t.uuid,d.oldvalue=t.value,d.value=JSON.stringify(t.value,null,4) +;const u=fe("span","optiondesc",t.name,l,"s1");e&&(u.textContent=e+":"),t.desc&&_s(t.desc,u,u,t);const A=fe("div","tag_editor",t.name,l,"tag_editor",!0),h=Object.entries(n).sort((([e],[t])=>{const n=e.toUpperCase(),i=t.toUpperCase();return ni?1:0})),p=(e,i)=>{const{color:a,add:l,click:c,disabled:u}=i,h=vs(e,{...t,id:"editor"+e},{onClick:c?()=>r&&r(e):void 0,class:c?"clickable":void 0,onDelete:()=>{delete n[e],d.value=JSON.stringify(n,null,4),h.remove(),s&&s(n)}, +onAdd:l?()=>o&&o(e):void 0,disabled:u,color:a});A.appendChild(h)},f=a?ys(xt("Add_Tag"),{...t,id:"new_tag",value:a[0]||""},a.reduce(((e,t)=>(e[t]={name:t,value:t},e)),{}),null,null):ws(xt("New_Tag"),{...t,id:"new_tag",value:""}),m=me("input","new_tag_add_button",l,"editor"+t.name,!0);return a&&0==a.length?m.setAttribute("disabled","disabled"):m.removeAttribute("disabled"),m.type="button",m.value=xt("Add"),m.addEventListener("click",(function(){const e=a?f.select:f.input,t=e.value +;t&&(n[t]?alert(xt("Tag_Already_Exists")):(a||(e.value=""),p(t,{click:!!r,add:!!o}),n[t]={},d.value=JSON.stringify(n,null,4),s&&s(n)))})),f.elem.appendChild(m),(()=>{for(const[e,t]of h)p(e,t)})(),c.appendChild(u),c.appendChild(A),c.appendChild(f.elem),c.appendChild(d),{elem:c,textarea:d,label:u}},createFileSelect:(e,t,n)=>{const i=(t.uuid?t.uuid:"")+t.id,r=me("input",t.name,i,"file");if(r.inserted||(r.type="file",r.addEventListener("change",(e=>{n(e.target.files)}),!1), +t.accept&&r.setAttribute("accept",t.accept)),e){const n=me("div",t.name,i,"input"),s=me("span",t.name,i,"s1");return s.textContent=e+":",n.appendChild(s),n.appendChild(r),{elem:n,input:r}}return{elem:r}},createInput:ws,createColorChooser:(e,t,n)=>{const i=(t.uuid?t.uuid:"")+t.id,r=ws(e,t,n),s=function(){n&&n.apply(this,arguments);const e=(this.value.match(/[a-fA-F0-9]+/)||"")[0];e&&[3,6].includes(e.length)&&o.setAttribute("style","background-color: #"+e+";")} +;r.input.inserted||r.input.addEventListener("keyup",s);const o=fe("span","color_choosed",t.name,i,"col");return r.col=o,r.elem.appendChild(r.col),s.call(r.input),r},createPassword:(e,t,n)=>{const i=ws(e,t,n);return i.input.setAttribute("type","password"),i},createCheckbox:(e,t,n)=>{const i=(t.uuid?t.uuid:"")+t.id,r=fe("div","checkbox",t.name,i,"cb1");r.key=t.id;const s=me("input",t.name,i,"cb",!0);s.title=t.desc?t.desc:"",s.name=t.name,s.uuid=t.uuid,s.key=t.id,s.reload=t.reload, +s.warning=t.warning,s.oldvalue=t.enabled,s.checked=t.enabled,s.type="checkbox",s.valtype="boolean",n&&!s.inserted&&s.addEventListener("click",n);const o=fe("span","checkbox_desc",t.name,i,"cb2");return o.textContent=e,t.desc&&_s(t.desc,r,o,t),r.appendChild(s),r.appendChild(o),{elem:r,input:s,span:o}},createDropDown:ys,createImageButton:(e,t,n,i,r)=>{let s=null,o=null,a=null;return s=fe("button","imgbutton button",e,t,"bu",!0),o=fe("div","imgbutton_container",e,t,"bu_container"),o.appendChild(s), +s.uuid=e,s.key=t,a=fe("i","imgbutton_image far fa-"+i,e,t,"bu_img",!0),s.appendChild(a),s.title=a.title=a.alt=n,!s.inserted&&r&&s.addEventListener("click",r),o},createImageTextButton:(e,t,n,i,r)=>{const s=fe("button","button imgtextbutton",e,t+n,"itb",!0);if(s.key=t,s.uuid=e,i){const r=bs(gs.get(i),e,t+n+"itb",i);s.appendChild(r)}const o=me("span",e,t+n,"itb");return o.textContent=n,s.appendChild(o),r&&s.addEventListener("click",r),s},createButton:function(e,t){ +return"Object"===N(t)?ks.apply(this,arguments):Rs.apply(this,arguments)},createPosition:(e,t,n)=>{const i=(t.uuid?t.uuid:"")+t.id,r=me("div",t.name,i,"pos1"),s=me("select",t.name,i,"pos",!0);for(let e=1;e<=t.posof;e++){const n=me("option",t.name,i,"opt"+e);n.textContent=e,e==t.pos&&(n.selected=!0),s.appendChild(n)}s.key=t.id,s.uuid=t.uuid,s.name=t.name,s.valtype="native",n&&!s.inserted&&s.addEventListener("change",n);const o=fe("span","optiondesc",t.name,i,"pos2");return o.textContent=e, +r.appendChild(o),r.appendChild(s),r},createSearchBox:e=>{const t=fe("div","searchbox","search_inner"),n=fe("div","searchbox_mv","search_inner_mv"),i=fe("input","searchbox_input","search_input"),r=fe("input","searchbox_button","search_button");i.type="text",i.setAttribute("spellcheck","false"),i.value=e,r.type="button",r.value="Go";const s=()=>{const e=i.value;window.location=window.location.origin+window.location.pathname+"?url="+encodeURIComponent(e)};return r.addEventListener("click",s), +i.addEventListener("keyup",(e=>{e&&13==e.keyCode&&s()})),n.appendChild(i),n.appendChild(r),t.appendChild(n),t},createSocialButtons:()=>{const e=[],t=fe("a","","github_link");t.href="https://github.com/derjanb",t.target="_blank";const n=fe("img","icon16","github");n.setAttribute("src",gs.origin("gh")),t.appendChild(n),e.push(t);const i=fe("a","","facebook_link");i.href="https://www.facebook.com/tampermonkey",i.target="_blank";const r=fe("img","icon16","facebook") +;r.setAttribute("src",gs.brand("facebook")),i.appendChild(r),e.push(i);const s=fe("a","","insta_link");s.href="https://www.instagram.com/der_jan_b/",s.target="_blank";const o=fe("img","icon16","instagram");return o.setAttribute("src",gs.brand("instagram")),s.appendChild(o),e.push(s),e},createGobalHint:(e,t)=>{ +const{id:n,class:i,text:r,qr:s,title:o,image:a,instant:l,onclick:c,onclose:d,onbuttonclick:u,timeout:A,delay:h,done:p,buttons:f}=e,m=!!s,g="global_hint_"+(i||"warning")+(c?" clickable":""),_=n||Date.now(),b=fe(m?"table":"span",[m?"table noborder":"simple","global_hint",g].join(" "),"globalhint",_),v=me("span","globalhint_c",_),w=me("span","globalhint_t",_);let y,k;if(m){const e=me("tr","globalhint_tr",_);b.appendChild(e) +;const t=fe("td","qr","globalhint_td1",_),n=fe("td","text","globalhint_td2",_),i=me("td","globalhint_td2",_);e.appendChild([t,n,i]),n.appendChild(v),y=me("span","globalhint_mi",_),t.appendChild(y),k=i}else b.appendChild(v),y=k=v;if(o&&(w.title=o),a&&v.appendChild(bs(gs.get(a),"globalhint_"+_,"icon"+_)),w.innerHTML=(e=>{const t=new RegExp(`[${Object.keys(P).map((e=>z(e))).join("")}]`,"g");return e.replace(t,(e=>P[e]||e))})(r).split("\n").join("
"),c&&!w.inserted&&w.addEventListener("click",c), +v.appendChild(w),s){const e=fe("div","qr","globalhint_qr",_),{img:t,...n}=s;(async(e,t)=>{let{size:n,text:i,img:r,csize:s,bsize:o,oversample:a,pixelPrecise:l}=t;if(!i)return;let c,d=1,u=n||225,A=n||225;if(s=s||75,o=o||0,l){const e=window.devicePixelRatio;if("number"==typeof e){const t=Math.min(Math.max(1,e),3);d=Math.round(t);const n=d*Math.round(u/t);c=`width: ${d*Math.round(A/t)}px; height: ${n}px;`}}a&&(c=c||`width: ${d*A}px; height: ${d*u}px;`,u*=a,A*=a,s*=a,o*=a);const h=ms.createCanvas({ +width:A,height:u,correctLevel:r?3:1,background:"#ffffff",foreground:"#000000",text:i});if(c&&h.setAttribute("style",c),e.append(h),r){const e=h.getContext("2d");if(e){let t,n;if(o&&(t=(A-s-o)/2,e.fillStyle="#ffffff",e.fillRect(t,t,s+o,s+o)),r.startsWith("data:image/svg")){const e=new Image;e.src=r,await e.decode(),n=await createImageBitmap(e,{resizeWidth:s,resizeHeight:s})}else n=await fetch(r).then((e=>e.blob())).then((e=>createImageBitmap(e)));t=(A-s)/2,e.drawImage(n,t,t,s,s)}}})(e,{...n, +...t?{img:gs.brand(t)}:{}}),y.appendChild(e),c&&!w.inserted&&e.addEventListener("click",c)}f&&f.forEach((e=>{const{text:t,id:n}=e,i=me(m?"a":"button","globalhint_b",n);i.textContent=t,u&&!i.inserted&&i.addEventListener("click",(t=>{u(e),x(),t.stopPropagation()}),!0),v.appendChild(i)}));const R=It(b);l||(R.hide(),window.setTimeout((()=>{R.fadeIn(500)}),h||1));const x=()=>{l?(R.hide(),R.remove()):R.fadeOut(500).then((()=>{R.remove()})),p&&p(b)};if(A&&window.setTimeout(x,A),!A||A>18e5){ +const e=fe("span","close","gh_close",_);k.appendChild(e),e.addEventListener("click",(e=>{x(),d&&d(),e.stopPropagation()}),!0)}return R.appendTo(t||document.body),R},isScrolledIntoView:(e,t,n)=>{const i=It(e),r=It(t),s=n&&n.padding&&n.padding.top||0,o=n&&n.padding&&n.padding.bottom||0,a=r.height(),l=i.offset().top-r.offset().top;return l+i.height()<=a-o&&l>=0+s}},Gs=Es,Zs={},Ss={create:(e,t,n,i)=>{const r=(o=/[0-9a-zA-Z]/g,(s=e)&&o?(s.match(o)||[]).join(""):"");var s,o;let a=!1;null==n&&(n={ +tv:"tv",tv_table:"tv_table",tr_tabs:"tr_tabs",tr_content:"tr_content",td_content:"td_content",td_tabs:"td_tabs",tv_tabs_fill:"tv_tabs_fill",tv_tabs_table:"tv_tabs_table",tv_tabs_align:"tv_tabs_align",tv_contents:"tv_contents",tv_tab_selected:"tv_tab tv_selected",tv_tab_close:"tv_tab_close",tv_tab:"tv_tab",tv_content:"tv_content"});const l=fe("div",n.tv,"main"+r),c=fe("table",n.tv_table+" noborder","main_table"+r);c.inserted?a=!0:(Zs[r]={},Zs[r].g_entries={},Zs[r].g_selectedId=null) +;const d=fe("tr",n.tr_tabs,"tabs"+t.id+r),u=fe("td",n.td_tabs,"pages"+r),A=fe("div",n.tv_tabs_fill,"tv_tabs_fill"+r),h=fe("div",n.tv_tabs_table,"tv_tabs_table"+r),p=fe("div",n.tv_tabs_align,"tv_tabs_align"+r),f=fe("tr",n.tr_content,"content"+t.id+r),m=fe("td",n.td_content,"content"+r),g=fe("div",n.tv_contents,"tv_content"+r),_=me("tfoot","tv_footer_t"+r),b=me("tr","tv_footer_tr"+r),v=me("td","tv_footer_td"+r);_.appendChild(b),b.appendChild(v),h.tabIndex=-1,h.appendChild(p),A.appendChild(h), +u.appendChild(A),d.appendChild(u),c.appendChild(d),m.appendChild(g),f.appendChild(m),c.appendChild(f),c.appendChild(_),l.appendChild(c),t.appendChild(l);const w=(e,t,n)=>{t?e.setAttribute("style",""):e.setAttribute("style",n?"position:absolute; left: -20000px; top: -200000px; width: 1px; height: 1px;":J),e.setAttribute("vis",t.toString())},y=(e,t)=>{const n=e.getId();if(Zs[r].g_entries[n]){if(t==Zs[r].g_entries[n].visible)return;Zs[r].g_entries[n].visible=t,w(Zs[r].g_entries[n].tab,t)} +},k=(e,t)=>{e&&w(e.content,t,!1)},R=e=>{if(null===e)return null;const t=Object.keys(Zs[r].g_entries);for(let n,i=0;n=t[i];i++){const t=Zs[r].g_entries[n];if(t.entry.getId()==e)return t.entry}return null},x=e=>{e.hide();const t=e.getId(),n=Zs[r].g_entries[t];if(n){n.tab.parentNode.removeChild(n.tab),n.content.parentNode.removeChild(n.content);const e=(e=>{const t=Object.keys(Zs[r].g_entries);for(let n,i=0;n=t[i];i++)if(Zs[r].g_entries[n].tab.id==e.id)return n;return null})(n.tab) +;e&&delete Zs[r].g_entries[e]}else console.log("tv: WARN: tab not part of tabview!")};let C=null;return a?C=Zs[r].tv:(C={getTabById:R,getSelectedTab:function(){return R(Zs[r].g_selectedId)},getAllTabs:function(){const e=It(p).find("div[tvid]");let t,n;const i=[];return e.each((r=>{(t=It(e.get(r)).attr("tvid"))&&(n=R(t))&&i.push(n)})),i},getNextTab:function(){const e=It(p).find("div[tvid]");let t;return Zs[r].g_selectedId&&e.each(((n,i)=>{ +t||It(i).attr("tvid")===Zs[r].g_selectedId&&(t=It(e.get(n+1)).attr("tvid"))})),R(t||e.first().attr("tvid"))},getPreviousTab:function(){const e=It(p).find("div[tvid]");let t;return Zs[r].g_selectedId&&e.each(((n,i)=>{t||It(i).attr("tvid")===Zs[r].g_selectedId&&(t=It(e.get(n-1)).attr("tvid"))})),R(t||e.last().attr("tvid"))},removeTab:x,appendTab:function(e,t,n,i,r){return this.insertTab(void 0,e,t,n,i,r)},insertTab:function(e,t,s,o,a,l){null===e&&(e=p.firstChild) +;const c="tab_"+t,d=me("div",c,"content"+r),u=void 0!==d.inserted&&1==d.inserted,A=me("div",c,"head_text"+r);if(s.appendChild(A),l){const e=fe("div",n.tv_tab_close,c,"tv_close"+r,"tab_close");e.inserted||(e.addEventListener("click",(()=>l())),s.addEventListener("auxclick",(e=>{e&&1==e.button&&l()}))),s.appendChild(e)}if(u){const e=(e=>{const t=Object.keys(Zs[r].g_entries);for(let n,i=0;n=t[i];i++){const t=Zs[r].g_entries[n];if(t.tab.id==e.id)return t}return null})(d);if(e)return e.entry +;console.log("tv: WARN: old tab, but not in tabs collection!")}let h;const f=t,m=e=>{""!=e.target.className&&e.target.className==n.tv_tab_close||h.select()};return d.setAttribute("tvid",t),d.tabIndex=0,d.addEventListener("click",m),d.addEventListener("keypress",(e=>{const{keyCode:t}=e;13!=t&&32!=t||m(e)})),s.addEventListener("click",m),d.setAttribute("name","tabview_tab"+r),d.setAttribute("class",n.tv_tab),d.appendChild(s),e?p.insertBefore(d,e):p.appendChild(d), +o.setAttribute("name","tabview_content"+r),o.setAttribute("class",n.tv_content),g.appendChild(o),h={getId:function(){return f},isVisible:function(){return"true"==d.getAttribute("vis")},isSelected:function(){return Zs[r].g_selectedId==this.getId()},isCloseable:function(){return!!l},modified:function(){return It(s).hasClass("modified")},remove:function(){x(this)},hide:function(){(e=>{const t=e.getId(),n=t==Zs[r].g_selectedId +;if(Zs[r].g_entries[t]?y(e,!1):console.log("tv: WARN: tab not part of tabview!"),n){let e=null,t=null;for(const n in Zs[r].g_entries)Zs[r].g_entries[n].visible&&(e=Zs[r].g_entries[n],t||e.closable||(t=e));i||e.closable||(e=t),e?e.entry.select():(Zs[r].g_selectedId=null,console.log("tv: WARN: selected tab set, but entry collection empty!"))}})(this)},show:function(){(e=>{const t=e.getId();Zs[r].g_entries[t]?y(e,!0):console.log("tv: WARN: tab not part of tabview!")})(this)},select:function(e){ +if(!e&&h.isSelected())return;const t=Te();a&&a(t.promise()),(e=>{if(e.getId()==Zs[r].g_selectedId)return;const t=e.getId();Zs[r].g_selectedId&&k(Zs[r].g_entries[Zs[r].g_selectedId],!1),Object.keys(Zs[r].g_entries).forEach((e=>{const i=Zs[r].g_entries[e];i.entry.getId()==t?i.visible?i.selected||(i.tab.setAttribute("class",n.tv_tab_selected),k(i,!0),i.selected=!0):console.log("tv: WARN: tab selected but not visible!"):i.selected&&(i.tab.setAttribute("class",n.tv_tab),k(i,!1),i.selected=!1)})), +Zs[r].g_selectedId=t})(this),t.resolve()},setHeading:function(e,t,n){const i=s.firstChild;if(t&&e.length>t){const r=Math.round(t/2);i.textContent=e.substr(0,r)+"..."+e.substr(r-t),i.title=n||e}else i.textContent=e},toggleClass:function(e,t){It(s,g).toggleClass(e,t)},close:function(){l&&l()}},Zs[r].g_entries[f]={entry:h,tab:d,content:o,closable:null!=l},k(Zs[r].g_entries[f],!1),h.show(),h},setFooter:function(e){v.appendChild(e)}},Zs[r].tv=C),C}},Bs=Ss,Ts=(Xe({timeout:10800,check_interval:300, +retimeout_on_get:!0}),qe({threads:5}),e=>{const t=(typeof e)[0];if("o"===t)try{e=t+JSON.stringify(e)}catch(n){console.error("Storage: setValue ERROR: "+n.message),e=t+JSON.stringify({})}else e=t+e;return e}),Is=new ze;window.requestFileSystem||(window.requestFileSystem=window.webkitRequestFileSystem);const Us=es.images,Ls=window.CodeMirror,Fs=window.MirrorFrame,Ms="chrome";window.setTimeout=He,window.Hinter={hint:(e,t)=>{const n=Te(),i=n.promise(),r=t||{},s=r.options||Oi;let o +;if(r.config?(o=JSON.parse(JSON.stringify(r.config)),"object"!=typeof o&&(o={})):o=JSON.parse(JSON.stringify(Di)),r.userscript||r.external){const e={};V(zi,(t=>{e[t]="writeable"})),o.globals={...e,...o.globals}}if(r.userscript&&(o.rules={...ji,...o.rules}),e)if(Mi&&G){const t=G,r=()=>{const e=new t("lint.js");e.onmessage=e=>{const t=e.data,{results:n,id:i}=t;let r,s;i&&(r=Ni[i])&&(s=r.d)&&(delete Ni[i],n?s.resolve(Qi(n)):s.reject(t.error||"Unknown error")),a(!!i)};const n={method:"base_uri", +value:Be.getURL("/")};return e.postMessage(n),Vi=void 0,e},a=e=>{if(Pi=Pi||r(),e)Vi=void 0;else if(Vi)return;let t,n=Date.now();if(Object.keys(Ni).forEach((e=>{Ni[e].ts<=n&&(t=Ni[e],n=t.ts)})),t){Vi=t.id;const e={method:t.method,id:t.id,config:t.c,options:t.o,text:t.t};Pi.postMessage(e)}};i.abort=()=>{Pi&&(Pi.terminate(),Pi=void 0,a())},Pi||r();const l=X(),c={method:"lint",id:l,d:n,t:e,c:o,o:s,ts:Date.now()};Ni[l]=c,a()}else Fe("vendor/eslint/eslint",(()=>{try{const t=((e,t,n)=>{ +const i=self.eslint,r={problem:"error",layout:1,suggestion:1},s=new i.Linter;if(s.defineRules(Ii.rules),t.extends&&t.extends.includes("eslint:recommended")){const e=t.rules=t.rules||{};s.getRules().forEach((function(t,n){if(!t||void 0!==e[n])return;const i=t.meta;if(!i)return;const s=i.docs;if(!s||!s.recommended)return;let o;const a=[(i.type?r[i.type]:null)||1],l=i.schema;if(l){const e={};(Array.isArray(l)?l:[l]).forEach((t=>{if("object"!=t.type)return;const n=t.properties +;n&&Object.entries(n).forEach((([t,n])=>{const i=n.default;void 0!==i&&!1!==i&&(e[t]=n.default,o=!0)}))})),o&&a.push(e)}e[n]=a}))}return s.verify(e,t,n)})(e,o,s);n.resolve(Qi(t||[]))}catch(e){n.reject(e.message)}}));else n.resolve([]);return i}};const js=()=>{const e=ye();Kt((()=>{const t={};let n={};const i=[],r={},s={};let o={},a={};const l={},c=(()=>{let e,t,n,i,r,s;if((e=M)&&(t=e.getItem("export_tm_settings"),n="true"===t,t=e.getItem("export_externals"),i="false"!==t, +t=e.getItem("export_script_storage"),s="false"!==t,r=e.getItem("cloud_config")))try{r=JSON.parse(se(r))}catch(e){}return{script_storage:s,add_tm_settings:n,include_externals:i,cloud_config:r}})();let d;const u={},h=function(e,t){let n,i;if((n=u[e])&&(i=n[t]))return i.apply(this,[].slice.call(arguments,2))},p=e=>{const t=e.msg||e;if(e.once){if(s[t])return!0;s[t]=!0}let n=confirm(t),i={};return n&&e.ok?i=e.ok:!n&&e.cancel&&(i=e.cancel),(e.ok||e.cancel)&&(n=!0),i.url&&$r({method:"newTab",url:i.url +},(()=>{})),n},f=(e,t)=>{try{const n=()=>{};t?$r({method:"newTab",url:e},n):lt.getSelected(null,(i=>{lt.sendMessage(i.id,{method:"loadUrl",url:e,newtab:t},n)}))}catch(e){console.log("lU: "+e.message)}},m=(e,t,n,i,r)=>{i=i||{};const s=Gs.createImage(i.default_icon||Xt.images.empty,void 0,n,t,i.title,r);if(s.inserted)return s;Array.isArray(e)||(e=e?[e]:[]);const o=async()=>{if(0==e.length){if(i.fill_with_question_mark&&s.parentNode){const e=Gs.createIcon(Us.get("question_mark"),t+"_ico",n) +;s.parentNode.insertBefore(e,s),s.parentNode.removeChild(s)}return}const r=e.shift(),a=0==e.length;let l,c;if(r.startsWith("data:")?l=r:c=await((e,t)=>{const n=Te();return $r({method:"imageUrlToTransferable",url:e,fallback:t},(e=>{n.resolve(e?lr.fromTransferableData(e.transferable):void 0)})),n.promise()})(r,a),l)s.setAttribute("src",l);else if(c)if(c.tryObjectUrl)s.setAttribute("src",c.tryObjectUrl);else if(c.tryDataUri)s.setAttribute("src",c.tryDataUri);else{ +const e=await c.toBlob(),t=URL.createObjectURL(e);s.setAttribute("src",t),s.onload=()=>URL.revokeObjectURL(t)}else await o()};return o(),i.title&&(s.title=i.title),s};let g=!1;const _=e=>{if(g)return;const t=gt,n=It("
").hide(),i=e=>{e?(n.html("").append(It('
').append(It('
').text(e))),window.setTimeout(i,1e3)):(n.fadeOut(1e3),window.setTimeout(jt.hideDialog,1e3)) +},r=It(''),s=[It('