commit 868598c2fd53e9e9847e71acb51f2b99da18b7f9 Author: Qiu Date: Sat Jun 13 18:35:43 2026 +0800 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0bd6f15 --- /dev/null +++ b/.gitignore @@ -0,0 +1,49 @@ +# ================== +# IDE & Editor +# ================== +.idea/ +.vscode/ +*.iws +*.iml +*.ipr +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +# ================== +# OS +# ================== +.DS_Store +Thumbs.db + +# ================== +# Java (easypan-java) +# ================== +HELP.md +target/ +build/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +# ================== +# Frontend (easypan-front) +# ================== +node_modules/ +easypan-front/dist/ + +# ================== +# Logs +# ================== +*.log diff --git a/README.md b/README.md new file mode 100644 index 0000000..ddad042 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# easypan +简单网盘项目 +前后端分离 diff --git a/easypan-front/index.html b/easypan-front/index.html new file mode 100644 index 0000000..ff3be1c --- /dev/null +++ b/easypan-front/index.html @@ -0,0 +1,17 @@ + + + + + + + + + SmallPan + + + +
+ + + + \ No newline at end of file diff --git a/easypan-front/package-lock.json b/easypan-front/package-lock.json new file mode 100644 index 0000000..e14a96f --- /dev/null +++ b/easypan-front/package-lock.json @@ -0,0 +1,2384 @@ +{ + "name": "easypan-front-web", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "easypan-front-web", + "version": "0.0.0", + "dependencies": { + "@highlightjs/vue-plugin": "^2.1.0", + "@moefe/vue-aplayer": "^2.0.0-beta.5", + "aplayer": "^1.10.1", + "axios": "^1.3.4", + "docx-preview": "^0.1.15", + "dplayer": "^1.27.1", + "element-plus": "^2.2.36", + "highlight.js": "^11.7.0", + "hls.js": "^1.1.5", + "js-md5": "^0.7.3", + "pinia": "^2.0.32", + "sass": "^1.59.2", + "sass-loader": "^13.2.0", + "spark-md5": "^3.0.2", + "vue": "^3.2.47", + "vue-clipboard3": "^2.0.0", + "vue-cookies": "^1.8.3", + "vue-pdf-embed": "^1.1.5", + "vue-router": "^4.1.6", + "vue3-pdfjs": "^0.1.6", + "xlsx": "^0.18.5" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^4.0.0", + "vite": "^4.1.4" + } + }, + "node_modules/@babel/parser": { + "version": "7.21.8", + "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.21.8.tgz", + "integrity": "sha512-6zavDGdzG3gUqAdWvlLFfk+36RilI+Pwyuuh7HItyeScCWP3k6i8vKclAQ0bM/0y/Kz/xiwvxhMv9MgTJP5gmA==", + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@ctrl/tinycolor": { + "version": "3.6.0", + "resolved": "https://registry.npmmirror.com/@ctrl/tinycolor/-/tinycolor-3.6.0.tgz", + "integrity": "sha512-/Z3l6pXthq0JvMYdUFyX9j0MaCltlIn6mfh9jLyQwg5aPKxkyNa0PTHtU1AlFXLNk55ZuAeJRcpvq+tmLfKmaQ==", + "engines": { + "node": ">=10" + } + }, + "node_modules/@element-plus/icons-vue": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.1.0.tgz", + "integrity": "sha512-PSBn3elNoanENc1vnCfh+3WA9fimRC7n+fWkf3rE5jvv+aBohNHABC/KAR5KWPecxWxDTVT1ERpRbOMRcOV/vA==", + "peerDependencies": { + "vue": "^3.2.0" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.17.19", + "resolved": "https://registry.npmmirror.com/@esbuild/android-arm/-/android-arm-0.17.19.tgz", + "integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmmirror.com/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz", + "integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmmirror.com/@esbuild/android-x64/-/android-x64-0.17.19.tgz", + "integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmmirror.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz", + "integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmmirror.com/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz", + "integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz", + "integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz", + "integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.17.19", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz", + "integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz", + "integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.17.19", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz", + "integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.17.19", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz", + "integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.17.19", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz", + "integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.17.19", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz", + "integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.17.19", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz", + "integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.17.19", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz", + "integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz", + "integrity": "sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmmirror.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz", + "integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmmirror.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz", + "integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmmirror.com/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz", + "integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmmirror.com/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz", + "integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.17.19", + "resolved": "https://registry.npmmirror.com/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz", + "integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmmirror.com/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz", + "integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@floating-ui/core": { + "version": "1.2.6", + "resolved": "https://registry.npmmirror.com/@floating-ui/core/-/core-1.2.6.tgz", + "integrity": "sha512-EvYTiXet5XqweYGClEmpu3BoxmsQ4hkj3QaYA6qEnigCWffTP3vNRwBReTdrwDwo7OoJ3wM8Uoe9Uk4n+d4hfg==" + }, + "node_modules/@floating-ui/dom": { + "version": "1.2.8", + "resolved": "https://registry.npmmirror.com/@floating-ui/dom/-/dom-1.2.8.tgz", + "integrity": "sha512-XLwhYV90MxiHDq6S0rzFZj00fnDM+A1R9jhSioZoMsa7G0Q0i+Q4x40ajR8FHSdYDE1bgjG45mIWe6jtv9UPmg==", + "dependencies": { + "@floating-ui/core": "^1.2.6" + } + }, + "node_modules/@highlightjs/vue-plugin": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/@highlightjs/vue-plugin/-/vue-plugin-2.1.0.tgz", + "integrity": "sha512-E+bmk4ncca+hBEYRV2a+1aIzIV0VSY/e5ArjpuSN9IO7wBJrzUE2u4ESCwrbQD7sAy+jWQjkV5qCCWgc+pu7CQ==", + "peerDependencies": { + "highlight.js": "^11.0.1", + "vue": "^3" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmmirror.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "peer": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "peer": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "peer": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.3", + "resolved": "https://registry.npmmirror.com/@jridgewell/source-map/-/source-map-0.3.3.tgz", + "integrity": "sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg==", + "peer": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.18", + "resolved": "https://registry.npmmirror.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", + "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", + "peer": true, + "dependencies": { + "@jridgewell/resolve-uri": "3.1.0", + "@jridgewell/sourcemap-codec": "1.4.14" + } + }, + "node_modules/@jridgewell/trace-mapping/node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "peer": true + }, + "node_modules/@moefe/vue-aplayer": { + "version": "2.0.0-beta.5", + "resolved": "https://registry.npmmirror.com/@moefe/vue-aplayer/-/vue-aplayer-2.0.0-beta.5.tgz", + "integrity": "sha512-ytzp4GStzjftuh7H1rIS/ziqwV1FO67iTLSkDxgN0J2bqlO+rBgDDr83Y+pZKBIgRUc30uu/UZHqmE4QiBHHeg==", + "dependencies": { + "vue": "^2.5.17" + }, + "peerDependencies": { + "vue": "^2.2.0" + } + }, + "node_modules/@moefe/vue-aplayer/node_modules/@vue/compiler-sfc": { + "version": "2.7.14", + "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-2.7.14.tgz", + "integrity": "sha512-aNmNHyLPsw+sVvlQFQ2/8sjNuLtK54TC6cuKnVzAY93ks4ZBrvwQSnkkIh7bsbNhum5hJBS00wSDipQ937f5DA==", + "dependencies": { + "@babel/parser": "^7.18.4", + "postcss": "^8.4.14", + "source-map": "^0.6.1" + } + }, + "node_modules/@moefe/vue-aplayer/node_modules/vue": { + "version": "2.7.14", + "resolved": "https://registry.npmmirror.com/vue/-/vue-2.7.14.tgz", + "integrity": "sha512-b2qkFyOM0kwqWFuQmgd4o+uHGU7T+2z3T+WQp8UBjADfEv2n4FEMffzBmCKNP0IGzOEEfYjvtcC62xaSKeQDrQ==", + "dependencies": { + "@vue/compiler-sfc": "2.7.14", + "csstype": "^3.1.0" + } + }, + "node_modules/@popperjs/core": { + "name": "@sxzz/popperjs-es", + "version": "2.11.7", + "resolved": "https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz", + "integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ==" + }, + "node_modules/@types/eslint": { + "version": "8.37.0", + "resolved": "https://registry.npmmirror.com/@types/eslint/-/eslint-8.37.0.tgz", + "integrity": "sha512-Piet7dG2JBuDIfohBngQ3rCt7MgO9xCO4xIMKxBThCq5PNRB91IjlJ10eJVwfoNtvTErmxLzwBZ7rHZtbOMmFQ==", + "peer": true, + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/eslint-scope": { + "version": "3.7.4", + "resolved": "https://registry.npmmirror.com/@types/eslint-scope/-/eslint-scope-3.7.4.tgz", + "integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==", + "peer": true, + "dependencies": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.1.tgz", + "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", + "peer": true + }, + "node_modules/@types/json-schema": { + "version": "7.0.11", + "resolved": "https://registry.npmmirror.com/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "peer": true + }, + "node_modules/@types/lodash": { + "version": "4.14.194", + "resolved": "https://registry.npmmirror.com/@types/lodash/-/lodash-4.14.194.tgz", + "integrity": "sha512-r22s9tAS7imvBt2lyHC9B8AGwWnXaYb1tY09oyLkXDs4vArpYJzw09nj8MLx5VfciBPGIb+ZwG0ssYnEPJxn/g==" + }, + "node_modules/@types/lodash-es": { + "version": "4.17.7", + "resolved": "https://registry.npmmirror.com/@types/lodash-es/-/lodash-es-4.17.7.tgz", + "integrity": "sha512-z0ptr6UI10VlU6l5MYhGwS4mC8DZyYer2mCoyysZtSF7p26zOX8UpbrV0YpNYLGS8K4PUFIyEr62IMFFjveSiQ==", + "dependencies": { + "@types/lodash": "*" + } + }, + "node_modules/@types/node": { + "version": "20.1.4", + "resolved": "https://registry.npmmirror.com/@types/node/-/node-20.1.4.tgz", + "integrity": "sha512-At4pvmIOki8yuwLtd7BNHl3CiWNbtclUbNtScGx4OHfBd4/oWoJC8KRCIxXwkdndzhxOsPXihrsOoydxBjlE9Q==", + "peer": true + }, + "node_modules/@types/web-bluetooth": { + "version": "0.0.16", + "resolved": "https://registry.npmmirror.com/@types/web-bluetooth/-/web-bluetooth-0.0.16.tgz", + "integrity": "sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ==" + }, + "node_modules/@vitejs/plugin-vue": { + "version": "4.2.3", + "resolved": "https://registry.npmmirror.com/@vitejs/plugin-vue/-/plugin-vue-4.2.3.tgz", + "integrity": "sha512-R6JDUfiZbJA9cMiguQ7jxALsgiprjBeHL5ikpXfJCH62pPHtI+JdJ5xWj6Ev73yXSlYl86+blXn1kZHQ7uElxw==", + "dev": true, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "peerDependencies": { + "vite": "^4.0.0", + "vue": "^3.2.25" + } + }, + "node_modules/@vue/compiler-core": { + "version": "3.3.2", + "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.3.2.tgz", + "integrity": "sha512-CKZWo1dzsQYTNTft7whzjL0HsrEpMfiK7pjZ2WFE3bC1NA7caUjWioHSK+49y/LK7Bsm4poJZzAMnvZMQ7OTeg==", + "dependencies": { + "@babel/parser": "^7.21.3", + "@vue/shared": "3.3.2", + "estree-walker": "^2.0.2", + "source-map-js": "^1.0.2" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.3.2", + "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.3.2.tgz", + "integrity": "sha512-6gS3auANuKXLw0XH6QxkWqyPYPunziS2xb6VRenM3JY7gVfZcJvkCBHkb5RuNY1FCbBO3lkIi0CdXUCW1c7SXw==", + "dependencies": { + "@vue/compiler-core": "3.3.2", + "@vue/shared": "3.3.2" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.3.2", + "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.3.2.tgz", + "integrity": "sha512-jG4jQy28H4BqzEKsQqqW65BZgmo3vzdLHTBjF+35RwtDdlFE+Fk1VWJYUnDMMqkFBo6Ye1ltSKVOMPgkzYj7SQ==", + "dependencies": { + "@babel/parser": "^7.20.15", + "@vue/compiler-core": "3.3.2", + "@vue/compiler-dom": "3.3.2", + "@vue/compiler-ssr": "3.3.2", + "@vue/reactivity-transform": "3.3.2", + "@vue/shared": "3.3.2", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.0", + "postcss": "^8.1.10", + "source-map-js": "^1.0.2" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.3.2", + "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.3.2.tgz", + "integrity": "sha512-K8OfY5FQtZaSOJHHe8xhEfIfLrefL/Y9frv4k4NsyQL3+0lRKxr9QuJhfdBDjkl7Fhz8CzKh63mULvmOfx3l2w==", + "dependencies": { + "@vue/compiler-dom": "3.3.2", + "@vue/shared": "3.3.2" + } + }, + "node_modules/@vue/devtools-api": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.5.0.tgz", + "integrity": "sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==" + }, + "node_modules/@vue/reactivity": { + "version": "3.3.2", + "resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.3.2.tgz", + "integrity": "sha512-yX8C4uTgg2Tdj+512EEMnMKbLveoITl7YdQX35AYgx8vBvQGszKiiCN46g4RY6/deeo/5DLbeUUGxCq1qWMf5g==", + "dependencies": { + "@vue/shared": "3.3.2" + } + }, + "node_modules/@vue/reactivity-transform": { + "version": "3.3.2", + "resolved": "https://registry.npmmirror.com/@vue/reactivity-transform/-/reactivity-transform-3.3.2.tgz", + "integrity": "sha512-iu2WaQvlJHdnONrsyv4ibIEnSsuKF+aHFngGj/y1lwpHQtalpVhKg9wsKMoiKXS9zPNjG9mNKzJS9vudvjzvyg==", + "dependencies": { + "@babel/parser": "^7.20.15", + "@vue/compiler-core": "3.3.2", + "@vue/shared": "3.3.2", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.0" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.3.2", + "resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.3.2.tgz", + "integrity": "sha512-qSl95qj0BvKfcsO+hICqFEoLhJn6++HtsPxmTkkadFbuhe3uQfJ8HmQwvEr7xbxBd2rcJB6XOJg7nWAn/ymC5A==", + "dependencies": { + "@vue/reactivity": "3.3.2", + "@vue/shared": "3.3.2" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.3.2", + "resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.3.2.tgz", + "integrity": "sha512-+drStsJT+0mtgHdarT7cXZReCcTFfm6ptxMrz0kAW5hms6UNBd8Q1pi4JKlncAhu+Ld/TevsSp7pqAZxBBoGng==", + "dependencies": { + "@vue/runtime-core": "3.3.2", + "@vue/shared": "3.3.2", + "csstype": "^3.1.1" + } + }, + "node_modules/@vue/server-renderer": { + "version": "3.3.2", + "resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.3.2.tgz", + "integrity": "sha512-QCwh6OGwJg6GDLE0fbQhRTR6tnU+XDJ1iCsTYHXBiezCXAhqMygFRij7BiLF4ytvvHcg5kX9joX5R5vP85++wg==", + "dependencies": { + "@vue/compiler-ssr": "3.3.2", + "@vue/shared": "3.3.2" + }, + "peerDependencies": { + "vue": "3.3.2" + } + }, + "node_modules/@vue/shared": { + "version": "3.3.2", + "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.3.2.tgz", + "integrity": "sha512-0rFu3h8JbclbnvvKrs7Fe5FNGV9/5X2rPD7KmOzhLSUAiQH5//Hq437Gv0fR5Mev3u/nbtvmLl8XgwCU20/ZfQ==" + }, + "node_modules/@vueuse/core": { + "version": "9.13.0", + "resolved": "https://registry.npmmirror.com/@vueuse/core/-/core-9.13.0.tgz", + "integrity": "sha512-pujnclbeHWxxPRqXWmdkKV5OX4Wk4YeK7wusHqRwU0Q7EFusHoqNA/aPhB6KCh9hEqJkLAJo7bb0Lh9b+OIVzw==", + "dependencies": { + "@types/web-bluetooth": "^0.0.16", + "@vueuse/metadata": "9.13.0", + "@vueuse/shared": "9.13.0", + "vue-demi": "*" + } + }, + "node_modules/@vueuse/core/node_modules/vue-demi": { + "version": "0.14.1", + "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.1.tgz", + "integrity": "sha512-rt+yuCtXvscYot9SQQj3WKZJVSriPNqVkpVBNEHPzSgBv7QIYzsS410VqVgvx8f9AAPgjg+XPKvmV3vOqqkJQQ==", + "hasInstallScript": true, + "bin": { + "vue-demi-fix": "bin/vue-demi-fix.js", + "vue-demi-switch": "bin/vue-demi-switch.js" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "@vue/composition-api": "^1.0.0-rc.1", + "vue": "^3.0.0-0 || ^2.6.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + } + }, + "node_modules/@vueuse/metadata": { + "version": "9.13.0", + "resolved": "https://registry.npmmirror.com/@vueuse/metadata/-/metadata-9.13.0.tgz", + "integrity": "sha512-gdU7TKNAUVlXXLbaF+ZCfte8BjRJQWPCa2J55+7/h+yDtzw3vOoGQDRXzI6pyKyo6bXFT5/QoPE4hAknExjRLQ==" + }, + "node_modules/@vueuse/shared": { + "version": "9.13.0", + "resolved": "https://registry.npmmirror.com/@vueuse/shared/-/shared-9.13.0.tgz", + "integrity": "sha512-UrnhU+Cnufu4S6JLCPZnkWh0WwZGUp72ktOF2DFptMlOs3TOdVv8xJN53zhHGARmVOsz5KqOls09+J1NR6sBKw==", + "dependencies": { + "vue-demi": "*" + } + }, + "node_modules/@vueuse/shared/node_modules/vue-demi": { + "version": "0.14.1", + "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.1.tgz", + "integrity": "sha512-rt+yuCtXvscYot9SQQj3WKZJVSriPNqVkpVBNEHPzSgBv7QIYzsS410VqVgvx8f9AAPgjg+XPKvmV3vOqqkJQQ==", + "hasInstallScript": true, + "bin": { + "vue-demi-fix": "bin/vue-demi-fix.js", + "vue-demi-switch": "bin/vue-demi-switch.js" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "@vue/composition-api": "^1.0.0-rc.1", + "vue": "^3.0.0-0 || ^2.6.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + } + }, + "node_modules/@webassemblyjs/ast": { + "version": "1.11.6", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/ast/-/ast-1.11.6.tgz", + "integrity": "sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==", + "peer": true, + "dependencies": { + "@webassemblyjs/helper-numbers": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6" + } + }, + "node_modules/@webassemblyjs/floating-point-hex-parser": { + "version": "1.11.6", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", + "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", + "peer": true + }, + "node_modules/@webassemblyjs/helper-api-error": { + "version": "1.11.6", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", + "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", + "peer": true + }, + "node_modules/@webassemblyjs/helper-buffer": { + "version": "1.11.6", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz", + "integrity": "sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==", + "peer": true + }, + "node_modules/@webassemblyjs/helper-numbers": { + "version": "1.11.6", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", + "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", + "peer": true, + "dependencies": { + "@webassemblyjs/floating-point-hex-parser": "1.11.6", + "@webassemblyjs/helper-api-error": "1.11.6", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/helper-wasm-bytecode": { + "version": "1.11.6", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", + "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", + "peer": true + }, + "node_modules/@webassemblyjs/helper-wasm-section": { + "version": "1.11.6", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz", + "integrity": "sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==", + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/wasm-gen": "1.11.6" + } + }, + "node_modules/@webassemblyjs/ieee754": { + "version": "1.11.6", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", + "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", + "peer": true, + "dependencies": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "node_modules/@webassemblyjs/leb128": { + "version": "1.11.6", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", + "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", + "peer": true, + "dependencies": { + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/utf8": { + "version": "1.11.6", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", + "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", + "peer": true + }, + "node_modules/@webassemblyjs/wasm-edit": { + "version": "1.11.6", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz", + "integrity": "sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==", + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/helper-wasm-section": "1.11.6", + "@webassemblyjs/wasm-gen": "1.11.6", + "@webassemblyjs/wasm-opt": "1.11.6", + "@webassemblyjs/wasm-parser": "1.11.6", + "@webassemblyjs/wast-printer": "1.11.6" + } + }, + "node_modules/@webassemblyjs/wasm-gen": { + "version": "1.11.6", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz", + "integrity": "sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==", + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" + } + }, + "node_modules/@webassemblyjs/wasm-opt": { + "version": "1.11.6", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz", + "integrity": "sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==", + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/wasm-gen": "1.11.6", + "@webassemblyjs/wasm-parser": "1.11.6" + } + }, + "node_modules/@webassemblyjs/wasm-parser": { + "version": "1.11.6", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz", + "integrity": "sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==", + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-api-error": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" + } + }, + "node_modules/@webassemblyjs/wast-printer": { + "version": "1.11.6", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz", + "integrity": "sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==", + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.6", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "peer": true + }, + "node_modules/@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmmirror.com/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "peer": true + }, + "node_modules/acorn": { + "version": "8.8.2", + "resolved": "https://registry.npmmirror.com/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-import-assertions": { + "version": "1.9.0", + "resolved": "https://registry.npmmirror.com/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", + "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", + "peer": true, + "peerDependencies": { + "acorn": "^8" + } + }, + "node_modules/adler-32": { + "version": "1.3.1", + "resolved": "https://registry.npmmirror.com/adler-32/-/adler-32-1.3.1.tgz", + "integrity": "sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A==", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmmirror.com/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmmirror.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "peer": true, + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmmirror.com/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/aplayer": { + "version": "1.10.1", + "resolved": "https://registry.npmmirror.com/aplayer/-/aplayer-1.10.1.tgz", + "integrity": "sha512-HAfyxgCUTLAqtYlxzzK9Fyqg6y+kZ9CqT1WfeWE8FSzwspT6oBqWOZHANPHF3RGTtC33IsyEgrfthPDzU5r9kQ==", + "dependencies": { + "balloon-css": "^0.5.0", + "promise-polyfill": "7.1.0", + "smoothscroll": "0.4.0" + } + }, + "node_modules/async-validator": { + "version": "4.2.5", + "resolved": "https://registry.npmmirror.com/async-validator/-/async-validator-4.2.5.tgz", + "integrity": "sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "node_modules/axios": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/axios/-/axios-1.4.0.tgz", + "integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==", + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/balloon-css": { + "version": "0.5.2", + "resolved": "https://registry.npmmirror.com/balloon-css/-/balloon-css-0.5.2.tgz", + "integrity": "sha512-zheJpzwyNrG4t39vusA67v3BYg1HTVXOF8cErPEHzWK88PEOFwgo6Ea9VHOgOWNMgeuOtFVtB73NE2NWl9uDyQ==" + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "engines": { + "node": ">=8" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmmirror.com/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.21.5", + "resolved": "https://registry.npmmirror.com/browserslist/-/browserslist-4.21.5.tgz", + "integrity": "sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==", + "peer": true, + "dependencies": { + "caniuse-lite": "^1.0.30001449", + "electron-to-chromium": "^1.4.284", + "node-releases": "^2.0.8", + "update-browserslist-db": "^1.0.10" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "peer": true + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001487", + "resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001487.tgz", + "integrity": "sha512-83564Z3yWGqXsh2vaH/mhXfEM0wX+NlBCm1jYHOb97TrTWJEmPTccZgeLTPBUUb0PNVo+oomb7wkimZBIERClA==", + "peer": true + }, + "node_modules/cfb": { + "version": "1.2.2", + "resolved": "https://registry.npmmirror.com/cfb/-/cfb-1.2.2.tgz", + "integrity": "sha512-KfdUZsSOw19/ObEWasvBP/Ac4reZvAGauZhs6S/gqNhXhI7cKwvlH7ulj+dOEYnca4bm4SGo8C1bTAQvnTjgQA==", + "dependencies": { + "adler-32": "~1.3.0", + "crc-32": "~1.2.0" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmmirror.com/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chrome-trace-event": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", + "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "peer": true, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/clipboard": { + "version": "2.0.11", + "resolved": "https://registry.npmmirror.com/clipboard/-/clipboard-2.0.11.tgz", + "integrity": "sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==", + "dependencies": { + "good-listener": "^1.2.2", + "select": "^1.1.2", + "tiny-emitter": "^2.0.0" + } + }, + "node_modules/codepage": { + "version": "1.15.0", + "resolved": "https://registry.npmmirror.com/codepage/-/codepage-1.15.0.tgz", + "integrity": "sha512-3g6NUTPd/YtuuGrhMnOMRjFc+LJw/bnMp3+0r/Wcz3IXUuCosKRJvMphm5+Q+bvTVGcJJuRvVLuYba+WojaFaA==", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmmirror.com/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "peer": true + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, + "node_modules/crc-32": { + "version": "1.2.2", + "resolved": "https://registry.npmmirror.com/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", + "bin": { + "crc32": "bin/crc32.njs" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/csstype": { + "version": "3.1.2", + "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.2.tgz", + "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" + }, + "node_modules/dayjs": { + "version": "1.11.7", + "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.7.tgz", + "integrity": "sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==" + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/delegate": { + "version": "3.2.0", + "resolved": "https://registry.npmmirror.com/delegate/-/delegate-3.2.0.tgz", + "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==" + }, + "node_modules/docx-preview": { + "version": "0.1.15", + "resolved": "https://registry.npmmirror.com/docx-preview/-/docx-preview-0.1.15.tgz", + "integrity": "sha512-qeYNwA+HF0e+GLxH/yltGdaBVQHoQrscfCwR2p7fRGCMjPBohdd36L7xDi1wdErS3ZnV/uh4kx5+tXOXgzq/dQ==", + "dependencies": { + "jszip": ">=3.0.0" + } + }, + "node_modules/dommatrix": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/dommatrix/-/dommatrix-1.0.3.tgz", + "integrity": "sha512-l32Xp/TLgWb8ReqbVJAFIvXmY7go4nTxxlWiAFyhoQw9RKEOHBZNnyGvJWqDVSPmq3Y9HlM4npqF/T6VMOXhww==", + "deprecated": "dommatrix is no longer maintained. Please use @thednp/dommatrix." + }, + "node_modules/dplayer": { + "version": "1.27.1", + "resolved": "https://registry.npmmirror.com/dplayer/-/dplayer-1.27.1.tgz", + "integrity": "sha512-2laBMXs5V1B9zPwJ7eAIw/OBo+Xjvy03i4GHTk3Cg+IWbrq8rKMFO0fFr6ClAYotYOCcFGOvaJDkOZcgKllsCA==", + "dependencies": { + "axios": "1.2.3", + "balloon-css": "^1.0.3", + "promise-polyfill": "8.3.0" + } + }, + "node_modules/dplayer/node_modules/axios": { + "version": "1.2.3", + "resolved": "https://registry.npmmirror.com/axios/-/axios-1.2.3.tgz", + "integrity": "sha512-pdDkMYJeuXLZ6Xj/Q5J3Phpe+jbGdsSzlQaFVkMQzRUL05+6+tetX8TV3p4HrU4kzuO9bt+io/yGQxuyxA/xcw==", + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/dplayer/node_modules/balloon-css": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/balloon-css/-/balloon-css-1.2.0.tgz", + "integrity": "sha512-urXwkHgwp6GsXVF+it01485Z2Cj4pnW02ICnM0TemOlkKmCNnDLmyy+ZZiRXBpwldUXO+aRNr7Hdia4CBvXJ5A==" + }, + "node_modules/dplayer/node_modules/promise-polyfill": { + "version": "8.3.0", + "resolved": "https://registry.npmmirror.com/promise-polyfill/-/promise-polyfill-8.3.0.tgz", + "integrity": "sha512-H5oELycFml5yto/atYqmjyigJoAo3+OXwolYiH7OfQuYlAqhxNvTfiNMbV9hsC6Yp83yE5r2KTVmtrG6R9i6Pg==" + }, + "node_modules/electron-to-chromium": { + "version": "1.4.394", + "resolved": "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.4.394.tgz", + "integrity": "sha512-0IbC2cfr8w5LxTz+nmn2cJTGafsK9iauV2r5A5scfzyovqLrxuLoxOHE5OBobP3oVIggJT+0JfKnw9sm87c8Hw==", + "peer": true + }, + "node_modules/element-plus": { + "version": "2.3.4", + "resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.3.4.tgz", + "integrity": "sha512-SQr0J9z7N4z48WYk/l9NE2tizl8Q7j2OhqlpTc42k4pGncry3+rVX6dsmcsglFynn6vt3NzYxWJqmLFyDKQq+g==", + "dependencies": { + "@ctrl/tinycolor": "^3.4.1", + "@element-plus/icons-vue": "^2.0.6", + "@floating-ui/dom": "^1.0.1", + "@popperjs/core": "npm:@sxzz/popperjs-es@^2.11.7", + "@types/lodash": "^4.14.182", + "@types/lodash-es": "^4.17.6", + "@vueuse/core": "^9.1.0", + "async-validator": "^4.2.5", + "dayjs": "^1.11.3", + "escape-html": "^1.0.3", + "lodash": "^4.17.21", + "lodash-es": "^4.17.21", + "lodash-unified": "^1.0.2", + "memoize-one": "^6.0.0", + "normalize-wheel-es": "^1.2.0" + }, + "peerDependencies": { + "vue": "^3.2.0" + } + }, + "node_modules/enhanced-resolve": { + "version": "5.14.0", + "resolved": "https://registry.npmmirror.com/enhanced-resolve/-/enhanced-resolve-5.14.0.tgz", + "integrity": "sha512-+DCows0XNwLDcUhbFJPdlQEVnT2zXlCv7hPxemTz86/O+B/hCQ+mb7ydkPKiflpVraqLPCAfu7lDy+hBXueojw==", + "peer": true, + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/es-module-lexer": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/es-module-lexer/-/es-module-lexer-1.2.1.tgz", + "integrity": "sha512-9978wrXM50Y4rTMmW5kXIC09ZdXQZqkE4mxhwkd8VbzsGkXGPgV4zWuqQJgCEzYngdo2dYDa0l8xhX4fkSwJSg==", + "peer": true + }, + "node_modules/esbuild": { + "version": "0.17.19", + "resolved": "https://registry.npmmirror.com/esbuild/-/esbuild-0.17.19.tgz", + "integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.17.19", + "@esbuild/android-arm64": "0.17.19", + "@esbuild/android-x64": "0.17.19", + "@esbuild/darwin-arm64": "0.17.19", + "@esbuild/darwin-x64": "0.17.19", + "@esbuild/freebsd-arm64": "0.17.19", + "@esbuild/freebsd-x64": "0.17.19", + "@esbuild/linux-arm": "0.17.19", + "@esbuild/linux-arm64": "0.17.19", + "@esbuild/linux-ia32": "0.17.19", + "@esbuild/linux-loong64": "0.17.19", + "@esbuild/linux-mips64el": "0.17.19", + "@esbuild/linux-ppc64": "0.17.19", + "@esbuild/linux-riscv64": "0.17.19", + "@esbuild/linux-s390x": "0.17.19", + "@esbuild/linux-x64": "0.17.19", + "@esbuild/netbsd-x64": "0.17.19", + "@esbuild/openbsd-x64": "0.17.19", + "@esbuild/sunos-x64": "0.17.19", + "@esbuild/win32-arm64": "0.17.19", + "@esbuild/win32-ia32": "0.17.19", + "@esbuild/win32-x64": "0.17.19" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmmirror.com/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "peer": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "peer": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmmirror.com/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "peer": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "peer": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmmirror.com/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "peer": true, + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmmirror.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "peer": true + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "peer": true + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmmirror.com/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/frac": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/frac/-/frac-1.1.2.tgz", + "integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA==", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmmirror.com/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmmirror.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "peer": true + }, + "node_modules/good-listener": { + "version": "1.2.2", + "resolved": "https://registry.npmmirror.com/good-listener/-/good-listener-1.2.2.tgz", + "integrity": "sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==", + "dependencies": { + "delegate": "^3.1.2" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "peer": true + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/highlight.js": { + "version": "11.8.0", + "resolved": "https://registry.npmmirror.com/highlight.js/-/highlight.js-11.8.0.tgz", + "integrity": "sha512-MedQhoqVdr0U6SSnWPzfiadUcDHfN/Wzq25AkXiQv9oiOO/sG0S7XkvpFIqWBl9Yq1UYyYOOVORs5UW2XlPyzg==", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/hls.js": { + "version": "1.4.3", + "resolved": "https://registry.npmmirror.com/hls.js/-/hls.js-1.4.3.tgz", + "integrity": "sha512-EE1MjIYDNO+ynbmCpAWfhUwQpyG8gUcKKuGDGgYgfRmW/g+inQUQ8sVVVY5WZaCxEGxDMGLbXhXGepkmDIMvdw==" + }, + "node_modules/immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmmirror.com/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==" + }, + "node_modules/immutable": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/immutable/-/immutable-4.3.0.tgz", + "integrity": "sha512-0AOCmOip+xgJwEVTQj1EfiDDOkPmuyllDuTuEX+DDXUgapLAsBIfkg3sxCYyCEA8mQqZrrxPUGjcOQ2JS3WLkg==" + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmmirror.com/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmmirror.com/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "node_modules/jest-worker": { + "version": "27.5.1", + "resolved": "https://registry.npmmirror.com/jest-worker/-/jest-worker-27.5.1.tgz", + "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", + "peer": true, + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/js-md5": { + "version": "0.7.3", + "resolved": "https://registry.npmmirror.com/js-md5/-/js-md5-0.7.3.tgz", + "integrity": "sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ==" + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmmirror.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "peer": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmmirror.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "peer": true + }, + "node_modules/jszip": { + "version": "3.10.1", + "resolved": "https://registry.npmmirror.com/jszip/-/jszip-3.10.1.tgz", + "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", + "dependencies": { + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "setimmediate": "^1.0.5" + } + }, + "node_modules/klona": { + "version": "2.0.6", + "resolved": "https://registry.npmmirror.com/klona/-/klona-2.0.6.tgz", + "integrity": "sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/lie": { + "version": "3.3.0", + "resolved": "https://registry.npmmirror.com/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "dependencies": { + "immediate": "~3.0.5" + } + }, + "node_modules/loader-runner": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/loader-runner/-/loader-runner-4.3.0.tgz", + "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", + "peer": true, + "engines": { + "node": ">=6.11.5" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" + }, + "node_modules/lodash-unified": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/lodash-unified/-/lodash-unified-1.0.3.tgz", + "integrity": "sha512-WK9qSozxXOD7ZJQlpSqOT+om2ZfcT4yO+03FuzAHD0wF6S0l0090LRPDx3vhTTLZ8cFKpBn+IOcVXK6qOcIlfQ==", + "peerDependencies": { + "@types/lodash-es": "*", + "lodash": "*", + "lodash-es": "*" + } + }, + "node_modules/magic-string": { + "version": "0.30.0", + "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.0.tgz", + "integrity": "sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.13" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/memoize-one": { + "version": "6.0.0", + "resolved": "https://registry.npmmirror.com/memoize-one/-/memoize-one-6.0.0.tgz", + "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==" + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "peer": true + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nanoid": { + "version": "3.3.6", + "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmmirror.com/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" + }, + "node_modules/node-releases": { + "version": "2.0.10", + "resolved": "https://registry.npmmirror.com/node-releases/-/node-releases-2.0.10.tgz", + "integrity": "sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==", + "peer": true + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/normalize-wheel-es": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/normalize-wheel-es/-/normalize-wheel-es-1.2.0.tgz", + "integrity": "sha512-Wj7+EJQ8mSuXr2iWfnujrimU35R2W4FAErEyTmJoJ7ucwTn2hOUSsRehMb5RSYkxXGTM7Y9QpvPmp++w5ftoJw==" + }, + "node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmmirror.com/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" + }, + "node_modules/pdfjs-dist": { + "version": "2.16.105", + "resolved": "https://registry.npmmirror.com/pdfjs-dist/-/pdfjs-dist-2.16.105.tgz", + "integrity": "sha512-J4dn41spsAwUxCpEoVf6GVoz908IAA3mYiLmNxg8J9kfRXc2jxpbUepcP0ocp0alVNLFthTAM8DZ1RaHh8sU0A==", + "dependencies": { + "dommatrix": "^1.0.3", + "web-streams-polyfill": "^3.2.1" + }, + "peerDependencies": { + "worker-loader": "^3.0.8" + }, + "peerDependenciesMeta": { + "worker-loader": { + "optional": true + } + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmmirror.com/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + } + }, + "node_modules/pinia": { + "version": "2.0.36", + "resolved": "https://registry.npmmirror.com/pinia/-/pinia-2.0.36.tgz", + "integrity": "sha512-4UKApwjlmJH+VuHKgA+zQMddcCb3ezYnyewQ9NVrsDqZ/j9dMv5+rh+1r48whKNdpFkZAWVxhBp5ewYaYX9JcQ==", + "dependencies": { + "@vue/devtools-api": "^6.5.0", + "vue-demi": "*" + }, + "peerDependencies": { + "@vue/composition-api": "^1.4.0", + "typescript": ">=4.4.4", + "vue": "^2.6.14 || ^3.2.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/pinia/node_modules/vue-demi": { + "version": "0.14.1", + "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.1.tgz", + "integrity": "sha512-rt+yuCtXvscYot9SQQj3WKZJVSriPNqVkpVBNEHPzSgBv7QIYzsS410VqVgvx8f9AAPgjg+XPKvmV3vOqqkJQQ==", + "hasInstallScript": true, + "bin": { + "vue-demi-fix": "bin/vue-demi-fix.js", + "vue-demi-switch": "bin/vue-demi-switch.js" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "@vue/composition-api": "^1.0.0-rc.1", + "vue": "^3.0.0-0 || ^2.6.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + } + }, + "node_modules/postcss": { + "version": "8.4.23", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.23.tgz", + "integrity": "sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA==", + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "node_modules/promise-polyfill": { + "version": "7.1.0", + "resolved": "https://registry.npmmirror.com/promise-polyfill/-/promise-polyfill-7.1.0.tgz", + "integrity": "sha512-P6NJ2wU/8fac44ENORsuqT8TiolKGB2u0fEClPtXezn7w5cmLIjM/7mhPlTebke2EPr6tmqZbXvnX0TxwykGrg==" + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, + "node_modules/punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "peer": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmmirror.com/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmmirror.com/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/rollup": { + "version": "3.21.7", + "resolved": "https://registry.npmmirror.com/rollup/-/rollup-3.21.7.tgz", + "integrity": "sha512-KXPaEuR8FfUoK2uHwNjxTmJ18ApyvD6zJpYv9FOJSqLStmt6xOY84l1IjK2dSolQmoXknrhEFRaPRgOPdqCT5w==", + "dev": true, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=14.18.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/sass": { + "version": "1.62.1", + "resolved": "https://registry.npmmirror.com/sass/-/sass-1.62.1.tgz", + "integrity": "sha512-NHpxIzN29MXvWiuswfc1W3I0N8SXBd8UR26WntmDlRYf0bSADnwnOjsyMZ3lMezSlArD33Vs3YFhp7dWvL770A==", + "dependencies": { + "chokidar": ">=3.0.0 <4.0.0", + "immutable": "^4.0.0", + "source-map-js": ">=0.6.2 <2.0.0" + }, + "bin": { + "sass": "sass.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/sass-loader": { + "version": "13.2.2", + "resolved": "https://registry.npmmirror.com/sass-loader/-/sass-loader-13.2.2.tgz", + "integrity": "sha512-nrIdVAAte3B9icfBiGWvmMhT/D+eCDwnk+yA7VE/76dp/WkHX+i44Q/pfo71NYbwj0Ap+PGsn0ekOuU1WFJ2AA==", + "dependencies": { + "klona": "^2.0.6", + "neo-async": "^2.6.2" + }, + "engines": { + "node": ">= 14.15.0" + }, + "peerDependencies": { + "fibers": ">= 3.1.0", + "node-sass": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0", + "sass": "^1.3.0", + "sass-embedded": "*", + "webpack": "^5.0.0" + }, + "peerDependenciesMeta": { + "fibers": { + "optional": true + }, + "node-sass": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + } + } + }, + "node_modules/schema-utils": { + "version": "3.1.2", + "resolved": "https://registry.npmmirror.com/schema-utils/-/schema-utils-3.1.2.tgz", + "integrity": "sha512-pvjEHOgWc9OWA/f/DE3ohBWTD6EleVLf7iFUkoSwAxttdBhB9QUebQgxER2kWueOvRJXPHNnyrvvh9eZINB8Eg==", + "peer": true, + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/select": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/select/-/select-1.1.2.tgz", + "integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==" + }, + "node_modules/serialize-javascript": { + "version": "6.0.1", + "resolved": "https://registry.npmmirror.com/serialize-javascript/-/serialize-javascript-6.0.1.tgz", + "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", + "peer": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmmirror.com/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" + }, + "node_modules/smoothscroll": { + "version": "0.4.0", + "resolved": "https://registry.npmmirror.com/smoothscroll/-/smoothscroll-0.4.0.tgz", + "integrity": "sha512-sggQ3U2Un38b3+q/j1P4Y4fCboCtoUIaBYoge+Lb6Xg1H8RTIif/hugVr+ErMtIDpvBbhQfTjtiTeYAfbw1ZGQ==" + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmmirror.com/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "peer": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/spark-md5": { + "version": "3.0.2", + "resolved": "https://registry.npmmirror.com/spark-md5/-/spark-md5-3.0.2.tgz", + "integrity": "sha512-wcFzz9cDfbuqe0FZzfi2or1sgyIrsDwmPwfZC4hiNidPdPINjeUwNfv5kldczoEAcjl9Y1L3SM7Uz2PUEQzxQw==" + }, + "node_modules/ssf": { + "version": "0.11.2", + "resolved": "https://registry.npmmirror.com/ssf/-/ssf-0.11.2.tgz", + "integrity": "sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==", + "dependencies": { + "frac": "~1.1.2" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmmirror.com/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/terser": { + "version": "5.17.3", + "resolved": "https://registry.npmmirror.com/terser/-/terser-5.17.3.tgz", + "integrity": "sha512-AudpAZKmZHkG9jueayypz4duuCFJMMNGRMwaPvQKWfxKedh8Z2x3OCoDqIIi1xx5+iwx1u6Au8XQcc9Lke65Yg==", + "peer": true, + "dependencies": { + "@jridgewell/source-map": "^0.3.2", + "acorn": "^8.5.0", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/terser-webpack-plugin": { + "version": "5.3.8", + "resolved": "https://registry.npmmirror.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.8.tgz", + "integrity": "sha512-WiHL3ElchZMsK27P8uIUh4604IgJyAW47LVXGbEoB21DbQcZ+OuMpGjVYnEUaqcWM6dO8uS2qUbA7LSCWqvsbg==", + "peer": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.17", + "jest-worker": "^27.4.5", + "schema-utils": "^3.1.1", + "serialize-javascript": "^6.0.1", + "terser": "^5.16.8" + }, + "engines": { + "node": ">= 10.13.0" + }, + "peerDependencies": { + "webpack": "^5.1.0" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "uglify-js": { + "optional": true + } + } + }, + "node_modules/tiny-emitter": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz", + "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==" + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmmirror.com/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.0.11", + "resolved": "https://registry.npmmirror.com/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", + "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", + "peer": true, + "dependencies": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmmirror.com/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "peer": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "node_modules/vite": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/vite/-/vite-4.3.5.tgz", + "integrity": "sha512-0gEnL9wiRFxgz40o/i/eTBwm+NEbpUeTWhzKrZDSdKm6nplj+z4lKz8ANDgildxHm47Vg8EUia0aicKbawUVVA==", + "dev": true, + "dependencies": { + "esbuild": "^0.17.5", + "postcss": "^8.4.23", + "rollup": "^3.21.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + }, + "peerDependencies": { + "@types/node": ">= 14", + "less": "*", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vue": { + "version": "3.3.2", + "resolved": "https://registry.npmmirror.com/vue/-/vue-3.3.2.tgz", + "integrity": "sha512-98hJcAhyDwZoOo2flAQBSPVYG/o0HA9ivIy2ktHshjE+6/q8IMQ+kvDKQzOZTFPxvnNMcGM+zS2A00xeZMA7tA==", + "dependencies": { + "@vue/compiler-dom": "3.3.2", + "@vue/compiler-sfc": "3.3.2", + "@vue/runtime-dom": "3.3.2", + "@vue/server-renderer": "3.3.2", + "@vue/shared": "3.3.2" + } + }, + "node_modules/vue-clipboard3": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/vue-clipboard3/-/vue-clipboard3-2.0.0.tgz", + "integrity": "sha512-Q9S7dzWGax7LN5iiSPcu/K1GGm2gcBBlYwmMsUc5/16N6w90cbKow3FnPmPs95sungns4yvd9/+JhbAznECS2A==", + "dependencies": { + "clipboard": "^2.0.6" + } + }, + "node_modules/vue-cookies": { + "version": "1.8.3", + "resolved": "https://registry.npmmirror.com/vue-cookies/-/vue-cookies-1.8.3.tgz", + "integrity": "sha512-VBRsyRMVdahBgFfh389TMHPmDdr4URDJNMk4FKSCfuNITs7+jitBDhwyL4RJd3WUsfOYNNjPAkfbehyH9AFuoA==" + }, + "node_modules/vue-pdf-embed": { + "version": "1.1.6", + "resolved": "https://registry.npmmirror.com/vue-pdf-embed/-/vue-pdf-embed-1.1.6.tgz", + "integrity": "sha512-CRQIw8OxiD6H1n8KT2zVWbp/00fA3PgSV/JYJ0Ut+FdC1jHrRDHNBj3BvaRVwZFZg3EJ8LLjyEDYxWWUMOjrDw==", + "peerDependencies": { + "vue": "^2.x || ^3.x" + } + }, + "node_modules/vue-router": { + "version": "4.2.0", + "resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-4.2.0.tgz", + "integrity": "sha512-c+usESa6ZoWsm4PPdzRSyenp5A4dsUtnDJnrI03fY1IpIihA9TK3x5ffgkFDpjhLJZewsXoKURapNLFdZjuqTg==", + "dependencies": { + "@vue/devtools-api": "^6.5.0" + }, + "peerDependencies": { + "vue": "^3.2.0" + } + }, + "node_modules/vue3-pdfjs": { + "version": "0.1.6", + "resolved": "https://registry.npmmirror.com/vue3-pdfjs/-/vue3-pdfjs-0.1.6.tgz", + "integrity": "sha512-7UaWbsp8wNqB0y/rRlyo5yRb0S+XOkkSpmdUuS267Dhi07Pt4RFEetQ8inrpf/aTFJwGnW0Uc/UE4p376s+Zmw==", + "dependencies": { + "pdfjs-dist": "^2.10.377", + "vue": "^3.2.19" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/watchpack": { + "version": "2.4.0", + "resolved": "https://registry.npmmirror.com/watchpack/-/watchpack-2.4.0.tgz", + "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", + "peer": true, + "dependencies": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/web-streams-polyfill": { + "version": "3.2.1", + "resolved": "https://registry.npmmirror.com/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", + "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/webpack": { + "version": "5.82.1", + "resolved": "https://registry.npmmirror.com/webpack/-/webpack-5.82.1.tgz", + "integrity": "sha512-C6uiGQJ+Gt4RyHXXYt+v9f+SN1v83x68URwgxNQ98cvH8kxiuywWGP4XeNZ1paOzZ63aY3cTciCEQJNFUljlLw==", + "peer": true, + "dependencies": { + "@types/eslint-scope": "^3.7.3", + "@types/estree": "^1.0.0", + "@webassemblyjs/ast": "^1.11.5", + "@webassemblyjs/wasm-edit": "^1.11.5", + "@webassemblyjs/wasm-parser": "^1.11.5", + "acorn": "^8.7.1", + "acorn-import-assertions": "^1.7.6", + "browserslist": "^4.14.5", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.14.0", + "es-module-lexer": "^1.2.1", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.9", + "json-parse-even-better-errors": "^2.3.1", + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^3.1.2", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.3.7", + "watchpack": "^2.4.0", + "webpack-sources": "^3.2.3" + }, + "bin": { + "webpack": "bin/webpack.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + } + } + }, + "node_modules/webpack-sources": { + "version": "3.2.3", + "resolved": "https://registry.npmmirror.com/webpack-sources/-/webpack-sources-3.2.3.tgz", + "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", + "peer": true, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/wmf": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/wmf/-/wmf-1.0.2.tgz", + "integrity": "sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw==", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/word": { + "version": "0.3.0", + "resolved": "https://registry.npmmirror.com/word/-/word-0.3.0.tgz", + "integrity": "sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA==", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/xlsx": { + "version": "0.18.5", + "resolved": "https://registry.npmmirror.com/xlsx/-/xlsx-0.18.5.tgz", + "integrity": "sha512-dmg3LCjBPHZnQp5/F/+nnTa+miPJxUXB6vtk42YjBBKayDNagxGEeIdWApkYPOf3Z3pm3k62Knjzp7lMeTEtFQ==", + "dependencies": { + "adler-32": "~1.3.0", + "cfb": "~1.2.1", + "codepage": "~1.15.0", + "crc-32": "~1.2.1", + "ssf": "~0.11.2", + "wmf": "~1.0.1", + "word": "~0.3.0" + }, + "bin": { + "xlsx": "bin/xlsx.njs" + }, + "engines": { + "node": ">=0.8" + } + } + } +} diff --git a/easypan-front/package.json b/easypan-front/package.json new file mode 100644 index 0000000..3b86c8a --- /dev/null +++ b/easypan-front/package.json @@ -0,0 +1,37 @@ +{ + "name": "easypan-front-web", + "version": "0.0.0", + "private": true, + "scripts": { + "dev": "vite --mode dev", + "build": "vite build --mode build", + "preview": "vite preview" + }, + "dependencies": { + "@highlightjs/vue-plugin": "^2.1.0", + "@moefe/vue-aplayer": "^2.0.0-beta.5", + "aplayer": "^1.10.1", + "axios": "^1.3.4", + "docx-preview": "^0.1.15", + "dplayer": "^1.27.1", + "element-plus": "^2.2.36", + "highlight.js": "^11.7.0", + "hls.js": "^1.1.5", + "js-md5": "^0.7.3", + "pinia": "^2.0.32", + "sass": "^1.59.2", + "sass-loader": "^13.2.0", + "spark-md5": "^3.0.2", + "vue": "^3.2.47", + "vue-clipboard3": "^2.0.0", + "vue-cookies": "^1.8.3", + "vue-pdf-embed": "^1.1.5", + "vue-router": "^4.1.6", + "vue3-pdfjs": "^0.1.6", + "xlsx": "^0.18.5" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^4.0.0", + "vite": "^4.1.4" + } +} diff --git a/easypan-front/public/favicon.ico b/easypan-front/public/favicon.ico new file mode 100644 index 0000000..27bd067 Binary files /dev/null and b/easypan-front/public/favicon.ico differ diff --git a/easypan-front/public/hls.min.js b/easypan-front/public/hls.min.js new file mode 100644 index 0000000..1ba6f90 --- /dev/null +++ b/easypan-front/public/hls.min.js @@ -0,0 +1,2 @@ +"undefined"!=typeof window&&function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Hls=e():t.Hls=e()}(this,(()=>(()=>{var t={21:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>u});var i=function(){function t(t,e){this.subtle=void 0,this.aesIV=void 0,this.subtle=t,this.aesIV=e}return t.prototype.decrypt=function(t,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,t)},t}(),n=function(){function t(t,e){this.subtle=void 0,this.key=void 0,this.subtle=t,this.key=e}return t.prototype.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},t}(),a=r(145),s=function(){function t(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var e=t.prototype;return e.uint8ArrayToUint32Array_=function(t){for(var e=new DataView(t),r=new Uint32Array(4),i=0;i<4;i++)r[i]=e.getUint32(4*i);return r},e.initTable=function(){var t=this.sBox,e=this.invSBox,r=this.subMix,i=r[0],n=r[1],a=r[2],s=r[3],o=this.invSubMix,l=o[0],u=o[1],d=o[2],h=o[3],c=new Uint32Array(256),f=0,g=0,v=0;for(v=0;v<256;v++)c[v]=v<128?v<<1:v<<1^283;for(v=0;v<256;v++){var p=g^g<<1^g<<2^g<<3^g<<4;p=p>>>8^255&p^99,t[f]=p,e[p]=f;var m=c[f],y=c[m],E=c[y],T=257*c[p]^16843008*p;i[f]=T<<24|T>>>8,n[f]=T<<16|T>>>16,a[f]=T<<8|T>>>24,s[f]=T,T=16843009*E^65537*y^257*m^16843008*f,l[p]=T<<24|T>>>8,u[p]=T<<16|T>>>16,d[p]=T<<8|T>>>24,h[p]=T,f?(f=m^c[c[c[E^m]]],g^=c[c[g]]):f=g=1}},e.expandKey=function(t){for(var e=this.uint8ArrayToUint32Array_(t),r=!0,i=0;i{"use strict";r.r(e),r.d(e,{canParse:()=>l,decodeFrame:()=>f,getID3Data:()=>s,getID3Frames:()=>c,getTimeStamp:()=>u,isFooter:()=>a,isHeader:()=>n,isTimeStampFrame:()=>d,testables:()=>E,utf8ArrayToStr:()=>y});var i,n=function(t,e){return e+10<=t.length&&73===t[e]&&68===t[e+1]&&51===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128},a=function(t,e){return e+10<=t.length&&51===t[e]&&68===t[e+1]&&73===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128},s=function(t,e){for(var r=e,i=0;n(t,e);)i+=10,i+=o(t,e+6),a(t,e+10)&&(i+=10),e+=i;if(i>0)return t.subarray(r,r+i)},o=function(t,e){var r=0;return r=(127&t[e])<<21,r|=(127&t[e+1])<<14,(r|=(127&t[e+2])<<7)|127&t[e+3]},l=function(t,e){return n(t,e)&&o(t,e+6)+10<=t.length-e},u=function(t){for(var e=c(t),r=0;r>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:u+=String.fromCharCode(a);break;case 12:case 13:s=t[d++],u+=String.fromCharCode((31&a)<<6|63&s);break;case 14:s=t[d++],o=t[d++],u+=String.fromCharCode((15&a)<<12|(63&s)<<6|(63&o)<<0)}}return u},E={decodeTextFrame:v};function T(){return i||void 0===self.TextDecoder||(i=new self.TextDecoder("utf-8")),i}},182:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>l});var i=r(544),n=r(851),a=r(93),s=r(729),o=r(973);function l(t){var e=new s.EventEmitter,r=function(e,r){t.postMessage({event:e,data:r})};e.on(n.Events.FRAG_DECRYPTED,r),e.on(n.Events.ERROR,r),t.addEventListener("message",(function(s){var l=s.data;switch(l.cmd){case"init":var d=JSON.parse(l.config);t.transmuxer=new i.default(e,l.typeSupported,d,l.vendor,l.id),(0,a.enableLogs)(d.debug,l.id),function(){var t=function(t){a.logger[t]=function(e){r("workerLog",{logType:t,message:e})}};for(var e in a.logger)t(e)}(),r("init",null);break;case"configure":t.transmuxer.configure(l.config);break;case"demux":var c=t.transmuxer.push(l.data,l.decryptdata,l.chunkMeta,l.state);(0,i.isPromise)(c)?(t.transmuxer.async=!0,c.then((function(e){u(t,e)})).catch((function(t){r(n.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:l.chunkMeta,fatal:!1,error:t,err:t,reason:"transmuxer-worker push error"})}))):(t.transmuxer.async=!1,u(t,c));break;case"flush":var f=l.chunkMeta,g=t.transmuxer.flush(f);(0,i.isPromise)(g)||t.transmuxer.async?((0,i.isPromise)(g)||(g=Promise.resolve(g)),g.then((function(e){h(t,e,f)})).catch((function(t){r(n.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:l.chunkMeta,fatal:!1,error:t,err:t,reason:"transmuxer-worker flush error"})}))):h(t,g,f)}}))}function u(t,e){if(!((r=e.remuxResult).audio||r.video||r.text||r.id3||r.initSegment))return!1;var r,i=[],n=e.remuxResult,a=n.audio,s=n.video;return a&&d(i,a),s&&d(i,s),t.postMessage({event:"transmuxComplete",data:e},i),!0}function d(t,e){e.data1&&t.push(e.data1.buffer),e.data2&&t.push(e.data2.buffer)}function h(t,e,r){e.reduce((function(e,r){return u(t,r)||e}),!1)||t.postMessage({event:"transmuxComplete",data:e[0]}),t.postMessage({event:"flush",data:r})}},544:(t,e,r)=>{"use strict";r.r(e),r.d(e,{TransmuxConfig:()=>st,TransmuxState:()=>ot,default:()=>it,isPromise:()=>at});var i=r(851),n=r(973),a=r(21),s=r(965),o=r(181),l=r(856);function u(t,e){return void 0===t&&(t=""),void 0===e&&(e=9e4),{type:t,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}var d=r(63),h=r(145),c=function(){function t(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}var e=t.prototype;return e.resetInitSegment=function(t,e,r,i){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},e.resetTimeStamp=function(t){this.initPTS=t,this.resetContiguity()},e.resetContiguity=function(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0},e.canParse=function(t,e){return!1},e.appendFrame=function(t,e,r){},e.demux=function(t,e){this.cachedData&&(t=(0,d.appendUint8Array)(this.cachedData,t),this.cachedData=null);var r,i=o.getID3Data(t,0),n=i?i.length:0,a=this._audioTrack,c=this._id3Track,g=i?o.getTimeStamp(i):void 0,v=t.length;for((null===this.basePTS||0===this.frameIndex&&(0,s.isFiniteNumber)(g))&&(this.basePTS=f(g,e,this.initPTS),this.lastPTS=this.basePTS),null===this.lastPTS&&(this.lastPTS=this.basePTS),i&&i.length>0&&c.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:i,type:l.MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY});n>>5}function E(t,e){return e+1=t.length)return!1;var i=y(t,e);if(i<=r)return!1;var n=e+i;return n===t.length||E(t,n)}return!1}function S(t,e,r,a,s){if(!t.samplerate){var o=function(t,e,r,a){var s,o,l,u,d=navigator.userAgent.toLowerCase(),h=a,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];s=1+((192&e[r+2])>>>6);var f=(60&e[r+2])>>>2;if(!(f>c.length-1))return l=(1&e[r+2])<<2,l|=(192&e[r+3])>>>6,v.logger.log("manifest codec:"+a+", ADTS type:"+s+", samplingIndex:"+f),/firefox/i.test(d)?f>=6?(s=5,u=new Array(4),o=f-3):(s=2,u=new Array(2),o=f):-1!==d.indexOf("android")?(s=2,u=new Array(2),o=f):(s=5,u=new Array(4),a&&(-1!==a.indexOf("mp4a.40.29")||-1!==a.indexOf("mp4a.40.5"))||!a&&f>=6?o=f-3:((a&&-1!==a.indexOf("mp4a.40.2")&&(f>=6&&1===l||/vivaldi/i.test(d))||!a&&1===l)&&(s=2,u=new Array(2)),o=f)),u[0]=s<<3,u[0]|=(14&f)>>1,u[1]|=(1&f)<<7,u[1]|=l<<3,5===s&&(u[1]|=(14&o)>>1,u[2]=(1&o)<<7,u[2]|=8,u[3]=0),{config:u,samplerate:c[f],channelCount:l,codec:"mp4a.40."+s,manifestCodec:h};t.trigger(i.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+f})}(e,r,a,s);if(!o)return;t.config=o.config,t.samplerate=o.samplerate,t.channelCount=o.channelCount,t.codec=o.codec,t.manifestCodec=o.manifestCodec,v.logger.log("parsed codec:"+t.codec+", rate:"+o.samplerate+", channels:"+o.channelCount)}}function b(t){return 9216e4/t}function L(t,e,r,i,n){var a,s=i+n*b(t.samplerate),o=function(t,e){var r=m(t,e);if(e+r<=t.length){var i=y(t,e)-r;if(i>0)return{headerLength:r,frameLength:i}}}(e,r);if(o){var l=o.frameLength,u=o.headerLength,d=u+l,h=Math.max(0,r+d-e.length);h?(a=new Uint8Array(d-u)).set(e.subarray(r+u,e.length),0):a=e.subarray(r+u,r+d);var c={unit:a,pts:s};return h||t.samples.push(c),{sample:c,length:d,missing:h}}var f=e.length-r;return(a=new Uint8Array(f)).set(e.subarray(r,e.length),0),{sample:{unit:a,pts:s},length:f,missing:-1}}function A(t,e){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},A(t,e)}const D=function(t){var e,r;function i(e,r){var i;return(i=t.call(this)||this).observer=void 0,i.config=void 0,i.observer=e,i.config=r,i}r=t,(e=i).prototype=Object.create(r.prototype),e.prototype.constructor=e,A(e,r);var n=i.prototype;return n.resetInitSegment=function(e,r,i,n){t.prototype.resetInitSegment.call(this,e,r,i,n),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:r,duration:n,inputTimeScale:9e4,dropped:0}},i.probe=function(t){if(!t)return!1;for(var e=(o.getID3Data(t,0)||[]).length,r=t.length;e16384?t.subarray(0,16384):t,(0,d.findBox)(t,["moof"]).length>0},e.demux=function(t,e){this.timeOffset=e;var r=t,i=this.videoTrack,n=this.txtTrack;if(this.config.progressive){this.remainderData&&(r=(0,d.appendUint8Array)(this.remainderData,t));var a=(0,d.segmentValidRange)(r);this.remainderData=a.remainder,i.samples=a.valid||new Uint8Array}else i.samples=r;var s=this.extractID3Track(i,e);return n.samples=(0,d.parseSamples)(e,i),{videoTrack:i,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}},e.flush=function(){var t=this.timeOffset,e=this.videoTrack,r=this.txtTrack;e.samples=this.remainderData||new Uint8Array,this.remainderData=null;var i=this.extractID3Track(e,this.timeOffset);return r.samples=(0,d.parseSamples)(t,e),{videoTrack:e,audioTrack:u(),id3Track:i,textTrack:u()}},e.extractID3Track=function(t,e){var r=this.id3Track;if(t.samples.length){var i=(0,d.findBox)(t.samples,["emsg"]);i&&i.forEach((function(t){var i=(0,d.parseEmsg)(t);if(k.test(i.schemeIdUri)){var n=(0,s.isFiniteNumber)(i.presentationTime)?i.presentationTime/i.timeScale:e+i.presentationTimeDelta/i.timeScale,a=4294967295===i.eventDuration?Number.POSITIVE_INFINITY:i.eventDuration/i.timeScale;a<=.001&&(a=Number.POSITIVE_INFINITY);var o=i.payload;r.samples.push({data:o,len:o.byteLength,dts:n,pts:n,type:l.MetadataSchema.emsg,duration:a})}}))}return r},e.demuxSampleAes=function(t,e,r){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},e.destroy=function(){},t}();var I=null,w=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],C=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],_=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],P=[0,1,1,4];function O(t,e,r,i,n){if(!(r+24>e.length)){var a=x(e,r);if(a&&r+a.frameLength<=e.length){var s=i+n*(9e4*a.samplesPerFrame/a.sampleRate),o={unit:e.subarray(r,r+a.frameLength),pts:s,dts:s};return t.config=[],t.channelCount=a.channelCount,t.samplerate=a.sampleRate,t.samples.push(o),{sample:o,length:a.frameLength,missing:0}}}}function x(t,e){var r=t[e+1]>>3&3,i=t[e+1]>>1&3,n=t[e+2]>>4&15,a=t[e+2]>>2&3;if(1!==r&&0!==n&&15!==n&&3!==a){var s=t[e+2]>>1&1,o=t[e+3]>>6,l=1e3*w[14*(3===r?3-i:3===i?3:4)+n-1],u=C[3*(3===r?0:2===r?1:2)+a],d=3===o?1:2,h=_[r][i],c=P[i],f=8*h*c,g=Math.floor(h*l/u+s)*c;if(null===I){var v=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);I=v?parseInt(v[1]):0}return!!I&&I<=87&&2===i&&l>=224e3&&0===o&&(t[e+3]=128|t[e+3]),{sampleRate:u,channelCount:d,frameLength:g,samplesPerFrame:f}}}function F(t,e){return 255===t[e]&&224==(224&t[e+1])&&0!=(6&t[e+1])}function M(t,e){return e+1t?(this.word<<=t,this.bitsAvailable-=t):(t-=this.bitsAvailable,t-=(e=t>>3)<<3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)},e.readBits=function(t){var e=Math.min(this.bitsAvailable,t),r=this.word>>>32-e;if(t>32&&v.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0)this.word<<=e;else{if(!(this.bytesAvailable>0))throw new Error("no bits available");this.loadWord()}return(e=t-e)>0&&this.bitsAvailable?r<>>t))return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()},e.skipUEG=function(){this.skipBits(1+this.skipLZ())},e.skipEG=function(){this.skipBits(1+this.skipLZ())},e.readUEG=function(){var t=this.skipLZ();return this.readBits(t+1)-1},e.readEG=function(){var t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)},e.readBoolean=function(){return 1===this.readBits(1)},e.readUByte=function(){return this.readBits(8)},e.readUShort=function(){return this.readBits(16)},e.readUInt=function(){return this.readBits(32)},e.skipScalingList=function(t){for(var e=8,r=8,i=0;i=t.length)return void r();if(!(t[e].unit.length<32||(this.decryptAacSample(t,e,r),this.decrypter.isSync())))return}},e.getAvcEncryptedData=function(t){for(var e=16*Math.floor((t.length-48)/160)+16,r=new Int8Array(e),i=0,n=32;n=t.length)return void i();for(var n=t[e].units;!(r>=n.length);r++){var a=n[r];if(!(a.data.length<=48||1!==a.type&&5!==a.type||(this.decryptAvcSample(t,e,r,i,a),this.decrypter.isSync())))return}}},t}();function G(){return G=Object.assign?Object.assign.bind():function(t){for(var e=1;e1;){var l=new Uint8Array(o[0].length+o[1].length);l.set(o[0]),l.set(o[1],o[0].length),o[0]=l,o.splice(1,1)}if(1===((e=o[0])[0]<<16)+(e[1]<<8)+e[2]){if((r=(e[4]<<8)+e[5])&&r>t.size-6)return null;var u=e[7];192&u&&(n=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,64&u?n-(a=536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2)>54e5&&(v.logger.warn(Math.round((n-a)/9e4)+"s delta between PTS and DTS, align them"),n=a):a=n);var d=(i=e[8])+9;if(t.size<=d)return null;t.size-=d;for(var h=new Uint8Array(t.size),c=0,f=o.length;cg){d-=g;continue}e=e.subarray(d),g-=d,d=0}h.set(e,s),s+=g}return r&&(r-=i+3),{data:h,pts:n,dts:a,len:r}}return null}function q(t,e){if(t.units.length&&t.frame){if(void 0===t.pts){var r=e.samples,i=r.length;if(!i)return void e.dropped++;var n=r[i-1];t.pts=n.pts,t.dts=n.dts}e.samples.push(t)}t.debug.length&&v.logger.log(t.pts+"/"+t.dts+":"+t.debug)}const X=function(){function t(t,e,r){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=t,this.config=e,this.typeSupported=r}t.probe=function(e){var r=t.syncOffset(e);return r>0&&v.logger.warn("MPEG2-TS detected but first sync word found @ offset "+r),-1!==r},t.syncOffset=function(t){for(var e=t.length,r=Math.min(940,t.length-K)+1,i=0;ir)return i;i++}return-1},t.createTrack=function(t,e){return{container:"video"===t||"audio"===t?"video/mp2t":void 0,type:t,id:d.RemuxerTrackIdConfig[t],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===t?e:void 0}};var e=t.prototype;return e.resetInitSegment=function(e,r,i,n){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=t.createTrack("video"),this._audioTrack=t.createTrack("audio",n),this._id3Track=t.createTrack("id3"),this._txtTrack=t.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=r,this.videoCodec=i,this._duration=n},e.resetTimeStamp=function(){},e.resetContiguity=function(){var t=this._audioTrack,e=this._avcTrack,r=this._id3Track;t&&(t.pesData=null),e&&(e.pesData=null),r&&(r.pesData=null),this.aacOverFlow=null,this.avcSample=null,this.remainderData=null},e.demux=function(e,r,a,s){var o;void 0===a&&(a=!1),void 0===s&&(s=!1),a||(this.sampleAes=null);var l=this._avcTrack,u=this._audioTrack,h=this._id3Track,c=this._txtTrack,f=l.pid,g=l.pesData,p=u.pid,m=h.pid,y=u.pesData,E=h.pesData,T=null,S=this.pmtParsed,b=this._pmtId,L=e.length;if(this.remainderData&&(L=(e=(0,d.appendUint8Array)(this.remainderData,e)).length,this.remainderData=null),L>4>1){if((w=k+5+e[k+4])===k+K)continue}else w=k+4;switch(I){case f:R&&(g&&(o=W(g))&&this.parseAVCPES(l,c,o,!1),g={data:[],size:0}),g&&(g.data.push(e.subarray(w,k+K)),g.size+=k+K-w);break;case p:if(R){if(y&&(o=W(y)))switch(u.segmentCodec){case"aac":this.parseAACPES(u,o);break;case"mp3":this.parseMPEGPES(u,o)}y={data:[],size:0}}y&&(y.data.push(e.subarray(w,k+K)),y.size+=k+K-w);break;case m:R&&(E&&(o=W(E))&&this.parseID3PES(h,o),E={data:[],size:0}),E&&(E.data.push(e.subarray(w,k+K)),E.size+=k+K-w);break;case 0:R&&(w+=e[w]+1),b=this._pmtId=V(e,w);break;case b:R&&(w+=e[w]+1);var C=Y(e,w,this.typeSupported,a);(f=C.avc)>0&&(l.pid=f),(p=C.audio)>0&&(u.pid=p,u.segmentCodec=C.segmentCodec),(m=C.id3)>0&&(h.pid=m),null===T||S||(v.logger.warn("MPEG-TS PMT found at "+k+" after unknown PID '"+T+"'. Backtracking to sync byte @"+A+" to parse all TS packets."),T=null,k=A-188),S=this.pmtParsed=!0;break;case 17:case 8191:break;default:T=I}}else D++;D>0&&this.observer.emit(i.Events.ERROR,i.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"Found "+D+" TS packet/s that do not start with 0x47"}),l.pesData=g,u.pesData=y,h.pesData=E;var _={audioTrack:u,videoTrack:l,id3Track:h,textTrack:c};return s&&this.extractRemainingSamples(_),_},e.flush=function(){var t,e=this.remainderData;return this.remainderData=null,t=e?this.demux(e,-1,!1,!0):{videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t},e.extractRemainingSamples=function(t){var e,r=t.audioTrack,i=t.videoTrack,n=t.id3Track,a=t.textTrack,s=i.pesData,o=r.pesData,l=n.pesData;if(s&&(e=W(s))?(this.parseAVCPES(i,a,e,!0),i.pesData=null):i.pesData=s,o&&(e=W(o))){switch(r.segmentCodec){case"aac":this.parseAACPES(r,e);break;case"mp3":this.parseMPEGPES(r,e)}r.pesData=null}else null!=o&&o.size&&v.logger.log("last AAC PES packet truncated,might overlap between fragments"),r.pesData=o;l&&(e=W(l))?(this.parseID3PES(n,e),n.pesData=null):n.pesData=l},e.demuxSampleAes=function(t,e,r){var i=this.demux(t,r,!0,!this.config.progressive),n=this.sampleAes=new B(this.observer,this.config,e);return this.decrypt(i,n)},e.decrypt=function(t,e){return new Promise((function(r){var i=t.audioTrack,n=t.videoTrack;i.samples&&"aac"===i.segmentCodec?e.decryptAacSamples(i.samples,0,(function(){n.samples?e.decryptAvcSamples(n.samples,0,0,(function(){r(t)})):r(t)})):n.samples&&e.decryptAvcSamples(n.samples,0,0,(function(){r(t)}))}))},e.destroy=function(){this._duration=0},e.parseAVCPES=function(t,e,r,i){var n,a=this,s=this.parseAVCNALu(t,r.data),o=this.avcSample,l=!1;r.data=null,o&&s.length&&!t.audFound&&(q(o,t),o=this.avcSample=H(!1,r.pts,r.dts,"")),s.forEach((function(i){switch(i.type){case 1:n=!0,o||(o=a.avcSample=H(!0,r.pts,r.dts,"")),o.frame=!0;var s=i.data;if(l&&s.length>4){var u=new U(s).readSliceType();2!==u&&4!==u&&7!==u&&9!==u||(o.key=!0)}break;case 5:n=!0,o||(o=a.avcSample=H(!0,r.pts,r.dts,"")),o.key=!0,o.frame=!0;break;case 6:n=!0,(0,d.parseSEIMessageFromNALu)(i.data,1,r.pts,e.samples);break;case 7:if(n=!0,l=!0,!t.sps){var h=new U(i.data).readSPS();t.width=h.width,t.height=h.height,t.pixelRatio=h.pixelRatio,t.sps=[i.data],t.duration=a._duration;for(var c=i.data.subarray(1,4),f="avc1.",g=0;g<3;g++){var v=c[g].toString(16);v.length<2&&(v="0"+v),f+=v}t.codec=f}break;case 8:n=!0,t.pps||(t.pps=[i.data]);break;case 9:n=!1,t.audFound=!0,o&&q(o,t),o=a.avcSample=H(!1,r.pts,r.dts,"");break;case 12:n=!0;break;default:n=!1,o&&(o.debug+="unknown NAL "+i.type+" ")}o&&n&&o.units.push(i)})),i&&o&&(q(o,t),this.avcSample=null)},e.getLastNalUnit=function(t){var e,r,i=this.avcSample;if(i&&0!==i.units.length||(i=t[t.length-1]),null!==(e=i)&&void 0!==e&&e.units){var n=i.units;r=n[n.length-1]}return r},e.parseAVCNALu=function(t,e){var r,i,n=e.byteLength,a=t.naluState||0,s=a,o=[],l=0,u=-1,d=0;for(-1===a&&(u=0,d=31&e[0],a=0,l=1);l=0){var h={data:e.subarray(u,l-a-1),type:d};o.push(h)}else{var c=this.getLastNalUnit(t.samples);if(c&&(s&&l<=4-s&&c.state&&(c.data=c.data.subarray(0,c.data.byteLength-s)),(i=l-a-1)>0)){var f=new Uint8Array(c.data.byteLength+i);f.set(c.data,0),f.set(e.subarray(0,i),c.data.byteLength),c.data=f,c.state=0}}l=0&&a>=0){var g={data:e.subarray(u,n),type:d,state:a};o.push(g)}if(0===o.length){var v=this.getLastNalUnit(t.samples);if(v){var p=new Uint8Array(v.data.byteLength+e.byteLength);p.set(v.data,0),p.set(e,v.data.byteLength),v.data=p}}return t.naluState=a,o},e.parseAACPES=function(t,e){var r,a,s,o,l,u=0,d=this.aacOverFlow,h=e.data;if(d){this.aacOverFlow=null;var c=d.missing,f=d.sample.unit.byteLength;if(-1===c){var g=new Uint8Array(f+h.byteLength);g.set(d.sample.unit,0),g.set(h,f),h=g}else{var p=f-c;d.sample.unit.set(h.subarray(0,c),p),t.samples.push(d.sample),u=d.missing}}for(r=u,a=h.length;r4?r:"hvc1"===r||"hev1"===r?"hvc1.1.c.L120.90":"av01"===r?"av01.0.04M.08":"avc1"===r||e===J.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}const tt=function(){function t(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndTime=null}var e=t.prototype;return e.destroy=function(){},e.resetTimeStamp=function(t){this.initPTS=t,this.lastEndTime=null},e.resetNextTimestamp=function(){this.lastEndTime=null},e.resetInitSegment=function(t,e,r,i){this.audioCodec=e,this.videoCodec=r,this.generateInitSegment((0,d.patchEncyptionData)(t,i)),this.emitInitSegment=!0},e.generateInitSegment=function(t){var e=this.audioCodec,r=this.videoCodec;if(!t||!t.byteLength)return this.initTracks=void 0,void(this.initData=void 0);var i=this.initData=(0,d.parseInitSegment)(t);e||(e=Z(i.audio,J.ElementaryStreamTypes.AUDIO)),r||(r=Z(i.video,J.ElementaryStreamTypes.VIDEO));var n={};i.audio&&i.video?n.audiovideo={container:"video/mp4",codec:e+","+r,initSegment:t,id:"main"}:i.audio?n.audio={container:"audio/mp4",codec:e,initSegment:t,id:"audio"}:i.video?n.video={container:"video/mp4",codec:r,initSegment:t,id:"main"}:v.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=n},e.remux=function(t,e,r,i,n){var a,o=this.initPTS,l=this.lastEndTime,u={audio:void 0,video:void 0,text:i,id3:r,initSegment:void 0};(0,s.isFiniteNumber)(l)||(l=this.lastEndTime=n||0);var h=e.samples;if(!h||!h.length)return u;var c={initPTS:void 0,timescale:1},f=this.initData;if(f&&f.length||(this.generateInitSegment(h),f=this.initData),!f||!f.length)return v.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),u;this.emitInitSegment&&(c.tracks=this.initTracks,this.emitInitSegment=!1);var g=(0,d.getStartDTS)(f,h);(0,s.isFiniteNumber)(o)||(this.initPTS=c.initPTS=o=g-n);var p=(0,d.getDuration)(h,f),m=t?g-o:l,y=m+p;(0,d.offsetStartDTS)(f,h,o),p>0?this.lastEndTime=y:(v.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var E=!!f.audio,T=!!f.video,S="";E&&(S+="audio"),T&&(S+="video");var b={data1:h,startPTS:m,startDTS:m,endPTS:y,endDTS:y,type:S,hasAudio:E,hasVideo:T,nb:1,dropped:0};u.audio="audio"===b.type?b:void 0,u.video="audio"!==b.type?b:void 0,u.initSegment=c;var L=null!=(a=this.initPTS)?a:0;return u.id3=(0,$.flushTextTrackMetadataCueSamples)(r,n,L,L),i.samples.length&&(u.text=(0,$.flushTextTrackUserdataCueSamples)(i,n,L)),u},t}();var et;try{et=self.performance.now.bind(self.performance)}catch(t){v.logger.debug("Unable to use Performance API on this environment"),et=self.Date.now}var rt=[{demux:R,remux:tt},{demux:X,remux:$.default},{demux:D,remux:$.default},{demux:Q,remux:$.default}],it=function(){function t(t,e,r,i,n){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=t,this.typeSupported=e,this.config=r,this.vendor=i,this.id=n}var e=t.prototype;return e.configure=function(t){this.transmuxConfig=t,this.decrypter&&this.decrypter.reset()},e.push=function(t,e,r,i){var n=this,a=r.transmuxing;a.executeStart=et();var s=new Uint8Array(t),o=this.currentTransmuxState,l=this.transmuxConfig;i&&(this.currentTransmuxState=i);var u=i||o,d=u.contiguous,h=u.discontinuity,c=u.trackSwitch,f=u.accurateTimeOffset,g=u.timeOffset,v=u.initSegmentChange,p=l.audioCodec,m=l.videoCodec,y=l.defaultInitPts,E=l.duration,T=l.initSegmentData,S=function(t,e){var r=null;return t.byteLength>0&&null!=e&&null!=e.key&&null!==e.iv&&null!=e.method&&(r=e),r}(s,e);if(S&&"AES-128"===S.method){var b=this.getDecrypter();if(!b.isSync())return this.decryptionPromise=b.webCryptoDecrypt(s,S.key.buffer,S.iv.buffer).then((function(t){var e=n.push(t,null,r);return n.decryptionPromise=null,e})),this.decryptionPromise;var L=b.softwareDecrypt(s,S.key.buffer,S.iv.buffer);if(r.part>-1&&(L=b.flush()),!L)return a.executeEnd=et(),nt(r);s=new Uint8Array(L)}var A=this.needsProbing(h,c);A&&this.configureTransmuxer(s),(h||c||v||A)&&this.resetInitSegment(T,p,m,E,e),(h||v||A)&&this.resetInitialTimestamp(y),d||this.resetContiguity();var D=this.transmux(s,S,g,f,r),k=this.currentTransmuxState;return k.contiguous=!0,k.discontinuity=!1,k.trackSwitch=!1,a.executeEnd=et(),D},e.flush=function(t){var e=this,r=t.transmuxing;r.executeStart=et();var a=this.decrypter,s=this.currentTransmuxState,o=this.decryptionPromise;if(o)return o.then((function(){return e.flush(t)}));var l=[],u=s.timeOffset;if(a){var d=a.flush();d&&l.push(this.push(d,null,t))}var h=this.demuxer,c=this.remuxer;if(!h||!c)return this.observer.emit(i.Events.ERROR,i.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),r.executeEnd=et(),[nt(t)];var f=h.flush(u);return at(f)?f.then((function(r){return e.flushRemux(l,r,t),l})):(this.flushRemux(l,f,t),l)},e.flushRemux=function(t,e,r){var i=e.audioTrack,n=e.videoTrack,a=e.id3Track,s=e.textTrack,o=this.currentTransmuxState,l=o.accurateTimeOffset,u=o.timeOffset;v.logger.log("[transmuxer.ts]: Flushed fragment "+r.sn+(r.part>-1?" p: "+r.part:"")+" of level "+r.level);var d=this.remuxer.remux(i,n,a,s,u,l,!0,this.id);t.push({remuxResult:d,chunkMeta:r}),r.transmuxing.executeEnd=et()},e.resetInitialTimestamp=function(t){var e=this.demuxer,r=this.remuxer;e&&r&&(e.resetTimeStamp(t),r.resetTimeStamp(t))},e.resetContiguity=function(){var t=this.demuxer,e=this.remuxer;t&&e&&(t.resetContiguity(),e.resetNextTimestamp())},e.resetInitSegment=function(t,e,r,i,n){var a=this.demuxer,s=this.remuxer;a&&s&&(a.resetInitSegment(t,e,r,i),s.resetInitSegment(t,e,r,n))},e.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},e.transmux=function(t,e,r,i,n){return e&&"SAMPLE-AES"===e.method?this.transmuxSampleAes(t,e,r,i,n):this.transmuxUnencrypted(t,r,i,n)},e.transmuxUnencrypted=function(t,e,r,i){var n=this.demuxer.demux(t,e,!1,!this.config.progressive),a=n.audioTrack,s=n.videoTrack,o=n.id3Track,l=n.textTrack;return{remuxResult:this.remuxer.remux(a,s,o,l,e,r,!1,this.id),chunkMeta:i}},e.transmuxSampleAes=function(t,e,r,i,n){var a=this;return this.demuxer.demuxSampleAes(t,e,r).then((function(t){return{remuxResult:a.remuxer.remux(t.audioTrack,t.videoTrack,t.id3Track,t.textTrack,r,i,!1,a.id),chunkMeta:n}}))},e.configureTransmuxer=function(t){for(var e,r=this.config,i=this.observer,n=this.typeSupported,a=this.vendor,s=0,o=rt.length;s{"use strict";var i,n;r.r(e),r.d(e,{ErrorDetails:()=>n,ErrorTypes:()=>i}),function(t){t.NETWORK_ERROR="networkError",t.MEDIA_ERROR="mediaError",t.KEY_SYSTEM_ERROR="keySystemError",t.MUX_ERROR="muxError",t.OTHER_ERROR="otherError"}(i||(i={})),function(t){t.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",t.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",t.KEY_SYSTEM_NO_SESSION="keySystemNoSession",t.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",t.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",t.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",t.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",t.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",t.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",t.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",t.MANIFEST_LOAD_ERROR="manifestLoadError",t.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",t.MANIFEST_PARSING_ERROR="manifestParsingError",t.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",t.LEVEL_EMPTY_ERROR="levelEmptyError",t.LEVEL_LOAD_ERROR="levelLoadError",t.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",t.LEVEL_SWITCH_ERROR="levelSwitchError",t.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",t.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",t.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",t.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",t.FRAG_LOAD_ERROR="fragLoadError",t.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",t.FRAG_DECRYPT_ERROR="fragDecryptError",t.FRAG_PARSING_ERROR="fragParsingError",t.REMUX_ALLOC_ERROR="remuxAllocError",t.KEY_LOAD_ERROR="keyLoadError",t.KEY_LOAD_TIMEOUT="keyLoadTimeOut",t.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",t.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",t.BUFFER_APPEND_ERROR="bufferAppendError",t.BUFFER_APPENDING_ERROR="bufferAppendingError",t.BUFFER_STALLED_ERROR="bufferStalledError",t.BUFFER_FULL_ERROR="bufferFullError",t.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",t.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",t.INTERNAL_EXCEPTION="internalException",t.INTERNAL_ABORTED="aborted",t.UNKNOWN="unknown"}(n||(n={}))},851:(t,e,r)=>{"use strict";var i;r.r(e),r.d(e,{Events:()=>i}),function(t){t.MEDIA_ATTACHING="hlsMediaAttaching",t.MEDIA_ATTACHED="hlsMediaAttached",t.MEDIA_DETACHING="hlsMediaDetaching",t.MEDIA_DETACHED="hlsMediaDetached",t.BUFFER_RESET="hlsBufferReset",t.BUFFER_CODECS="hlsBufferCodecs",t.BUFFER_CREATED="hlsBufferCreated",t.BUFFER_APPENDING="hlsBufferAppending",t.BUFFER_APPENDED="hlsBufferAppended",t.BUFFER_EOS="hlsBufferEos",t.BUFFER_FLUSHING="hlsBufferFlushing",t.BUFFER_FLUSHED="hlsBufferFlushed",t.MANIFEST_LOADING="hlsManifestLoading",t.MANIFEST_LOADED="hlsManifestLoaded",t.MANIFEST_PARSED="hlsManifestParsed",t.LEVEL_SWITCHING="hlsLevelSwitching",t.LEVEL_SWITCHED="hlsLevelSwitched",t.LEVEL_LOADING="hlsLevelLoading",t.LEVEL_LOADED="hlsLevelLoaded",t.LEVEL_UPDATED="hlsLevelUpdated",t.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",t.LEVELS_UPDATED="hlsLevelsUpdated",t.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",t.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",t.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",t.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",t.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",t.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",t.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",t.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",t.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",t.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",t.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",t.CUES_PARSED="hlsCuesParsed",t.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",t.INIT_PTS_FOUND="hlsInitPtsFound",t.FRAG_LOADING="hlsFragLoading",t.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",t.FRAG_LOADED="hlsFragLoaded",t.FRAG_DECRYPTED="hlsFragDecrypted",t.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",t.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",t.FRAG_PARSING_METADATA="hlsFragParsingMetadata",t.FRAG_PARSED="hlsFragParsed",t.FRAG_BUFFERED="hlsFragBuffered",t.FRAG_CHANGED="hlsFragChanged",t.FPS_DROP="hlsFpsDrop",t.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",t.ERROR="hlsError",t.DESTROYING="hlsDestroying",t.KEY_LOADING="hlsKeyLoading",t.KEY_LOADED="hlsKeyLoaded",t.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",t.BACK_BUFFER_REACHED="hlsBackBufferReached"}(i||(i={}))},76:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>Bi});var i,n=r(945),a=r(965),s=r(851),o=r(973),l=r(93),u=/^(\d+)x(\d+)$/,d=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,h=function(){function t(e){for(var r in"string"==typeof e&&(e=t.parseAttrList(e)),e)e.hasOwnProperty(r)&&(this[r]=e[r])}var e=t.prototype;return e.decimalInteger=function(t){var e=parseInt(this[t],10);return e>Number.MAX_SAFE_INTEGER?1/0:e},e.hexadecimalInteger=function(t){if(this[t]){var e=(this[t]||"0x").slice(2);e=(1&e.length?"0":"")+e;for(var r=new Uint8Array(e.length/2),i=0;iNumber.MAX_SAFE_INTEGER?1/0:e},e.decimalFloatingPoint=function(t){return parseFloat(this[t])},e.optionalFloat=function(t,e){var r=this[t];return r?parseFloat(r):e},e.enumeratedString=function(t){return this[t]},e.bool=function(t){return"YES"===this[t]},e.decimalResolution=function(t){var e=u.exec(this[t]);if(null!==e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}},t.parseAttrList=function(t){var e,r={};for(d.lastIndex=0;null!==(e=d.exec(t));){var i=e[2];0===i.indexOf('"')&&i.lastIndexOf('"')===i.length-1&&(i=i.slice(1,-1)),r[e[1]]=i}return r},t}();function c(){return c=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(!this.endOnNext||!!this.class)}}])&&f(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),v=r(923);function p(t,e){for(var r=0;rt.endSN||e>0||0===e&&r>0,this.updated||this.advanced?this.misses=Math.floor(.6*t.misses):this.misses=t.misses+1,this.availabilityDelay=t.availabilityDelay},e=t,(r=[{key:"hasProgramDateTime",get:function(){return!!this.fragments.length&&(0,a.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime)}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||10}},{key:"drift",get:function(){var t=this.driftEndTime-this.driftStartTime;return t>0?1e3*(this.driftEnd-this.driftStart)/t:1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var t;return null!==(t=this.fragments)&&void 0!==t&&t.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}])&&p(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function S(t){return Uint8Array.from(atob(t),(function(t){return t.charCodeAt(0)}))}function b(t){return Uint8Array.from(unescape(encodeURIComponent(t)),(function(t){return t.charCodeAt(0)}))}function L(t){switch(t){case y.FAIRPLAY:return m.FAIRPLAY;case y.PLAYREADY:return m.PLAYREADY;case y.WIDEVINE:return m.WIDEVINE;case y.CLEARKEY:return m.CLEARKEY}}function A(t){switch(t){case m.FAIRPLAY:return y.FAIRPLAY;case m.PLAYREADY:return y.PLAYREADY;case m.WIDEVINE:return y.WIDEVINE;case m.CLEARKEY:return y.CLEARKEY}}function D(t){var e=t.drmSystems,r=t.widevineLicenseUrl,i=e?[m.FAIRPLAY,m.WIDEVINE,m.PLAYREADY,m.CLEARKEY].filter((function(t){return!!e[t]})):[];return!i[m.WIDEVINE]&&r&&i.push(m.WIDEVINE),i}!function(t){t.CLEARKEY="org.w3.clearkey",t.FAIRPLAY="com.apple.fps",t.PLAYREADY="com.microsoft.playready",t.WIDEVINE="com.widevine.alpha"}(m||(m={})),function(t){t.CLEARKEY="org.w3.clearkey",t.FAIRPLAY="com.apple.streamingkeydelivery",t.PLAYREADY="com.microsoft.playready",t.WIDEVINE="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"}(y||(y={})),function(t){t.WIDEVINE="edef8ba979d64acea3c827dcd51d21ed"}(E||(E={}));var k="undefined"!=typeof self&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null,R=r(63),I={},w=function(){function t(t,e,r,i,n){void 0===i&&(i=[1]),void 0===n&&(n=null),this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=t,this.uri=e,this.keyFormat=r,this.keyFormatVersions=i,this.iv=n,this.encrypted=!!t&&"NONE"!==t,this.isCommonEncryption=this.encrypted&&"AES-128"!==t}t.clearKeyUriToKeyIdMap=function(){I={}};var e=t.prototype;return e.isSupported=function(){if(this.method){if("AES-128"===this.method||"NONE"===this.method)return!0;switch(this.keyFormat){case"identity":return"SAMPLE-AES"===this.method;case y.FAIRPLAY:case y.WIDEVINE:case y.PLAYREADY:case y.CLEARKEY:return-1!==["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)}}return!1},e.getDecryptData=function(e){if(!this.encrypted||!this.uri)return null;if("AES-128"===this.method&&this.uri&&!this.iv){"number"!=typeof e&&("AES-128"!==this.method||this.iv||l.logger.warn('missing IV for initialization segment with method="'+this.method+'" - compliance issue'),e=0);var r=function(t){for(var e=new Uint8Array(16),r=12;r<16;r++)e[r]=t>>8*(15-r)&255;return e}(e);return new t(this.method,this.uri,"identity",this.keyFormatVersions,r)}var i=function(t){var e,r,i=t.split(":"),n=null;if("data"===i[0]&&2===i.length){var a=i[1].split(";"),s=a[a.length-1].split(",");if(2===s.length){var o="base64"===s[0],l=s[1];o?(a.splice(-1,1),n=S(l)):(e=b(l).subarray(0,16),(r=new Uint8Array(16)).set(e,16-e.length),n=r)}}return n}(this.uri);if(i)switch(this.keyFormat){case y.WIDEVINE:this.pssh=i,i.length>=22&&(this.keyId=i.subarray(i.length-22,i.length-6));break;case y.PLAYREADY:var n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=(0,R.mp4pssh)(n,null,i);var a=new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2),s=String.fromCharCode.apply(null,Array.from(a)),o=s.substring(s.indexOf("<"),s.length),u=(new DOMParser).parseFromString(o,"text/xml").getElementsByTagName("KID")[0];if(u){var d=u.childNodes[0]?u.childNodes[0].nodeValue:u.getAttribute("VALUE");if(d){var h=S(d).subarray(0,16);!function(t){var e=function(t,e,r){var i=t[e];t[e]=t[r],t[r]=i};e(t,0,3),e(t,1,2),e(t,4,5),e(t,6,7)}(h),this.keyId=h}}break;default:var c=i.subarray(0,16);if(16!==c.length){var f=new Uint8Array(16);f.set(c,16-c.length),c=f}this.keyId=c}if(!this.keyId||16!==this.keyId.byteLength){var g=I[this.uri];if(!g){var v=Object.keys(I).length%Number.MAX_SAFE_INTEGER;g=new Uint8Array(16),new DataView(g.buffer,12,4).setUint32(0,v),I[this.uri]=g}this.keyId=g}return this},t}(),C={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dva1:!0,dvav:!0,dvh1:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function _(t,e){return MediaSource.isTypeSupported((e||"video")+'/mp4;codecs="'+t+'"')}function P(){return P=Object.assign?Object.assign.bind():function(t){for(var e=1;e2){var r=e.shift()+".";return(r+=parseInt(e.shift()).toString(16))+("000"+parseInt(e.shift()).toString(16)).slice(-4)}return t},t.resolve=function(t,e){return(0,n.buildAbsoluteURL)(e,t,{alwaysNormalize:!0})},t.parseMasterPlaylist=function(e,r){var i,n=[],a=[],s={},o=[],u=!1;for(O.lastIndex=0;null!=(i=O.exec(e));)if(i[1]){var d,c=new h(i[1]),f={attrs:c,bitrate:c.decimalInteger("AVERAGE-BANDWIDTH")||c.decimalInteger("BANDWIDTH"),name:c.NAME,url:t.resolve(i[2],r)},g=c.decimalResolution("RESOLUTION");g&&(f.width=g.width,f.height=g.height),B((c.CODECS||"").split(/[ ,]+/).filter((function(t){return t})),f),f.videoCodec&&-1!==f.videoCodec.indexOf("avc1")&&(f.videoCodec=t.convertAVC1ToAVCOTI(f.videoCodec)),null!==(d=f.unknownCodecs)&&void 0!==d&&d.length||a.push(f),n.push(f)}else if(i[3]){var v=new h(i[3]);v["DATA-ID"]&&(u=!0,s[v["DATA-ID"]]=v)}else if(i[4]){var p=i[4],m=U(p,r);m.encrypted&&m.isSupported()?o.push(m):l.logger.warn('[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "'+p+'"')}return{levels:a.length>0&&a.length0&&X.bool("CAN-SKIP-DATERANGES"),d.partHoldBack=X.optionalFloat("PART-HOLD-BACK",0),d.holdBack=X.optionalFloat("HOLD-BACK",0);break;case"PART-INF":var z=new h(w);d.partTarget=z.decimalFloatingPoint("PART-TARGET");break;case"PART":var Q=d.partList;Q||(Q=d.partList=[]);var $=m>0?Q[Q.length-1]:void 0,J=m++,Z=new v.Part(new h(w),b,e,J,$);Q.push(Z),b.duration+=Z.duration;break;case"PRELOAD-HINT":var tt=new h(w);d.preloadHint=tt;break;case"RENDITION-REPORT":var et=new h(w);d.renditionReports=d.renditionReports||[],d.renditionReports.push(et);break;default:l.logger.warn("line parsed but not handled: "+s)}}}S&&!S.relurl?(c.pop(),y-=S.duration,d.partList&&(d.fragmentHint=S)):d.partList&&(K(b,S),b.cc=E,d.fragmentHint=b,u&&j(b,u,d));var rt=c.length,it=c[0],nt=c[rt-1];if((y+=d.skippedSegments*d.targetduration)>0&&rt&&nt){d.averagetargetduration=y/rt;var at=nt.sn;d.endSN="initSegment"!==at?at:0,d.live||(nt.endList=!0),it&&(d.startCC=it.cc)}else d.endSN=0,d.startCC=0;return d.fragmentHint&&(y+=d.fragmentHint.duration),d.totalduration=y,d.endCC=E,L>0&&function(t,e){for(var r=t[e],i=e;i--;){var n=t[i];if(!n)return;n.programDateTime=r.programDateTime-1e3*n.duration,r=n}}(c,L),d},t}();function U(t,e){var r,i,n=new h(t),a=null!=(r=n.enumeratedString("METHOD"))?r:"",s=n.URI,o=n.hexadecimalInteger("IV"),u=n.enumeratedString("KEYFORMATVERSIONS"),d=null!=(i=n.enumeratedString("KEYFORMAT"))?i:"identity";s&&n.IV&&!o&&l.logger.error("Invalid IV: "+n.IV);var c=s?N.resolve(s,e):"",f=(u||"1").split("/").map(Number).filter(Number.isFinite);return new w(a,c,d,f,o)}function B(t,e){["video","audio","text"].forEach((function(r){var i=t.filter((function(t){return function(t,e){var r=C[e];return!!r&&!0===r[t.slice(0,4)]}(t,r)}));if(i.length){var n=i.filter((function(t){return 0===t.lastIndexOf("avc1",0)||0===t.lastIndexOf("mp4a",0)}));e[r+"Codec"]=n.length>0?n[0]:i[0],t=t.filter((function(t){return-1===i.indexOf(t)}))}})),e.unknownCodecs=t}function G(t,e,r){var i=e[r];i&&(t[r]=i)}function K(t,e){t.rawProgramDateTime?t.programDateTime=Date.parse(t.rawProgramDateTime):null!=e&&e.programDateTime&&(t.programDateTime=e.endProgramDateTime),(0,a.isFiniteNumber)(t.programDateTime)||(t.programDateTime=null,t.rawProgramDateTime=null)}function H(t,e,r,i){t.relurl=e.URI,e.BYTERANGE&&t.setByteRange(e.BYTERANGE),t.level=r,t.sn="initSegment",i&&(t.levelkeys=i),t.initSegment=null}function j(t,e,r){t.levelkeys=e;var i=r.encryptedFragments;i.length&&i[i.length-1].levelkeys===e||!Object.keys(e).some((function(t){return e[t].isCommonEncryption}))||i.push(t)}var V=r(308);function Y(t,e){var r=t.url;return void 0!==r&&0!==r.indexOf("data:")||(r=e.url),r}const W=function(){function t(t){this.hls=void 0,this.loaders=Object.create(null),this.hls=t,this.registerListeners()}var e=t.prototype;return e.startLoad=function(t){},e.stopLoad=function(){this.destroyInternalLoaders()},e.registerListeners=function(){var t=this.hls;t.on(s.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(s.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(s.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(s.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},e.unregisterListeners=function(){var t=this.hls;t.off(s.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(s.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(s.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(s.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},e.createInternalLoader=function(t){var e=this.hls.config,r=e.pLoader,i=e.loader,n=new(r||i)(e);return t.loader=n,this.loaders[t.type]=n,n},e.getInternalLoader=function(t){return this.loaders[t.type]},e.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},e.destroyInternalLoaders=function(){for(var t in this.loaders){var e=this.loaders[t];e&&e.destroy(),this.resetInternalLoader(t)}},e.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},e.onManifestLoading=function(t,e){var r=e.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:V.PlaylistContextType.MANIFEST,url:r,deliveryDirectives:null})},e.onLevelLoading=function(t,e){var r=e.id,i=e.level,n=e.url,a=e.deliveryDirectives;this.load({id:r,groupId:null,level:i,responseType:"text",type:V.PlaylistContextType.LEVEL,url:n,deliveryDirectives:a})},e.onAudioTrackLoading=function(t,e){var r=e.id,i=e.groupId,n=e.url,a=e.deliveryDirectives;this.load({id:r,groupId:i,level:null,responseType:"text",type:V.PlaylistContextType.AUDIO_TRACK,url:n,deliveryDirectives:a})},e.onSubtitleTrackLoading=function(t,e){var r=e.id,i=e.groupId,n=e.url,a=e.deliveryDirectives;this.load({id:r,groupId:i,level:null,responseType:"text",type:V.PlaylistContextType.SUBTITLE_TRACK,url:n,deliveryDirectives:a})},e.load=function(t){var e,r,i,n,a,s,o=this.hls.config,u=this.getInternalLoader(t);if(u){var d=u.context;if(d&&d.url===t.url)return void l.logger.trace("[playlist-loader]: playlist request ongoing");l.logger.log("[playlist-loader]: aborting previous loader for type: "+t.type),u.abort()}switch(t.type){case V.PlaylistContextType.MANIFEST:r=o.manifestLoadingMaxRetry,i=o.manifestLoadingTimeOut,n=o.manifestLoadingRetryDelay,a=o.manifestLoadingMaxRetryTimeout;break;case V.PlaylistContextType.LEVEL:case V.PlaylistContextType.AUDIO_TRACK:case V.PlaylistContextType.SUBTITLE_TRACK:r=0,i=o.levelLoadingTimeOut;break;default:r=o.levelLoadingMaxRetry,i=o.levelLoadingTimeOut,n=o.levelLoadingRetryDelay,a=o.levelLoadingMaxRetryTimeout}if(u=this.createInternalLoader(t),null!==(e=t.deliveryDirectives)&&void 0!==e&&e.part&&(t.type===V.PlaylistContextType.LEVEL&&null!==t.level?s=this.hls.levels[t.level].details:t.type===V.PlaylistContextType.AUDIO_TRACK&&null!==t.id?s=this.hls.audioTracks[t.id].details:t.type===V.PlaylistContextType.SUBTITLE_TRACK&&null!==t.id&&(s=this.hls.subtitleTracks[t.id].details),s)){var h=s.partTarget,c=s.targetduration;h&&c&&(i=Math.min(1e3*Math.max(3*h,.8*c),i))}var f={timeout:i,maxRetry:r,retryDelay:n,maxRetryDelay:a,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(t,f,g)},e.loadsuccess=function(t,e,r,i){void 0===i&&(i=null),this.resetInternalLoader(r.type);var n=t.data;0===n.indexOf("#EXTM3U")?(e.parsing.start=performance.now(),n.indexOf("#EXTINF:")>0||n.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(t,e,r,i):this.handleMasterPlaylist(t,e,r,i)):this.handleManifestParsingError(t,r,"no EXTM3U delimiter",i)},e.loaderror=function(t,e,r){void 0===r&&(r=null),this.handleNetworkError(e,r,!1,t)},e.loadtimeout=function(t,e,r){void 0===r&&(r=null),this.handleNetworkError(e,r,!0)},e.handleMasterPlaylist=function(t,e,r,i){var n=this.hls,a=t.data,o=Y(t,r),u=N.parseMasterPlaylist(a,o),d=u.levels,c=u.sessionData,f=u.sessionKeys;if(d.length){var g=d.map((function(t){return{id:t.attrs.AUDIO,audioCodec:t.audioCodec}})),v=d.map((function(t){return{id:t.attrs.SUBTITLES,textCodec:t.textCodec}})),p=N.parseMasterPlaylistMedia(a,o,"AUDIO",g),m=N.parseMasterPlaylistMedia(a,o,"SUBTITLES",v),y=N.parseMasterPlaylistMedia(a,o,"CLOSED-CAPTIONS");p.length&&(p.some((function(t){return!t.url}))||!d[0].audioCodec||d[0].attrs.AUDIO||(l.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),p.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new h({}),bitrate:0,url:""}))),n.trigger(s.Events.MANIFEST_LOADED,{levels:d,audioTracks:p,subtitles:m,captions:y,url:o,stats:e,networkDetails:i,sessionData:c,sessionKeys:f})}else this.handleManifestParsingError(t,r,"no level found in manifest",i)},e.handleTrackOrLevelPlaylist=function(t,e,r,i){var n=this.hls,l=r.id,u=r.level,d=r.type,c=Y(t,r),f=(0,a.isFiniteNumber)(l)?l:0,g=(0,a.isFiniteNumber)(u)?u:f,v=function(t){switch(t.type){case V.PlaylistContextType.AUDIO_TRACK:return V.PlaylistLevelType.AUDIO;case V.PlaylistContextType.SUBTITLE_TRACK:return V.PlaylistLevelType.SUBTITLE;default:return V.PlaylistLevelType.MAIN}}(r),p=N.parseLevelPlaylist(t.data,c,g,v,f);if(p.fragments.length){if(d===V.PlaylistContextType.MANIFEST){var m={attrs:new h({}),bitrate:0,details:p,name:"",url:c};n.trigger(s.Events.MANIFEST_LOADED,{levels:[m],audioTracks:[],url:c,stats:e,networkDetails:i,sessionData:null,sessionKeys:null})}e.parsing.end=performance.now(),r.levelDetails=p,this.handlePlaylistLoaded(t,e,r,i)}else n.trigger(s.Events.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:c,reason:"no fragments found in level",level:"number"==typeof r.level?r.level:void 0})},e.handleManifestParsingError=function(t,e,r,i){this.hls.trigger(s.Events.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:e.type===V.PlaylistContextType.MANIFEST,url:t.url,reason:r,response:t,context:e,networkDetails:i})},e.handleNetworkError=function(t,e,r,i){void 0===r&&(r=!1),l.logger.warn("[playlist-loader]: A network "+(r?"timeout":"error")+" occurred while loading "+t.type+" level: "+t.level+" id: "+t.id+' group-id: "'+t.groupId+'"');var n=o.ErrorDetails.UNKNOWN,a=!1,u=this.getInternalLoader(t);switch(t.type){case V.PlaylistContextType.MANIFEST:n=r?o.ErrorDetails.MANIFEST_LOAD_TIMEOUT:o.ErrorDetails.MANIFEST_LOAD_ERROR,a=!0;break;case V.PlaylistContextType.LEVEL:n=r?o.ErrorDetails.LEVEL_LOAD_TIMEOUT:o.ErrorDetails.LEVEL_LOAD_ERROR,a=!1;break;case V.PlaylistContextType.AUDIO_TRACK:n=r?o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,a=!1;break;case V.PlaylistContextType.SUBTITLE_TRACK:n=r?o.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:o.ErrorDetails.SUBTITLE_LOAD_ERROR,a=!1}u&&this.resetInternalLoader(t.type);var d={type:o.ErrorTypes.NETWORK_ERROR,details:n,fatal:a,url:t.url,loader:u,context:t,networkDetails:e};i&&(d.response=i),this.hls.trigger(s.Events.ERROR,d)},e.handlePlaylistLoaded=function(t,e,r,i){var n=r.type,a=r.level,o=r.id,l=r.groupId,u=r.loader,d=r.levelDetails,h=r.deliveryDirectives;if(null!=d&&d.targetduration){if(u)switch(d.live&&(u.getCacheAge&&(d.ageHeader=u.getCacheAge()||0),u.getCacheAge&&!isNaN(d.ageHeader)||(d.ageHeader=0)),n){case V.PlaylistContextType.MANIFEST:case V.PlaylistContextType.LEVEL:this.hls.trigger(s.Events.LEVEL_LOADED,{details:d,level:a||0,id:o||0,stats:e,networkDetails:i,deliveryDirectives:h});break;case V.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(s.Events.AUDIO_TRACK_LOADED,{details:d,id:o||0,groupId:l||"",stats:e,networkDetails:i,deliveryDirectives:h});break;case V.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(s.Events.SUBTITLE_TRACK_LOADED,{details:d,id:o||0,groupId:l||"",stats:e,networkDetails:i,deliveryDirectives:h})}}else this.handleManifestParsingError(t,r,"invalid target duration",i)},t}();function q(t,e){var r;try{r=new Event("addtrack")}catch(t){(r=document.createEvent("Event")).initEvent("addtrack",!1,!1)}r.track=t,e.dispatchEvent(r)}function X(t,e){var r=t.mode;if("disabled"===r&&(t.mode="hidden"),t.cues&&!t.cues.getCueById(e.id))try{if(t.addCue(e),!t.cues.getCueById(e.id))throw new Error("addCue is failed for: "+e)}catch(r){l.logger.debug("[texttrack-utils]: "+r);var i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,t.addCue(i)}"disabled"===r&&(t.mode=r)}function z(t){var e=t.mode;if("disabled"===e&&(t.mode="hidden"),t.cues)for(var r=t.cues.length;r--;)t.removeCue(t.cues[r]);"disabled"===e&&(t.mode=e)}function Q(t,e,r,i){var n=t.mode;if("disabled"===n&&(t.mode="hidden"),t.cues&&t.cues.length>0)for(var a=function(t,e,r){var i=[],n=function(t,e){if(et[r].endTime)return-1;for(var i=0,n=r;i<=n;){var a=Math.floor((n+i)/2);if(et[a].startTime&&i-1)for(var a=n,s=t.length;a=e&&o.endTime<=r)i.push(o);else if(o.startTime>r)return i}return i}(t.cues,e,r),s=0;stt&&(h=tt),h-d<=0&&(h=d+.25);for(var c=0;cn.startDate&&t.push(r),t}),[]).sort((function(t,e){return t.startDate.getTime()-e.startDate.getTime()}))[0];p&&(c=et(p.startDate,g),d=!0)}for(var m,y=Object.keys(n.attr),E=0;E.05&&this.forwardBufferLength>1){var u=Math.min(2,Math.max(1,a)),d=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;t.playbackRate=Math.min(u,Math.max(1,d))}else 1!==t.playbackRate&&0!==t.playbackRate&&(t.playbackRate=1)}}}}},i.estimateLiveEdge=function(){var t=this.levelDetails;return null===t?null:t.edge+t.age},i.computeLatency=function(){var t=this.estimateLiveEdge();return null===t?null:t-this.currentTime},e=t,(r=[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var t=this.config,e=this.levelDetails;return void 0!==t.liveMaxLatencyDuration?t.liveMaxLatencyDuration:e?t.liveMaxLatencyDurationCount*e.targetduration:0}},{key:"targetLatency",get:function(){var t=this.levelDetails;if(null===t)return null;var e=t.holdBack,r=t.partHoldBack,i=t.targetduration,n=this.config,a=n.liveSyncDuration,s=n.liveSyncDurationCount,o=n.lowLatencyMode,l=this.hls.userConfig,u=o&&r||e;(l.liveSyncDuration||l.liveSyncDurationCount||0===u)&&(u=void 0!==a?a:s*i);var d=i;return u+Math.min(1*this.stallCount,d)}},{key:"liveSyncPosition",get:function(){var t=this.estimateLiveEdge(),e=this.targetLatency,r=this.levelDetails;if(null===t||null===e||null===r)return null;var i=r.edge,n=t-e-this.edgeStalled,a=i-r.totalduration,s=i-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(a,n),s)}},{key:"drift",get:function(){var t=this.levelDetails;return null===t?1:t.drift}},{key:"edgeStalled",get:function(){var t=this.levelDetails;if(null===t)return 0;var e=3*(this.config.lowLatencyMode&&t.partTarget||t.targetduration);return Math.max(t.age-e,0)}},{key:"forwardBufferLength",get:function(){var t=this.media,e=this.levelDetails;if(!t||!e)return 0;var r=t.buffered.length;return(r?t.buffered.end(r-1):e.edge)-this.currentTime}}])&&it(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function at(t,e){for(var r=0;rt.sn?(n=r-t.start,i=t):(n=t.start-r,i=e),i.duration!==n&&(i.duration=n)}else e.sn>t.sn?t.cc===e.cc&&t.minEndPTS?e.start=t.start+(t.minEndPTS-t.start):e.start=t.start+t.duration:e.start=Math.max(t.start-e.duration,0)}function gt(t,e,r,i,n,s){i-r<=0&&(l.logger.warn("Fragment should have a positive duration",e),i=r+e.duration,s=n+e.duration);var o=r,u=i,d=e.startPTS,h=e.endPTS;if((0,a.isFiniteNumber)(d)){var c=Math.abs(d-r);(0,a.isFiniteNumber)(e.deltaPTS)?e.deltaPTS=Math.max(c,e.deltaPTS):e.deltaPTS=c,o=Math.max(r,d),r=Math.min(r,d),n=Math.min(n,e.startDTS),u=Math.min(i,h),i=Math.max(i,h),s=Math.max(s,e.endDTS)}e.duration=i-r;var f=r-e.start;e.start=e.startPTS=r,e.maxStartPTS=o,e.startDTS=n,e.endPTS=i,e.minEndPTS=u,e.endDTS=s;var g,v=e.sn;if(!t||vt.endSN)return 0;var p=v-t.startSN,m=t.fragments;for(m[p]=e,g=p;g>0;g--)ft(m[g],m[g-1]);for(g=p;g=i.length||pt(e,i[r].start)}function pt(t,e){if(e){for(var r=t.fragments,i=t.skippedSegments;i=0&&u>e.partTarget&&(o+=1)}return new lt(s,o>=0?o:void 0,st.No)}}},e.loadPlaylist=function(t){-1===this.requestScheduled&&(this.requestScheduled=self.performance.now())},e.shouldLoadTrack=function(t){return this.canLoad&&t&&!!t.url&&(!t.details||t.details.live)},e.playlistLoaded=function(t,e,r){var i=this,n=e.details,s=e.stats,o=self.performance.now(),u=s.loading.first?Math.max(0,o-s.loading.first):0;if(n.advancedDateTime=Date.now()-u,n.live||null!=r&&r.live){if(n.reloaded(r),r&&this.log("live playlist "+t+" "+(n.advanced?"REFRESHED "+n.lastPartSn+"-"+n.lastPartIndex:"MISSED")),r&&n.fragments.length>0&&function(t,e){for(var r=null,i=t.fragments,n=i.length-1;n>=0;n--){var s=i[n].initSegment;if(s){r=s;break}}t.fragmentHint&&delete t.fragmentHint.endPTS;var o,u,d,h,c,f=0;if(function(t,e,r){for(var i=e.skippedSegments,n=Math.max(t.startSN,e.startSN)-e.startSN,a=(t.fragmentHint?1:0)+(i?e.endSN:Math.min(t.endSN,e.endSN))-e.startSN,s=e.startSN-t.startSN,o=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,l=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,u=n;u<=a;u++){var d=l[s+u],h=o[u];i&&!h&&u0){if(r&&S>r.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+r.tuneInGoal+" to: "+S+" with playlist age: "+n.age),S=0;else{var b=Math.floor(S/n.targetduration);h+=b,void 0!==c&&(c+=Math.round(S%n.targetduration/n.partTarget)),this.log("CDN Tune-in age: "+n.ageHeader+"s last advanced "+E.toFixed(2)+"s goal: "+S+" skip sn "+b+" to part "+c)}n.tuneInGoal=S}if(d=this.getDeliveryDirectives(n,e.deliveryDirectives,h,c),f||!y)return void this.loadPlaylist(d)}else d=this.getDeliveryDirectives(n,e.deliveryDirectives,h,c);var L=this.hls.mainForwardBufferInfo,A=L?L.end-L.len:0,D=function(t,e){void 0===e&&(e=1/0);var r=1e3*t.targetduration;if(t.updated){var i=t.fragments;if(i.length&&4*r>e){var n=1e3*i[i.length-1].duration;nthis.requestScheduled+D&&(this.requestScheduled=s.loading.start):this.requestScheduled=-1,void 0!==h&&n.canBlockReload?this.requestScheduled=s.loading.first+D-(1e3*n.partTarget||1e3):this.requestScheduled=(-1===this.requestScheduled?o:this.requestScheduled)+D;var k=this.requestScheduled-o;k=Math.max(0,k),this.log("reload live playlist "+t+" in "+Math.round(k)+" ms"),this.timer=self.setTimeout((function(){return i.loadPlaylist(d)}),k)}else this.clearTimer()},e.getDeliveryDirectives=function(t,e,r,i){var n=function(t,e){var r=t.canSkipUntil,i=t.canSkipDateRanges,n=t.endSN;return r&&(void 0!==e?e-n:0)-1&&null!==(e=t.context)&&void 0!==e&&e.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+t.details+'"'),this.loadPlaylist();else{var a=Math.min(Math.pow(2,this.retryCount)*i.levelLoadingRetryDelay,i.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout((function(){return r.loadPlaylist()}),a),this.warn("retry playlist loading #"+this.retryCount+" in "+a+' ms after "'+t.details+'"')}else this.warn('cannot recover from error "'+t.details+'"'),this.clearTimer(),t.fatal=!0;return n},t}();function yt(){return yt=Object.assign?Object.assign.bind():function(t){for(var e=1;e0){r=n[0].bitrate,n.sort((function(t,e){return t.attrs["HDCP-LEVEL"]!==e.attrs["HDCP-LEVEL"]?(t.attrs["HDCP-LEVEL"]||"")>(e.attrs["HDCP-LEVEL"]||"")?1:-1:t.bitrate!==e.bitrate?t.bitrate-e.bitrate:t.attrs.SCORE!==e.attrs.SCORE?t.attrs.decimalFloatingPoint("SCORE")-e.attrs.decimalFloatingPoint("SCORE"):d&&t.height!==e.height?t.height-e.height:0})),this._levels=n;for(var f=0;fthis.hls.config.fragLoadingMaxRetry&&(l=h)):l=h}break;case o.ErrorDetails.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:var f=s.attrs["HDCP-LEVEL"];f&&(this.hls.maxHdcpLevel=ot[ot.indexOf(f)-1],this.warn('Restricting playback to HDCP-LEVEL of "'+this.hls.maxHdcpLevel+'" or lower'));case o.ErrorDetails.FRAG_PARSING_ERROR:case o.ErrorDetails.KEY_SYSTEM_NO_SESSION:l=(null===(i=r.frag)||void 0===i?void 0:i.type)===V.PlaylistLevelType.MAIN?r.frag.level:this.currentLevelIndex,r.levelRetry=!1;break;case o.ErrorDetails.LEVEL_LOAD_ERROR:case o.ErrorDetails.LEVEL_LOAD_TIMEOUT:a&&(a.deliveryDirectives&&(d=!1),l=a.level),u=!0;break;case o.ErrorDetails.REMUX_ALLOC_ERROR:l=null!=(n=r.level)?n:this.currentLevelIndex,u=!0}void 0!==l&&this.recoverLevel(r,l,u,d)}}},l.recoverLevel=function(t,e,r,i){var n=t.details,a=this._levels[e];if(a.loadError++,r){if(!this.retryLoadingOrFail(t))return void(this.currentLevelIndex=-1);t.levelRetry=!0}if(i){var s=a.url.length;if(s>1&&a.loadError-1&&this.currentLevelIndex!==o?(this.warn(n+": switch to "+o),t.levelRetry=!0,this.hls.nextAutoLevel=o):!1===t.levelRetry&&(t.fatal=!0)}}},l.redundantFailover=function(t){var e=this._levels[t],r=e.url.length;if(r>1){var i=(e.urlId+1)%r;this.warn("Switching to redundant URL-id "+i),this._levels.forEach((function(t){t.urlId=i})),this.level=t}},l.onFragLoaded=function(t,e){var r=e.frag;if(void 0!==r&&r.type===V.PlaylistLevelType.MAIN){var i=this._levels[r.level];void 0!==i&&(i.fragmentError=0,i.loadError=0)}},l.onLevelLoaded=function(t,e){var r,i,n=e.level,a=e.details,s=this._levels[n];if(!s)return this.warn("Invalid level index "+n),void(null!==(i=e.deliveryDirectives)&&void 0!==i&&i.skip&&(a.deltaUpdateFailed=!0));n===this.currentLevelIndex?(0===s.fragmentError&&(s.loadError=0,this.retryCount=0),this.playlistLoaded(n,e,s.details)):null!==(r=e.deliveryDirectives)&&void 0!==r&&r.skip&&(a.deltaUpdateFailed=!0)},l.onAudioTrackSwitched=function(t,e){var r=this.hls.levels[this.currentLevelIndex];if(r&&r.audioGroupIds){for(var i=-1,n=this.hls.audioTracks[e.id].groupId,a=0;a0){var n=i.urlId,a=i.url[n];if(e)try{a=e.addDirectives(a)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}this.log("Attempt loading level index "+r+(void 0!==(null==e?void 0:e.msn)?" at sn "+e.msn+" part "+e.part:"")+" with URL-id "+n+" "+a),this.clearTimer(),this.hls.trigger(s.Events.LEVEL_LOADING,{url:a,level:r,id:n,deliveryDirectives:e||null})}},l.removeLevel=function(t,e){var r=function(t,r){return r!==e},i=this._levels.filter((function(i,n){return n!==t||i.url.length>1&&void 0!==e&&(i.url=i.url.filter(r),i.audioGroupIds&&(i.audioGroupIds=i.audioGroupIds.filter(r)),i.textGroupIds&&(i.textGroupIds=i.textGroupIds.filter(r)),i.urlId=0,!0)})).map((function(t,e){var r=t.details;return null!=r&&r.fragments&&r.fragments.forEach((function(t){t.level=e})),t}));this._levels=i,this.hls.trigger(s.Events.LEVELS_UPDATED,{levels:i})},n=i,(a=[{key:"levels",get:function(){return 0===this._levels.length?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(t){var e,r=this._levels;if(0!==r.length&&(this.currentLevelIndex!==t||null===(e=r[t])||void 0===e||!e.details)){if(t<0||t>=r.length){var i=t<0;if(this.hls.trigger(s.Events.ERROR,{type:o.ErrorTypes.OTHER_ERROR,details:o.ErrorDetails.LEVEL_SWITCH_ERROR,level:t,fatal:i,reason:"invalid level idx"}),i)return;t=Math.min(t,r.length-1)}this.clearTimer();var n=this.currentLevelIndex,a=r[n],l=r[t];this.log("switching to level "+t+" from "+n),this.currentLevelIndex=t;var u=yt({},l,{level:t,maxBitrate:l.maxBitrate,uri:l.uri,urlId:l.urlId});delete u._urlId,this.hls.trigger(s.Events.LEVEL_SWITCHING,u);var d=l.details;if(!d||d.live){var h=this.switchParams(l.uri,null==a?void 0:a.details);this.loadPlaylist(h)}}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(t){this.manualLevelIndex=t,void 0===this._startLevel&&(this._startLevel=t),-1!==t&&(this.level=t)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(t){this._firstLevel=t}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var t=this.hls.config.startLevel;return void 0!==t?t:this._firstLevel}return this._startLevel},set:function(t){this._startLevel=t}},{key:"nextLoadLevel",get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(t){this.level=t,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=t)}}])&&Et(n.prototype,a),Object.defineProperty(n,"prototype",{writable:!1}),i}(mt);!function(t){t.NOT_LOADED="NOT_LOADED",t.APPENDING="APPENDING",t.PARTIAL="PARTIAL",t.OK="OK"}(St||(St={}));var At=function(){function t(t){this.activeFragment=null,this.activeParts=null,this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=t,this._registerListeners()}var e=t.prototype;return e._registerListeners=function(){var t=this.hls;t.on(s.Events.BUFFER_APPENDED,this.onBufferAppended,this),t.on(s.Events.FRAG_BUFFERED,this.onFragBuffered,this),t.on(s.Events.FRAG_LOADED,this.onFragLoaded,this)},e._unregisterListeners=function(){var t=this.hls;t.off(s.Events.BUFFER_APPENDED,this.onBufferAppended,this),t.off(s.Events.FRAG_BUFFERED,this.onFragBuffered,this),t.off(s.Events.FRAG_LOADED,this.onFragLoaded,this)},e.destroy=function(){this._unregisterListeners(),this.fragments=this.endListFragments=this.timeRanges=this.activeFragment=this.activeParts=null},e.getAppendedFrag=function(t,e){if(e===V.PlaylistLevelType.MAIN){var r=this.activeFragment,i=this.activeParts;if(!r)return null;if(i)for(var n=i.length;n--;){var a=i[n],s=a?a.end:r.appendedPTS;if(a.start<=t&&void 0!==s&&t<=s)return n>9&&(this.activeParts=i.slice(n-9)),a}else if(r.start<=t&&void 0!==r.appendedPTS&&t<=r.appendedPTS)return r}return this.getBufferedFrag(t,e)},e.getBufferedFrag=function(t,e){for(var r=this.fragments,i=Object.keys(r),n=i.length;n--;){var a=r[i[n]];if((null==a?void 0:a.body.type)===e&&a.buffered){var s=a.body;if(s.start<=t&&t<=s.end)return s}}return null},e.detectEvictedFragments=function(t,e,r){var i=this;this.timeRanges&&(this.timeRanges[t]=e),Object.keys(this.fragments).forEach((function(n){var a=i.fragments[n];if(a)if(a.buffered||a.loaded){var s=a.range[t];s&&s.time.some((function(t){var r=!i.isTimeBuffered(t.startPTS,t.endPTS,e);return r&&i.removeFragment(a.body),r}))}else a.body.type===r&&i.removeFragment(a.body)}))},e.detectPartialFragments=function(t){var e=this,r=this.timeRanges,i=t.frag,n=t.part;if(r&&"initSegment"!==i.sn){var a=kt(i),s=this.fragments[a];s&&(Object.keys(r).forEach((function(t){var a=i.elementaryStreams[t];if(a){var o=r[t],l=null!==n||!0===a.partial;s.range[t]=e.getBufferedTimes(i,n,l,o)}})),s.loaded=null,Object.keys(s.range).length?(s.buffered=!0,s.body.endList&&(this.endListFragments[s.body.type]=s)):this.removeFragment(s.body))}},e.fragBuffered=function(t){var e=kt(t),r=this.fragments[e];r&&(r.loaded=null,r.buffered=!0)},e.getBufferedTimes=function(t,e,r,i){for(var n={time:[],partial:r},a=e?e.start:t.start,s=e?e.end:t.end,o=t.minEndPTS||s,l=t.maxStartPTS||a,u=0;u=d&&o<=h){n.time.push({startPTS:Math.max(a,i.start(u)),endPTS:Math.min(s,i.end(u))});break}if(ad)n.partial=!0,n.time.push({startPTS:Math.max(a,i.start(u)),endPTS:Math.min(s,i.end(u))});else if(s<=d)break}return n},e.getPartialFragment=function(t){var e,r,i,n=null,a=0,s=this.bufferPadding,o=this.fragments;return Object.keys(o).forEach((function(l){var u=o[l];u&&Dt(u)&&(r=u.body.start-s,i=u.body.end+s,t>=r&&t<=i&&(e=Math.min(t-r,i-t),a<=e&&(n=u.body,a=e)))})),n},e.isEndListAppended=function(t){var e=this.endListFragments[t];return void 0!==e&&(e.buffered||Dt(e))},e.getState=function(t){var e=kt(t),r=this.fragments[e];return r?r.buffered?Dt(r)?St.PARTIAL:St.OK:St.APPENDING:St.NOT_LOADED},e.isTimeBuffered=function(t,e,r){for(var i,n,a=0;a=i&&e<=n)return!0;if(e<=i)return!1}return!1},e.onFragLoaded=function(t,e){var r=e.frag,i=e.part;if("initSegment"!==r.sn&&!r.bitrateTest&&!i){var n=kt(r);this.fragments[n]={body:r,loaded:e,buffered:!1,range:Object.create(null)}}},e.onBufferAppended=function(t,e){var r=this,i=e.frag,n=e.part,a=e.timeRanges;if(i.type===V.PlaylistLevelType.MAIN)if(this.activeFragment!==i&&(this.activeFragment=i,i.appendedPTS=void 0),n){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(n)}else this.activeParts=null;this.timeRanges=a,Object.keys(a).forEach((function(t){var e=a[t];if(r.detectEvictedFragments(t,e),!n&&i.type===V.PlaylistLevelType.MAIN){var s=i.elementaryStreams[t];if(!s)return;for(var o=0;os.startPTS?i.appendedPTS=Math.max(l,i.appendedPTS||0):i.appendedPTS=s.endPTS}}}))},e.onFragBuffered=function(t,e){this.detectPartialFragments(e)},e.hasFragment=function(t){var e=kt(t);return!!this.fragments[e]},e.removeFragmentsInRange=function(t,e,r){var i=this;Object.keys(this.fragments).forEach((function(n){var a=i.fragments[n];if(a&&a.buffered){var s=a.body;s.type===r&&s.startt&&i.removeFragment(s)}}))},e.removeFragment=function(t){var e=kt(t);t.stats.loaded=0,t.clearElementaryStreamInfo(),t.appendedPTS=void 0,delete this.fragments[e],t.endList&&delete this.endListFragments[t.type]},e.removeAllFragments=function(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activeFragment=null,this.activeParts=null},t}();function Dt(t){var e,r;return t.buffered&&((null===(e=t.range.video)||void 0===e?void 0:e.partial)||(null===(r=t.range.audio)||void 0===r?void 0:r.partial))}function kt(t){return t.type+"_"+t.level+"_"+t.urlId+"_"+t.sn}function Rt(t){var e="function"==typeof Map?new Map:void 0;return Rt=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,i)}function i(){return It(t,arguments,_t(this).constructor)}return i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ct(i,t)},Rt(t)}function It(t,e,r){return It=wt()?Reflect.construct.bind():function(t,e,r){var i=[null];i.push.apply(i,e);var n=new(Function.bind.apply(t,i));return r&&Ct(n,r.prototype),n},It.apply(null,arguments)}function wt(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function Ct(t,e){return Ct=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ct(t,e)}function _t(t){return _t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_t(t)}var Pt=Math.pow(2,17),Ot=function(){function t(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}var e=t.prototype;return e.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},e.abort=function(){this.loader&&this.loader.abort()},e.load=function(t,e){var r=this,i=t.url;if(!i)return Promise.reject(new Ft({type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,networkDetails:null},"Fragment does not have a "+(i?"part list":"url")));this.abort();var n=this.config,a=n.fLoader,s=n.loader;return new Promise((function(i,l){r.loader&&r.loader.destroy();var u=r.loader=t.loader=a?new a(n):new s(n),d=xt(t),h={timeout:n.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:n.fragLoadingMaxRetryTimeout,highWaterMark:"initSegment"===t.sn?1/0:Pt};t.stats=u.stats,u.load(d,h,{onSuccess:function(e,n,a,s){r.resetLoader(t,u);var o=e.data;a.resetIV&&t.decryptdata&&(t.decryptdata.iv=new Uint8Array(o.slice(0,16)),o=o.slice(16)),i({frag:t,part:null,payload:o,networkDetails:s})},onError:function(e,i,n){r.resetLoader(t,u),l(new Ft({type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:e,networkDetails:n}))},onAbort:function(e,i,n){r.resetLoader(t,u),l(new Ft({type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,networkDetails:n}))},onTimeout:function(e,i,n){r.resetLoader(t,u),l(new Ft({type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,networkDetails:n}))},onProgress:function(r,i,n,a){e&&e({frag:t,part:null,payload:n,networkDetails:a})}})}))},e.loadPart=function(t,e,r){var i=this;this.abort();var n=this.config,a=n.fLoader,s=n.loader;return new Promise((function(l,u){i.loader&&i.loader.destroy();var d=i.loader=t.loader=a?new a(n):new s(n),h=xt(t,e),c={timeout:n.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:n.fragLoadingMaxRetryTimeout,highWaterMark:Pt};e.stats=d.stats,d.load(h,c,{onSuccess:function(n,a,s,o){i.resetLoader(t,d),i.updateStatsFromPart(t,e);var u={frag:t,part:e,payload:n.data,networkDetails:o};r(u),l(u)},onError:function(r,n,a){i.resetLoader(t,d),u(new Ft({type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:e,response:r,networkDetails:a}))},onAbort:function(r,n,a){t.stats.aborted=e.stats.aborted,i.resetLoader(t,d),u(new Ft({type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,part:e,networkDetails:a}))},onTimeout:function(r,n,a){i.resetLoader(t,d),u(new Ft({type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:e,networkDetails:a}))}})}))},e.updateStatsFromPart=function(t,e){var r=t.stats,i=e.stats,n=i.total;if(r.loaded+=i.loaded,n){var a=Math.round(t.duration/e.duration),s=Math.min(Math.round(r.loaded/n),a),o=(a-s)*Math.round(r.loaded/s);r.total=r.loaded+o}else r.total=Math.max(r.loaded,r.total);var l=r.loading,u=i.loading;l.start?l.first+=u.first-u.start:(l.start=u.start,l.first=u.first),l.end=u.end},e.resetLoader=function(t,e){t.loader=null,this.loader===e&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),e.destroy()},t}();function xt(t,e){void 0===e&&(e=null);var r=e||t,i={frag:t,part:e,responseType:"arraybuffer",url:r.url,headers:{},rangeStart:0,rangeEnd:0},n=r.byteRangeStartOffset,s=r.byteRangeEndOffset;if((0,a.isFiniteNumber)(n)&&(0,a.isFiniteNumber)(s)){var o,l=n,u=s;if("initSegment"===t.sn&&"AES-128"===(null===(o=t.decryptdata)||void 0===o?void 0:o.method)){var d=s-n;d%16&&(u=s+(16-d%16)),0!==n&&(i.resetIV=!0,l=n-16)}i.rangeStart=l,i.rangeEnd=u}return i}var Ft=function(t){var e,r;function i(e){for(var r,i=arguments.length,n=new Array(i>1?i-1:0),a=1;a1&&this.tickImmediate(),this._tickCallCount=0)},e.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},e.doTick=function(){},t}(),Ut={length:0,start:function(){return 0},end:function(){return 0}},Bt=function(){function t(){}return t.isBuffered=function(e,r){try{if(e)for(var i=t.getBuffered(e),n=0;n=i.start(n)&&r<=i.end(n))return!0}catch(t){}return!1},t.bufferInfo=function(e,r,i){try{if(e){var n,a=t.getBuffered(e),s=[];for(n=0;ns&&(i[a-1].end=t[n].end):i.push(t[n])}else i.push(t[n])}else i=t;for(var o,l=0,u=e,d=e,h=0;h=c&&e0)r=n+1;else{if(!(s<0))return a;i=n-1}}return null};function Wt(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=null;if(t?n=e[t.sn-e[0].sn+1]||null:0===r&&0===e[0].start&&(n=e[0]),n&&0===qt(r,i,n))return n;var a=Yt(e,qt.bind(null,r,i));return!a||a===t&&n?n:a}function qt(t,e,r){if(void 0===t&&(t=0),void 0===e&&(e=0),r.start<=t&&r.start+r.duration>t)return 0;var i=Math.min(e,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.start+r.duration-i<=t?1:r.start-i>t&&r.start?-1:0}function Xt(t,e,r){var i=1e3*Math.min(e,r.duration+(r.deltaPTS?r.deltaPTS:0));return(r.endProgramDateTime||0)-i>t}var zt=r(21);const Qt=function(t){for(var e="",r=t.length,i=0;io.end){var h=s>d;(s0&&a&&a.key&&a.iv&&"AES-128"===a.method){var o=self.performance.now();return r.decrypter.decrypt(new Uint8Array(n),a.key.buffer,a.iv.buffer).then((function(r){var n=self.performance.now();return i.trigger(s.Events.FRAG_DECRYPTED,{frag:t,payload:r,stats:{tstart:o,tdecrypt:n}}),e.payload=r,e}))}return e})).then((function(e){var i=r.fragCurrent,n=r.hls,a=r.levels;if(!a)throw new Error("init load aborted, missing levels");a[t.level].details;var o=t.stats;r.state=te,r.fragLoadError=0,t.data=new Uint8Array(e.payload),o.parsing.start=o.buffering.start=self.performance.now(),o.parsing.end=o.buffering.end=self.performance.now(),e.frag===i&&n.trigger(s.Events.FRAG_BUFFERED,{stats:o,frag:i,part:null,id:t.type}),r.tick()})).catch((function(e){r.state!==Zt&&r.state!==le&&(r.warn(e),r.resetFragmentLoading(t))}))},d.fragContextChanged=function(t){var e=this.fragCurrent;return!t||!e||t.level!==e.level||t.sn!==e.sn||t.urlId!==e.urlId},d.fragBufferedComplete=function(t,e){var r,i,n,a,s=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+t.type+" sn: "+t.sn+(e?" part: "+e.index:"")+" of "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+t.level+" (frag:["+(null!=(r=t.startPTS)?r:NaN).toFixed(3)+"-"+(null!=(i=t.endPTS)?i:NaN).toFixed(3)+"] > buffer:"+(s?Qt(Bt.getBuffered(s)):"(detached)")+")"),this.state=te,s&&(!this.loadedmetadata&&t.type==V.PlaylistLevelType.MAIN&&s.buffered.length&&(null===(n=this.fragCurrent)||void 0===n?void 0:n.sn)===(null===(a=this.fragPrevious)||void 0===a?void 0:a.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())},d.seekToStartPos=function(){},d._handleFragmentLoadComplete=function(t){var e=this.transmuxer;if(e){var r=t.frag,i=t.part,n=t.partsLoaded,a=!n||0===n.length||n.some((function(t){return!t})),s=new Gt(r.level,r.sn,r.stats.chunkCount+1,0,i?i.index:-1,!a);e.flush(s)}},d._handleFragmentLoadProgress=function(t){},d._doFragLoad=function(t,e,r,i){var n,o=this;if(void 0===r&&(r=null),!this.levels)throw new Error("frag load aborted, missing levels");var l=null;if(!t.encrypted||null!==(n=t.decryptdata)&&void 0!==n&&n.key?!t.encrypted&&e.encryptedFragments.length&&this.keyLoader.loadClear(t,e.encryptedFragments):(this.log("Loading key for "+t.sn+" of ["+e.startSN+"-"+e.endSN+"], "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+t.level),this.state=ee,this.fragCurrent=t,l=this.keyLoader.load(t).then((function(t){if(!o.fragContextChanged(t.frag))return o.hls.trigger(s.Events.KEY_LOADED,t),o.state===ee&&(o.state=te),t})),this.hls.trigger(s.Events.KEY_LOADING,{frag:t}),this.throwIfFragContextChanged("KEY_LOADING")),r=Math.max(t.start,r||0),this.config.lowLatencyMode&&e){var u=e.partList;if(u&&i){r>t.end&&e.fragmentHint&&(t=e.fragmentHint);var d=this.getNextPart(u,t,r);if(d>-1){var h=u[d];return this.log("Loading part sn: "+t.sn+" p: "+h.index+" cc: "+t.cc+" of playlist ["+e.startSN+"-"+e.endSN+"] parts [0-"+d+"-"+(u.length-1)+"] "+("[stream-controller]"===this.logPrefix?"level":"track")+": "+t.level+", target: "+parseFloat(r.toFixed(3))),this.nextLoadPosition=h.start+h.duration,this.state=re,this.hls.trigger(s.Events.FRAG_LOADING,{frag:t,part:u[d],targetBufferTime:r}),this.throwIfFragContextChanged("FRAG_LOADING parts"),l?l.then((function(e){return!e||o.fragContextChanged(e.frag)?null:o.doFragPartsLoad(t,u,d,i)})).catch((function(t){return o.handleFragLoadError(t)})):this.doFragPartsLoad(t,u,d,i).catch((function(t){return o.handleFragLoadError(t)}))}if(!t.url||this.loadedEndOfParts(u,r))return Promise.resolve(null)}}this.log("Loading fragment "+t.sn+" cc: "+t.cc+" "+(e?"of ["+e.startSN+"-"+e.endSN+"] ":"")+("[stream-controller]"===this.logPrefix?"level":"track")+": "+t.level+", target: "+parseFloat(r.toFixed(3))),(0,a.isFiniteNumber)(t.sn)&&!this.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),this.state=re,this.hls.trigger(s.Events.FRAG_LOADING,{frag:t,targetBufferTime:r}),this.throwIfFragContextChanged("FRAG_LOADING");var c=this.config.progressive;return c&&l?l.then((function(e){return!e||o.fragContextChanged(null==e?void 0:e.frag)?null:o.fragmentLoader.load(t,i)})).catch((function(t){return o.handleFragLoadError(t)})):Promise.all([this.fragmentLoader.load(t,c?i:void 0),l]).then((function(t){var e=t[0];return!c&&e&&i&&i(e),e})).catch((function(t){return o.handleFragLoadError(t)}))},d.throwIfFragContextChanged=function(t){if(null===this.fragCurrent)throw new Error("frag load aborted, context changed in "+t)},d.doFragPartsLoad=function(t,e,r,i){var n=this;return new Promise((function(a,o){var l=[];!function r(u){var d=e[u];n.fragmentLoader.loadPart(t,d,i).then((function(i){l[d.index]=i;var o=i.part;n.hls.trigger(s.Events.FRAG_LOADED,i);var h=e[u+1];if(!h||h.fragment!==t)return a({frag:t,part:o,partsLoaded:l});r(u+1)})).catch(o)}(r)}))},d.handleFragLoadError=function(t){if("data"in t){var e=t.data;t.data&&e.details===o.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(e.frag,e.part):this.hls.trigger(s.Events.ERROR,e)}else this.hls.trigger(s.Events.ERROR,{type:o.ErrorTypes.OTHER_ERROR,details:o.ErrorDetails.INTERNAL_EXCEPTION,err:t,fatal:!0});return null},d._handleTransmuxerFlush=function(t){var e=this.getCurrentContext(t);if(e&&this.state===ae){var r=e.frag,i=e.part,n=e.level,a=self.performance.now();r.stats.parsing.end=a,i&&(i.stats.parsing.end=a),this.updateLevelTiming(r,i,n,t.partial)}else this.fragCurrent||this.state===Zt||this.state===le||(this.state=te)},d.getCurrentContext=function(t){var e=this.levels,r=t.level,i=t.sn,n=t.part;if(!e||!e[r])return this.warn("Levels object was unset while buffering fragment "+i+" of level "+r+". The current chunk will not be buffered."),null;var a=e[r],s=n>-1?function(t,e,r){if(!t||!t.details)return null;var i=t.details.partList;if(i)for(var n=i.length;n--;){var a=i[n];if(a.index===r&&a.fragment.sn===e)return a}return null}(a,i,n):null,o=s?s.fragment:function(t,e,r){if(!t||!t.details)return null;var i=t.details,n=i.fragments[e-i.startSN];return n||((n=i.fragmentHint)&&n.sn===e?n:ea&&this.flushMainBuffer(s,t.start)}else this.flushMainBuffer(0,t.start)},d.getFwdBufferInfo=function(t,e){var r=this.config,i=this.getLoadPosition();if(!(0,a.isFiniteNumber)(i))return null;var n=Bt.bufferInfo(t,i,r.maxBufferHole);if(0===n.len&&void 0!==n.nextStart){var s=this.fragmentTracker.getBufferedFrag(i,e);if(s&&n.nextStart=r&&(e.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+e.maxMaxBufferLength+"s"),!0)},d.getNextFragment=function(t,e){var r=e.fragments,i=r.length;if(!i)return null;var n,a=this.config,s=r[0].start;if(e.live){var o=a.initialLiveManifestSize;if(i-1&&rr.start&&r.loaded},d.getInitialLiveFragment=function(t,e){var r=this.fragPrevious,i=null;if(r){if(t.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+r.programDateTime),i=function(t,e,r){if(null===e||!Array.isArray(t)||!t.length||!(0,a.isFiniteNumber)(e))return null;if(e<(t[0].programDateTime||0))return null;if(e>=(t[t.length-1].endProgramDateTime||0))return null;r=r||0;for(var i=0;i=t.startSN&&n<=t.endSN){var s=e[n-t.startSN];r.cc===s.cc&&(i=s,this.log("Live playlist, switching playlist, load frag with next SN: "+i.sn))}i||(i=function(t,e){return Yt(t,(function(t){return t.cce?-1:0}))}(e,r.cc),i&&this.log("Live playlist, switching playlist, load frag with same CC: "+i.sn))}}else{var o=this.hls.liveSyncPosition;null!==o&&(i=this.getFragmentAtPosition(o,this.bitrateTest?t.fragmentEnd:t.edge,t))}return i},d.getFragmentAtPosition=function(t,e,r){var i,n=this.config,a=this.fragPrevious,s=r.fragments,o=r.endSN,l=r.fragmentHint,u=n.maxFragLookUpTolerance,d=!!(n.lowLatencyMode&&r.partList&&l);if(d&&l&&!this.bitrateTest&&(s=s.concat(l),o=l.sn),i=te-u?0:u):s[s.length-1]){var h=i.sn-r.startSN;if(this.fragmentTracker.getState(i)===St.OK&&(a=i),a&&i.sn===a.sn&&!d&&a&&i.level===a.level){var c=s[h+1];i.sn=a-e.maxFragLookUpTolerance&&n<=s;if(null!==i&&r.duration>i&&(nr.startCC||t&&t.cc"+t.startSN+" prev-sn: "+(n?n.sn:"na")+" fragments: "+o),c}return u},d.waitForCdnTuneIn=function(t){return t.live&&t.canBlockReload&&t.partTarget&&t.tuneInGoal>Math.max(t.partHoldBack,3*t.partTarget)},d.setStartPosition=function(t,e){var r=this.startPosition;if(r"+t))}}])&&$t(n.prototype,u),Object.defineProperty(n,"prototype",{writable:!1}),i}(Nt);function ce(){return self.MediaSource||self.WebKitMediaSource}function fe(){return self.SourceBuffer||self.WebKitSourceBuffer}var ge=function(){var t=ENTRY_MODULE,e={},r=function r(i){var n=e[i];if(void 0!==n)return n.exports;var a=e[i]={exports:{}};return t[i].call(a.exports,a,a.exports,r),a.exports};r.m=t,r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i=r(ENTRY_MODULE);return i.default||i}.toString().split("ENTRY_MODULE"),ve="\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)";function pe(t){return(t+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function me(t,e,i){var n={};n[i]=[];var a=e.toString().replace(/^"[^"]+"/,"function"),s=a.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/)||a.match(/^\(\w+,\s*\w+,\s*(\w+)\)\s?\=\s?\>/);if(!s)return n;for(var o,l=s[1],u=new RegExp("(\\\\n|\\W)"+pe(l)+ve,"g");o=u.exec(a);)"dll-reference"!==o[3]&&n[i].push(o[3]);for(u=new RegExp("\\("+pe(l)+'\\("(dll-reference\\s([\\.|\\-|\\+|\\w|/|@]+))"\\)\\)'+ve,"g");o=u.exec(a);)t[o[2]]||(n[i].push(o[1]),t[o[2]]=r(o[1]).m),n[o[2]]=n[o[2]]||[],n[o[2]].push(o[4]);for(var d,h=Object.keys(n),c=0;c0}),!1)}function Ee(t,e,r,i){var n=t[i].map((function(t){return'"'+t+'": '+e[i][t].toString().replace(/^"[^"]+"/,"function")})).join(",");return ge[0]+"{"+n+"}"+ge[1]+'"'+r+'"'+ge[2]}var Te=r(544),Se=r(729),be=r.n(Se),Le=ce()||{isTypeSupported:function(){return!1}},Ae=function(){function t(t,e,i,n){var a=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;var u=t.config;this.hls=t,this.id=e,this.useWorker=!!u.enableWorker,this.onTransmuxComplete=i,this.onFlush=n;var d=function(t,e){(e=e||{}).frag=a.frag,e.id=a.id,a.hls.trigger(t,e)};this.observer=new Se.EventEmitter,this.observer.on(s.Events.FRAG_DECRYPTED,d),this.observer.on(s.Events.ERROR,d);var h={mp4:Le.isTypeSupported("video/mp4"),mpeg:Le.isTypeSupported("audio/mpeg"),mp3:Le.isTypeSupported('audio/mp4; codecs="mp3"')},c=navigator.vendor;if(this.useWorker&&"undefined"!=typeof Worker){var f;l.logger.log("demuxing in webworker");try{f=this.worker=function(t,e){e=e||{};var i={main:r.m},n=e.all?{main:Object.keys(i.main)}:function(t,e){for(var r={main:[e]},i={main:[]},n={main:{}};ye(r);)for(var a=Object.keys(r),s=0;s1&&u.id===(null==y?void 0:y.stats.chunkCount),A=!T&&(1===S||0===S&&(1===b||L&&b<=0)),D=self.performance.now();(T||S||0===n.stats.parsing.start)&&(n.stats.parsing.start=D),!a||!b&&A||(a.stats.parsing.start=D);var k=!(y&&(null===(h=n.initSegment)||void 0===h?void 0:h.url)===(null===(c=y.initSegment)||void 0===c?void 0:c.url)),R=new Te.TransmuxState(E,A,o,T,p,k);if(!A||E||k){l.logger.log("[transmuxer-interface, "+n.type+"]: Starting new transmux session for sn: "+u.sn+" p: "+u.part+" level: "+u.level+" id: "+u.id+"\n discontinuity: "+E+"\n trackSwitch: "+T+"\n contiguous: "+A+"\n accurateTimeOffset: "+o+"\n timeOffset: "+p+"\n initSegmentChange: "+k);var I=new Te.TransmuxConfig(r,i,e,s,d);this.configureTransmuxer(I)}if(this.frag=n,this.part=a,v)v.postMessage({cmd:"demux",data:t,decryptdata:m,chunkMeta:u,state:R},t instanceof ArrayBuffer?[t]:[]);else if(g){var w=g.push(t,m,u,R);(0,Te.isPromise)(w)?(g.async=!0,w.then((function(t){f.handleTransmuxComplete(t)})).catch((function(t){f.transmuxerError(t,u,"transmuxer-interface push error")}))):(g.async=!1,this.handleTransmuxComplete(w))}},e.flush=function(t){var e=this;t.transmuxing.start=self.performance.now();var r=this.transmuxer,i=this.worker;if(i)i.postMessage({cmd:"flush",chunkMeta:t});else if(r){var n=r.flush(t);(0,Te.isPromise)(n)||r.async?((0,Te.isPromise)(n)||(n=Promise.resolve(n)),n.then((function(r){e.handleFlushResult(r,t)})).catch((function(r){e.transmuxerError(r,t,"transmuxer-interface flush error")}))):this.handleFlushResult(n,t)}},e.transmuxerError=function(t,e,r){this.hls&&this.hls.trigger(s.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:e,fatal:!1,error:t,err:t,reason:r})},e.handleFlushResult=function(t,e){var r=this;t.forEach((function(t){r.handleTransmuxComplete(t)})),this.onFlush(e)},e.onWorkerMessage=function(t){var e=t.data,r=this.hls;switch(e.event){case"init":self.URL.revokeObjectURL(this.worker.objectURL);break;case"transmuxComplete":this.handleTransmuxComplete(e.data);break;case"flush":this.onFlush(e.data);break;case"workerLog":l.logger[e.data.logType]&&l.logger[e.data.logType](e.data.message);break;default:e.data=e.data||{},e.data.frag=this.frag,e.data.id=this.id,r.trigger(e.event,e.data)}},e.configureTransmuxer=function(t){var e=this.worker,r=this.transmuxer;e?e.postMessage({cmd:"configure",config:t}):r&&r.configure(t)},e.handleTransmuxComplete=function(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)},t}(),De=function(){function t(t,e,r,i){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=t,this.media=e,this.fragmentTracker=r,this.hls=i}var e=t.prototype;return e.destroy=function(){this.media=null,this.hls=this.fragmentTracker=null},e.poll=function(t,e){var r=this.config,i=this.media,n=this.stalled;if(null!==i){var a=i.currentTime,s=i.seeking,o=this.seeking&&!s,u=!this.seeking&&s;if(this.seeking=s,a===t){if((u||o)&&(this.stalled=null),!(i.paused&&!s||i.ended||0===i.playbackRate)&&Bt.getBuffered(i).length){var d=Bt.bufferInfo(i,a,0),h=d.len>0,c=d.nextStart||0;if(h||c){if(s){var f=d.len>2,g=!c||e&&e.start<=a||c-a>2&&!this.fragmentTracker.getPartialFragment(a);if(f||g)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var v,p=Math.max(c,d.start||0)-a,m=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,y=(null==m||null===(v=m.details)||void 0===v?void 0:v.live)?2*m.details.targetduration:2;if(p>0&&p<=y)return void this._trySkipBufferHole(null)}var E=self.performance.now();if(null!==n){var T=E-n;if(s||!(T>=250)||(this._reportStall(d),this.media)){var S=Bt.bufferInfo(i,a,r.maxBufferHole);this._tryFixBufferStall(S,T)}}else this.stalled=E}}}else if(this.moved=!0,null!==n){if(this.stallReported){var b=self.performance.now()-n;l.logger.warn("playback not stuck anymore @"+a+", after "+Math.round(b)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}}},e._tryFixBufferStall=function(t,e){var r=this.config,i=this.fragmentTracker,n=this.media;if(null!==n){var a=n.currentTime,s=i.getPartialFragment(a);if(s&&(this._trySkipBufferHole(s)||!this.media))return;t.len>r.maxBufferHole&&e>1e3*r.highBufferWatchdogPeriod&&(l.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}},e._reportStall=function(t){var e=this.hls,r=this.media;!this.stallReported&&r&&(this.stallReported=!0,l.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer ("+JSON.stringify(t)+")"),e.trigger(s.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:t.len}))},e._trySkipBufferHole=function(t){var e=this.config,r=this.hls,i=this.media;if(null===i)return 0;for(var n=i.currentTime,a=0,u=Bt.getBuffered(i),d=0;d=a&&n1?(i=0,this.bitrateTest=!0):i=r.nextAutoLevel),this.level=r.nextLoadLevel=i,this.loadedmetadata=!1}e>0&&-1===t&&(this.log("Override startPosition with lastCurrentTime @"+e.toFixed(3)),t=e),this.state=te,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this._forceStartLoad=!0,this.state=Zt},u.stopLoad=function(){this._forceStartLoad=!1,t.prototype.stopLoad.call(this)},u.doTick=function(){switch(this.state){case te:this.doTickIdle();break;case de:var t,e=this.levels,r=this.level,i=null==e||null===(t=e[r])||void 0===t?void 0:t.details;if(i&&(!i.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(i))break;this.state=te;break}break;case ie:var n,a=self.performance.now(),s=this.retryDate;(!s||a>=s||null!==(n=this.media)&&void 0!==n&&n.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.level),this.state=te)}this.onTickEnd()},u.onTickEnd=function(){t.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},u.doTickIdle=function(){var t=this.hls,e=this.levelLastLoaded,r=this.levels,i=this.media,n=t.config,a=t.nextLoadLevel;if(null!==e&&(i||!this.startFragRequested&&n.startFragPrefetch)&&(!this.altAudio||!this.audioOnly)&&r&&r[a]){var o=r[a],l=this.getMainFwdBufferInfo();if(null!==l){var u=this.getLevelDetails();if(u&&this._streamEnded(l,u)){var d={};return this.altAudio&&(d.type="video"),this.hls.trigger(s.Events.BUFFER_EOS,d),void(this.state=oe)}this.level=t.nextLoadLevel=a;var h=o.details;if(!h||this.state===de||h.live&&this.levelLastLoaded!==a)return this.level=a,void(this.state=de);if(!(l.len>=this.getMaxBufferLength(o.maxBitrate))){this.backtrackFragment&&this.backtrackFragment.start>l.end&&(this.backtrackFragment=null);var c=this.backtrackFragment?this.backtrackFragment.start:l.end,f=this.getNextFragment(c,h);if(this.couldBacktrack&&!this.fragPrevious&&f&&"initSegment"!==f.sn&&this.fragmentTracker.getState(f)!==St.OK){var g,p=(null!=(g=this.backtrackFragment)?g:f).sn-h.startSN,m=h.fragments[p-1];m&&f.cc===m.cc&&(f=m,this.fragmentTracker.removeFragment(m))}else this.backtrackFragment&&l.len&&(this.backtrackFragment=null);if(f&&this.fragmentTracker.getState(f)===St.OK&&this.nextLoadPosition>c){var y=this.audioOnly&&!this.altAudio?v.ElementaryStreamTypes.AUDIO:v.ElementaryStreamTypes.VIDEO,E=(y===v.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;E&&this.afterBufferFlushed(E,y,V.PlaylistLevelType.MAIN),f=this.getNextFragment(this.nextLoadPosition,h)}f&&(!f.initSegment||f.initSegment.data||this.bitrateTest||(f=f.initSegment),this.loadFragment(f,h,c))}}}},u.loadFragment=function(e,r,i){var n,a=this.fragmentTracker.getState(e);this.fragCurrent=e,a===St.NOT_LOADED?"initSegment"===e.sn?this._loadInitSegment(e,r):this.bitrateTest?(this.log("Fragment "+e.sn+" of level "+e.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(e,r)):(this.startFragRequested=!0,t.prototype.loadFragment.call(this,e,r,i)):a===St.APPENDING?this.reduceMaxBufferLength(e.duration)&&this.fragmentTracker.removeFragment(e):0===(null===(n=this.media)||void 0===n?void 0:n.buffered.length)&&this.fragmentTracker.removeAllFragments()},u.getAppendedFrag=function(t){var e=this.fragmentTracker.getAppendedFrag(t,V.PlaylistLevelType.MAIN);return e&&"fragment"in e?e.fragment:e},u.getBufferedFrag=function(t){return this.fragmentTracker.getBufferedFrag(t,V.PlaylistLevelType.MAIN)},u.followingBufferedFrag=function(t){return t?this.getBufferedFrag(t.end+.5):null},u.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},u.nextLevelSwitch=function(){var t=this.levels,e=this.media;if(null!=e&&e.readyState){var r,i=this.getAppendedFrag(e.currentTime);if(i&&i.start>1&&this.flushMainBuffer(0,i.start-1),!e.paused&&t){var n=t[this.hls.nextLoadLevel],a=this.fragLastKbps;r=a&&this.fragCurrent?this.fragCurrent.duration*n.maxBitrate/(1e3*a)+1:0}else r=0;var s=this.getBufferedFrag(e.currentTime+r);if(s){var o=this.followingBufferedFrag(s);if(o){this.abortCurrentFrag();var l=o.maxStartPTS?o.maxStartPTS:o.start,u=o.duration,d=Math.max(s.end,l+Math.min(Math.max(u-this.config.maxFragLookUpTolerance,.5*u),.75*u));this.flushMainBuffer(d,Number.POSITIVE_INFINITY)}}}},u.abortCurrentFrag=function(){var t=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,t&&t.abortRequests(),this.state){case ee:case re:case ie:case ae:case se:this.state=te}this.nextLoadPosition=this.getLoadPosition()},u.flushMainBuffer=function(e,r){t.prototype.flushMainBuffer.call(this,e,r,this.altAudio?"video":null)},u.onMediaAttached=function(e,r){t.prototype.onMediaAttached.call(this,e,r);var i=r.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),i.addEventListener("playing",this.onvplaying),i.addEventListener("seeked",this.onvseeked),this.gapController=new De(this.config,i,this.fragmentTracker,this.hls)},u.onMediaDetaching=function(){var e=this.media;e&&this.onvplaying&&this.onvseeked&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),t.prototype.onMediaDetaching.call(this)},u.onMediaPlaying=function(){this.tick()},u.onMediaSeeked=function(){var t=this.media,e=t?t.currentTime:null;(0,a.isFiniteNumber)(e)&&this.log("Media seeked to "+e.toFixed(3)),this.tick()},u.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(s.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null,this.backtrackFragment=null},u.onManifestParsed=function(t,e){var r,i,n,a=!1,s=!1;e.levels.forEach((function(t){(r=t.audioCodec)&&(-1!==r.indexOf("mp4a.40.2")&&(a=!0),-1!==r.indexOf("mp4a.40.5")&&(s=!0))})),this.audioCodecSwitch=a&&s&&!("function"==typeof(null==(n=fe())||null===(i=n.prototype)||void 0===i?void 0:i.changeType)),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startFragRequested=!1},u.onLevelLoading=function(t,e){var r=this.levels;if(r&&this.state===te){var i=r[e.level];(!i.details||i.details.live&&this.levelLastLoaded!==e.level||this.waitForCdnTuneIn(i.details))&&(this.state=de)}},u.onLevelLoaded=function(t,e){var r,i=this.levels,n=e.level,a=e.details,o=a.totalduration;if(i){this.log("Level "+n+" loaded ["+a.startSN+","+a.endSN+"], cc ["+a.startCC+", "+a.endCC+"] duration:"+o);var l=this.fragCurrent;!l||this.state!==re&&this.state!==ie||l.level!==e.level&&l.loader&&(this.state=te,this.backtrackFragment=null,l.abortRequests());var u=i[n],d=0;if(a.live||null!==(r=u.details)&&void 0!==r&&r.live){if(a.fragments[0]||(a.deltaUpdateFailed=!0),a.deltaUpdateFailed)return;d=this.alignPlaylists(a,u.details)}if(u.details=a,this.levelLastLoaded=n,this.hls.trigger(s.Events.LEVEL_UPDATED,{details:a,level:n}),this.state===de){if(this.waitForCdnTuneIn(a))return;this.state=te}this.startFragRequested?a.live&&this.synchronizeToLiveEdge(a):this.setStartPosition(a,d),this.tick()}else this.warn("Levels were reset while loading level "+n)},u._handleFragmentLoadProgress=function(t){var e,r=t.frag,i=t.part,n=t.payload,a=this.levels;if(a){var s=a[r.level],o=s.details;if(o){var l=s.videoCodec,u=o.PTSKnown||!o.live,d=null===(e=r.initSegment)||void 0===e?void 0:e.data,h=this._getAudioCodec(s),c=this.transmuxer=this.transmuxer||new Ae(this.hls,V.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),f=i?i.index:-1,g=-1!==f,v=new Gt(r.level,r.sn,r.stats.chunkCount,n.byteLength,f,g),p=this.initPTS[r.cc];c.push(n,d,h,l,r,i,o.totalduration,u,v,p)}else this.warn("Dropping fragment "+r.sn+" of level "+r.level+" after level details were reset")}else this.warn("Levels were reset while fragment load was in progress. Fragment "+r.sn+" of level "+r.level+" will not be buffered")},u.onAudioTrackSwitching=function(t,e){var r=this.altAudio,i=!!e.url,n=e.id;if(!i){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var a=this.fragCurrent;a&&(this.log("Switching to main audio track, cancel main fragment load"),a.abortRequests()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var o=this.hls;r&&o.trigger(s.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),o.trigger(s.Events.AUDIO_TRACK_SWITCHED,{id:n})}},u.onAudioTrackSwitched=function(t,e){var r=e.id,i=!!this.hls.audioTracks[r].url;if(i){var n=this.videoBuffer;n&&this.mediaBuffer!==n&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=n)}this.altAudio=i,this.tick()},u.onBufferCreated=function(t,e){var r,i,n=e.tracks,a=!1;for(var s in n){var o=n[s];if("main"===o.id){if(i=s,r=o,"video"===s){var l=n[s];l&&(this.videoBuffer=l.buffer)}}else a=!0}a&&r?(this.log("Alternate track found, use "+i+".buffered to schedule main fragment loading"),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media},u.onFragBuffered=function(t,e){var r=e.frag,i=e.part;if(!r||r.type===V.PlaylistLevelType.MAIN){if(this.fragContextChanged(r))return this.warn("Fragment "+r.sn+(i?" p: "+i.index:"")+" of level "+r.level+" finished buffering, but was aborted. state: "+this.state),void(this.state===se&&(this.state=te));var n=i?i.stats:r.stats;this.fragLastKbps=Math.round(8*n.total/(n.buffering.end-n.loading.first)),"initSegment"!==r.sn&&(this.fragPrevious=r),this.fragBufferedComplete(r,i)}},u.onError=function(t,e){if(e.type!==o.ErrorTypes.KEY_SYSTEM_ERROR)switch(e.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.FRAG_PARSING_ERROR:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(V.PlaylistLevelType.MAIN,e);break;case o.ErrorDetails.LEVEL_LOAD_ERROR:case o.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==le&&(e.fatal?(this.warn(""+e.details),this.state=le):e.levelRetry||this.state!==de||(this.state=te));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if("main"===e.parent&&(this.state===ae||this.state===se)){var r=!0,i=this.getFwdBufferInfo(this.media,V.PlaylistLevelType.MAIN);i&&i.len>.5&&(r=!this.reduceMaxBufferLength(i.len)),r&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}}else this.onFragmentOrKeyLoadError(V.PlaylistLevelType.MAIN,e)},u.checkBuffer=function(){var t=this.media,e=this.gapController;if(t&&e&&t.readyState){if(this.loadedmetadata||!Bt.getBuffered(t).length){var r=this.state!==te?this.fragCurrent:null;e.poll(this.lastCurrentTime,r)}this.lastCurrentTime=t.currentTime}},u.onFragLoadEmergencyAborted=function(){this.state=te,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},u.onBufferFlushed=function(t,e){var r=e.type;if(r!==v.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var i=(r===v.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(i,r,V.PlaylistLevelType.MAIN)}},u.onLevelsUpdated=function(t,e){this.levels=e.levels},u.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},u.seekToStartPos=function(){var t=this.media;if(t){var e=t.currentTime,r=this.startPosition;if(r>=0&&e0&&(n1&&!1===t.seeking){var r=t.currentTime;if(Bt.isBuffered(t,r)?e=this.getAppendedFrag(r):Bt.isBuffered(t,r+.1)&&(e=this.getAppendedFrag(r+.1)),e){this.backtrackFragment=null;var i=this.fragPlaying,n=e.level;i&&e.sn===i.sn&&i.level===n&&e.urlId===i.urlId||(this.fragPlaying=e,this.hls.trigger(s.Events.FRAG_CHANGED,{frag:e}),i&&i.level===n||this.hls.trigger(s.Events.LEVEL_SWITCHED,{level:n}))}}},n=i,(l=[{key:"nextLevel",get:function(){var t=this.nextBufferedFrag;return t?t.level:-1}},{key:"currentFrag",get:function(){var t=this.media;return t?this.fragPlaying||this.getAppendedFrag(t.currentTime):null}},{key:"currentProgramDateTime",get:function(){var t=this.media;if(t){var e=t.currentTime,r=this.currentFrag;if(r&&(0,a.isFiniteNumber)(e)&&(0,a.isFiniteNumber)(r.programDateTime)){var i=r.programDateTime+1e3*(e-r.start);return new Date(i)}}return null}},{key:"currentLevel",get:function(){var t=this.currentFrag;return t?t.level:-1}},{key:"nextBufferedFrag",get:function(){var t=this.currentFrag;return t?this.followingBufferedFrag(t):null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}])&&ke(n.prototype,l),Object.defineProperty(n,"prototype",{writable:!1}),i}(he);const we=function(){function t(t,e,r){void 0===e&&(e=0),void 0===r&&(r=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=t,this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=e,this.totalWeight_=r}var e=t.prototype;return e.sample=function(t,e){var r=Math.pow(this.alpha_,t);this.estimate_=e*(1-r)+r*this.estimate_,this.totalWeight_+=t},e.getTotalWeight=function(){return this.totalWeight_},e.getEstimate=function(){if(this.alpha_){var t=1-Math.pow(this.alpha_,this.totalWeight_);if(t)return this.estimate_/t}return this.estimate_},t}(),Ce=function(){function t(t,e,r){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=r,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new we(t),this.fast_=new we(e)}var e=t.prototype;return e.update=function(t,e){var r=this.slow_,i=this.fast_;this.slow_.halfLife!==t&&(this.slow_=new we(t,r.getEstimate(),r.getTotalWeight())),this.fast_.halfLife!==e&&(this.fast_=new we(e,i.getEstimate(),i.getTotalWeight()))},e.sample=function(t,e){var r=(t=Math.max(t,this.minDelayMs_))/1e3,i=8*e/r;this.fast_.sample(r,i),this.slow_.sample(r,i)},e.canEstimate=function(){var t=this.fast_;return t&&t.getTotalWeight()>=this.minWeight_},e.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},e.destroy=function(){},t}();function _e(t,e){for(var r=0;rp;b--){var A=v[b].maxBitrate;if((L=E?u*A/(6.4*E):u*A/g)=T||(l.logger.warn("Fragment "+t.sn+(e?" part "+e.index:"")+" of level "+t.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+b+"\n Current BW estimate: "+((0,a.isFiniteNumber)(g)?(g/1024).toFixed(3):"Unknown")+" Kb/s\n Estimated load time for current fragment: "+T.toFixed(3)+" s\n Estimated load time for the next fragment: "+L.toFixed(3)+" s\n Time to underbuffer: "+S.toFixed(3)+" s"),r.nextLoadLevel=b,f&&this.bwEstimator.sample(h,o.loaded),this.clearTimer(),(t.loader||t.keyLoader)&&(this.fragCurrent=this.partCurrent=null,t.abortRequests()),r.trigger(s.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:e,stats:o}))}}}}}},i.onFragLoaded=function(t,e){var r=e.frag,i=e.part;if(r.type===V.PlaylistLevelType.MAIN&&(0,a.isFiniteNumber)(r.sn)){var n=i?i.stats:r.stats,o=i?i.duration:r.duration;if(this.clearTimer(),this.lastLoadedFragLevel=r.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var l=this.hls.levels[r.level],u=(l.loaded?l.loaded.bytes:0)+n.loaded,d=(l.loaded?l.loaded.duration:0)+o;l.loaded={bytes:u,duration:d},l.realBitrate=Math.round(8*u/d)}if(r.bitrateTest){var h={stats:n,frag:r,part:i,id:r.type};this.onFragBuffered(s.Events.FRAG_BUFFERED,h)}}},i.onFragBuffered=function(t,e){var r=e.frag,i=e.part,n=i?i.stats:r.stats;if(!n.aborted&&r.type===V.PlaylistLevelType.MAIN&&"initSegment"!==r.sn){var a=n.parsing.end-n.loading.start;this.bwEstimator.sample(a,n.loaded),n.bwEstimate=this.bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=a/1e3:this.bitrateTestDelay=0}},i.onError=function(t,e){var r;if((null===(r=e.frag)||void 0===r?void 0:r.type)===V.PlaylistLevelType.MAIN){if(e.type===o.ErrorTypes.KEY_SYSTEM_ERROR)return void this.clearTimer();switch(e.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.clearTimer()}}},i.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},i.getNextABRAutoLevel=function(){var t=this.fragCurrent,e=this.partCurrent,r=this.hls,i=r.maxAutoLevel,n=r.config,a=r.minAutoLevel,s=r.media,o=e?e.duration:t?t.duration:0,u=s&&0!==s.playbackRate?Math.abs(s.playbackRate):1,d=this.bwEstimator?this.bwEstimator.getEstimate():n.abrEwmaDefaultEstimate,h=r.mainForwardBufferInfo,c=(h?h.len:0)/u,f=this.findBestLevel(d,a,i,c,n.abrBandWidthFactor,n.abrBandWidthUpFactor);if(f>=0)return f;l.logger.trace((c?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var g=o?Math.min(o,n.maxStarvationDelay):n.maxStarvationDelay,v=n.abrBandWidthFactor,p=n.abrBandWidthUpFactor;if(!c){var m=this.bitrateTestDelay;m&&(g=(o?Math.min(o,n.maxLoadingDelay):n.maxLoadingDelay)-m,l.logger.trace("bitrate test took "+Math.round(1e3*m)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*g)+" ms"),v=p=1)}return f=this.findBestLevel(d,a,i,c+g,v,p),Math.max(f,0)},i.findBestLevel=function(t,e,r,i,n,s){for(var o,u=this.fragCurrent,d=this.partCurrent,h=this.lastLoadedFragLevel,c=this.hls.levels,f=c[h],g=!(null==f||null===(o=f.details)||void 0===o||!o.live),v=null==f?void 0:f.codecSet,p=d?d.duration:u?u.duration:0,m=r;m>=e;m--){var y=c[m];if(y&&(!v||y.codecSet===v)){var E,T=y.details,S=(d?null==T?void 0:T.partTarget:null==T?void 0:T.averagetargetduration)||p;E=m<=h?n*t:s*t;var b=c[m].maxBitrate,L=b*S/E;if(l.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+m+"/"+Math.round(E)+"/"+b+"/"+S+"/"+i+"/"+L),E>b&&(0===L||!(0,a.isFiniteNumber)(L)||g&&!this.bitrateTestDelay||L0&&-1===t?(this.log("Override startPosition with lastCurrentTime @"+e.toFixed(3)),t=e,this.state=te):(this.loadedmetadata=!1,this.state=ne),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()},n.doTick=function(){switch(this.state){case te:this.doTickIdle();break;case ne:var e,r=this.levels,i=this.trackId,n=null==r||null===(e=r[i])||void 0===e?void 0:e.details;if(n){if(this.waitForCdnTuneIn(n))break;this.state=ue}break;case ie:var a,s=performance.now(),o=this.retryDate;(!o||s>=o||null!==(a=this.media)&&void 0!==a&&a.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.trackId),this.state=te);break;case ue:var l=this.waitingData;if(l){var u=l.frag,d=l.part,h=l.cache,c=l.complete;if(void 0!==this.initPTS[u.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=re;var f={frag:u,part:d,payload:h.flush(),networkDetails:null};this._handleFragmentLoadProgress(f),c&&t.prototype._handleFragmentLoadComplete.call(this,f)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log("Waiting fragment cc ("+u.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var g=this.getLoadPosition(),v=Bt.bufferInfo(this.mediaBuffer,g,this.config.maxBufferHole);qt(v.end,this.config.maxFragLookUpTolerance,u)<0&&(this.log("Waiting fragment cc ("+u.cc+") @ "+u.start+" cancelled because another fragment at "+v.end+" is needed"),this.clearWaitingFragment())}}else this.state=te}this.onTickEnd()},n.clearWaitingFragment=function(){var t=this.waitingData;t&&(this.fragmentTracker.removeFragment(t.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=te)},n.resetLoadingState=function(){this.clearWaitingFragment(),t.prototype.resetLoadingState.call(this)},n.onTickEnd=function(){var t=this.media;t&&t.readyState&&(this.lastCurrentTime=t.currentTime)},n.doTickIdle=function(){var t=this.hls,e=this.levels,r=this.media,i=this.trackId,n=t.config;if(e&&e[i]&&(r||!this.startFragRequested&&n.startFragPrefetch)){var a=e[i].details;if(!a||a.live&&this.levelLastLoaded!==i||this.waitForCdnTuneIn(a))this.state=ne;else{var o=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&o&&(this.bufferFlushed=!1,this.afterBufferFlushed(o,v.ElementaryStreamTypes.AUDIO,V.PlaylistLevelType.AUDIO));var l=this.getFwdBufferInfo(o,V.PlaylistLevelType.AUDIO);if(null!==l){var u=this.audioSwitch;if(!u&&this._streamEnded(l,a))return t.trigger(s.Events.BUFFER_EOS,{type:"audio"}),void(this.state=oe);var d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,V.PlaylistLevelType.MAIN);if(!(l.len>=this.getMaxBufferLength(null==d?void 0:d.len))||u){var h=a.fragments[0].start,c=l.end;if(u&&r){var f=this.getLoadPosition();c=f,a.PTSKnown&&fh||l.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),r.currentTime=h+.05)}if(!(d&&c>d.end+a.targetduration)&&(d&&d.len||!l.len)){var g=this.getNextFragment(c,a);g?this.loadFragment(g,a,c):this.bufferFlushed=!0}}}}}},n.getMaxBufferLength=function(e){var r=t.prototype.getMaxBufferLength.call(this);return e?Math.max(r,e):r},n.onMediaDetaching=function(){this.videoBuffer=null,t.prototype.onMediaDetaching.call(this)},n.onAudioTracksUpdated=function(t,e){var r=e.audioTracks;this.resetTransmuxer(),this.levels=r.map((function(t){return new ut(t)}))},n.onAudioTrackSwitching=function(t,e){var r=!!e.url;this.trackId=e.id;var i=this.fragCurrent;i&&i.abortRequests(),this.fragCurrent=null,this.clearWaitingFragment(),r?this.setInterval(100):this.resetTransmuxer(),r?(this.audioSwitch=!0,this.state=te):this.state=Zt,this.tick()},n.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},n.onLevelLoaded=function(t,e){this.mainDetails=e.details,null!==this.cachedTrackLoadedData&&(this.hls.trigger(s.Events.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)},n.onAudioTrackLoaded=function(t,e){var r;if(null!=this.mainDetails){var i=this.levels,n=e.details,a=e.id;if(i){this.log("Track "+a+" loaded ["+n.startSN+","+n.endSN+"],duration:"+n.totalduration);var s=i[a],o=0;if(n.live||null!==(r=s.details)&&void 0!==r&&r.live){var l=this.mainDetails;if(n.fragments[0]||(n.deltaUpdateFailed=!0),n.deltaUpdateFailed||!l)return;!s.details&&n.hasProgramDateTime&&l.hasProgramDateTime?(Vt(n,l),o=n.fragments[0].start):o=this.alignPlaylists(n,s.details)}s.details=n,this.levelLastLoaded=a,this.startFragRequested||!this.mainDetails&&n.live||this.setStartPosition(s.details,o),this.state!==ne||this.waitForCdnTuneIn(n)||(this.state=te),this.tick()}else this.warn("Audio tracks were reset while loading level "+a)}else this.cachedTrackLoadedData=e},n._handleFragmentLoadProgress=function(t){var e,r=t.frag,i=t.part,n=t.payload,a=this.config,s=this.trackId,o=this.levels;if(o){var l=o[s],u=l.details,d=a.defaultAudioCodec||l.audioCodec||"mp4a.40.2",h=this.transmuxer;h||(h=this.transmuxer=new Ae(this.hls,V.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var c=this.initPTS[r.cc],f=null===(e=r.initSegment)||void 0===e?void 0:e.data;if(void 0!==c){var g=i?i.index:-1,v=-1!==g,p=new Gt(r.level,r.sn,r.stats.chunkCount,n.byteLength,g,v);h.push(n,f,d,"",r,i,u.totalduration,!1,p,c)}else this.log("Unknown video PTS for cc "+r.cc+", waiting for video PTS before demuxing audio frag "+r.sn+" of ["+u.startSN+" ,"+u.endSN+"],track "+s),(this.waitingData=this.waitingData||{frag:r,part:i,cache:new Oe,complete:!1}).cache.push(new Uint8Array(n)),this.waitingVideoCC=this.videoTrackCC,this.state=ue}else this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+r.sn+" of level "+r.level+" will not be buffered")},n._handleFragmentLoadComplete=function(e){this.waitingData?this.waitingData.complete=!0:t.prototype._handleFragmentLoadComplete.call(this,e)},n.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},n.onBufferCreated=function(t,e){var r=e.tracks.audio;r&&(this.mediaBuffer=r.buffer||null),e.tracks.video&&(this.videoBuffer=e.tracks.video.buffer||null)},n.onFragBuffered=function(t,e){var r,i=e.frag,n=e.part;i.type===V.PlaylistLevelType.AUDIO?this.fragContextChanged(i)?this.warn("Fragment "+i.sn+(n?" p: "+n.index:"")+" of level "+i.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch):("initSegment"!==i.sn&&(this.fragPrevious=i,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(s.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(i,n)):this.loadedmetadata||i.type!==V.PlaylistLevelType.MAIN||null!==(r=this.videoBuffer||this.media)&&void 0!==r&&r.buffered.length&&(this.loadedmetadata=!0)},n.onError=function(e,r){if(r.type!==o.ErrorTypes.KEY_SYSTEM_ERROR)switch(r.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.FRAG_PARSING_ERROR:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(V.PlaylistLevelType.AUDIO,r);break;case o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==le&&this.state!==Zt&&(this.state=r.fatal?le:te,this.warn(r.details+" while loading frag, switching to "+this.state+" state"));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if("audio"===r.parent&&(this.state===ae||this.state===se)){var i=!0,n=this.getFwdBufferInfo(this.mediaBuffer,V.PlaylistLevelType.AUDIO);n&&n.len>.5&&(i=!this.reduceMaxBufferLength(n.len)),i&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,t.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}}else this.onFragmentOrKeyLoadError(V.PlaylistLevelType.AUDIO,r)},n.onBufferFlushed=function(t,e){e.type===v.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0,this.state===oe&&(this.state=te))},n._handleTransmuxComplete=function(t){var e,r="audio",i=this.hls,n=t.remuxResult,a=t.chunkMeta,o=this.getCurrentContext(a);if(!o)return this.warn("The loading context changed while buffering fragment "+a.sn+" of level "+a.level+". This chunk will not be buffered."),void this.resetStartWhenNotLoaded(a.level);var l=o.frag,u=o.part,d=o.level.details,h=n.audio,c=n.text,f=n.id3,g=n.initSegment;if(!this.fragContextChanged(l)&&d){if(this.state=ae,this.audioSwitch&&h&&this.completeAudioSwitch(),null!=g&&g.tracks&&(this._bufferInitSegment(g.tracks,l,a),i.trigger(s.Events.FRAG_PARSING_INIT_SEGMENT,{frag:l,id:r,tracks:g.tracks})),h){var p=h.startPTS,m=h.endPTS,y=h.startDTS,E=h.endDTS;u&&(u.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:p,endPTS:m,startDTS:y,endDTS:E}),l.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,p,m,y,E),this.bufferFragmentData(h,l,u,a)}if(null!=f&&null!==(e=f.samples)&&void 0!==e&&e.length){var T=xe({id:r,frag:l,details:d},f);i.trigger(s.Events.FRAG_PARSING_METADATA,T)}if(c){var S=xe({id:r,frag:l,details:d},c);i.trigger(s.Events.FRAG_PARSING_USERDATA,S)}}},n._bufferInitSegment=function(t,e,r){if(this.state===ae){t.video&&delete t.video;var i=t.audio;if(i){i.levelCodec=i.codec,i.id="audio",this.log("Init audio buffer, container:"+i.container+", codecs[parsed]=["+i.codec+"]"),this.hls.trigger(s.Events.BUFFER_CODECS,t);var n=i.initSegment;if(null!=n&&n.byteLength){var a={type:"audio",frag:e,part:null,chunkMeta:r,parent:e.type,data:n};this.hls.trigger(s.Events.BUFFER_APPENDING,a)}this.tick()}}},n.loadFragment=function(e,r,i){var n=this.fragmentTracker.getState(e);this.fragCurrent=e,(this.audioSwitch||n===St.NOT_LOADED||n===St.PARTIAL)&&("initSegment"===e.sn?this._loadInitSegment(e,r):r.live&&!(0,a.isFiniteNumber)(this.initPTS[e.cc])?(this.log("Waiting for video PTS in continuity counter "+e.cc+" of live stream before loading audio fragment "+e.sn+" of level "+this.trackId),this.state=ue):(this.startFragRequested=!0,t.prototype.loadFragment.call(this,e,r,i)))},n.completeAudioSwitch=function(){var e=this.hls,r=this.media,i=this.trackId;r&&(this.log("Switching audio track : flushing all audio"),t.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,e.trigger(s.Events.AUDIO_TRACK_SWITCHED,{id:i})},i}(he);const Ne=Me;function Ue(t,e){for(var r=0;r=e.length)this.warn("Invalid id passed to audio-track controller");else{this.clearTimer();var r=e[this.trackId];this.log("Now switching to audio-track index "+t);var i=e[t],n=i.id,a=i.groupId,o=void 0===a?"":a,l=i.name,u=i.type,d=i.url;if(this.trackId=t,this.trackName=l,this.selectDefaultTrack=!1,this.hls.trigger(s.Events.AUDIO_TRACK_SWITCHING,{id:n,groupId:o,name:l,type:u,url:d}),!i.details||i.details.live){var h=this.switchParams(i.url,null==r?void 0:r.details);this.loadPlaylist(h)}}},l.selectInitialTrack=function(){this.tracksInGroup;var t=this.trackName,e=this.findTrackId(t)||this.findTrackId();-1!==e?this.setAudioTrack(e):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(s.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},l.findTrackId=function(t){for(var e=this.tracksInGroup,r=0;r=n[o].start&&s<=n[o].end){a=n[o];break}var l=r.start+r.duration;a?a.end=l:(a={start:s,end:l},n.push(a)),this.fragmentTracker.fragBuffered(r)}}},o.onBufferFlushing=function(t,e){var r=e.startOffset,i=e.endOffset;if(0===r&&i!==Number.POSITIVE_INFINITY){var n=this.currentTrackId,a=this.levels;if(!a.length||!a[n]||!a[n].details)return;var s=i-a[n].details.targetduration;if(s<=0)return;e.endOffsetSubtitles=Math.max(0,s),this.tracksBuffered.forEach((function(t){for(var e=0;e=s.length||n!==a)&&o){this.mediaBuffer=this.mediaBufferTimeRanges;var l=0;if(i.live||null!==(r=o.details)&&void 0!==r&&r.live){var u=this.mainDetails;if(i.deltaUpdateFailed||!u)return;var d=u.fragments[0];o.details?0===(l=this.alignPlaylists(i,o.details))&&d&&pt(i,l=d.start):i.hasProgramDateTime&&u.hasProgramDateTime?(Vt(i,u),l=i.fragments[0].start):d&&pt(i,l=d.start)}o.details=i,this.levelLastLoaded=n,this.startFragRequested||!this.mainDetails&&i.live||this.setStartPosition(o.details,l),this.tick(),i.live&&!this.fragCurrent&&this.media&&this.state===te&&(Wt(null,i.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),o.details=void 0))}}},o._handleFragmentLoadComplete=function(t){var e=this,r=t.frag,i=t.payload,n=r.decryptdata,a=this.hls;if(!this.fragContextChanged(r)&&i&&i.byteLength>0&&n&&n.key&&n.iv&&"AES-128"===n.method){var o=performance.now();this.decrypter.decrypt(new Uint8Array(i),n.key.buffer,n.iv.buffer).then((function(t){var e=performance.now();a.trigger(s.Events.FRAG_DECRYPTED,{frag:r,payload:t,stats:{tstart:o,tdecrypt:e}})})).catch((function(t){e.warn(t.name+": "+t.message),e.state=te}))}},o.doTick=function(){if(this.media){if(this.state===te){var t=this.currentTrackId,e=this.levels;if(!e.length||!e[t]||!e[t].details)return;var r=e[t].details,i=r.targetduration,n=this.config,a=this.getLoadPosition(),s=Bt.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],a-i,n.maxBufferHole),o=s.end,l=s.len,u=this.getFwdBufferInfo(this.media,V.PlaylistLevelType.MAIN);if(l>this.getMaxBufferLength(null==u?void 0:u.len)+i)return;var d=r.fragments,h=d.length,c=r.edge,f=null,g=this.fragPrevious;if(o>>=0)>i-1)throw new DOMException("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+r+") is greater than the maximum bound ("+i+")");return t[r][e]};this.buffered={get length(){return t.length},end:function(r){return e("end",r,t.length)},start:function(r){return e("start",r,t.length)}}};function Ye(t,e){for(var r=0;r-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))},o.pollTrackChange=function(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,t)},o.onMediaDetaching=function(){this.media&&(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),qe(this.media.textTracks).forEach((function(t){z(t)})),this.subtitleTrack=-1,this.media=null)},o.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},o.onManifestParsed=function(t,e){this.tracks=e.subtitleTracks},o.onSubtitleTrackLoaded=function(t,e){var r=e.id,i=e.details,n=this.trackId,a=this.tracksInGroup[n];if(a){var s=a.details;a.details=e.details,this.log("subtitle track "+r+" loaded ["+i.startSN+"-"+i.endSN+"]"),r===this.trackId&&(this.retryCount=0,this.playlistLoaded(r,e,s))}else this.warn("Invalid subtitle track id "+r)},o.onLevelLoading=function(t,e){this.switchLevel(e.level)},o.onLevelSwitching=function(t,e){this.switchLevel(e.level)},o.switchLevel=function(t){var e=this.hls.levels[t];if(null!=e&&e.textGroupIds){var r=e.textGroupIds[e.urlId];if(this.groupId!==r){var i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,n=this.tracks.filter((function(t){return!r||t.groupId===r}));this.tracksInGroup=n;var a=this.findTrackId(null==i?void 0:i.name)||this.findTrackId();this.groupId=r;var o={subtitleTracks:n};this.log("Updating subtitle tracks, "+n.length+' track(s) found in "'+r+'" group-id'),this.hls.trigger(s.Events.SUBTITLE_TRACKS_UPDATED,o),-1!==a&&this.setSubtitleTrack(a,i)}}},o.findTrackId=function(t){for(var e=this.tracksInGroup,r=0;r=i.length)){this.clearTimer();var n=i[t];if(this.log("Switching to subtitle track "+t),this.trackId=t,n){var a=n.id,o=n.groupId,l=void 0===o?"":o,u=n.name,d=n.type,h=n.url;this.hls.trigger(s.Events.SUBTITLE_TRACK_SWITCH,{id:a,groupId:l,name:u,type:d,url:h});var c=this.switchParams(n.url,null==e?void 0:e.details);this.loadPlaylist(c)}else this.hls.trigger(s.Events.SUBTITLE_TRACK_SWITCH,{id:t})}}else this.queuedDefaultTrack=t},o.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),this.media&&this.hls.config.renderTextTracksNatively){for(var t=-1,e=qe(this.media.textTracks),r=0;r-1&&this.toggleTrackModes(this.trackId)}},{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(t){this.selectDefaultTrack=!1;var e=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(t,e)}}])&&Ye(n.prototype,a),Object.defineProperty(n,"prototype",{writable:!1}),i}(mt);var ze,Qe=function(){function t(t){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=t}var e=t.prototype;return e.append=function(t,e){var r=this.queues[e];r.push(t),1===r.length&&this.buffers[e]&&this.executeNext(e)},e.insertAbort=function(t,e){this.queues[e].unshift(t),this.executeNext(e)},e.appendBlocker=function(t){var e,r=new Promise((function(t){e=t})),i={execute:e,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(i,t),r},e.executeNext=function(t){var e=this.buffers,r=this.queues,i=e[t],n=r[t];if(n.length){var a=n[0];try{a.execute()}catch(e){l.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),a.onError(e),i&&i.updating||(n.shift(),this.executeNext(t))}}},e.shiftAndExecuteNext=function(t){this.queues[t].shift(),this.executeNext(t)},e.current=function(t){return this.queues[t][0]},t}(),$e=ce(),Je=/([ha]vc.)(?:\.[^.,]+)+/,Ze=function(){function t(t){var e=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var t=e.media,r=e.mediaSource;l.logger.log("[buffer-controller]: Media source opened"),t&&(t.removeEventListener("emptied",e._onMediaEmptied),e.updateMediaElementDuration(),e.hls.trigger(s.Events.MEDIA_ATTACHED,{media:t})),r&&r.removeEventListener("sourceopen",e._onMediaSourceOpen),e.checkPendingTracks()},this._onMediaSourceClose=function(){l.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){l.logger.log("[buffer-controller]: Media source ended")},this._onMediaEmptied=function(){var t=e.media,r=e._objectUrl;t&&t.src!==r&&l.logger.error("Media element src was set while attaching MediaSource ("+r+" > "+t.src+")")},this.hls=t,this._initSourceBuffer(),this.registerListeners()}var e=t.prototype;return e.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},e.destroy=function(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null},e.registerListeners=function(){var t=this.hls;t.on(s.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(s.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(s.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(s.Events.BUFFER_RESET,this.onBufferReset,this),t.on(s.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.on(s.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.on(s.Events.BUFFER_EOS,this.onBufferEos,this),t.on(s.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(s.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(s.Events.FRAG_PARSED,this.onFragParsed,this),t.on(s.Events.FRAG_CHANGED,this.onFragChanged,this)},e.unregisterListeners=function(){var t=this.hls;t.off(s.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(s.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(s.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(s.Events.BUFFER_RESET,this.onBufferReset,this),t.off(s.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.off(s.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.off(s.Events.BUFFER_EOS,this.onBufferEos,this),t.off(s.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(s.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(s.Events.FRAG_PARSED,this.onFragParsed,this),t.off(s.Events.FRAG_CHANGED,this.onFragChanged,this)},e._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new Qe(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.lastMpegAudioChunk=null},e.onManifestParsed=function(t,e){var r=2;(e.audio&&!e.video||!e.altAudio)&&(r=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=r,this.details=null,l.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},e.onMediaAttaching=function(t,e){var r=this.media=e.media;if(r&&$e){var i=this.mediaSource=new $e;i.addEventListener("sourceopen",this._onMediaSourceOpen),i.addEventListener("sourceended",this._onMediaSourceEnded),i.addEventListener("sourceclose",this._onMediaSourceClose),r.src=self.URL.createObjectURL(i),this._objectUrl=r.src,r.addEventListener("emptied",this._onMediaEmptied)}},e.onMediaDetaching=function(){var t=this.media,e=this.mediaSource,r=this._objectUrl;if(e){if(l.logger.log("[buffer-controller]: media source detaching"),"open"===e.readyState)try{e.endOfStream()}catch(t){l.logger.warn("[buffer-controller]: onMediaDetaching: "+t.message+" while calling endOfStream")}this.onBufferReset(),e.removeEventListener("sourceopen",this._onMediaSourceOpen),e.removeEventListener("sourceended",this._onMediaSourceEnded),e.removeEventListener("sourceclose",this._onMediaSourceClose),t&&(t.removeEventListener("emptied",this._onMediaEmptied),r&&self.URL.revokeObjectURL(r),t.src===r?(t.removeAttribute("src"),t.load()):l.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(s.Events.MEDIA_DETACHED,void 0)},e.onBufferReset=function(){var t=this;this.getSourceBufferTypes().forEach((function(e){var r=t.sourceBuffer[e];try{r&&(t.removeBufferListeners(e),t.mediaSource&&t.mediaSource.removeSourceBuffer(r),t.sourceBuffer[e]=void 0)}catch(t){l.logger.warn("[buffer-controller]: Failed to reset the "+e+" buffer",t)}})),this._initSourceBuffer()},e.onBufferCodecs=function(t,e){var r=this,i=this.getSourceBufferTypes().length;Object.keys(e).forEach((function(t){if(i){var n=r.tracks[t];if(n&&"function"==typeof n.buffer.changeType){var a=e[t],s=a.id,o=a.codec,u=a.levelCodec,d=a.container,h=a.metadata,c=(n.levelCodec||n.codec).replace(Je,"$1"),f=(u||o).replace(Je,"$1");if(c!==f){var g=d+";codecs="+(u||o);r.appendChangeType(t,g),l.logger.log("[buffer-controller]: switching codec "+c+" to "+f),r.tracks[t]={buffer:n.buffer,codec:o,container:d,levelCodec:u,metadata:h,id:s}}}}else r.pendingTracks[t]=e[t]})),i||(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())},e.appendChangeType=function(t,e){var r=this,i=this.operationQueue,n={execute:function(){var n=r.sourceBuffer[t];n&&(l.logger.log("[buffer-controller]: changing "+t+" sourceBuffer type to "+e),n.changeType(e)),i.shiftAndExecuteNext(t)},onStart:function(){},onComplete:function(){},onError:function(e){l.logger.warn("[buffer-controller]: Failed to change "+t+" SourceBuffer type",e)}};i.append(n,t)},e.onBufferAppending=function(t,e){var r=this,i=this.hls,n=this.operationQueue,a=this.tracks,u=e.data,d=e.type,h=e.frag,c=e.part,f=e.chunkMeta,g=f.buffering[d],v=self.performance.now();g.start=v;var p=h.stats.buffering,m=c?c.stats.buffering:null;0===p.start&&(p.start=v),m&&0===m.start&&(m.start=v);var y=a.audio,E=!1;"audio"===d&&"audio/mpeg"===(null==y?void 0:y.container)&&(E=!this.lastMpegAudioChunk||1===f.id||this.lastMpegAudioChunk.sn!==f.sn,this.lastMpegAudioChunk=f);var T=h.start,S={execute:function(){if(g.executeStart=self.performance.now(),E){var t=r.sourceBuffer[d];if(t){var e=T-t.timestampOffset;Math.abs(e)>=.1&&(l.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+T+" (delta: "+e+") sn: "+h.sn+")"),t.timestampOffset=T)}}r.appendExecutor(u,d)},onStart:function(){},onComplete:function(){var t=self.performance.now();g.executeEnd=g.end=t,0===p.first&&(p.first=t),m&&0===m.first&&(m.first=t);var e=r.sourceBuffer,i={};for(var n in e)i[n]=Bt.getBuffered(e[n]);r.appendError=0,r.hls.trigger(s.Events.BUFFER_APPENDED,{type:d,frag:h,part:c,chunkMeta:f,parent:h.type,timeRanges:i})},onError:function(t){l.logger.error("[buffer-controller]: Error encountered while trying to append to the "+d+" SourceBuffer",t);var e={type:o.ErrorTypes.MEDIA_ERROR,parent:h.type,details:o.ErrorDetails.BUFFER_APPEND_ERROR,err:t,fatal:!1};t.code===DOMException.QUOTA_EXCEEDED_ERR?e.details=o.ErrorDetails.BUFFER_FULL_ERROR:(r.appendError++,e.details=o.ErrorDetails.BUFFER_APPEND_ERROR,r.appendError>i.config.appendErrorMaxRetry&&(l.logger.error("[buffer-controller]: Failed "+i.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),e.fatal=!0,i.stopLoad())),i.trigger(s.Events.ERROR,e)}};n.append(S,d)},e.onBufferFlushing=function(t,e){var r=this,i=this.operationQueue,n=function(t){return{execute:r.removeExecutor.bind(r,t,e.startOffset,e.endOffset),onStart:function(){},onComplete:function(){r.hls.trigger(s.Events.BUFFER_FLUSHED,{type:t})},onError:function(e){l.logger.warn("[buffer-controller]: Failed to remove from "+t+" SourceBuffer",e)}}};e.type?i.append(n(e.type),e.type):this.getSourceBufferTypes().forEach((function(t){i.append(n(t),t)}))},e.onFragParsed=function(t,e){var r=this,i=e.frag,n=e.part,a=[],o=n?n.elementaryStreams:i.elementaryStreams;o[v.ElementaryStreamTypes.AUDIOVIDEO]?a.push("audiovideo"):(o[v.ElementaryStreamTypes.AUDIO]&&a.push("audio"),o[v.ElementaryStreamTypes.VIDEO]&&a.push("video")),0===a.length&&l.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+i.type+" level: "+i.level+" sn: "+i.sn),this.blockBuffers((function(){var t=self.performance.now();i.stats.buffering.end=t,n&&(n.stats.buffering.end=t);var e=n?n.stats:i.stats;r.hls.trigger(s.Events.FRAG_BUFFERED,{frag:i,part:n,stats:e,id:i.type})}),a)},e.onFragChanged=function(t,e){this.flushBackBuffer()},e.onBufferEos=function(t,e){var r=this;this.getSourceBufferTypes().reduce((function(t,i){var n=r.sourceBuffer[i];return!n||e.type&&e.type!==i||(n.ending=!0,n.ended||(n.ended=!0,l.logger.log("[buffer-controller]: "+i+" sourceBuffer now EOS"))),t&&!(n&&!n.ended)}),!0)&&(l.logger.log("[buffer-controller]: Queueing mediaSource.endOfStream()"),this.blockBuffers((function(){r.getSourceBufferTypes().forEach((function(t){var e=r.sourceBuffer[t];e&&(e.ending=!1)}));var t=r.mediaSource;t&&"open"===t.readyState?(l.logger.log("[buffer-controller]: Calling mediaSource.endOfStream()"),t.endOfStream()):t&&l.logger.info("[buffer-controller]: Could not call mediaSource.endOfStream(). mediaSource.readyState: "+t.readyState)})))},e.onLevelUpdated=function(t,e){var r=e.details;r.fragments.length&&(this.details=r,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())},e.flushBackBuffer=function(){var t=this.hls,e=this.details,r=this.media,i=this.sourceBuffer;if(r&&null!==e){var n=this.getSourceBufferTypes();if(n.length){var o=e.live&&null!==t.config.liveBackBufferLength?t.config.liveBackBufferLength:t.config.backBufferLength;if((0,a.isFiniteNumber)(o)&&!(o<0)){var u=r.currentTime,d=e.levelTargetDuration,h=Math.max(o,d),c=Math.floor(u/d)*d-h;n.forEach((function(r){var n=i[r];if(n){var a=Bt.getBuffered(n);if(a.length>0&&c>a.start(0)){if(t.trigger(s.Events.BACK_BUFFER_REACHED,{bufferEnd:c}),e.live)t.trigger(s.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:c});else if(n.ended&&a.end(a.length-1)-u<2*d)return void l.logger.info("[buffer-controller]: Cannot flush "+r+" back buffer while SourceBuffer is in ended state");t.trigger(s.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:c,type:r})}}}))}}}},e.updateMediaElementDuration=function(){if(this.details&&this.media&&this.mediaSource&&"open"===this.mediaSource.readyState){var t=this.details,e=this.hls,r=this.media,i=this.mediaSource,n=t.fragments[0].start+t.totalduration,s=r.duration,o=(0,a.isFiniteNumber)(i.duration)?i.duration:0;t.live&&e.config.liveDurationInfinity?(l.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),i.duration=1/0,this.updateSeekableRange(t)):(n>o&&n>s||!(0,a.isFiniteNumber)(s))&&(l.logger.log("[buffer-controller]: Updating Media Source duration to "+n.toFixed(3)),i.duration=n)}},e.updateSeekableRange=function(t){var e=this.mediaSource,r=t.fragments;if(r.length&&t.live&&null!=e&&e.setLiveSeekableRange){var i=Math.max(0,r[0].start),n=Math.max(i,i+t.totalduration);e.setLiveSeekableRange(i,n)}},e.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,e=this.operationQueue,r=this.pendingTracks,i=Object.keys(r).length;if(i&&!t||2===i){this.createSourceBuffers(r),this.pendingTracks={};var n=this.getSourceBufferTypes();if(0===n.length)return void this.hls.trigger(s.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});n.forEach((function(t){e.executeNext(t)}))}},e.createSourceBuffers=function(t){var e=this.sourceBuffer,r=this.mediaSource;if(!r)throw Error("createSourceBuffers called when mediaSource was null");var i=0;for(var n in t)if(!e[n]){var a=t[n];if(!a)throw Error("source buffer exists for track "+n+", however track does not");var u=a.levelCodec||a.codec,d=a.container+";codecs="+u;l.logger.log("[buffer-controller]: creating sourceBuffer("+d+")");try{var h=e[n]=r.addSourceBuffer(d),c=n;this.addBufferListener(c,"updatestart",this._onSBUpdateStart),this.addBufferListener(c,"updateend",this._onSBUpdateEnd),this.addBufferListener(c,"error",this._onSBUpdateError),this.tracks[n]={buffer:h,codec:u,container:a.container,levelCodec:a.levelCodec,metadata:a.metadata,id:a.id},i++}catch(t){l.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+t.message),this.hls.trigger(s.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:t,mimeType:d})}}i&&this.hls.trigger(s.Events.BUFFER_CREATED,{tracks:this.tracks})},e._onSBUpdateStart=function(t){this.operationQueue.current(t).onStart()},e._onSBUpdateEnd=function(t){var e=this.operationQueue;e.current(t).onComplete(),e.shiftAndExecuteNext(t)},e._onSBUpdateError=function(t,e){l.logger.error("[buffer-controller]: "+t+" SourceBuffer error",e),this.hls.trigger(s.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var r=this.operationQueue.current(t);r&&r.onError(e)},e.removeExecutor=function(t,e,r){var i=this.media,n=this.mediaSource,s=this.operationQueue,o=this.sourceBuffer[t];if(!i||!n||!o)return l.logger.warn("[buffer-controller]: Attempting to remove from the "+t+" SourceBuffer, but it does not exist"),void s.shiftAndExecuteNext(t);var u=(0,a.isFiniteNumber)(i.duration)?i.duration:1/0,d=(0,a.isFiniteNumber)(n.duration)?n.duration:1/0,h=Math.max(0,e),c=Math.min(r,u,d);c>h&&!o.ending?(o.ended=!1,l.logger.log("[buffer-controller]: Removing ["+h+","+c+"] from the "+t+" SourceBuffer"),o.remove(h,c)):s.shiftAndExecuteNext(t)},e.appendExecutor=function(t,e){var r=this.operationQueue,i=this.sourceBuffer[e];if(!i)return l.logger.warn("[buffer-controller]: Attempting to append to the "+e+" SourceBuffer, but it does not exist"),void r.shiftAndExecuteNext(e);i.ended=!1,i.appendBuffer(t)},e.blockBuffers=function(t,e){var r=this;if(void 0===e&&(e=this.getSourceBufferTypes()),!e.length)return l.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve().then(t);var i=this.operationQueue,n=e.map((function(t){return i.appendBlocker(t)}));Promise.all(n).then((function(){t(),e.forEach((function(t){var e=r.sourceBuffer[t];e&&e.updating||i.shiftAndExecuteNext(t)}))}))},e.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},e.addBufferListener=function(t,e,r){var i=this.sourceBuffer[t];if(i){var n=r.bind(this,t);this.listeners[t].push({event:e,listener:n}),i.addEventListener(e,n)}},e.removeBufferListeners=function(t){var e=this.sourceBuffer[t];e&&this.listeners[t].forEach((function(t){e.removeEventListener(t.event,t.listener)}))},t}(),tr={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},er=function(t){var e=t;return tr.hasOwnProperty(t)&&(e=tr[t]),String.fromCharCode(e)},rr=15,ir=100,nr={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},ar={17:2,18:4,21:6,22:8,23:10,19:13,20:15},sr={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},or={25:2,26:4,29:6,30:8,31:10,27:13,28:15},lr=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];!function(t){t[t.ERROR=0]="ERROR",t[t.TEXT=1]="TEXT",t[t.WARNING=2]="WARNING",t[t.INFO=2]="INFO",t[t.DEBUG=3]="DEBUG",t[t.DATA=3]="DATA"}(ze||(ze={}));var ur=function(){function t(){this.time=null,this.verboseLevel=ze.ERROR}return t.prototype.log=function(t,e){if(this.verboseLevel>=t){var r="function"==typeof e?e():e;l.logger.log(this.time+" ["+t+"] "+r)}},t}(),dr=function(t){for(var e=[],r=0;rir&&(this.logger.log(ze.DEBUG,"Too large cursor position "+this.pos),this.pos=ir)},e.moveCursor=function(t){var e=this.pos+t;if(t>1)for(var r=this.pos+1;r=144&&this.backSpace();var r=er(t);this.pos>=ir?this.logger.log(ze.ERROR,(function(){return"Cannot insert "+t.toString(16)+" ("+r+") at position "+e.pos+". Skipping it!"})):(this.chars[this.pos].setChar(r,this.currPenState),this.moveCursor(1))},e.clearFromPos=function(t){var e;for(e=t;e0&&(r=t?"["+e.join(" | ")+"]":e.join("\n")),r},e.getTextAndFormat=function(){return this.rows},t}(),vr=function(){function t(t,e,r){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=t,this.outputFilter=e,this.mode=null,this.verbose=0,this.displayedMemory=new gr(r),this.nonDisplayedMemory=new gr(r),this.lastOutputScreen=new gr(r),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=r}var e=t.prototype;return e.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},e.getHandler=function(){return this.outputFilter},e.setHandler=function(t){this.outputFilter=t},e.setPAC=function(t){this.writeScreen.setPAC(t)},e.setBkgData=function(t){this.writeScreen.setBkgData(t)},e.setMode=function(t){t!==this.mode&&(this.mode=t,this.logger.log(ze.INFO,(function(){return"MODE="+t})),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=t)},e.insertChars=function(t){for(var e=this,r=0;r=46,e.italics)e.foreground="white";else{var r=Math.floor(t/2)-16;e.foreground=["white","green","blue","cyan","red","yellow","magenta"][r]}this.logger.log(ze.INFO,"MIDROW: "+JSON.stringify(e)),this.writeScreen.setPen(e)},e.outputDataUpdate=function(t){void 0===t&&(t=!1);var e=this.logger.time;null!==e&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},e.cueSplitAtTime=function(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))},t}(),pr=function(){function t(t,e,r){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var i=new ur;this.channels=[null,new vr(t,e,i),new vr(t+1,r,i)],this.cmdHistory={a:null,b:null},this.logger=i}var e=t.prototype;return e.getHandler=function(t){return this.channels[t].getHandler()},e.setHandler=function(t,e){this.channels[t].setHandler(e)},e.addData=function(t,e){var r,i,n,a=!1;this.logger.time=t;for(var s=0;s ("+dr([i,n])+")"),(r=this.parseCmd(i,n))||(r=this.parseMidrow(i,n)),r||(r=this.parsePAC(i,n)),r||(r=this.parseBackgroundAttributes(i,n)),!r&&(a=this.parseChars(i,n))){var o=this.currentChannel;o&&o>0?this.channels[o].insertChars(a):this.logger.log(ze.WARNING,"No channel found yet. TEXT-MODE?")}r||a||this.logger.log(ze.WARNING,"Couldn't parse cleaned data "+dr([i,n])+" orig: "+dr([e[s],e[s+1]]))}},e.parseCmd=function(t,e){var r=this.cmdHistory;if(!((20===t||28===t||21===t||29===t)&&e>=32&&e<=47||(23===t||31===t)&&e>=33&&e<=35))return!1;if(yr(t,e,r))return mr(null,null,r),this.logger.log(ze.DEBUG,"Repeated command ("+dr([t,e])+") is dropped"),!0;var i=20===t||21===t||23===t?1:2,n=this.channels[i];return 20===t||21===t||28===t||29===t?32===e?n.ccRCL():33===e?n.ccBS():34===e?n.ccAOF():35===e?n.ccAON():36===e?n.ccDER():37===e?n.ccRU(2):38===e?n.ccRU(3):39===e?n.ccRU(4):40===e?n.ccFON():41===e?n.ccRDC():42===e?n.ccTR():43===e?n.ccRTD():44===e?n.ccEDM():45===e?n.ccCR():46===e?n.ccENM():47===e&&n.ccEOC():n.ccTO(e-32),mr(t,e,r),this.currentChannel=i,!0},e.parseMidrow=function(t,e){var r=0;if((17===t||25===t)&&e>=32&&e<=47){if((r=17===t?1:2)!==this.currentChannel)return this.logger.log(ze.ERROR,"Mismatch channel in midrow parsing"),!1;var i=this.channels[r];return!!i&&(i.ccMIDROW(e),this.logger.log(ze.DEBUG,"MIDROW ("+dr([t,e])+")"),!0)}return!1},e.parsePAC=function(t,e){var r,i=this.cmdHistory;if(!((t>=17&&t<=23||t>=25&&t<=31)&&e>=64&&e<=127||(16===t||24===t)&&e>=64&&e<=95))return!1;if(yr(t,e,i))return mr(null,null,i),!0;var n=t<=23?1:2;r=e>=64&&e<=95?1===n?nr[t]:sr[t]:1===n?ar[t]:or[t];var a=this.channels[n];return!!a&&(a.setPAC(this.interpretPAC(r,e)),mr(t,e,i),this.currentChannel=n,!0)},e.interpretPAC=function(t,e){var r,i={color:null,italics:!1,indent:null,underline:!1,row:t};return r=e>95?e-96:e-64,i.underline=1==(1&r),r<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(i.italics=!0,i.color="white"):i.indent=4*Math.floor((r-16)/2),i},e.parseChars=function(t,e){var r,i,n=null,a=null;if(t>=25?(r=2,a=t-8):(r=1,a=t),a>=17&&a<=19?(i=17===a?e+80:18===a?e+112:e+144,this.logger.log(ze.INFO,"Special char '"+er(i)+"' in channel "+r),n=[i]):t>=32&&t<=127&&(n=0===e?[t]:[t,e]),n){var s=dr(n);this.logger.log(ze.DEBUG,"Char codes = "+s.join(",")),mr(t,e,this.cmdHistory)}return n},e.parseBackgroundAttributes=function(t,e){var r;if(!((16===t||24===t)&&e>=32&&e<=47||(23===t||31===t)&&e>=45&&e<=47))return!1;var i={};16===t||24===t?(r=Math.floor((e-32)/2),i.background=lr[r],e%2==1&&(i.background=i.background+"_semi")):45===e?i.background="transparent":(i.foreground="black",47===e&&(i.underline=!0));var n=t<=23?1:2;return this.channels[n].setBkgData(i),mr(t,e,this.cmdHistory),!0},e.reset=function(){for(var t=0;tt)&&(this.startTime=t),this.endTime=e,this.screen=r,this.timelineController.createCaptionsTrack(this.trackName)},e.reset=function(){this.cueRanges=[],this.startTime=null},t}();const Sr=function(){if("undefined"!=typeof self&&self.VTTCue)return self.VTTCue;var t=["","lr","rl"],e=["start","middle","end","left","right"];function r(t,e){if("string"!=typeof e)return!1;if(!Array.isArray(t))return!1;var r=e.toLowerCase();return!!~t.indexOf(r)&&r}function i(t){return r(e,t)}function n(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i100)throw new Error("Position must be between 0 and 100.");E=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",n({},l,{get:function(){return T},set:function(t){var e=i(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");T=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",n({},l,{get:function(){return S},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");S=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",n({},l,{get:function(){return b},set:function(t){var e=i(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");b=e,this.hasBeenReset=!0}})),o.displayState=void 0}return a.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},a}();var br=function(){function t(){}return t.prototype.decode=function(t,e){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))},t}();function Lr(t){function e(t,e,r,i){return 3600*(0|t)+60*(0|e)+(0|r)+parseFloat(i||0)}var r=t.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return r?parseFloat(r[2])>59?e(r[2],r[3],0,r[4]):e(r[1],r[2],r[3],r[4]):null}var Ar=function(){function t(){this.values=Object.create(null)}var e=t.prototype;return e.set=function(t,e){this.get(t)||""===e||(this.values[t]=e)},e.get=function(t,e,r){return r?this.has(t)?this.values[t]:e[r]:this.has(t)?this.values[t]:e},e.has=function(t){return t in this.values},e.alt=function(t,e,r){for(var i=0;i=0&&r<=100)return this.set(t,r),!0}return!1},t}();function Dr(t,e,r,i){var n=i?t.split(i):[t];for(var a in n)if("string"==typeof n[a]){var s=n[a].split(r);2===s.length&&e(s[0],s[1])}}var kr=new Sr(0,0,""),Rr="middle"===kr.align?"middle":"center";function Ir(t,e,r){var i=t;function n(){var e=Lr(t);if(null===e)throw new Error("Malformed timestamp: "+i);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function a(){t=t.replace(/^\s+/,"")}if(a(),e.startTime=n(),a(),"--\x3e"!==t.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+i);t=t.slice(3),a(),e.endTime=n(),a(),function(t,e){var i=new Ar;Dr(t,(function(t,e){var n;switch(t){case"region":for(var a=r.length-1;a>=0;a--)if(r[a].id===e){i.set(t,r[a].region);break}break;case"vertical":i.alt(t,e,["rl","lr"]);break;case"line":n=e.split(","),i.integer(t,n[0]),i.percent(t,n[0])&&i.set("snapToLines",!1),i.alt(t,n[0],["auto"]),2===n.length&&i.alt("lineAlign",n[1],["start",Rr,"end"]);break;case"position":n=e.split(","),i.percent(t,n[0]),2===n.length&&i.alt("positionAlign",n[1],["start",Rr,"end","line-left","line-right","auto"]);break;case"size":i.percent(t,e);break;case"align":i.alt(t,e,["start",Rr,"end","left","right"])}}),/:/,/\s/),e.region=i.get("region",null),e.vertical=i.get("vertical","");var n=i.get("line","auto");"auto"===n&&-1===kr.line&&(n=-1),e.line=n,e.lineAlign=i.get("lineAlign","start"),e.snapToLines=i.get("snapToLines",!0),e.size=i.get("size",100),e.align=i.get("align",Rr);var a=i.get("position","auto");"auto"===a&&50===kr.position&&(a="start"===e.align||"left"===e.align?0:"end"===e.align||"right"===e.align?100:50),e.position=a}(t,e)}function wr(t){return t.replace(//gi,"\n")}var Cr=function(){function t(){this.state="INITIAL",this.buffer="",this.decoder=new br,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var e=t.prototype;return e.parse=function(t){var e=this;function r(){var t=e.buffer,r=0;for(t=wr(t);r>>0).toString()};function Mr(t,e,r){return Fr(t.toString())+Fr(e.toString())+Fr(r)}function Nr(){return Nr=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0&&(c[0]=Math.min(c[0],e),c[1]=Math.max(c[1],r),d=!0,f/(r-e)>.5))return}if(d||n.push([e,r]),this.config.renderTextTracksNatively){var g=this.captionsTracks[t];this.Cues.newCue(g,e,r,i)}else{var v=this.Cues.newCue(null,e,r,i);this.hls.trigger(s.Events.CUES_PARSED,{type:"captions",cues:v,track:t})}},e.onInitPtsFound=function(t,e){var r=this,i=e.frag,n=e.id,a=e.initPTS,o=e.timescale,l=this.unparsedVttFrags;"main"===n&&(this.initPTS[i.cc]=a,this.timescale[i.cc]=o),l.length&&(this.unparsedVttFrags=[],l.forEach((function(t){r.onFragLoaded(s.Events.FRAG_LOADED,t)})))},e.getExistingTrack=function(t){var e=this.media;if(e)for(var r=0;r0&&c.push(t)},d.onparsingerror=function(t){u=t},d.onflush=function(){u?l(u):o(c)},h.forEach((function(t){if(m){if(xr(t,"X-TIMESTAMP-MAP=")){m=!1,t.slice(16).split(",").forEach((function(t){xr(t,"LOCAL:")?g=t.slice(6):xr(t,"MPEGTS:")&&(v=parseInt(t.slice(7)))}));try{p=function(t){var e=parseInt(t.slice(-3)),r=parseInt(t.slice(-6,-4)),i=parseInt(t.slice(-9,-7)),n=t.length>9?parseInt(t.substring(0,t.indexOf(":"))):0;if(!((0,a.isFiniteNumber)(e)&&(0,a.isFiniteNumber)(r)&&(0,a.isFiniteNumber)(i)&&(0,a.isFiniteNumber)(n)))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+t);return e+=1e3*r,(e+=6e4*i)+36e5*n}(g)/1e3}catch(t){u=t}return}""===t&&(m=!1)}d.parse(t+"\n")})),d.flush()}(null!==(i=t.initSegment)&&void 0!==i&&i.data?(0,R.appendUint8Array)(t.initSegment.data,new Uint8Array(e)):e,this.initPTS[t.cc],this.timescale[t.cc],r,t.cc,t.start,(function(e){n._appendCues(e,t.level),o.trigger(s.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})}),(function(r){n._fallbackToIMSC1(t,e),l.logger.log("Failed to parse VTT cue: "+r),o.trigger(s.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:r})}))},e._fallbackToIMSC1=function(t,e){var r=this,i=this.tracks[t.level];i.textCodec||Hr(e,this.initPTS[t.cc],this.timescale[t.cc],(function(){i.textCodec=Ur,r._parseIMSC1(t,e)}),(function(){i.textCodec="wvtt"}))},e._appendCues=function(t,e){var r=this.hls;if(this.config.renderTextTracksNatively){var i=this.textTracks[e];if(!i||"disabled"===i.mode)return;t.forEach((function(t){return X(i,t)}))}else{var n=this.tracks[e];if(!n)return;var a=n.default?"default":"subtitles"+e;r.trigger(s.Events.CUES_PARSED,{type:"subtitles",cues:t,track:a})}},e.onFragDecrypted=function(t,e){var r=e.frag;if(r.type===V.PlaylistLevelType.SUBTITLE){if(!(0,a.isFiniteNumber)(this.initPTS[r.cc]))return void this.unparsedVttFrags.push(e);this.onFragLoaded(s.Events.FRAG_LOADED,e)}},e.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},e.onFragParsingUserdata=function(t,e){var r=this.cea608Parser1,i=this.cea608Parser2;if(this.enabled&&r&&i){var n=e.frag,a=e.samples;if(n.type!==V.PlaylistLevelType.MAIN||"NONE"!==this.closedCaptionsForLevel(n))for(var s=0;s0&&this.mediaWidth>0){var t=this.hls.levels;if(t.length){var e=this.hls;e.autoLevelCapping=this.getMaxLevel(t.length-1),e.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=e.autoLevelCapping}}},i.getMaxLevel=function(e){var r=this,i=this.hls.levels;if(!i.length)return-1;var n=i.filter((function(i,n){return t.isLevelAllowed(n,r.restrictedLevels)&&n<=e}));return this.clientRect=null,t.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)},i.startCapping=function(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},i.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},i.getDimensions=function(){if(this.clientRect)return this.clientRect;var t=this.media,e={width:0,height:0};if(t){var r=t.getBoundingClientRect();e.width=r.width,e.height=r.height,e.width||e.height||(e.width=r.right-r.left||t.width||0,e.height=r.bottom-r.top||t.height||0)}return this.clientRect=e,e},t.isLevelAllowed=function(t,e){return void 0===e&&(e=[]),-1===e.indexOf(t)},t.getMaxLevelByMediaSize=function(t,e,r){if(!t||!t.length)return-1;for(var i,n,a=t.length-1,s=0;s=e||o.height>=r)&&(i=o,!(n=t[s+1])||i.width!==n.width||i.height!==n.height)){a=s;break}}return a},e=t,(r=[{key:"mediaWidth",get:function(){return this.getDimensions().width*this.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*this.contentScaleFactor}},{key:"contentScaleFactor",get:function(){var t=1;if(!this.hls.config.ignoreDevicePixelRatio)try{t=self.devicePixelRatio}catch(t){}return t}}])&&$r(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Zr=function(){function t(t){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=t,this.registerListeners()}var e=t.prototype;return e.setStreamController=function(t){this.streamController=t},e.registerListeners=function(){this.hls.on(s.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},e.unregisterListeners=function(){this.hls.off(s.Events.MEDIA_ATTACHING,this.onMediaAttaching)},e.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},e.onMediaAttaching=function(t,e){var r=this.hls.config;if(r.capLevelOnFPSDrop){var i=e.media instanceof self.HTMLVideoElement?e.media:null;this.media=i,i&&"function"==typeof i.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),r.fpsDroppedMonitoringPeriod)}},e.checkFPS=function(t,e,r){var i=performance.now();if(e){if(this.lastTime){var n=i-this.lastTime,a=r-this.lastDroppedFrames,o=e-this.lastDecodedFrames,u=1e3*a/n,d=this.hls;if(d.trigger(s.Events.FPS_DROP,{currentDropped:a,currentDecoded:o,totalDroppedFrames:r}),u>0&&a>d.config.fpsDroppedMonitoringThreshold*o){var h=d.currentLevel;l.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+h),h>0&&(-1===d.autoLevelCapping||d.autoLevelCapping>=h)&&(h-=1,d.trigger(s.Events.FPS_DROP_LEVEL_CAPPING,{level:h,droppedLevel:d.currentLevel}),d.autoLevelCapping=h,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=r,this.lastDecodedFrames=e}},e.checkFPSInterval=function(){var t=this.media;if(t)if(this.isVideoPlaybackQualityAvailable){var e=t.getVideoPlaybackQuality();this.checkFPS(t,e.totalVideoFrames,e.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)},t}();var ti=r(300);function ei(t){var e="function"==typeof Map?new Map:void 0;return ei=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,i)}function i(){return ri(t,arguments,ai(this).constructor)}return i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),ni(i,t)},ei(t)}function ri(t,e,r){return ri=ii()?Reflect.construct.bind():function(t,e,r){var i=[null];i.push.apply(i,e);var n=new(Function.bind.apply(t,i));return r&&ni(n,r.prototype),n},ri.apply(null,arguments)}function ii(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function ni(t,e){return ni=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ni(t,e)}function ai(t){return ai=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ai(t)}var si="[eme]",oi=function(){function t(e){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=t.CDMCleanupPromise?[t.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=l.logger.debug.bind(l.logger,si),this.log=l.logger.log.bind(l.logger,si),this.warn=l.logger.warn.bind(l.logger,si),this.error=l.logger.error.bind(l.logger,si),this.hls=e,this.config=e.config,this.registerListeners()}var e=t.prototype;return e.destroy=function(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null},e.registerListeners=function(){this.hls.on(s.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(s.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(s.Events.MANIFEST_LOADED,this.onManifestLoaded,this)},e.unregisterListeners=function(){this.hls.off(s.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(s.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(s.Events.MANIFEST_LOADED,this.onManifestLoaded,this)},e.getLicenseServerUrl=function(t){var e=this.config,r=e.drmSystems,i=e.widevineLicenseUrl,n=r[t];if(n)return n.licenseUrl;if(t===m.WIDEVINE&&i)return i;throw new Error('no license server URL configured for key-system "'+t+'"')},e.getServerCertificateUrl=function(t){var e=this.config.drmSystems[t];if(e)return e.serverCertificateUrl;this.log('No Server Certificate in config.drmSystems["'+t+'"]')},e.attemptKeySystemAccess=function(t){var e=this,r=this.hls.levels,i=function(t,e,r){return!!t&&r.indexOf(t)===e},n=r.map((function(t){return t.audioCodec})).filter(i),a=r.map((function(t){return t.videoCodec})).filter(i);return n.length+a.length===0&&a.push("avc1.42e01e"),new Promise((function(r,i){!function t(s){var l=s.shift();e.getMediaKeysPromise(l,n,a).then((function(t){return r({keySystem:l,mediaKeys:t})})).catch((function(e){s.length?t(s):i(e instanceof li?e:new li({type:o.ErrorTypes.KEY_SYSTEM_ERROR,details:o.ErrorDetails.KEY_SYSTEM_NO_ACCESS,error:e,fatal:!0},e.message))}))}(t)}))},e.requestMediaKeySystemAccess=function(t,e){var r=this.config.requestMediaKeySystemAccessFunc;if("function"!=typeof r){var i="Configured requestMediaKeySystemAccess is not a function "+r;return null===k&&"http:"===self.location.protocol&&(i="navigator.requestMediaKeySystemAccess is not available over insecure protocol "+location.protocol),Promise.reject(new Error(i))}return r(t,e)},e.getMediaKeysPromise=function(t,e,r){var i=this,n=function(t,e,r,i){var n;switch(t){case m.FAIRPLAY:n=["cenc","sinf"];break;case m.WIDEVINE:case m.PLAYREADY:n=["cenc"];break;case m.CLEARKEY:n=["cenc","keyids"];break;default:throw new Error("Unknown key-system: "+t)}return function(t,e,r,i){return[{initDataTypes:t,persistentState:i.persistentState||"not-allowed",distinctiveIdentifier:i.distinctiveIdentifier||"not-allowed",sessionTypes:i.sessionTypes||[i.sessionType||"temporary"],audioCapabilities:e.map((function(t){return{contentType:'audio/mp4; codecs="'+t+'"',robustness:i.audioRobustness||"",encryptionScheme:i.audioEncryptionScheme||null}})),videoCapabilities:r.map((function(t){return{contentType:'video/mp4; codecs="'+t+'"',robustness:i.videoRobustness||"",encryptionScheme:i.videoEncryptionScheme||null}}))}]}(n,e,r,i)}(t,e,r,this.config.drmSystemOptions),a=this.keySystemAccessPromises[t],s=null==a?void 0:a.keySystemAccess;if(!s){this.log('Requesting encrypted media "'+t+'" key-system access with config: '+JSON.stringify(n)),s=this.requestMediaKeySystemAccess(t,n);var o=this.keySystemAccessPromises[t]={keySystemAccess:s};return s.catch((function(e){i.log('Failed to obtain access to key-system "'+t+'": '+e)})),s.then((function(e){i.log('Access for key-system "'+e.keySystem+'" obtained');var r=i.fetchServerCertificate(t);return i.log('Create media-keys for "'+t+'"'),o.mediaKeys=e.createMediaKeys().then((function(e){return i.log('Media-keys created for "'+t+'"'),r.then((function(r){return r?i.setMediaKeysServerCertificate(e,t,r):e}))})),o.mediaKeys.catch((function(e){i.error('Failed to create media-keys for "'+t+'"}: '+e)})),o.mediaKeys}))}return s.then((function(){return a.mediaKeys}))},e.createMediaKeySessionContext=function(t){var e=t.decryptdata,r=t.keySystem,i=t.mediaKeys;this.log('Creating key-system session "'+r+'" keyId: '+ti.default.hexDump(e.keyId||[]));var n=i.createSession(),a={decryptdata:e,keySystem:r,mediaKeys:i,mediaKeysSession:n,keyStatus:"status-pending"};return this.mediaKeySessions.push(a),a},e.renewKeySession=function(t){var e=t.decryptdata;if(e.pssh){var r=this.createMediaKeySessionContext(t),i=this.getKeyIdString(e);this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(r,"cenc",e.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(t)},e.getKeyIdString=function(t){if(!t)throw new Error("Could not read keyId of undefined decryptdata");if(null===t.keyId)throw new Error("keyId is null");return ti.default.hexDump(t.keyId)},e.updateKeySession=function(t,e){var r,i=t.mediaKeysSession;return this.log('Updating key-session "'+i.sessionId+'" for keyID '+ti.default.hexDump((null===(r=t.decryptdata)||void 0===r?void 0:r.keyId)||[])+"\n } (data length: "+(e?e.byteLength:e)+")"),i.update(e)},e.selectKeySystemFormat=function(t){var e=Object.keys(t.levelkeys||{});return this.keyFormatPromise||(this.log("Selecting key-system from fragment (sn: "+t.sn+" "+t.type+": "+t.level+") key formats "+e.join(", ")),this.keyFormatPromise=this.getKeyFormatPromise(e)),this.keyFormatPromise},e.getKeyFormatPromise=function(t){var e=this;return new Promise((function(r,i){var n=D(e.config),a=t.map(L).filter((function(t){return!!t&&-1!==n.indexOf(t)}));return e.getKeySystemSelectionPromise(a).then((function(t){var e=t.keySystem,n=A(e);n?r(n):i(new Error('Unable to find format for key-system "'+e+'"'))})).catch(i)}))},e.loadKey=function(t){var e=this,r=t.keyInfo.decryptdata,i=this.getKeyIdString(r),n="(keyId: "+i+' format: "'+r.keyFormat+'" method: '+r.method+" uri: "+r.uri+")";this.log("Starting session for key "+n);var a=this.keyIdToKeySessionPromise[i];return a||(a=this.keyIdToKeySessionPromise[i]=this.getKeySystemForKeyPromise(r).then((function(i){var a=i.keySystem,s=i.mediaKeys;return e.throwIfDestroyed(),e.log("Handle encrypted media sn: "+t.frag.sn+" "+t.frag.type+": "+t.frag.level+" using key "+n),e.attemptSetMediaKeys(a,s).then((function(){e.throwIfDestroyed();var t=e.createMediaKeySessionContext({keySystem:a,mediaKeys:s,decryptdata:r});return e.generateRequestWithPreferredKeySession(t,"cenc",r.pssh,"playlist-key")}))}))).catch((function(t){return e.handleError(t)})),a},e.throwIfDestroyed=function(t){if(void 0===t&&(t="Invalid state"),!this.hls)throw new Error("invalid state")},e.handleError=function(t){this.hls&&(this.error(t.message),t instanceof li?this.hls.trigger(s.Events.ERROR,t.data):this.hls.trigger(s.Events.ERROR,{type:o.ErrorTypes.KEY_SYSTEM_ERROR,details:o.ErrorDetails.KEY_SYSTEM_NO_KEYS,error:t,fatal:!0}))},e.getKeySystemForKeyPromise=function(t){var e=this.getKeyIdString(t),r=this.keyIdToKeySessionPromise[e];if(!r){var i=L(t.keyFormat),n=i?[i]:D(this.config);return this.attemptKeySystemAccess(n)}return r},e.getKeySystemSelectionPromise=function(t){if(t.length||(t=D(this.config)),0===t.length)throw new li({type:o.ErrorTypes.KEY_SYSTEM_ERROR,details:o.ErrorDetails.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},"Missing key-system license configuration options "+JSON.stringify({drmSystems:this.config.drmSystems}));return this.attemptKeySystemAccess(t)},e._onMediaEncrypted=function(t){var e=this,r=t.initDataType,i=t.initData;if(this.debug('"'+t.type+'" event: init data type: "'+r+'"'),null!==i){var n,a;if("sinf"===r&&this.config.drmSystems[m.FAIRPLAY]){var s=(0,R.bin2str)(new Uint8Array(i));try{var o=S(JSON.parse(s).sinf),l=(0,R.parseSinf)(new Uint8Array(o));if(!l)return;n=l.subarray(8,24),a=m.FAIRPLAY}catch(t){return void this.warn('Failed to parse sinf "encrypted" event message initData')}}else{var u=(0,R.parsePssh)(i);if(null===u)return;0===u.version&&u.systemId===E.WIDEVINE&&u.data&&(n=u.data.subarray(8,24)),a=function(t){if(t===E.WIDEVINE)return m.WIDEVINE}(u.systemId)}if(a&&n){for(var d=ti.default.hexDump(n),h=this.keyIdToKeySessionPromise,c=this.mediaKeySessions,f=h[d],g=function(t){var a=c[t],s=a.decryptdata;if(s.pssh||!s.keyId)return"continue";var o=ti.default.hexDump(s.keyId);return d===o||-1!==s.uri.replace(/-/g,"").indexOf(d)?(f=h[o],delete h[o],s.pssh=new Uint8Array(i),s.keyId=n,f=h[d]=f.then((function(){return e.generateRequestWithPreferredKeySession(a,r,i,"encrypted-event-key-match")})),"break"):void 0},v=0;v3||s.status>=400&&s.status<500)n(new li({type:o.ErrorTypes.KEY_SYSTEM_ERROR,details:o.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:s},"License Request XHR failed ("+a+"). Status: "+s.status+" ("+s.statusText+")"));else{var d=3-r._requestLicenseFailureCount+1;r.warn("Retrying license request, "+d+" attempts left"),r.requestLicense(t,e).then(i,n)}},t.licenseXhr&&t.licenseXhr.readyState!==XMLHttpRequest.DONE&&t.licenseXhr.abort(),t.licenseXhr=s,r.setupLicenseXHR(s,a,t,e).then((function(t){var e=t.xhr,r=t.licenseChallenge;e.send(r)}))}))},e.onMediaAttached=function(t,e){if(this.config.emeEnabled){var r=e.media;this.media=r,r.addEventListener("encrypted",this.onMediaEncrypted),r.addEventListener("waitingforkey",this.onWaitingForKey)}},e.onMediaDetached=function(){var e=this,r=this.media,i=this.mediaKeySessions;r&&(r.removeEventListener("encrypted",this.onMediaEncrypted),r.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},w.clearKeyUriToKeyIdMap();var n=i.length;t.CDMCleanupPromise=Promise.all(i.map((function(t){return e.removeSession(t)})).concat(null==r?void 0:r.setMediaKeys(null).catch((function(t){e.log("Could not clear media keys: "+t+". media.src: "+(null==r?void 0:r.src))})))).then((function(){n&&(e.log("finished closing key sessions and clearing media keys"),i.length=0)})).catch((function(t){e.log("Could not close sessions and clear media keys: "+t+". media.src: "+(null==r?void 0:r.src))}))},e.onManifestLoaded=function(t,e){var r=e.sessionKeys;if(r&&this.config.emeEnabled&&!this.keyFormatPromise){var i=r.reduce((function(t,e){return-1===t.indexOf(e.keyFormat)&&t.push(e.keyFormat),t}),[]);this.log("Selecting key-system from session-keys "+i.join(", ")),this.keyFormatPromise=this.getKeyFormatPromise(i)}},e.removeSession=function(t){var e=this,r=t.mediaKeysSession,i=t.licenseXhr;if(r){this.log("Remove licenses and keys and close session "+r.sessionId),r.onmessage=null,r.onkeystatuseschange=null,i&&i.readyState!==XMLHttpRequest.DONE&&i.abort(),t.mediaKeysSession=t.decryptdata=t.licenseXhr=void 0;var n=this.mediaKeySessions.indexOf(t);return n>-1&&this.mediaKeySessions.splice(n,1),r.remove().catch((function(t){e.log("Could not remove session: "+t)})).then((function(){return r.close()})).catch((function(t){e.log("Could not close session: "+t)}))}},t}();oi.CDMCleanupPromise=void 0;var li=function(t){var e,r;function i(e,r){var i;return(i=t.call(this,r)||this).data=void 0,i.data=e,e.err=e.error,i}return r=t,(e=i).prototype=Object.create(r.prototype),e.prototype.constructor=e,ni(e,r),i}(ei(Error));const ui=oi;var di,hi,ci;function fi(t,e){for(var r=0;r=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function pi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r-1?n+1:i.levels.length;e=i.levels.slice(0,a)}for(var s,o=vi(e);!(s=o()).done;){var l=s.value;l.bitrate>r&&(r=l.bitrate)}return r>0?r:NaN},e.getBufferLength=function(t){var e=this.hls.media,r=t===di.AUDIO?this.audioBuffer:this.videoBuffer;return r&&e?1e3*Bt.bufferInfo(r,e.currentTime,this.config.maxBufferHole).len:NaN},e.createPlaylistLoader=function(){var t=this.config.pLoader,e=this.applyPlaylistData,r=t||this.config.loader;return function(){function t(t){this.loader=void 0,this.loader=new r(t)}var i=t.prototype;return i.destroy=function(){this.loader.destroy()},i.abort=function(){this.loader.abort()},i.load=function(t,r,i){e(t),this.loader.load(t,r,i)},gi(t,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),t}()},e.createFragmentLoader=function(){var t=this.config.fLoader,e=this.applyFragmentData,r=t||this.config.loader;return function(){function t(t){this.loader=void 0,this.loader=new r(t)}var i=t.prototype;return i.destroy=function(){this.loader.destroy()},i.abort=function(){this.loader.abort()},i.load=function(t,r,i){e(t),this.loader.load(t,r,i)},gi(t,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),t}()},t.uuid=function(){var t=URL.createObjectURL(new Blob),e=t.toString();return URL.revokeObjectURL(t),e.slice(e.lastIndexOf("/")+1)},t.serialize=function(t){for(var e,r=[],i=function(t){return!Number.isNaN(t)&&null!=t&&""!==t&&!1!==t},n=function(t){return Math.round(t)},a=function(t){return 100*n(t/100)},s={br:n,d:n,bl:a,dl:a,mtp:a,nor:function(t){return encodeURIComponent(t)},rtp:a,tb:n},o=vi(Object.keys(t||{}).sort());!(e=o()).done;){var l=e.value,u=t[l];if(i(u)&&!("v"===l&&1===u||"pr"==l&&1===u)){var d=s[l];d&&(u=d(u));var h,c=typeof u;h="ot"===l||"sf"===l||"st"===l?l+"="+u:"boolean"===c?l:"number"===c?l+"="+u:l+"="+JSON.stringify(u),r.push(h)}}return r.join(",")},t.toHeaders=function(e){for(var r={},i=["Object","Request","Session","Status"],n=[{},{},{},{}],a={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},s=0,o=Object.keys(e);s=2)if(self.clearTimeout(this.requestTimeout),0===r.loading.first&&(r.loading.first=Math.max(self.performance.now(),r.loading.start)),4===i){e.onreadystatechange=null,e.onprogress=null;var a=e.status,s="arraybuffer"===e.responseType;if(a>=200&&a<300&&(s&&e.response||null!==e.responseText)){var o,u;if(r.loading.end=Math.max(self.performance.now(),r.loading.first),u=s?(o=e.response).byteLength:(o=e.responseText).length,r.loaded=r.total=u,!this.callbacks)return;var d=this.callbacks.onProgress;if(d&&d(r,t,o,e),!this.callbacks)return;var h={url:e.responseURL,data:o};this.callbacks.onSuccess(h,r,t,e)}else r.retry>=n.maxRetry||a>=400&&a<499?(l.logger.error(a+" while loading "+t.url),this.callbacks.onError({code:a,text:e.statusText},t,e)):(l.logger.warn(a+" while loading "+t.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,n.maxRetryDelay),r.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout)}},e.loadtimeout=function(){l.logger.warn("timeout while loading "+this.context.url);var t=this.callbacks;t&&(this.abortInternal(),t.onTimeout(this.stats,this.context,this.loader))},e.loadprogress=function(t){var e=this.stats;e.loaded=t.loaded,t.lengthComputable&&(e.total=t.total)},e.getCacheAge=function(){var t=null;if(this.loader&&Ti.test(this.loader.getAllResponseHeaders())){var e=this.loader.getResponseHeader("age");t=e?parseFloat(e):null}return t},t}();function bi(t){var e="function"==typeof Map?new Map:void 0;return bi=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,i)}function i(){return Li(t,arguments,ki(this).constructor)}return i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Di(i,t)},bi(t)}function Li(t,e,r){return Li=Ai()?Reflect.construct.bind():function(t,e,r){var i=[null];i.push.apply(i,e);var n=new(Function.bind.apply(t,i));return r&&Di(n,r.prototype),n},Li.apply(null,arguments)}function Ai(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function Di(t,e){return Di=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Di(t,e)}function ki(t){return ki=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ki(t)}function Ri(){return Ri=Object.assign?Object.assign.bind():function(t){for(var e=1;e=i&&n(e,r,a.flush(),t)):n(e,r,l,t),o()})).catch((function(){return Promise.reject()}))}()},t}();function wi(t,e){return new self.Request(t.url,e)}var Ci=function(t){var e,r;function i(e,r,i){var n;return(n=t.call(this,e)||this).code=void 0,n.details=void 0,n.code=r,n.details=i,n}return r=t,(e=i).prototype=Object.create(r.prototype),e.prototype.constructor=e,Di(e,r),i}(bi(Error));const _i=Ii;var Pi=/\s/;function Oi(){return Oi=Object.assign?Object.assign.bind():function(t){for(var e=1;e=16?o--:o++;var f=wr(l.trim()),g=Mr(e,r,f);t&&t.cues&&t.cues.getCueById(g)||((a=new d(e,r,f)).id=g,a.line=h+1,a.align="left",a.position=10+Math.min(80,10*Math.floor(8*o/32)),u.push(a))}return t&&u.length&&(u.sort((function(t,e){return"auto"===t.line||"auto"===e.line?0:t.line>8&&e.line>8?e.line-t.line:t.line-e.line})),u.forEach((function(e){return X(t,e)}))),u}},enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:je,subtitleTrackController:Xe,timelineController:zr,audioStreamController:Ne,audioTrackController:Ge,emeController:ui,cmcdController:yi});function Ui(t,e){for(var r=0;r-1&&(this._maxHdcpLevel=t)}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var t=this.levels,e=this.config.minAutoBitrate;if(!t)return 0;for(var r=t.length,i=0;i=e)return i;return 0}},{key:"maxAutoLevel",get:function(){var t,e=this.levels,r=this.autoLevelCapping,i=this.maxHdcpLevel;if(t=-1===r&&e&&e.length?e.length-1:r,i)for(var n=t;n--;){var a=e[n].attrs["HDCP-LEVEL"];if(a&&a<=i)return n}return t}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(t){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,t)}},{key:"playingDate",get:function(){return this.streamController.currentProgramDateTime}},{key:"mainForwardBufferInfo",get:function(){return this.streamController.getMainFwdBufferInfo()}},{key:"audioTracks",get:function(){var t=this.audioTrackController;return t?t.audioTracks:[]}},{key:"audioTrack",get:function(){var t=this.audioTrackController;return t?t.audioTrack:-1},set:function(t){var e=this.audioTrackController;e&&(e.audioTrack=t)}},{key:"subtitleTracks",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTrack:-1},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleTrack=t)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var t=this.subtitleTrackController;return!!t&&t.subtitleDisplay},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleDisplay=t)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(t){this.config.lowLatencyMode=t}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}])&&Ui(e.prototype,r),i&&Ui(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();Bi.defaultConfig=void 0},923:(t,e,r)=>{"use strict";r.r(e),r.d(e,{BaseSegment:()=>h,ElementaryStreamTypes:()=>i,Fragment:()=>c,Part:()=>f});var i,n=r(965),a=r(945),s=r(408);function o(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,l(t,e)}function l(t,e){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},l(t,e)}function u(t,e){for(var r=0;r1||1===r&&this.levelkeys[e[0]].encrypted)return!0}return!1}}]),e}(h),f=function(t){function e(e,r,i,n,a){var o;(o=t.call(this,i)||this).fragOffset=0,o.duration=0,o.gap=!1,o.independent=!1,o.relurl=void 0,o.fragment=void 0,o.index=void 0,o.stats=new s.LoadStats,o.duration=e.decimalFloatingPoint("DURATION"),o.gap=e.bool("GAP"),o.independent=e.bool("INDEPENDENT"),o.relurl=e.enumeratedString("URI"),o.fragment=r,o.index=n;var l=e.enumeratedString("BYTERANGE");return l&&o.setByteRange(l,a),a&&(o.fragOffset=a.fragOffset+a.duration),o}return o(e,t),d(e,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var t=this.elementaryStreams;return!!(t.audio||t.video||t.audiovideo)}}]),e}(h)},408:(t,e,r)=>{"use strict";r.r(e),r.d(e,{LoadStats:()=>i});var i=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},965:(t,e,r)=>{"use strict";r.r(e),r.d(e,{MAX_SAFE_INTEGER:()=>n,isFiniteNumber:()=>i});var i=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},n=Number.MAX_SAFE_INTEGER||9007199254740991},524:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>p,flushTextTrackMetadataCueSamples:()=>y,flushTextTrackUserdataCueSamples:()=>E,normalizePts:()=>m});var i=r(965);const n=function(){function t(){}return t.getSilentFrame=function(t,e){if("mp4a.40.2"===t){if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===e)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}},t}();var a=Math.pow(2,32)-1,s=function(){function t(){}return t.init=function(){var e;for(e in t.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},t.types)t.types.hasOwnProperty(e)&&(t.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);var r=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),i=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);t.HDLR_TYPES={video:r,audio:i};var n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),a=new Uint8Array([0,0,0,0,0,0,0,0]);t.STTS=t.STSC=t.STCO=a,t.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),t.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),t.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),t.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var s=new Uint8Array([105,115,111,109]),o=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);t.FTYP=t.box(t.types.ftyp,s,l,s,o),t.DINF=t.box(t.types.dinf,t.box(t.types.dref,n))},t.box=function(t){for(var e=8,r=arguments.length,i=new Array(r>1?r-1:0),n=1;n>24&255,o[1]=e>>16&255,o[2]=e>>8&255,o[3]=255&e,o.set(t,4),a=0,e=8;a>24&255,e>>16&255,e>>8&255,255&e,i>>24,i>>16&255,i>>8&255,255&i,n>>24,n>>16&255,n>>8&255,255&n,85,196,0,0]))},t.mdia=function(e){return t.box(t.types.mdia,t.mdhd(e.timescale,e.duration),t.hdlr(e.type),t.minf(e))},t.mfhd=function(e){return t.box(t.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))},t.minf=function(e){return"audio"===e.type?t.box(t.types.minf,t.box(t.types.smhd,t.SMHD),t.DINF,t.stbl(e)):t.box(t.types.minf,t.box(t.types.vmhd,t.VMHD),t.DINF,t.stbl(e))},t.moof=function(e,r,i){return t.box(t.types.moof,t.mfhd(e),t.traf(i,r))},t.moov=function(e){for(var r=e.length,i=[];r--;)i[r]=t.trak(e[r]);return t.box.apply(null,[t.types.moov,t.mvhd(e[0].timescale,e[0].duration)].concat(i).concat(t.mvex(e)))},t.mvex=function(e){for(var r=e.length,i=[];r--;)i[r]=t.trex(e[r]);return t.box.apply(null,[t.types.mvex].concat(i))},t.mvhd=function(e,r){r*=e;var i=Math.floor(r/(a+1)),n=Math.floor(r%(a+1)),s=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24,i>>16&255,i>>8&255,255&i,n>>24,n>>16&255,n>>8&255,255&n,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return t.box(t.types.mvhd,s)},t.sdtp=function(e){var r,i,n=e.samples||[],a=new Uint8Array(4+n.length);for(r=0;r>>8&255),a.push(255&n),a=a.concat(Array.prototype.slice.call(i));for(r=0;r>>8&255),s.push(255&n),s=s.concat(Array.prototype.slice.call(i));var o=t.box(t.types.avcC,new Uint8Array([1,a[3],a[4],a[5],255,224|e.sps.length].concat(a).concat([e.pps.length]).concat(s))),l=e.width,u=e.height,d=e.pixelRatio[0],h=e.pixelRatio[1];return t.box(t.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,255&l,u>>8&255,255&u,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,t.box(t.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),t.box(t.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,255&d,h>>24,h>>16&255,h>>8&255,255&h])))},t.esds=function(t){var e=t.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(t.config).concat([6,1,2]))},t.mp4a=function(e){var r=e.samplerate;return t.box(t.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]),t.box(t.types.esds,t.esds(e)))},t.mp3=function(e){var r=e.samplerate;return t.box(t.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]))},t.stsd=function(e){return"audio"===e.type?"mp3"===e.segmentCodec&&"mp3"===e.codec?t.box(t.types.stsd,t.STSD,t.mp3(e)):t.box(t.types.stsd,t.STSD,t.mp4a(e)):t.box(t.types.stsd,t.STSD,t.avc1(e))},t.tkhd=function(e){var r=e.id,i=e.duration*e.timescale,n=e.width,s=e.height,o=Math.floor(i/(a+1)),l=Math.floor(i%(a+1));return t.box(t.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,l>>24,l>>16&255,l>>8&255,255&l,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>8&255,255&n,0,0,s>>8&255,255&s,0,0]))},t.traf=function(e,r){var i=t.sdtp(e),n=e.id,s=Math.floor(r/(a+1)),o=Math.floor(r%(a+1));return t.box(t.types.traf,t.box(t.types.tfhd,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n])),t.box(t.types.tfdt,new Uint8Array([1,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,o>>24,o>>16&255,o>>8&255,255&o])),t.trun(e,i.length+16+20+8+16+8+8),i)},t.trak=function(e){return e.duration=e.duration||4294967295,t.box(t.types.trak,t.tkhd(e),t.mdia(e))},t.trex=function(e){var r=e.id;return t.box(t.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},t.trun=function(e,r){var i,n,a,s,o,l,u=e.samples||[],d=u.length,h=12+16*d,c=new Uint8Array(h);for(r+=8+h,c.set(["video"===e.type?1:0,0,15,1,d>>>24&255,d>>>16&255,d>>>8&255,255&d,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),i=0;i>>24&255,a>>>16&255,a>>>8&255,255&a,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,61440&o.degradPrio,15&o.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*i);return t.box(t.types.trun,c)},t.initSegment=function(e){t.types||t.init();var r=t.moov(e),i=new Uint8Array(t.FTYP.byteLength+r.byteLength);return i.set(t.FTYP),i.set(r,t.FTYP.byteLength),i},t}();s.types=void 0,s.HDLR_TYPES=void 0,s.STTS=void 0,s.STSC=void 0,s.STCO=void 0,s.STSZ=void 0,s.VMHD=void 0,s.SMHD=void 0,s.STSD=void 0,s.FTYP=void 0,s.DINF=void 0;const o=s;var l=r(851),u=r(973),d=r(93),h=r(308),c=r(673);function f(){return f=Object.assign?Object.assign.bind():function(t){for(var e=1;e0?t:r.pts}),t[0].pts);return e&&d.logger.debug("PTS rollover detected"),r},e.remux=function(t,e,r,i,n,a,s,o){var l,u,c,f,g,v,p=n,T=n,S=t.pid>-1,b=e.pid>-1,L=e.samples.length,A=t.samples.length>0,D=s&&L>0||L>1;if((!S||A)&&(!b||D)||this.ISGenerated||s){this.ISGenerated||(c=this.generateIS(t,e,n));var k,R=this.isVideoContiguous,I=-1;if(D&&(I=function(t){for(var e=0;e0){d.logger.warn("[mp4-remuxer]: Dropped "+I+" out of "+L+" video samples due to a missing keyframe");var w=this.getVideoStartPts(e.samples);e.samples=e.samples.slice(I),e.dropped+=I,k=T+=(e.samples[0].pts-w)/e.inputTimeScale}else-1===I&&(d.logger.warn("[mp4-remuxer]: No keyframe found out of "+L+" video samples"),v=!1);if(this.ISGenerated){if(A&&D){var C=this.getVideoStartPts(e.samples),_=(m(t.samples[0].pts,C)-C)/e.inputTimeScale;p+=Math.max(0,_),T+=Math.max(0,-_)}if(A){if(t.samplerate||(d.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),c=this.generateIS(t,e,n)),u=this.remuxAudio(t,p,this.isAudioContiguous,a,b||D||o===h.PlaylistLevelType.AUDIO?T:void 0),D){var P=u?u.endPTS-u.startPTS:0;e.inputTimeScale||(d.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),c=this.generateIS(t,e,n)),l=this.remuxVideo(e,T,R,P)}}else D&&(l=this.remuxVideo(e,T,R,0));l&&(l.firstKeyFrame=I,l.independent=-1!==I,l.firstKeyFramePTS=k)}}return this.ISGenerated&&(r.samples.length&&(g=y(r,n,this._initPTS,this._initDTS)),i.samples.length&&(f=E(i,n,this._initPTS))),{audio:u,video:l,initSegment:c,independent:v,text:f,id3:g}},e.generateIS=function(t,e,r){var n,a,s,l=t.samples,u=e.samples,d=this.typeSupported,h={},c=!(0,i.isFiniteNumber)(this._initPTS),f="audio/mp4";if(c&&(n=a=1/0),t.config&&l.length&&(t.timescale=t.samplerate,"mp3"===t.segmentCodec&&(d.mpeg?(f="audio/mpeg",t.codec=""):d.mp3&&(t.codec="mp3")),h.audio={id:"audio",container:f,codec:t.codec,initSegment:"mp3"===t.segmentCodec&&d.mpeg?new Uint8Array(0):o.initSegment([t]),metadata:{channelCount:t.channelCount}},c&&(s=t.inputTimeScale,n=a=l[0].pts-Math.round(s*r))),e.sps&&e.pps&&u.length&&(e.timescale=e.inputTimeScale,h.video={id:"main",container:"video/mp4",codec:e.codec,initSegment:o.initSegment([e]),metadata:{width:e.width,height:e.height}},c)){s=e.inputTimeScale;var g=this.getVideoStartPts(u),v=Math.round(s*r);a=Math.min(a,m(u[0].dts,g)-v),n=Math.min(n,g-v)}if(Object.keys(h).length)return this.ISGenerated=!0,c&&(this._initPTS=n,this._initDTS=a),{tracks:h,initPTS:n,timescale:s}},e.remuxVideo=function(t,e,r,i){var n,a,s=t.inputTimeScale,h=t.samples,p=[],y=h.length,E=this._initPTS,S=this.nextAvcDts,b=8,L=this.videoSampleDuration,A=Number.POSITIVE_INFINITY,D=Number.NEGATIVE_INFINITY,k=!1;r&&null!==S||(S=e*s-(h[0].pts-m(h[0].dts,h[0].pts)));for(var R=0;R0?R-1:R].dts&&(k=!0)}k&&h.sort((function(t,e){var r=t.dts-e.dts,i=t.pts-e.pts;return r||i})),n=h[0].dts;var w=h[h.length-1].dts-n,C=w?Math.round(w/(y-1)):L||t.inputTimeScale/30;if(r){var _=n-S,P=_>C,O=_<-1;if((P||O)&&(P?d.logger.warn("AVC: "+(0,c.toMsFromMpegTsClock)(_,!0)+" ms ("+_+"dts) hole between fragments detected, filling it"):d.logger.warn("AVC: "+(0,c.toMsFromMpegTsClock)(-_,!0)+" ms ("+_+"dts) overlapping between fragments detected"),!O||S>h[0].pts)){n=S;var x=h[0].pts-_;h[0].dts=n,h[0].pts=x,d.logger.log("Video: First PTS/DTS adjusted: "+(0,c.toMsFromMpegTsClock)(x,!0)+"/"+(0,c.toMsFromMpegTsClock)(n,!0)+", delta: "+(0,c.toMsFromMpegTsClock)(_,!0)+" ms")}}n=Math.max(0,n);for(var F=0,M=0,N=0;N0?J.dts-h[$-1].dts:C;if(st=$>0?J.pts-h[$-1].pts:C,ot.stretchShortVideoTrack&&null!==this.nextAudioPts){var ut=Math.floor(ot.maxBufferHole*s),dt=(i?A+i*s:this.nextAudioPts)-J.pts;dt>ut?((L=dt-lt)<0?L=lt:W=!0,d.logger.log("[mp4-remuxer]: It is approximately "+dt/90+" ms to the next segment; using duration "+L/90+" ms for the last video frame.")):L=lt}else L=lt}var ht=Math.round(J.pts-J.dts);q=Math.min(q,L),z=Math.max(z,L),X=Math.min(X,st),Q=Math.max(Q,st),p.push(new T(J.key,L,tt,ht))}if(p.length)if(g){if(g<70){var ct=p[0].flags;ct.dependsOn=2,ct.isNonSync=0}}else if(v&&Q-X0&&(i&&Math.abs(A-L)<9e3||Math.abs(m(S[0].pts-v,A)-L)<20*g),S.forEach((function(t){t.pts=m(t.pts-v,A)})),!r||L<0){if(S=S.filter((function(t){return t.pts>=0})),!S.length)return;L=0===a?0:i&&!E?Math.max(0,A):S[0].pts}if("aac"===t.segmentCodec)for(var D=this.config.maxAudioFramesDrift,k=0,R=L;k=D*g&&_<1e4&&E){var P=Math.round(C/g);(R=w-P*g)<0&&(P--,R+=g),0===k&&(this.nextAudioPts=L=R),d.logger.warn("[mp4-remuxer]: Injecting "+P+" audio frame @ "+(R/s).toFixed(3)+"s due to "+Math.round(1e3*C/s)+" ms gap.");for(var O=0;O0))return;B+=b;try{M=new Uint8Array(B)}catch(t){return void this.observer.emit(l.Events.ERROR,l.Events.ERROR,{type:u.ErrorTypes.MUX_ERROR,details:u.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:B,reason:"fail allocating audio mdat "+B})}p||(new DataView(M.buffer).setUint32(0,B),M.set(o.types.mdat,4))}M.set(V,b);var W=V.byteLength;b+=W,y.push(new T(!0,c,W,0)),U=Y}var q=y.length;if(q){var X=y[y.length-1];this.nextAudioPts=L=U+h*X.duration;var z=p?new Uint8Array(0):o.moof(t.sequenceNumber++,N/h,f({},t,{samples:y}));t.samples=[];var Q=N/s,$=L/s,J={data1:z,data2:M,startPTS:Q,endPTS:$,startDTS:Q,endDTS:$,type:"audio",hasAudio:!0,hasVideo:!1,nb:q};return this.isAudioContiguous=!0,J}},e.remuxEmptyAudio=function(t,e,r,i){var a=t.inputTimeScale,s=a/(t.samplerate?t.samplerate:a),o=this.nextAudioPts,l=(null!==o?o:i.startDTS*a)+this._initDTS,u=i.endDTS*a+this._initDTS,h=1024*s,c=Math.ceil((u-l)/h),f=n.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);if(d.logger.warn("[mp4-remuxer]: remux empty Audio"),f){for(var g=[],v=0;v4294967296;)t+=r;return t}function y(t,e,r,i){var n=t.samples.length;if(n){for(var a=t.inputTimeScale,s=0;s{"use strict";var i;r.r(e),r.d(e,{MetadataSchema:()=>i}),function(t){t.audioId3="org.id3",t.dateRange="com.apple.quicktime.HLS",t.emsg="https://aomedia.org/emsg/ID3"}(i||(i={}))},308:(t,e,r)=>{"use strict";var i,n;r.r(e),r.d(e,{PlaylistContextType:()=>i,PlaylistLevelType:()=>n}),function(t){t.MANIFEST="manifest",t.LEVEL="level",t.AUDIO_TRACK="audioTrack",t.SUBTITLE_TRACK="subtitleTrack"}(i||(i={})),function(t){t.MAIN="main",t.AUDIO="audio",t.SUBTITLE="subtitle"}(n||(n={}))},300:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>i});const i={hexDump:function(t){for(var e="",r=0;r{"use strict";r.r(e),r.d(e,{enableLogs:()=>o,logger:()=>l});var i=function(){},n={trace:i,debug:i,log:i,warn:i,info:i,error:i},a=n;function s(t){var e=self.console[t];return e?e.bind(self.console,"["+t+"] >"):i}function o(t,e){if(self.console&&!0===t||"object"==typeof t){!function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i{"use strict";r.r(e),r.d(e,{RemuxerTrackIdConfig:()=>d,appendUint8Array:()=>k,bin2str:()=>h,computeRawDurationFromSamples:()=>L,discardEPB:()=>C,findBox:()=>p,getDuration:()=>b,getStartDTS:()=>S,mp4Box:()=>P,mp4pssh:()=>O,offsetStartDTS:()=>A,parseEmsg:()=>_,parseInitSegment:()=>y,parsePssh:()=>x,parseSEIMessageFromNALu:()=>w,parseSamples:()=>R,parseSegmentIndex:()=>m,parseSinf:()=>T,patchEncyptionData:()=>E,readSint32:()=>g,readUint16:()=>c,readUint32:()=>f,segmentValidRange:()=>D,writeUint32:()=>v});var i=r(923),n=r(145),a=r(181),s=r(93),o=r(300),l=Math.pow(2,32)-1,u=[].push,d={video:1,audio:2,id3:3,text:4};function h(t){return String.fromCharCode.apply(null,t)}function c(t,e){var r=t[e]<<8|t[e+1];return r<0?65536+r:r}function f(t,e){var r=g(t,e);return r<0?4294967296+r:r}function g(t,e){return t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}function v(t,e,r){t[e]=r>>24,t[e+1]=r>>16&255,t[e+2]=r>>8&255,t[e+3]=255&r}function p(t,e){var r=[];if(!e.length)return r;for(var i=t.byteLength,n=0;n1?n+a:i;if(h(t.subarray(n+4,n+8))===e[0])if(1===e.length)r.push(t.subarray(n+8,s));else{var o=p(t.subarray(n+8,s),e.slice(1));o.length&&u.apply(r,o)}n=s}return r}function m(t){var e=[],r=t[0],i=8,n=f(t,i);i+=4,i+=0===r?8:16,i+=2;var a=t.length+0,s=c(t,i);i+=2;for(var o=0;o>>31)return console.warn("SIDX has hierarchical references (not supported)"),null;var h=f(t,l);l+=4,e.push({referenceSize:d,subsegmentDuration:h,info:{duration:h/n,start:a,end:a+d-1}}),a+=d,i=l+=4}return{earliestPresentationTime:0,timescale:n,version:r,referencesCount:s,references:e}}function y(t){for(var e=[],r=p(t,["moov","trak"]),n=0;n0;n||(i=p(e,["encv"])),i.forEach((function(t){p(n?t.subarray(28):t.subarray(78),["sinf"]).forEach((function(t){var e=T(t);if(e){var i=e.subarray(8,24);i.some((function(t){return 0!==t}))||(s.logger.log("[eme] Patching keyId in 'enc"+(n?"a":"v")+">sinf>>tenc' box: "+o.default.hexDump(i)+" -> "+o.default.hexDump(r)),e.set(r,8))}}))}))})),t}function T(t){var e=p(t,["schm"])[0];if(e){var r=h(e.subarray(4,8));if("cbcs"===r||"cenc"===r)return p(t,["schi","tenc"])[0]}return s.logger.error("[eme] missing 'schm' box"),null}function S(t,e){return p(e,["moof","traf"]).reduce((function(e,r){var i=p(r,["tfdt"])[0],n=i[0],a=p(r,["tfhd"]).reduce((function(e,r){var a=f(r,4),s=t[a];if(s){var o=f(i,4);1===n&&(o*=Math.pow(2,32),o+=f(i,8));var l=o/(s.timescale||9e4);if(isFinite(l)&&(null===e||l>1&63;return 39===r||40===r}return 6==(31&e)}function w(t,e,r,i){var n=C(t),s=0;s+=e;for(var o=0,l=0,u=!1,d=0;s=n.length)break;o+=d=n[s++]}while(255===d);l=0;do{if(s>=n.length)break;l+=d=n[s++]}while(255===d);var h=n.length-s;if(!u&&4===o&&s16){for(var b=[],L=0;L<16;L++){var A=n[s++].toString(16);b.push(1==A.length?"0"+A:A),3!==L&&5!==L&&7!==L&&9!==L||b.push("-")}for(var D=l-16,k=new Uint8Array(D),R=0;Rh)break}}function C(t){for(var e=t.byteLength,r=[],i=1;i1?e-1:0),i=1;i>24&255,o[1]=a>>16&255,o[2]=a>>8&255,o[3]=255&a,o.set(t,4),s=0,a=8;s0?(a=new Uint8Array(4),e.length>0&&new DataView(a.buffer).setUint32(0,e.length,!1)):a=new Uint8Array;var l=new Uint8Array(4);return r&&r.byteLength>0&&new DataView(l.buffer).setUint32(0,r.byteLength,!1),P([112,115,115,104],new Uint8Array([i,0,0,0]),t,a,n,l,r||new Uint8Array)}function x(t){if(!(t instanceof ArrayBuffer)||t.byteLength<32)return null;var e={version:0,systemId:"",kids:null,data:null},r=new DataView(t),i=r.getUint32(0);if(t.byteLength!==i&&i>44)return null;if(1886614376!==r.getUint32(4))return null;if(e.version=r.getUint32(8)>>>24,e.version>1)return null;e.systemId=o.default.hexDump(new Uint8Array(t,12,16));var n=r.getUint32(28);if(0===e.version){if(i-32{"use strict";function i(t,e,r,i){void 0===r&&(r=1),void 0===i&&(i=!1);var n=t*e*r;return i?Math.round(n):n}function n(t,e,r,n){return void 0===r&&(r=1),void 0===n&&(n=!1),i(t,e,1/r,n)}function a(t,e){return void 0===e&&(e=!1),i(t,1e3,1/9e4,e)}function s(t,e){return void 0===e&&(e=1),i(t,9e4,1/e)}r.r(e),r.d(e,{toMpegTsClockFromTimescale:()=>s,toMsFromMpegTsClock:()=>a,toTimescaleFromBase:()=>i,toTimescaleFromScale:()=>n})},145:(t,e,r)=>{"use strict";function i(t,e,r){return Uint8Array.prototype.slice?t.slice(e,r):new Uint8Array(Array.prototype.slice.call(t,e,r))}r.r(e),r.d(e,{sliceUint8:()=>i})},729:t=>{"use strict";var e=Object.prototype.hasOwnProperty,r="~";function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function a(t,e,i,a,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new n(i,a||t,s),l=r?r+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],o]:t._events[l].push(o):(t._events[l]=o,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function o(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),o.prototype.eventNames=function(){var t,i,n=[];if(0===this._eventsCount)return n;for(i in t=this._events)e.call(t,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},o.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,a=i.length,s=new Array(a);n{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i=r(76);return i.default})())); +//# sourceMappingURL=hls.min.js.map \ No newline at end of file diff --git a/easypan-front/src/App.vue b/easypan-front/src/App.vue new file mode 100644 index 0000000..6bc78d4 --- /dev/null +++ b/easypan-front/src/App.vue @@ -0,0 +1,18 @@ + + + + + diff --git a/easypan-front/src/assets/base.scss b/easypan-front/src/assets/base.scss new file mode 100644 index 0000000..85e2b18 --- /dev/null +++ b/easypan-front/src/assets/base.scss @@ -0,0 +1,65 @@ +::-webkit-scrollbar { + width: 8px; + height: 8px; +} + +::-webkit-scrollbar-track { + background: rgb(239, 239, 239); + border-radius: 2px; +} + +::-webkit-scrollbar-thumb { + background: #bfbfbf; + border-radius: 10px; +} + +::-webkit-scrollbar-thumb:hover { + background: #bfbfbf; +} + +::-webkit-scrollbar-corner { + background: #bfbfbf; +} + +:root { + --link: #007fff; + --pink: #FF6699; + --text2: #61666d; + --icon: #9499a0; +} + +body { + padding: 0px; + margin: 0px; + font-size: 14px; + color: #636d7e; +} + +* { + box-sizing: border-box; + padding: 0; + border: 0; + outline: 0; + vertical-align: middle; +} + +.a-link { + text-decoration: none; + color: var(--link); + cursor: pointer; +} + +.el-form-item { + align-items: center; +} + +.container-body { + margin: 0px auto; + padding-top: 5px; +} + +.el-button { + .iconfont::before { + margin-right: 5px; + } +} \ No newline at end of file diff --git a/easypan-front/src/assets/file.list.scss b/easypan-front/src/assets/file.list.scss new file mode 100644 index 0000000..67d3587 --- /dev/null +++ b/easypan-front/src/assets/file.list.scss @@ -0,0 +1,133 @@ +.top { + margin-top: 20px; + + .top-op { + display: flex; + align-items: center; + + .btn { + margin-right: 10px; + } + + .search-panel { + margin-left: 10px; + width: 300px; + } + + .icon-refresh { + cursor: pointer; + margin-left: 10px; + } + + .not-allow { + background: #d2d2d2 !important; + cursor: not-allowed; + } + } +} + +.file-list { + .file-item { + display: flex; + align-items: center; + padding: 6px 0px; + + .file-name { + margin-left: 8px; + flex: 1; + width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + + span { + cursor: pointer; + + &:hover { + color: #06a7ff; + } + } + + .transfer-status { + font-size: 13px; + margin-left: 10px; + color: #e6a23c; + } + + .transfer-fail { + color: #f75000; + } + } + + .edit-panel { + flex: 1; + width: 0; + display: flex; + align-items: center; + margin: 0px 5px; + + .iconfont { + margin-left: 10px; + background: #0c95f7; + color: #fff; + padding: 3px 5px; + border-radius: 5px; + cursor: pointer; + } + + .not-allow { + cursor: not-allowed; + background: #7cb1d7; + color: #ddd; + text-decoration: none; + } + } + + .op { + width: 280px; + margin-left: 15px; + + .iconfont { + font-size: 13px; + margin-left: 10px; + color: #06a7ff; + cursor: pointer; + } + + .iconfont::before { + margin-right: 3px; + } + } + } +} + +.no-data { + height: calc(100vh - 150px); + display: flex; + align-items: center; + justify-content: center; + + .no-data-inner { + text-align: center; + + .tips { + margin-top: 10px; + } + + .op-list { + margin-top: 20px; + display: flex; + justify-content: center; + align-items: center; + + .op-item { + cursor: pointer; + width: 100px; + height: 100px; + margin: 0px 10px; + padding: 5px 0px; + background: rgb(241, 241, 241); + } + } + } +} \ No newline at end of file diff --git a/easypan-front/src/assets/icon-image/clean.png b/easypan-front/src/assets/icon-image/clean.png new file mode 100644 index 0000000..8b58f8d Binary files /dev/null and b/easypan-front/src/assets/icon-image/clean.png differ diff --git a/easypan-front/src/assets/icon-image/code.png b/easypan-front/src/assets/icon-image/code.png new file mode 100644 index 0000000..5a94ebb Binary files /dev/null and b/easypan-front/src/assets/icon-image/code.png differ diff --git a/easypan-front/src/assets/icon-image/del.png b/easypan-front/src/assets/icon-image/del.png new file mode 100644 index 0000000..3128064 Binary files /dev/null and b/easypan-front/src/assets/icon-image/del.png differ diff --git a/easypan-front/src/assets/icon-image/excel.png b/easypan-front/src/assets/icon-image/excel.png new file mode 100644 index 0000000..685b77e Binary files /dev/null and b/easypan-front/src/assets/icon-image/excel.png differ diff --git a/easypan-front/src/assets/icon-image/exe.png b/easypan-front/src/assets/icon-image/exe.png new file mode 100644 index 0000000..f90e105 Binary files /dev/null and b/easypan-front/src/assets/icon-image/exe.png differ diff --git a/easypan-front/src/assets/icon-image/file.png b/easypan-front/src/assets/icon-image/file.png new file mode 100644 index 0000000..6f74253 Binary files /dev/null and b/easypan-front/src/assets/icon-image/file.png differ diff --git a/easypan-front/src/assets/icon-image/folder.png b/easypan-front/src/assets/icon-image/folder.png new file mode 100644 index 0000000..e0ee92d Binary files /dev/null and b/easypan-front/src/assets/icon-image/folder.png differ diff --git a/easypan-front/src/assets/icon-image/image.png b/easypan-front/src/assets/icon-image/image.png new file mode 100644 index 0000000..064651a Binary files /dev/null and b/easypan-front/src/assets/icon-image/image.png differ diff --git a/easypan-front/src/assets/icon-image/music.png b/easypan-front/src/assets/icon-image/music.png new file mode 100644 index 0000000..2532065 Binary files /dev/null and b/easypan-front/src/assets/icon-image/music.png differ diff --git a/easypan-front/src/assets/icon-image/no_data.png b/easypan-front/src/assets/icon-image/no_data.png new file mode 100644 index 0000000..a07c43c Binary files /dev/null and b/easypan-front/src/assets/icon-image/no_data.png differ diff --git a/easypan-front/src/assets/icon-image/others.png b/easypan-front/src/assets/icon-image/others.png new file mode 100644 index 0000000..9422860 Binary files /dev/null and b/easypan-front/src/assets/icon-image/others.png differ diff --git a/easypan-front/src/assets/icon-image/pause.png b/easypan-front/src/assets/icon-image/pause.png new file mode 100644 index 0000000..d824bd8 Binary files /dev/null and b/easypan-front/src/assets/icon-image/pause.png differ diff --git a/easypan-front/src/assets/icon-image/pdf.png b/easypan-front/src/assets/icon-image/pdf.png new file mode 100644 index 0000000..934e577 Binary files /dev/null and b/easypan-front/src/assets/icon-image/pdf.png differ diff --git a/easypan-front/src/assets/icon-image/ppt1.png b/easypan-front/src/assets/icon-image/ppt1.png new file mode 100644 index 0000000..909ee22 Binary files /dev/null and b/easypan-front/src/assets/icon-image/ppt1.png differ diff --git a/easypan-front/src/assets/icon-image/txt.png b/easypan-front/src/assets/icon-image/txt.png new file mode 100644 index 0000000..51e24f5 Binary files /dev/null and b/easypan-front/src/assets/icon-image/txt.png differ diff --git a/easypan-front/src/assets/icon-image/upload.png b/easypan-front/src/assets/icon-image/upload.png new file mode 100644 index 0000000..4daaf7f Binary files /dev/null and b/easypan-front/src/assets/icon-image/upload.png differ diff --git a/easypan-front/src/assets/icon-image/video.png b/easypan-front/src/assets/icon-image/video.png new file mode 100644 index 0000000..456fa79 Binary files /dev/null and b/easypan-front/src/assets/icon-image/video.png differ diff --git a/easypan-front/src/assets/icon-image/word.png b/easypan-front/src/assets/icon-image/word.png new file mode 100644 index 0000000..6b1cf38 Binary files /dev/null and b/easypan-front/src/assets/icon-image/word.png differ diff --git a/easypan-front/src/assets/icon-image/zip.png b/easypan-front/src/assets/icon-image/zip.png new file mode 100644 index 0000000..5167f03 Binary files /dev/null and b/easypan-front/src/assets/icon-image/zip.png differ diff --git a/easypan-front/src/assets/icon-image/原图/cloude.png b/easypan-front/src/assets/icon-image/原图/cloude.png new file mode 100644 index 0000000..0d5f4fc Binary files /dev/null and b/easypan-front/src/assets/icon-image/原图/cloude.png differ diff --git a/easypan-front/src/assets/icon-image/原图/cloude_color.png b/easypan-front/src/assets/icon-image/原图/cloude_color.png new file mode 100644 index 0000000..3fc4c57 Binary files /dev/null and b/easypan-front/src/assets/icon-image/原图/cloude_color.png differ diff --git a/easypan-front/src/assets/icon-image/原图/code.png b/easypan-front/src/assets/icon-image/原图/code.png new file mode 100644 index 0000000..5a94ebb Binary files /dev/null and b/easypan-front/src/assets/icon-image/原图/code.png differ diff --git a/easypan-front/src/assets/icon-image/原图/excel.png b/easypan-front/src/assets/icon-image/原图/excel.png new file mode 100644 index 0000000..685b77e Binary files /dev/null and b/easypan-front/src/assets/icon-image/原图/excel.png differ diff --git a/easypan-front/src/assets/icon-image/原图/exe.png b/easypan-front/src/assets/icon-image/原图/exe.png new file mode 100644 index 0000000..f90e105 Binary files /dev/null and b/easypan-front/src/assets/icon-image/原图/exe.png differ diff --git a/easypan-front/src/assets/icon-image/原图/foder.png b/easypan-front/src/assets/icon-image/原图/foder.png new file mode 100644 index 0000000..e0ee92d Binary files /dev/null and b/easypan-front/src/assets/icon-image/原图/foder.png differ diff --git a/easypan-front/src/assets/icon-image/原图/image.png b/easypan-front/src/assets/icon-image/原图/image.png new file mode 100644 index 0000000..064651a Binary files /dev/null and b/easypan-front/src/assets/icon-image/原图/image.png differ diff --git a/easypan-front/src/assets/icon-image/原图/music.png b/easypan-front/src/assets/icon-image/原图/music.png new file mode 100644 index 0000000..2532065 Binary files /dev/null and b/easypan-front/src/assets/icon-image/原图/music.png differ diff --git a/easypan-front/src/assets/icon-image/原图/others.png b/easypan-front/src/assets/icon-image/原图/others.png new file mode 100644 index 0000000..7f6e747 Binary files /dev/null and b/easypan-front/src/assets/icon-image/原图/others.png differ diff --git a/easypan-front/src/assets/icon-image/原图/pdf.png b/easypan-front/src/assets/icon-image/原图/pdf.png new file mode 100644 index 0000000..934e577 Binary files /dev/null and b/easypan-front/src/assets/icon-image/原图/pdf.png differ diff --git a/easypan-front/src/assets/icon-image/原图/ppt.png b/easypan-front/src/assets/icon-image/原图/ppt.png new file mode 100644 index 0000000..909ee22 Binary files /dev/null and b/easypan-front/src/assets/icon-image/原图/ppt.png differ diff --git a/easypan-front/src/assets/icon-image/原图/share.png b/easypan-front/src/assets/icon-image/原图/share.png new file mode 100644 index 0000000..b64d8f9 Binary files /dev/null and b/easypan-front/src/assets/icon-image/原图/share.png differ diff --git a/easypan-front/src/assets/icon-image/原图/share_color.png b/easypan-front/src/assets/icon-image/原图/share_color.png new file mode 100644 index 0000000..85418bd Binary files /dev/null and b/easypan-front/src/assets/icon-image/原图/share_color.png differ diff --git a/easypan-front/src/assets/icon-image/原图/txt.png b/easypan-front/src/assets/icon-image/原图/txt.png new file mode 100644 index 0000000..51e24f5 Binary files /dev/null and b/easypan-front/src/assets/icon-image/原图/txt.png differ diff --git a/easypan-front/src/assets/icon-image/原图/video.png b/easypan-front/src/assets/icon-image/原图/video.png new file mode 100644 index 0000000..456fa79 Binary files /dev/null and b/easypan-front/src/assets/icon-image/原图/video.png differ diff --git a/easypan-front/src/assets/icon-image/原图/word.png b/easypan-front/src/assets/icon-image/原图/word.png new file mode 100644 index 0000000..6b1cf38 Binary files /dev/null and b/easypan-front/src/assets/icon-image/原图/word.png differ diff --git a/easypan-front/src/assets/icon-image/原图/zip.png b/easypan-front/src/assets/icon-image/原图/zip.png new file mode 100644 index 0000000..7f0e1ce Binary files /dev/null and b/easypan-front/src/assets/icon-image/原图/zip.png differ diff --git a/easypan-front/src/assets/icon/demo.css b/easypan-front/src/assets/icon/demo.css new file mode 100644 index 0000000..a67054a --- /dev/null +++ b/easypan-front/src/assets/icon/demo.css @@ -0,0 +1,539 @@ +/* Logo 字体 */ +@font-face { + font-family: "iconfont logo"; + src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834'); + src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'), + url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'), + url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'), + url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg'); +} + +.logo { + font-family: "iconfont logo"; + font-size: 160px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +/* tabs */ +.nav-tabs { + position: relative; +} + +.nav-tabs .nav-more { + position: absolute; + right: 0; + bottom: 0; + height: 42px; + line-height: 42px; + color: #666; +} + +#tabs { + border-bottom: 1px solid #eee; +} + +#tabs li { + cursor: pointer; + width: 100px; + height: 40px; + line-height: 40px; + text-align: center; + font-size: 16px; + border-bottom: 2px solid transparent; + position: relative; + z-index: 1; + margin-bottom: -1px; + color: #666; +} + + +#tabs .active { + border-bottom-color: #f00; + color: #222; +} + +.tab-container .content { + display: none; +} + +/* 页面布局 */ +.main { + padding: 30px 100px; + width: 960px; + margin: 0 auto; +} + +.main .logo { + color: #333; + text-align: left; + margin-bottom: 30px; + line-height: 1; + height: 110px; + margin-top: -50px; + overflow: hidden; + *zoom: 1; +} + +.main .logo a { + font-size: 160px; + color: #333; +} + +.helps { + margin-top: 40px; +} + +.helps pre { + padding: 20px; + margin: 10px 0; + border: solid 1px #e7e1cd; + background-color: #fffdef; + overflow: auto; +} + +.icon_lists { + width: 100% !important; + overflow: hidden; + *zoom: 1; +} + +.icon_lists li { + width: 100px; + margin-bottom: 10px; + margin-right: 20px; + text-align: center; + list-style: none !important; + cursor: default; +} + +.icon_lists li .code-name { + line-height: 1.2; +} + +.icon_lists .icon { + display: block; + height: 100px; + line-height: 100px; + font-size: 42px; + margin: 10px auto; + color: #333; + -webkit-transition: font-size 0.25s linear, width 0.25s linear; + -moz-transition: font-size 0.25s linear, width 0.25s linear; + transition: font-size 0.25s linear, width 0.25s linear; +} + +.icon_lists .icon:hover { + font-size: 100px; +} + +.icon_lists .svg-icon { + /* 通过设置 font-size 来改变图标大小 */ + width: 1em; + /* 图标和文字相邻时,垂直对齐 */ + vertical-align: -0.15em; + /* 通过设置 color 来改变 SVG 的颜色/fill */ + fill: currentColor; + /* path 和 stroke 溢出 viewBox 部分在 IE 下会显示 + normalize.css 中也包含这行 */ + overflow: hidden; +} + +.icon_lists li .name, +.icon_lists li .code-name { + color: #666; +} + +/* markdown 样式 */ +.markdown { + color: #666; + font-size: 14px; + line-height: 1.8; +} + +.highlight { + line-height: 1.5; +} + +.markdown img { + vertical-align: middle; + max-width: 100%; +} + +.markdown h1 { + color: #404040; + font-weight: 500; + line-height: 40px; + margin-bottom: 24px; +} + +.markdown h2, +.markdown h3, +.markdown h4, +.markdown h5, +.markdown h6 { + color: #404040; + margin: 1.6em 0 0.6em 0; + font-weight: 500; + clear: both; +} + +.markdown h1 { + font-size: 28px; +} + +.markdown h2 { + font-size: 22px; +} + +.markdown h3 { + font-size: 16px; +} + +.markdown h4 { + font-size: 14px; +} + +.markdown h5 { + font-size: 12px; +} + +.markdown h6 { + font-size: 12px; +} + +.markdown hr { + height: 1px; + border: 0; + background: #e9e9e9; + margin: 16px 0; + clear: both; +} + +.markdown p { + margin: 1em 0; +} + +.markdown>p, +.markdown>blockquote, +.markdown>.highlight, +.markdown>ol, +.markdown>ul { + width: 80%; +} + +.markdown ul>li { + list-style: circle; +} + +.markdown>ul li, +.markdown blockquote ul>li { + margin-left: 20px; + padding-left: 4px; +} + +.markdown>ul li p, +.markdown>ol li p { + margin: 0.6em 0; +} + +.markdown ol>li { + list-style: decimal; +} + +.markdown>ol li, +.markdown blockquote ol>li { + margin-left: 20px; + padding-left: 4px; +} + +.markdown code { + margin: 0 3px; + padding: 0 5px; + background: #eee; + border-radius: 3px; +} + +.markdown strong, +.markdown b { + font-weight: 600; +} + +.markdown>table { + border-collapse: collapse; + border-spacing: 0px; + empty-cells: show; + border: 1px solid #e9e9e9; + width: 95%; + margin-bottom: 24px; +} + +.markdown>table th { + white-space: nowrap; + color: #333; + font-weight: 600; +} + +.markdown>table th, +.markdown>table td { + border: 1px solid #e9e9e9; + padding: 8px 16px; + text-align: left; +} + +.markdown>table th { + background: #F7F7F7; +} + +.markdown blockquote { + font-size: 90%; + color: #999; + border-left: 4px solid #e9e9e9; + padding-left: 0.8em; + margin: 1em 0; +} + +.markdown blockquote p { + margin: 0; +} + +.markdown .anchor { + opacity: 0; + transition: opacity 0.3s ease; + margin-left: 8px; +} + +.markdown .waiting { + color: #ccc; +} + +.markdown h1:hover .anchor, +.markdown h2:hover .anchor, +.markdown h3:hover .anchor, +.markdown h4:hover .anchor, +.markdown h5:hover .anchor, +.markdown h6:hover .anchor { + opacity: 1; + display: inline-block; +} + +.markdown>br, +.markdown>p>br { + clear: both; +} + + +.hljs { + display: block; + background: white; + padding: 0.5em; + color: #333333; + overflow-x: auto; +} + +.hljs-comment, +.hljs-meta { + color: #969896; +} + +.hljs-string, +.hljs-variable, +.hljs-template-variable, +.hljs-strong, +.hljs-emphasis, +.hljs-quote { + color: #df5000; +} + +.hljs-keyword, +.hljs-selector-tag, +.hljs-type { + color: #a71d5d; +} + +.hljs-literal, +.hljs-symbol, +.hljs-bullet, +.hljs-attribute { + color: #0086b3; +} + +.hljs-section, +.hljs-name { + color: #63a35c; +} + +.hljs-tag { + color: #333333; +} + +.hljs-title, +.hljs-attr, +.hljs-selector-id, +.hljs-selector-class, +.hljs-selector-attr, +.hljs-selector-pseudo { + color: #795da3; +} + +.hljs-addition { + color: #55a532; + background-color: #eaffea; +} + +.hljs-deletion { + color: #bd2c00; + background-color: #ffecec; +} + +.hljs-link { + text-decoration: underline; +} + +/* 代码高亮 */ +/* PrismJS 1.15.0 +https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */ +/** + * prism.js default theme for JavaScript, CSS and HTML + * Based on dabblet (http://dabblet.com) + * @author Lea Verou + */ +code[class*="language-"], +pre[class*="language-"] { + color: black; + background: none; + text-shadow: 0 1px white; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +pre[class*="language-"]::-moz-selection, +pre[class*="language-"] ::-moz-selection, +code[class*="language-"]::-moz-selection, +code[class*="language-"] ::-moz-selection { + text-shadow: none; + background: #b3d4fc; +} + +pre[class*="language-"]::selection, +pre[class*="language-"] ::selection, +code[class*="language-"]::selection, +code[class*="language-"] ::selection { + text-shadow: none; + background: #b3d4fc; +} + +@media print { + + code[class*="language-"], + pre[class*="language-"] { + text-shadow: none; + } +} + +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: .5em 0; + overflow: auto; +} + +:not(pre)>code[class*="language-"], +pre[class*="language-"] { + background: #f5f2f0; +} + +/* Inline code */ +:not(pre)>code[class*="language-"] { + padding: .1em; + border-radius: .3em; + white-space: normal; +} + +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: slategray; +} + +.token.punctuation { + color: #999; +} + +.namespace { + opacity: .7; +} + +.token.property, +.token.tag, +.token.boolean, +.token.number, +.token.constant, +.token.symbol, +.token.deleted { + color: #905; +} + +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.builtin, +.token.inserted { + color: #690; +} + +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string { + color: #9a6e3a; + background: hsla(0, 0%, 100%, .5); +} + +.token.atrule, +.token.attr-value, +.token.keyword { + color: #07a; +} + +.token.function, +.token.class-name { + color: #DD4A68; +} + +.token.regex, +.token.important, +.token.variable { + color: #e90; +} + +.token.important, +.token.bold { + font-weight: bold; +} + +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} diff --git a/easypan-front/src/assets/icon/demo_index.html b/easypan-front/src/assets/icon/demo_index.html new file mode 100644 index 0000000..b78725c --- /dev/null +++ b/easypan-front/src/assets/icon/demo_index.html @@ -0,0 +1,1062 @@ + + + + + iconfont Demo + + + + + + + + + + + + + +
+

+ + +

+ +
+
+
    + +
  • + +
    settings
    +
    &#xe673;
    +
  • + +
  • + +
    回收站
    +
    &#xe636;
    +
  • + +
  • + +
    验证 验证码
    +
    &#xe626;
    +
  • + +
  • + +
    账户
    +
    &#xe60a;
    +
  • + +
  • + +
    password
    +
    &#xe65d;
    +
  • + +
  • + +
    文档
    +
    &#xe882;
    +
  • + +
  • + +
    导入
    +
    &#xe60e;
    +
  • + +
  • + +
    link
    +
    &#xe600;
    +
  • + +
  • + +
    cancel
    +
    &#xe772;
    +
  • + +
  • + +
    还原
    +
    &#xe60f;
    +
  • + +
  • + +
    round_close_fill
    +
    &#xe658;
    +
  • + +
  • + +
    search
    +
    &#xe65c;
    +
  • + +
  • + +
    transfer
    +
    &#xe6b4;
    +
  • + +
  • + +
    转码
    +
    &#xe6a2;
    +
  • + +
  • + +
    关闭
    +
    &#xe624;
    +
  • + +
  • + +
    播放
    +
    &#xe625;
    +
  • + +
  • + +
    暂停
    +
    &#xe629;
    +
  • + +
  • + +
    ok
    +
    &#xe613;
    +
  • + +
  • + +
    clock-fill
    +
    &#xe7d7;
    +
  • + +
  • + +
    close
    +
    &#xe656;
    +
  • + +
  • + +
    分享给好友icon
    +
    &#xe65e;
    +
  • + +
  • + +
    ok
    +
    &#xe65b;
    +
  • + +
  • + +
    icon_error
    +
    &#xe651;
    +
  • + +
  • + +
    edit
    +
    &#xe61f;
    +
  • + +
  • + +
    share
    +
    &#xe86f;
    +
  • + +
  • + +
    move
    +
    &#xe67b;
    +
  • + +
  • + +
    folder-add
    +
    &#xe7d1;
    +
  • + +
  • + +
    right
    +
    &#xe7eb;
    +
  • + +
  • + +
    download
    +
    &#xe83a;
    +
  • + +
  • + +
    upload
    +
    &#xe83b;
    +
  • + +
  • + +
    AppstoreFilled
    +
    &#xe6ff;
    +
  • + +
  • + +
    自治云
    +
    &#xe66d;
    +
  • + +
  • + +
    moviesel
    +
    &#xe61c;
    +
  • + +
  • + +
    其他
    +
    &#xe631;
    +
  • + +
  • + +
    音乐_填充
    +
    &#xe6a1;
    +
  • + +
  • + +
    play_fill
    +
    &#xe74f;
    +
  • + +
  • + +
    image
    +
    &#xe68d;
    +
  • + +
  • + +
    网盘-copy
    +
    &#xe6e2;
    +
  • + +
+
+

Unicode 引用

+
+ +

Unicode 是字体在网页端最原始的应用方式,特点是:

+
    +
  • 支持按字体的方式去动态调整图标大小,颜色等等。
  • +
  • 默认情况下不支持多色,直接添加多色图标会自动去色。
  • +
+
+

注意:新版 iconfont 支持两种方式引用多色图标:SVG symbol 引用方式和彩色字体图标模式。(使用彩色字体图标需要在「编辑项目」中开启「彩色」选项后并重新生成。)

+
+

Unicode 使用步骤如下:

+

第一步:拷贝项目下面生成的 @font-face

+
@font-face {
+  font-family: 'iconfont';
+  src: url('iconfont.woff2?t=1680443314592') format('woff2'),
+       url('iconfont.woff?t=1680443314592') format('woff'),
+       url('iconfont.ttf?t=1680443314592') format('truetype');
+}
+
+

第二步:定义使用 iconfont 的样式

+
.iconfont {
+  font-family: "iconfont" !important;
+  font-size: 16px;
+  font-style: normal;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+
+

第三步:挑选相应图标并获取字体编码,应用于页面

+
+<span class="iconfont">&#x33;</span>
+
+
+

"iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。

+
+
+
+
+
    + +
  • + +
    + settings +
    +
    .icon-settings +
    +
  • + +
  • + +
    + 回收站 +
    +
    .icon-del +
    +
  • + +
  • + +
    + 验证 验证码 +
    +
    .icon-checkcode +
    +
  • + +
  • + +
    + 账户 +
    +
    .icon-account +
    +
  • + +
  • + +
    + password +
    +
    .icon-password +
    +
  • + +
  • + +
    + 文档 +
    +
    .icon-doc +
    +
  • + +
  • + +
    + 导入 +
    +
    .icon-import +
    +
  • + +
  • + +
    + link +
    +
    .icon-link +
    +
  • + +
  • + +
    + cancel +
    +
    .icon-cancel +
    +
  • + +
  • + +
    + 还原 +
    +
    .icon-revert +
    +
  • + +
  • + +
    + round_close_fill +
    +
    .icon-close3 +
    +
  • + +
  • + +
    + search +
    +
    .icon-search +
    +
  • + +
  • + +
    + transfer +
    +
    .icon-transfer +
    +
  • + +
  • + +
    + 转码 +
    +
    .icon-refresh +
    +
  • + +
  • + +
    + 关闭 +
    +
    .icon-close2 +
    +
  • + +
  • + +
    + 播放 +
    +
    .icon-start +
    +
  • + +
  • + +
    + 暂停 +
    +
    .icon-pause +
    +
  • + +
  • + +
    + ok +
    +
    .icon-ok +
    +
  • + +
  • + +
    + clock-fill +
    +
    .icon-clock +
    +
  • + +
  • + +
    + close +
    +
    .icon-close +
    +
  • + +
  • + +
    + 分享给好友icon +
    +
    .icon-share +
    +
  • + +
  • + +
    + ok +
    +
    .icon-right1 +
    +
  • + +
  • + +
    + icon_error +
    +
    .icon-error +
    +
  • + +
  • + +
    + edit +
    +
    .icon-edit +
    +
  • + +
  • + +
    + share +
    +
    .icon-share1 +
    +
  • + +
  • + +
    + move +
    +
    .icon-move +
    +
  • + +
  • + +
    + folder-add +
    +
    .icon-folder-add +
    +
  • + +
  • + +
    + right +
    +
    .icon-right +
    +
  • + +
  • + +
    + download +
    +
    .icon-download +
    +
  • + +
  • + +
    + upload +
    +
    .icon-upload +
    +
  • + +
  • + +
    + AppstoreFilled +
    +
    .icon-all +
    +
  • + +
  • + +
    + 自治云 +
    +
    .icon-cloude +
    +
  • + +
  • + +
    + moviesel +
    +
    .icon-movie2 +
    +
  • + +
  • + +
    + 其他 +
    +
    .icon-more +
    +
  • + +
  • + +
    + 音乐_填充 +
    +
    .icon-music +
    +
  • + +
  • + +
    + play_fill +
    +
    .icon-video +
    +
  • + +
  • + +
    + image +
    +
    .icon-image +
    +
  • + +
  • + +
    + 网盘-copy +
    +
    .icon-pan +
    +
  • + +
+
+

font-class 引用

+
+ +

font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。

+

与 Unicode 使用方式相比,具有如下特点:

+
    +
  • 相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。
  • +
  • 因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。
  • +
+

使用步骤如下:

+

第一步:引入项目下面生成的 fontclass 代码:

+
<link rel="stylesheet" href="./iconfont.css">
+
+

第二步:挑选相应图标并获取类名,应用于页面:

+
<span class="iconfont icon-xxx"></span>
+
+
+

" + iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。

+
+
+
+
+
    + +
  • + +
    settings
    +
    #icon-settings
    +
  • + +
  • + +
    回收站
    +
    #icon-del
    +
  • + +
  • + +
    验证 验证码
    +
    #icon-checkcode
    +
  • + +
  • + +
    账户
    +
    #icon-account
    +
  • + +
  • + +
    password
    +
    #icon-password
    +
  • + +
  • + +
    文档
    +
    #icon-doc
    +
  • + +
  • + +
    导入
    +
    #icon-import
    +
  • + +
  • + +
    link
    +
    #icon-link
    +
  • + +
  • + +
    cancel
    +
    #icon-cancel
    +
  • + +
  • + +
    还原
    +
    #icon-revert
    +
  • + +
  • + +
    round_close_fill
    +
    #icon-close3
    +
  • + +
  • + +
    search
    +
    #icon-search
    +
  • + +
  • + +
    transfer
    +
    #icon-transfer
    +
  • + +
  • + +
    转码
    +
    #icon-refresh
    +
  • + +
  • + +
    关闭
    +
    #icon-close2
    +
  • + +
  • + +
    播放
    +
    #icon-start
    +
  • + +
  • + +
    暂停
    +
    #icon-pause
    +
  • + +
  • + +
    ok
    +
    #icon-ok
    +
  • + +
  • + +
    clock-fill
    +
    #icon-clock
    +
  • + +
  • + +
    close
    +
    #icon-close
    +
  • + +
  • + +
    分享给好友icon
    +
    #icon-share
    +
  • + +
  • + +
    ok
    +
    #icon-right1
    +
  • + +
  • + +
    icon_error
    +
    #icon-error
    +
  • + +
  • + +
    edit
    +
    #icon-edit
    +
  • + +
  • + +
    share
    +
    #icon-share1
    +
  • + +
  • + +
    move
    +
    #icon-move
    +
  • + +
  • + +
    folder-add
    +
    #icon-folder-add
    +
  • + +
  • + +
    right
    +
    #icon-right
    +
  • + +
  • + +
    download
    +
    #icon-download
    +
  • + +
  • + +
    upload
    +
    #icon-upload
    +
  • + +
  • + +
    AppstoreFilled
    +
    #icon-all
    +
  • + +
  • + +
    自治云
    +
    #icon-cloude
    +
  • + +
  • + +
    moviesel
    +
    #icon-movie2
    +
  • + +
  • + +
    其他
    +
    #icon-more
    +
  • + +
  • + +
    音乐_填充
    +
    #icon-music
    +
  • + +
  • + +
    play_fill
    +
    #icon-video
    +
  • + +
  • + +
    image
    +
    #icon-image
    +
  • + +
  • + +
    网盘-copy
    +
    #icon-pan
    +
  • + +
+
+

Symbol 引用

+
+ +

这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇文章 + 这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:

+
    +
  • 支持多色图标了,不再受单色限制。
  • +
  • 通过一些技巧,支持像字体那样,通过 font-size, color 来调整样式。
  • +
  • 兼容性较差,支持 IE9+,及现代浏览器。
  • +
  • 浏览器渲染 SVG 的性能一般,还不如 png。
  • +
+

使用步骤如下:

+

第一步:引入项目下面生成的 symbol 代码:

+
<script src="./iconfont.js"></script>
+
+

第二步:加入通用 CSS 代码(引入一次就行):

+
<style>
+.icon {
+  width: 1em;
+  height: 1em;
+  vertical-align: -0.15em;
+  fill: currentColor;
+  overflow: hidden;
+}
+</style>
+
+

第三步:挑选相应图标并获取类名,应用于页面:

+
<svg class="icon" aria-hidden="true">
+  <use xlink:href="#icon-xxx"></use>
+</svg>
+
+
+
+ +
+
+ + + diff --git a/easypan-front/src/assets/icon/iconfont.css b/easypan-front/src/assets/icon/iconfont.css new file mode 100644 index 0000000..fc4b1e8 --- /dev/null +++ b/easypan-front/src/assets/icon/iconfont.css @@ -0,0 +1,167 @@ +@font-face { + font-family: "iconfont"; /* Project id 3946741 */ + src: url('iconfont.woff2?t=1680443314592') format('woff2'), + url('iconfont.woff?t=1680443314592') format('woff'), + url('iconfont.ttf?t=1680443314592') format('truetype'); +} + +.iconfont { + font-family: "iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-settings:before { + content: "\e673"; +} + +.icon-del:before { + content: "\e636"; +} + +.icon-checkcode:before { + content: "\e626"; +} + +.icon-account:before { + content: "\e60a"; +} + +.icon-password:before { + content: "\e65d"; +} + +.icon-doc:before { + content: "\e882"; +} + +.icon-import:before { + content: "\e60e"; +} + +.icon-link:before { + content: "\e600"; +} + +.icon-cancel:before { + content: "\e772"; +} + +.icon-revert:before { + content: "\e60f"; +} + +.icon-close3:before { + content: "\e658"; +} + +.icon-search:before { + content: "\e65c"; +} + +.icon-transfer:before { + content: "\e6b4"; +} + +.icon-refresh:before { + content: "\e6a2"; +} + +.icon-close2:before { + content: "\e624"; +} + +.icon-start:before { + content: "\e625"; +} + +.icon-pause:before { + content: "\e629"; +} + +.icon-ok:before { + content: "\e613"; +} + +.icon-clock:before { + content: "\e7d7"; +} + +.icon-close:before { + content: "\e656"; +} + +.icon-share:before { + content: "\e65e"; +} + +.icon-right1:before { + content: "\e65b"; +} + +.icon-error:before { + content: "\e651"; +} + +.icon-edit:before { + content: "\e61f"; +} + +.icon-share1:before { + content: "\e86f"; +} + +.icon-move:before { + content: "\e67b"; +} + +.icon-folder-add:before { + content: "\e7d1"; +} + +.icon-right:before { + content: "\e7eb"; +} + +.icon-download:before { + content: "\e83a"; +} + +.icon-upload:before { + content: "\e83b"; +} + +.icon-all:before { + content: "\e6ff"; +} + +.icon-cloude:before { + content: "\e66d"; +} + +.icon-movie2:before { + content: "\e61c"; +} + +.icon-more:before { + content: "\e631"; +} + +.icon-music:before { + content: "\e6a1"; +} + +.icon-video:before { + content: "\e74f"; +} + +.icon-image:before { + content: "\e68d"; +} + +.icon-pan:before { + content: "\e6e2"; +} + diff --git a/easypan-front/src/assets/icon/iconfont.js b/easypan-front/src/assets/icon/iconfont.js new file mode 100644 index 0000000..5b33fee --- /dev/null +++ b/easypan-front/src/assets/icon/iconfont.js @@ -0,0 +1 @@ +window._iconfont_svg_string_3946741='',function(a){var l=(l=document.getElementsByTagName("script"))[l.length-1],c=l.getAttribute("data-injectcss"),l=l.getAttribute("data-disable-injectsvg");if(!l){var o,t,i,e,h,s=function(l,c){c.parentNode.insertBefore(l,c)};if(c&&!a.__iconfont__svg__cssinject__){a.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}o=function(){var l,c=document.createElement("div");c.innerHTML=a._iconfont_svg_string_3946741,(c=c.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",c=c,(l=document.body).firstChild?s(c,l.firstChild):l.appendChild(c))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(o,0):(t=function(){document.removeEventListener("DOMContentLoaded",t,!1),o()},document.addEventListener("DOMContentLoaded",t,!1)):document.attachEvent&&(i=o,e=a.document,h=!1,m(),e.onreadystatechange=function(){"complete"==e.readyState&&(e.onreadystatechange=null,d())})}function d(){h||(h=!0,i())}function m(){try{e.documentElement.doScroll("left")}catch(l){return void setTimeout(m,50)}d()}}(window); \ No newline at end of file diff --git a/easypan-front/src/assets/icon/iconfont.json b/easypan-front/src/assets/icon/iconfont.json new file mode 100644 index 0000000..5e1a5c0 --- /dev/null +++ b/easypan-front/src/assets/icon/iconfont.json @@ -0,0 +1,275 @@ +{ + "id": "3946741", + "name": "easypan", + "font_family": "iconfont", + "css_prefix_text": "icon-", + "description": "", + "glyphs": [ + { + "icon_id": "715362", + "name": "settings", + "font_class": "settings", + "unicode": "e673", + "unicode_decimal": 58995 + }, + { + "icon_id": "1440893", + "name": "回收站", + "font_class": "del", + "unicode": "e636", + "unicode_decimal": 58934 + }, + { + "icon_id": "553324", + "name": "验证 验证码", + "font_class": "checkcode", + "unicode": "e626", + "unicode_decimal": 58918 + }, + { + "icon_id": "2127118", + "name": "账户", + "font_class": "account", + "unicode": "e60a", + "unicode_decimal": 58890 + }, + { + "icon_id": "12779504", + "name": "password", + "font_class": "password", + "unicode": "e65d", + "unicode_decimal": 58973 + }, + { + "icon_id": "9626991", + "name": "文档", + "font_class": "doc", + "unicode": "e882", + "unicode_decimal": 59522 + }, + { + "icon_id": "10885271", + "name": "导入", + "font_class": "import", + "unicode": "e60e", + "unicode_decimal": 58894 + }, + { + "icon_id": "9223527", + "name": "link", + "font_class": "link", + "unicode": "e600", + "unicode_decimal": 58880 + }, + { + "icon_id": "26867547", + "name": "cancel", + "font_class": "cancel", + "unicode": "e772", + "unicode_decimal": 59250 + }, + { + "icon_id": "21189968", + "name": "还原", + "font_class": "revert", + "unicode": "e60f", + "unicode_decimal": 58895 + }, + { + "icon_id": "29943", + "name": "round_close_fill", + "font_class": "close3", + "unicode": "e658", + "unicode_decimal": 58968 + }, + { + "icon_id": "29947", + "name": "search", + "font_class": "search", + "unicode": "e65c", + "unicode_decimal": 58972 + }, + { + "icon_id": "15066965", + "name": "transfer", + "font_class": "transfer", + "unicode": "e6b4", + "unicode_decimal": 59060 + }, + { + "icon_id": "16365914", + "name": "转码", + "font_class": "refresh", + "unicode": "e6a2", + "unicode_decimal": 59042 + }, + { + "icon_id": "2674473", + "name": "关闭", + "font_class": "close2", + "unicode": "e624", + "unicode_decimal": 58916 + }, + { + "icon_id": "2674474", + "name": "播放", + "font_class": "start", + "unicode": "e625", + "unicode_decimal": 58917 + }, + { + "icon_id": "2674483", + "name": "暂停", + "font_class": "pause", + "unicode": "e629", + "unicode_decimal": 58921 + }, + { + "icon_id": "1421450", + "name": "ok", + "font_class": "ok", + "unicode": "e613", + "unicode_decimal": 58899 + }, + { + "icon_id": "6151154", + "name": "clock-fill", + "font_class": "clock", + "unicode": "e7d7", + "unicode_decimal": 59351 + }, + { + "icon_id": "11903682", + "name": "close", + "font_class": "close", + "unicode": "e656", + "unicode_decimal": 58966 + }, + { + "icon_id": "300021", + "name": "分享给好友icon", + "font_class": "share", + "unicode": "e65e", + "unicode_decimal": 58974 + }, + { + "icon_id": "760480", + "name": "ok", + "font_class": "right1", + "unicode": "e65b", + "unicode_decimal": 58971 + }, + { + "icon_id": "14410256", + "name": "icon_error", + "font_class": "error", + "unicode": "e651", + "unicode_decimal": 58961 + }, + { + "icon_id": "1185453", + "name": "edit", + "font_class": "edit", + "unicode": "e61f", + "unicode_decimal": 58911 + }, + { + "icon_id": "6353306", + "name": "share", + "font_class": "share1", + "unicode": "e86f", + "unicode_decimal": 59503 + }, + { + "icon_id": "15838518", + "name": "move", + "font_class": "move", + "unicode": "e67b", + "unicode_decimal": 59003 + }, + { + "icon_id": "4766848", + "name": "folder-add", + "font_class": "folder-add", + "unicode": "e7d1", + "unicode_decimal": 59345 + }, + { + "icon_id": "4767011", + "name": "right", + "font_class": "right", + "unicode": "e7eb", + "unicode_decimal": 59371 + }, + { + "icon_id": "6151351", + "name": "download", + "font_class": "download", + "unicode": "e83a", + "unicode_decimal": 59450 + }, + { + "icon_id": "6151353", + "name": "upload", + "font_class": "upload", + "unicode": "e83b", + "unicode_decimal": 59451 + }, + { + "icon_id": "26721527", + "name": "AppstoreFilled", + "font_class": "all", + "unicode": "e6ff", + "unicode_decimal": 59135 + }, + { + "icon_id": "4562501", + "name": "自治云", + "font_class": "cloude", + "unicode": "e66d", + "unicode_decimal": 58989 + }, + { + "icon_id": "6050457", + "name": "moviesel", + "font_class": "movie2", + "unicode": "e61c", + "unicode_decimal": 58908 + }, + { + "icon_id": "741255", + "name": "其他", + "font_class": "more", + "unicode": "e631", + "unicode_decimal": 58929 + }, + { + "icon_id": "145741", + "name": "音乐_填充", + "font_class": "music", + "unicode": "e6a1", + "unicode_decimal": 59041 + }, + { + "icon_id": "212328", + "name": "play_fill", + "font_class": "video", + "unicode": "e74f", + "unicode_decimal": 59215 + }, + { + "icon_id": "14441151", + "name": "image", + "font_class": "image", + "unicode": "e68d", + "unicode_decimal": 59021 + }, + { + "icon_id": "34532161", + "name": "网盘-copy", + "font_class": "pan", + "unicode": "e6e2", + "unicode_decimal": 59106 + } + ] +} diff --git a/easypan-front/src/assets/icon/iconfont.ttf b/easypan-front/src/assets/icon/iconfont.ttf new file mode 100644 index 0000000..74b9538 Binary files /dev/null and b/easypan-front/src/assets/icon/iconfont.ttf differ diff --git a/easypan-front/src/assets/icon/iconfont.woff b/easypan-front/src/assets/icon/iconfont.woff new file mode 100644 index 0000000..0fc47a1 Binary files /dev/null and b/easypan-front/src/assets/icon/iconfont.woff differ diff --git a/easypan-front/src/assets/icon/iconfont.woff2 b/easypan-front/src/assets/icon/iconfont.woff2 new file mode 100644 index 0000000..77e4003 Binary files /dev/null and b/easypan-front/src/assets/icon/iconfont.woff2 differ diff --git a/easypan-front/src/assets/login_bg.jpg b/easypan-front/src/assets/login_bg.jpg new file mode 100644 index 0000000..6aa0f50 Binary files /dev/null and b/easypan-front/src/assets/login_bg.jpg differ diff --git a/easypan-front/src/assets/login_img.png b/easypan-front/src/assets/login_img.png new file mode 100644 index 0000000..5553410 Binary files /dev/null and b/easypan-front/src/assets/login_img.png differ diff --git a/easypan-front/src/assets/music_cover.png b/easypan-front/src/assets/music_cover.png new file mode 100644 index 0000000..a7d2008 Binary files /dev/null and b/easypan-front/src/assets/music_cover.png differ diff --git a/easypan-front/src/assets/music_icon.png b/easypan-front/src/assets/music_icon.png new file mode 100644 index 0000000..312a126 Binary files /dev/null and b/easypan-front/src/assets/music_icon.png differ diff --git a/easypan-front/src/assets/qq.png b/easypan-front/src/assets/qq.png new file mode 100644 index 0000000..0b90838 Binary files /dev/null and b/easypan-front/src/assets/qq.png differ diff --git a/easypan-front/src/assets/share_bg.png b/easypan-front/src/assets/share_bg.png new file mode 100644 index 0000000..18f596f Binary files /dev/null and b/easypan-front/src/assets/share_bg.png differ diff --git a/easypan-front/src/components/Avatar.vue b/easypan-front/src/components/Avatar.vue new file mode 100644 index 0000000..12c8ecc --- /dev/null +++ b/easypan-front/src/components/Avatar.vue @@ -0,0 +1,48 @@ + + + + + \ No newline at end of file diff --git a/easypan-front/src/components/AvatarUpload.vue b/easypan-front/src/components/AvatarUpload.vue new file mode 100644 index 0000000..7dc7758 --- /dev/null +++ b/easypan-front/src/components/AvatarUpload.vue @@ -0,0 +1,91 @@ + + + + + \ No newline at end of file diff --git a/easypan-front/src/components/Dialog.vue b/easypan-front/src/components/Dialog.vue new file mode 100644 index 0000000..e2c3a4a --- /dev/null +++ b/easypan-front/src/components/Dialog.vue @@ -0,0 +1,95 @@ + + + + + \ No newline at end of file diff --git a/easypan-front/src/components/FolderSelect.vue b/easypan-front/src/components/FolderSelect.vue new file mode 100644 index 0000000..72da73c --- /dev/null +++ b/easypan-front/src/components/FolderSelect.vue @@ -0,0 +1,148 @@ + + + + \ No newline at end of file diff --git a/easypan-front/src/components/Icon.vue b/easypan-front/src/components/Icon.vue new file mode 100644 index 0000000..8fd38b7 --- /dev/null +++ b/easypan-front/src/components/Icon.vue @@ -0,0 +1,74 @@ + + + + + \ No newline at end of file diff --git a/easypan-front/src/components/Navigation.vue b/easypan-front/src/components/Navigation.vue new file mode 100644 index 0000000..be0236f --- /dev/null +++ b/easypan-front/src/components/Navigation.vue @@ -0,0 +1,213 @@ + + + + + \ No newline at end of file diff --git a/easypan-front/src/components/NoData.vue b/easypan-front/src/components/NoData.vue new file mode 100644 index 0000000..9fff6c5 --- /dev/null +++ b/easypan-front/src/components/NoData.vue @@ -0,0 +1,30 @@ + + + + + \ No newline at end of file diff --git a/easypan-front/src/components/Table.vue b/easypan-front/src/components/Table.vue new file mode 100644 index 0000000..81e7e73 --- /dev/null +++ b/easypan-front/src/components/Table.vue @@ -0,0 +1,180 @@ + + + diff --git a/easypan-front/src/components/Window.vue b/easypan-front/src/components/Window.vue new file mode 100644 index 0000000..bc75b35 --- /dev/null +++ b/easypan-front/src/components/Window.vue @@ -0,0 +1,122 @@ + + + + + \ No newline at end of file diff --git a/easypan-front/src/components/preview/Preview.vue b/easypan-front/src/components/preview/Preview.vue new file mode 100644 index 0000000..c7a5172 --- /dev/null +++ b/easypan-front/src/components/preview/Preview.vue @@ -0,0 +1,127 @@ + + + + + \ No newline at end of file diff --git a/easypan-front/src/components/preview/PreviewDoc.vue b/easypan-front/src/components/preview/PreviewDoc.vue new file mode 100644 index 0000000..85fbaf6 --- /dev/null +++ b/easypan-front/src/components/preview/PreviewDoc.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/easypan-front/src/components/preview/PreviewDownload.vue b/easypan-front/src/components/preview/PreviewDownload.vue new file mode 100644 index 0000000..6ca4900 --- /dev/null +++ b/easypan-front/src/components/preview/PreviewDownload.vue @@ -0,0 +1,73 @@ + + + + + \ No newline at end of file diff --git a/easypan-front/src/components/preview/PreviewExcel.vue b/easypan-front/src/components/preview/PreviewExcel.vue new file mode 100644 index 0000000..9c643e1 --- /dev/null +++ b/easypan-front/src/components/preview/PreviewExcel.vue @@ -0,0 +1,50 @@ + + + + + diff --git a/easypan-front/src/components/preview/PreviewImage.vue b/easypan-front/src/components/preview/PreviewImage.vue new file mode 100644 index 0000000..17ce7ac --- /dev/null +++ b/easypan-front/src/components/preview/PreviewImage.vue @@ -0,0 +1,53 @@ + + + + + \ No newline at end of file diff --git a/easypan-front/src/components/preview/PreviewMusic.vue b/easypan-front/src/components/preview/PreviewMusic.vue new file mode 100644 index 0000000..f96c67e --- /dev/null +++ b/easypan-front/src/components/preview/PreviewMusic.vue @@ -0,0 +1,79 @@ + + + + + \ No newline at end of file diff --git a/easypan-front/src/components/preview/PreviewPdf.vue b/easypan-front/src/components/preview/PreviewPdf.vue new file mode 100644 index 0000000..781e851 --- /dev/null +++ b/easypan-front/src/components/preview/PreviewPdf.vue @@ -0,0 +1,62 @@ + + + + + \ No newline at end of file diff --git a/easypan-front/src/components/preview/PreviewTxt.vue b/easypan-front/src/components/preview/PreviewTxt.vue new file mode 100644 index 0000000..a6bb528 --- /dev/null +++ b/easypan-front/src/components/preview/PreviewTxt.vue @@ -0,0 +1,101 @@ + + + + + \ No newline at end of file diff --git a/easypan-front/src/components/preview/PreviewVideo.vue b/easypan-front/src/components/preview/PreviewVideo.vue new file mode 100644 index 0000000..9d7bef7 --- /dev/null +++ b/easypan-front/src/components/preview/PreviewVideo.vue @@ -0,0 +1,57 @@ + + + + + diff --git a/easypan-front/src/js/CategoryInfo.js b/easypan-front/src/js/CategoryInfo.js new file mode 100644 index 0000000..e79db89 --- /dev/null +++ b/easypan-front/src/js/CategoryInfo.js @@ -0,0 +1,20 @@ +export default { + "all": { + accept: "*" + }, + "video": { + accept: ".mp4,.avi,.rmvb,.mkv,.mov" + }, + "music": { + accept: ".mp3,.wav,.wma,.mp2,.flac,.midi,.ra,.ape,.aac,.cda" + }, + "image": { + accept: ".jpeg,.jpg,.png,.gif,.bmp,.dds,.psd,.pdt,.webp,.xmp,.svg,.tiff" + }, + "doc": { + accept: ".pdf,.doc,.docx,.xls,.xlsx,.txt" + }, + "others": { + accept: "*" + }, +} \ No newline at end of file diff --git a/easypan-front/src/main.js b/easypan-front/src/main.js new file mode 100644 index 0000000..053ebca --- /dev/null +++ b/easypan-front/src/main.js @@ -0,0 +1,67 @@ +import { createApp } from 'vue' +import { createPinia } from 'pinia' + +import App from '@/App.vue' +import router from '@/router' +//引入cookies +import VueCookies from 'vue-cookies' +//引入element plus +import ElementPlus from 'element-plus' +import 'element-plus/dist/index.css' +//图标 图标在附件中 +import '@/assets/icon/iconfont.css' +import '@/assets/base.scss' + +//引入代码高亮 +import HljsVuePlugin from '@highlightjs/vue-plugin' +import "highlight.js/styles/atom-one-light.css"; +import 'highlight.js/lib/common' + + +import Request from '@/utils/Request'; +import Message from '@/utils/Message' +import Confirm from '@/utils/Confirm' +import Verify from '@/utils/Verify' +import Utils from '@/utils/Utils' + +//自定义组件 +import Icon from "@/components/Icon.vue" +import Table from '@/components/Table.vue' +import Dialog from '@/components/Dialog.vue' +import NoData from '@/components/NoData.vue' +import Window from '@/components/Window.vue' +import Preview from '@/components/preview/Preview.vue' +import Navigation from '@/components/Navigation.vue' +import FolderSelect from '@/components/FolderSelect.vue' +import Avatar from '@/components/Avatar.vue' + +const app = createApp(App) +app.use(ElementPlus); +app.use(createPinia()) +app.use(HljsVuePlugin); +app.use(router) + +app.component("Icon", Icon); +app.component("Table", Table); +app.component("Dialog", Dialog); +app.component("NoData", NoData); +app.component("Window", Window); +app.component("Preview", Preview); +app.component("Navigation", Navigation); +app.component("FolderSelect", FolderSelect); +app.component("Avatar", Avatar); + + +//配置全局变量 +app.config.globalProperties.Request = Request; +app.config.globalProperties.Message = Message; +app.config.globalProperties.Confirm = Confirm; +app.config.globalProperties.Verify = Verify; +app.config.globalProperties.Utils = Utils; + +app.config.globalProperties.VueCookies = VueCookies; +app.config.globalProperties.globalInfo = { + avatarUrl: "/api/getAvatar/", + imageUrl: "/api/file/getImage/" +} +app.mount('#app') diff --git a/easypan-front/src/router/index.js b/easypan-front/src/router/index.js new file mode 100644 index 0000000..f5543ce --- /dev/null +++ b/easypan-front/src/router/index.js @@ -0,0 +1,101 @@ +import { createRouter, createWebHistory } from 'vue-router' +import VueCookies from 'vue-cookies' + +const router = createRouter({ + history: createWebHistory(import.meta.env.BASE_URL), + routes: [ + { + path: '/login', + name: '登录', + component: () => import("@/views/Login.vue") + }, + { + path: "/", + component: () => import("@/views/Framework.vue"), + children: [ + { + path: '/', + redirect: "/main/all" + }, + { + path: '/main/:category', + name: '首页', + meta: { + needLogin: true, + menuCode: "main" + }, + component: () => import("@/views/main/Main.vue") + }, + { + path: '/myshare', + name: '我的分享', + meta: { + needLogin: true, + menuCode: "share" + }, + component: () => import("@/views/share/Share.vue") + }, + { + path: '/recycle', + name: '回收站', + meta: { + needLogin: true, + menuCode: "recycle" + }, + component: () => import("@/views/recycle/Recycle.vue") + }, + { + path: '/settings/sysSetting', + name: '系统设置', + meta: { + needLogin: true, + menuCode: "settings" + }, + component: () => import("@/views/admin/SysSettings.vue") + }, + { + path: '/settings/userList', + name: '用户管理', + meta: { + needLogin: true, + menuCode: "settings" + }, + component: () => import("@/views/admin/UserList.vue") + }, + { + path: '/settings/fileList', + name: '用户文件', + meta: { + needLogin: true, + menuCode: "settings" + }, + component: () => import("@/views/admin/FileList.vue") + }, + ] + }, + { + path: '/shareCheck/:shareId', + name: '分享校验', + component: () => import("@/views/webshare/ShareCheck.vue") + }, + { + path: '/share/:shareId', + name: '分享', + component: () => import("@/views/webshare/Share.vue") + }, { + path: '/qqlogincalback', + name: "qq登录回调", + component: () => import('@/views/QqLoginCallback.vue'), + } + ] +}) + +router.beforeEach((to, from, next) => { + const userInfo = VueCookies.get("userInfo"); + if (to.meta.needLogin != null && to.meta.needLogin && userInfo == null) { + router.push("/login"); + } + next(); +}) + +export default router diff --git a/easypan-front/src/stores/useInfoStore.js b/easypan-front/src/stores/useInfoStore.js new file mode 100644 index 0000000..7e58f5d --- /dev/null +++ b/easypan-front/src/stores/useInfoStore.js @@ -0,0 +1,19 @@ +import { defineStore } from 'pinia' + +export const userStore = defineStore('userInfo', { + state: () => { + return { + userInfo: {}, + } + }, + getters: { + getUserInfo() { + return this.userInfo; + } + }, + actions: { + saveUserInfo(userInfo) { + this.userInfo = userInfo + } + } +}) diff --git a/easypan-front/src/utils/Confirm.js b/easypan-front/src/utils/Confirm.js new file mode 100644 index 0000000..2dc7014 --- /dev/null +++ b/easypan-front/src/utils/Confirm.js @@ -0,0 +1,16 @@ + +import { ElMessageBox } from 'element-plus' + +const confirm = (message, okfun) => { + ElMessageBox.confirm(message, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'info', + }).then(() => { + okfun(); + }).catch(() => { }) +}; + +export default confirm; + + diff --git a/easypan-front/src/utils/Message.js b/easypan-front/src/utils/Message.js new file mode 100644 index 0000000..fb23625 --- /dev/null +++ b/easypan-front/src/utils/Message.js @@ -0,0 +1,28 @@ +import { ElMessage } from 'element-plus' + +const showMessage = (msg, callback, type) => { + ElMessage({ + type: type, + message: msg, + duration: 2000, + onClose: () => { + if (callback) { + callback(); + } + } + }) +} + +const message = { + error: (msg, callback) => { + showMessage(msg, callback, "error"); + }, + success: (msg, callback) => { + showMessage(msg, callback, "success"); + }, + warning: (msg, callback) => { + showMessage(msg, callback, "warning"); + }, +} + +export default message; \ No newline at end of file diff --git a/easypan-front/src/utils/Request.js b/easypan-front/src/utils/Request.js new file mode 100644 index 0000000..75aacdc --- /dev/null +++ b/easypan-front/src/utils/Request.js @@ -0,0 +1,111 @@ +import axios from 'axios' + +import { ElLoading } from 'element-plus' +import router from '@/router' + +import Message from '../utils/Message' + +const contentTypeForm = 'application/x-www-form-urlencoded;charset=UTF-8' +const contentTypeJson = 'application/json' +//arraybuffer ArrayBuffer对象 +//blob Blob对象 +//document Documnet对象 +//json JavaScript object, parsed from a JSON string returned by the server +//text DOMString +const responseTypeJson = "json" + +let loading = null; +const instance = axios.create({ + baseURL: '/api', + timeout: 10 * 1000, +}); +//请求前拦截器 +instance.interceptors.request.use( + (config) => { + if (config.showLoading) { + loading = ElLoading.service({ + lock: true, + text: '加载中......', + background: 'rgba(0, 0, 0, 0.7)', + }); + } + return config; + }, + (error) => { + if (config.showLoading && loading) { + loading.close(); + } + Message.error("请求发送失败"); + return Promise.reject("请求发送失败"); + } +); +//请求后拦截器 +instance.interceptors.response.use( + (response) => { + const { showLoading, errorCallback, showError = true, responseType } = response.config; + if (showLoading && loading) { + loading.close() + } + const responseData = response.data; + if (responseType == "arraybuffer" || responseType == "blob") { + return responseData; + } + //正常请求 + if (responseData.code == 200) { + return responseData; + } else if (responseData.code == 901) { + //登录超时 + router.push("/login?redirectUrl=" + encodeURI(router.currentRoute.value.path)); + return Promise.reject({ showError: false, msg: "登录超时" }); + } else { + //其他错误 + if (errorCallback) { + errorCallback(responseData.info); + } + return Promise.reject({ showError: showError, msg: responseData.info }); + } + }, + (error) => { + if (error.config.showLoading && loading) { + loading.close(); + } + return Promise.reject({ showError: true, msg: "网络异常" }) + } +); + +const request = (config) => { + const { url, params, dataType, showLoading = true, responseType = responseTypeJson } = config; + let contentType = contentTypeForm; + let formData = new FormData();// 创建form对象 + for (let key in params) { + formData.append(key, params[key] == undefined ? "" : params[key]); + } + if (dataType != null && dataType == 'json') { + contentType = contentTypeJson; + } + let headers = { + 'Content-Type': contentType, + 'X-Requested-With': 'XMLHttpRequest', + } + + return instance.post(url, formData, { + onUploadProgress: (event) => { + if (config.uploadProgressCallback) { + config.uploadProgressCallback(event); + } + }, + responseType: responseType, + headers: headers, + showLoading: showLoading, + errorCallback: config.errorCallback, + showError: config.showError + }).catch(error => { + console.log(error); + if (error.showError) { + Message.error(error.msg); + } + return null; + }); +}; + +export default request; diff --git a/easypan-front/src/utils/Utils.js b/easypan-front/src/utils/Utils.js new file mode 100644 index 0000000..56dcf50 --- /dev/null +++ b/easypan-front/src/utils/Utils.js @@ -0,0 +1,21 @@ +export default { + sizeToStr: (limit) => { + var size = ""; + if (limit < 0.1 * 1024) { //小于0.1KB,则转化成B + size = limit.toFixed(2) + "B" + } else if (limit < 0.1 * 1024 * 1024) { //小于0.1MB,则转化成KB + size = (limit / 1024).toFixed(2) + "KB" + } else if (limit < 0.1 * 1024 * 1024 * 1024) { //小于0.1GB,则转化成MB + size = (limit / (1024 * 1024)).toFixed(2) + "MB" + } else { //其他转化成GB + size = (limit / (1024 * 1024 * 1024)).toFixed(2) + "GB" + } + var sizeStr = size + ""; //转成字符串 + var index = sizeStr.indexOf("."); //获取小数点处的索引 + var dou = sizeStr.substr(index + 1, 2) //获取小数点后两位的值 + if (dou == "00") { //判断后两位是否为00,如果是则删除00 + return sizeStr.substring(0, index) + sizeStr.substr(index + 3, 2) + } + return size; + }, +} \ No newline at end of file diff --git a/easypan-front/src/utils/Verify.js b/easypan-front/src/utils/Verify.js new file mode 100644 index 0000000..2c3fcf7 --- /dev/null +++ b/easypan-front/src/utils/Verify.js @@ -0,0 +1,32 @@ +const regs = { + email: /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/, + number: /^([0]|[1-9][0-9]*)$/, + password: /^(?=.*\d)(?=.*[a-zA-Z])[\da-zA-Z~!@#$%^&*_]{8,}$/, + shareCode: /^[A-Za-z0-9]+$/ +} +const verify = (rule, value, reg, callback) => { + if (value) { + if (reg.test(value)) { + callback() + } else { + callback(new Error(rule.message)) + } + } else { + callback() + } +} + +export default { + email: (rule, value, callback) => { + return verify(rule, value, regs.email, callback) + }, + number: (rule, value, callback) => { + return verify(rule, value, regs.number, callback) + }, + password: (rule, value, callback) => { + return verify(rule, value, regs.password, callback) + }, + shareCode: (rule, value, callback) => { + return verify(rule, value, regs.shareCode, callback) + }, +} diff --git a/easypan-front/src/views/Framework.vue b/easypan-front/src/views/Framework.vue new file mode 100644 index 0000000..536e7f2 --- /dev/null +++ b/easypan-front/src/views/Framework.vue @@ -0,0 +1,495 @@ + + + + + \ No newline at end of file diff --git a/easypan-front/src/views/Login.vue b/easypan-front/src/views/Login.vue new file mode 100644 index 0000000..4a74bcb --- /dev/null +++ b/easypan-front/src/views/Login.vue @@ -0,0 +1,541 @@ + + + + + \ No newline at end of file diff --git a/easypan-front/src/views/QqLoginCallback.vue b/easypan-front/src/views/QqLoginCallback.vue new file mode 100644 index 0000000..22d1e38 --- /dev/null +++ b/easypan-front/src/views/QqLoginCallback.vue @@ -0,0 +1,38 @@ + + + + + diff --git a/easypan-front/src/views/UpdateAvatar.vue b/easypan-front/src/views/UpdateAvatar.vue new file mode 100644 index 0000000..40ea786 --- /dev/null +++ b/easypan-front/src/views/UpdateAvatar.vue @@ -0,0 +1,93 @@ + + + + + \ No newline at end of file diff --git a/easypan-front/src/views/UpdatePassword.vue b/easypan-front/src/views/UpdatePassword.vue new file mode 100644 index 0000000..9a50885 --- /dev/null +++ b/easypan-front/src/views/UpdatePassword.vue @@ -0,0 +1,136 @@ + + + + + \ No newline at end of file diff --git a/easypan-front/src/views/admin/FileList.vue b/easypan-front/src/views/admin/FileList.vue new file mode 100644 index 0000000..ff437cc --- /dev/null +++ b/easypan-front/src/views/admin/FileList.vue @@ -0,0 +1,313 @@ + + + + + \ No newline at end of file diff --git a/easypan-front/src/views/admin/SysSettings.vue b/easypan-front/src/views/admin/SysSettings.vue new file mode 100644 index 0000000..0b40eb5 --- /dev/null +++ b/easypan-front/src/views/admin/SysSettings.vue @@ -0,0 +1,107 @@ + + + + + \ No newline at end of file diff --git a/easypan-front/src/views/admin/UserList.vue b/easypan-front/src/views/admin/UserList.vue new file mode 100644 index 0000000..9ed8c54 --- /dev/null +++ b/easypan-front/src/views/admin/UserList.vue @@ -0,0 +1,263 @@ + + + + \ No newline at end of file diff --git a/easypan-front/src/views/main/Main.vue b/easypan-front/src/views/main/Main.vue new file mode 100644 index 0000000..91aa429 --- /dev/null +++ b/easypan-front/src/views/main/Main.vue @@ -0,0 +1,511 @@ + + + + + \ No newline at end of file diff --git a/easypan-front/src/views/main/ShareFile.vue b/easypan-front/src/views/main/ShareFile.vue new file mode 100644 index 0000000..9e9445e --- /dev/null +++ b/easypan-front/src/views/main/ShareFile.vue @@ -0,0 +1,149 @@ + + + + + diff --git a/easypan-front/src/views/main/Uploader.vue b/easypan-front/src/views/main/Uploader.vue new file mode 100644 index 0000000..5a58f89 --- /dev/null +++ b/easypan-front/src/views/main/Uploader.vue @@ -0,0 +1,455 @@ + + + + + diff --git a/easypan-front/src/views/recycle/Recycle.vue b/easypan-front/src/views/recycle/Recycle.vue new file mode 100644 index 0000000..f753ce2 --- /dev/null +++ b/easypan-front/src/views/recycle/Recycle.vue @@ -0,0 +1,228 @@ + + + + + \ No newline at end of file diff --git a/easypan-front/src/views/share/Share.vue b/easypan-front/src/views/share/Share.vue new file mode 100644 index 0000000..e7bd7b5 --- /dev/null +++ b/easypan-front/src/views/share/Share.vue @@ -0,0 +1,213 @@ + + + + + \ No newline at end of file diff --git a/easypan-front/src/views/webshare/Share.vue b/easypan-front/src/views/webshare/Share.vue new file mode 100644 index 0000000..2f76687 --- /dev/null +++ b/easypan-front/src/views/webshare/Share.vue @@ -0,0 +1,397 @@ + + + + + diff --git a/easypan-front/src/views/webshare/ShareCheck.vue b/easypan-front/src/views/webshare/ShareCheck.vue new file mode 100644 index 0000000..f8596d0 --- /dev/null +++ b/easypan-front/src/views/webshare/ShareCheck.vue @@ -0,0 +1,188 @@ + + + + + \ No newline at end of file diff --git a/easypan-front/vite.config.js b/easypan-front/vite.config.js new file mode 100644 index 0000000..02f6549 --- /dev/null +++ b/easypan-front/vite.config.js @@ -0,0 +1,50 @@ +import { fileURLToPath, URL } from 'node:url' + +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [vue()], + define: { + 'process.env': {} + }, + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)) + } + }, + server: { + port: 1024, + hmr: true, + proxy: { + "/api": { + target: "http://localhost:7090", + changeOrigin: true, + pathRewrite: { + "^api": "/api" + } + } + } + }, + build: { + chunkSizeWarningLimit: 3000, + rollupOptions: { + output: { + manualChunks(id) { + if (id.includes('node_modules')) { + return id.toString().split('node_modules/')[1].split('/')[0].toString(); + } + } + } + }, + chunkFileNames: (chunkInfo) => { + const facadeModuleId = chunkInfo.facadeModuleId + ? chunkInfo.facadeModuleId.split('/') + : []; + const fileName = + facadeModuleId[facadeModuleId.length - 2] || '[name]'; + return `js/${fileName}/[name].[hash].js`; + } + } +}) diff --git a/easypan-java/.gitignore b/easypan-java/.gitignore new file mode 100644 index 0000000..549e00a --- /dev/null +++ b/easypan-java/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/easypan-java/pom.xml b/easypan-java/pom.xml new file mode 100644 index 0000000..68c55ae --- /dev/null +++ b/easypan-java/pom.xml @@ -0,0 +1,165 @@ + + + + + + org.springframework.boot + spring-boot-starter-parent + 2.6.1 + + + 4.0.0 + + com.easypan + easypan + 1.0 + jar + + + 1.8 + UTF-8 + 1.8 + 1.8 + true + + 2.6.1 + 1.3.2 + 1.2.10 + 8.0.19 + 1.2.16 + 1.9.4 + 1.2.66 + 3.4 + 1.9 + 2.5 + + + + + org.springframework.boot + spring-boot-starter-web + + + ch.qos.logback + logback-classic + + + ch.qos.logback + logback-core + + + + + + org.projectlombok + lombok + + + + org.springframework.boot + spring-boot-starter-mail + ${springboot.version} + + + + org.springframework.boot + spring-boot-starter-data-redis + ${springboot.version} + + + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + ${mybatis.version} + + + + + + mysql + mysql-connector-java + ${mysql.version} + + + + com.alibaba + druid-spring-boot-starter + ${druid.version} + + + + + + ch.qos.logback + logback-classic + ${logback.version} + + + ch.qos.logback + logback-core + ${logback.version} + + + + + org.aspectj + aspectjweaver + ${aspectjweaver.version} + + + + com.alibaba + fastjson + ${fastjson.version} + + + + + org.apache.commons + commons-lang3 + ${commons.lang3.version} + + + + commons-codec + commons-codec + ${commons.codec.version} + + + + commons-io + commons-io + ${commons.io.version} + + + + org.springframework.boot + spring-boot-devtools + + + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.2.6.RELEASE + + + + + repackage + + + + + + com.easypan.EasyPanApplication + + + + + + diff --git a/easypan-java/src/main/java/com/easypan/EasypanApplication.java b/easypan-java/src/main/java/com/easypan/EasypanApplication.java new file mode 100644 index 0000000..db5fb14 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/EasypanApplication.java @@ -0,0 +1,22 @@ +package com.easypan; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.transaction.annotation.EnableTransactionManagement; + + +@SpringBootApplication +@EnableTransactionManagement // 事务 +@EnableScheduling // 定时任务 +@EnableAsync // 异步调用 +@MapperScan("com.easypan.mappers") +public class EasypanApplication { + + public static void main(String[] args) { + SpringApplication.run(EasypanApplication.class, args); + } + +} diff --git a/easypan-java/src/main/java/com/easypan/annotation/GlobalInterceptor.java b/easypan-java/src/main/java/com/easypan/annotation/GlobalInterceptor.java new file mode 100644 index 0000000..becad28 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/annotation/GlobalInterceptor.java @@ -0,0 +1,22 @@ +package com.easypan.annotation; + +import org.springframework.web.bind.annotation.Mapping; + +import java.lang.annotation.*; + +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Mapping +public @interface GlobalInterceptor { + + // 校验参数 + boolean checkParams() default false; + + // 校验登陆 + boolean checkLogin() default true; + + // 校验管理员 + boolean checkAdmin() default false; + +} diff --git a/easypan-java/src/main/java/com/easypan/annotation/VerifyParam.java b/easypan-java/src/main/java/com/easypan/annotation/VerifyParam.java new file mode 100644 index 0000000..5927e53 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/annotation/VerifyParam.java @@ -0,0 +1,23 @@ +package com.easypan.annotation; + +import com.easypan.entity.enums.VerifyRegexEnum; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.PARAMETER, ElementType.FIELD}) +public @interface VerifyParam { + + int min() default -1; + + int max() default -1; + + boolean required() default false; + + //默认不校验 + VerifyRegexEnum regex() default VerifyRegexEnum.NO; + +} diff --git a/easypan-java/src/main/java/com/easypan/aspect/GlobalOperationAspect.java b/easypan-java/src/main/java/com/easypan/aspect/GlobalOperationAspect.java new file mode 100644 index 0000000..349ac8c --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/aspect/GlobalOperationAspect.java @@ -0,0 +1,180 @@ +package com.easypan.aspect; + +import com.easypan.annotation.GlobalInterceptor; +import com.easypan.annotation.VerifyParam; +import com.easypan.config.AppConfig; +import com.easypan.entity.constants.Constants; +import com.easypan.entity.dto.SessionWebUserDto; +import com.easypan.entity.enums.ResponseCodeEnum; +import com.easypan.exception.BusinessException; +import com.easypan.service.UserInfoService; +import com.easypan.utils.StringTools; +import com.easypan.utils.VerifyUtils; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.annotation.Pointcut; +import org.aspectj.lang.reflect.MethodSignature; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.lang.reflect.Parameter; + + +@Component +@Slf4j +@Aspect +public class GlobalOperationAspect { + + private static final String TYPE_STRING = "java.lang.String"; + private static final String TYPE_INTEGER = "java.lang.Integer"; + private static final String TYPE_LONG = "java.lang.Long"; + + @Resource + private UserInfoService userInfoService; + + @Resource + private AppConfig appConfig; + + + @Pointcut("@annotation(com.easypan.annotation.GlobalInterceptor)") + private void requestInterceptor() { + } + + @Before("requestInterceptor()") + public void interceptorDo(JoinPoint point) throws BusinessException { + try { + Object target = point.getTarget(); + Object[] arguments = point.getArgs(); + String methodName = point.getSignature().getName(); + Class[] parameterTypes = ((MethodSignature) point.getSignature()).getMethod().getParameterTypes(); + Method method = target.getClass().getMethod(methodName, parameterTypes); + GlobalInterceptor interceptor = method.getAnnotation(GlobalInterceptor.class); + if (null == interceptor) { + return; + } + /** + * 校验登陆 + */ + if (interceptor.checkLogin() || interceptor.checkAdmin()) { + checkLogin(interceptor.checkAdmin()); + } + /** + * 校验参数 + */ + if (interceptor.checkParams()) { + validateParams(method, arguments); + } + } catch (BusinessException e) { + log.error("全局拦截器异常", e); + throw e; + } catch (Exception e) { + log.error("全局拦截器异常", e); + throw new BusinessException(ResponseCodeEnum.CODE_500); + } catch (Throwable e) { + log.error("全局拦截器异常", e); + throw new BusinessException(ResponseCodeEnum.CODE_500); + } + } + + private void checkLogin(Boolean checkAdmin) { + HttpServletRequest request = ((ServletRequestAttributes) + RequestContextHolder.getRequestAttributes()).getRequest(); + HttpSession session = request.getSession(); + SessionWebUserDto userDto = (SessionWebUserDto) session.getAttribute(Constants.SESSION_KEY); + + if (userDto == null) { + throw new BusinessException(ResponseCodeEnum.CODE_901); + } + if (checkAdmin && ! userDto.getIsAdmin()) { + throw new BusinessException(ResponseCodeEnum.CODE_404); + } + } + + private void validateParams(Method m, Object[] arguments) throws BusinessException { + Parameter[] parameters = m.getParameters(); + for (int i = 0; i < parameters.length; i++) { + Parameter parameter = parameters[i]; + Object value = arguments[i]; + VerifyParam verifyParam = parameter.getAnnotation(VerifyParam.class); + if (verifyParam == null) { + continue; + } + //基本数据类型 + if (TYPE_STRING.equals(parameter.getParameterizedType().getTypeName()) || TYPE_LONG.equals(parameter.getParameterizedType().getTypeName()) || TYPE_INTEGER.equals(parameter.getParameterizedType().getTypeName())) { + checkValue(value, verifyParam); + //如果传递的是对象 + } else { + checkObjValue(parameter, value); + } + } + } + + private void checkObjValue(Parameter parameter, Object value) { + try { + String typeName = parameter.getParameterizedType().getTypeName(); + Class clazz = Class.forName(typeName); + Field[] fields = clazz.getDeclaredFields(); + for (Field field : fields) { + VerifyParam fieldVerifyParam = field.getAnnotation(VerifyParam.class); + if (fieldVerifyParam == null) { + continue; + } + field.setAccessible(true); + Object resultValue = field.get(value); + checkValue(resultValue, fieldVerifyParam); + } + } catch (BusinessException e) { + log.error("校验参数失败", e); + throw e; + } catch (Exception e) { + log.error("校验参数失败", e); + throw new BusinessException(ResponseCodeEnum.CODE_600); + } + } + + /** + * 校验参数 + * + * @param value + * @param verifyParam + * @throws BusinessException + */ + private void checkValue(Object value, VerifyParam verifyParam) throws BusinessException { + Boolean isEmpty = value == null || StringTools.isEmpty(value.toString()); + Integer length = value == null ? 0 : value.toString().length(); + + /** + * 校验空 + */ + if (isEmpty && verifyParam.required()) { + throw new BusinessException(ResponseCodeEnum.CODE_600); + } + + /** + * 校验长度 + */ + if (!isEmpty && (verifyParam.max() != -1 && verifyParam.max() < length + || verifyParam.min() != -1 && verifyParam.min() > length)) { + throw new BusinessException(ResponseCodeEnum.CODE_600); + } + /** + * 校验正则 + */ + if (!isEmpty && !StringTools.isEmpty(verifyParam.regex().getRegex()) + && !VerifyUtils.verify(verifyParam.regex(), String.valueOf(value))) { + throw new BusinessException(ResponseCodeEnum.CODE_600); + } + } +} \ No newline at end of file diff --git a/easypan-java/src/main/java/com/easypan/config/AppConfig.java b/easypan-java/src/main/java/com/easypan/config/AppConfig.java new file mode 100644 index 0000000..65935d3 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/config/AppConfig.java @@ -0,0 +1,109 @@ +package com.easypan.config; + +import com.easypan.utils.StringTools; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +@Component +public class AppConfig { + + private static final Logger logger = LoggerFactory.getLogger(AppConfig.class); + + /** + * 文件目录 + */ + @Value("${project.folder:}") + private String projectFolder; + + /** + * 发送人 + */ + @Value("${spring.mail.username:}") + private String sendUserName; + + + @Value("${admin.emails:}") + private String adminEmails; + + public String getAdminEmails() { + return adminEmails; + } + + @Value("${dev:false}") + private Boolean dev; + + + @Value("${qq.app.id:}") + private String qqAppId; + + @Value("${qq.app.key:}") + private String qqAppKey; + + + @Value("${qq.url.authorization:}") + private String qqUrlAuthorization; + + + @Value("${qq.url.access.token:}") + private String qqUrlAccessToken; + + + @Value("${qq.url.openid:}") + private String qqUrlOpenId; + + @Value("${qq.url.user.info:}") + private String qqUrlUserInfo; + + @Value("${qq.url.redirect:}") + private String qqUrlRedirect; + + + public String getProjectFolder() { + if (!StringTools.isEmpty(projectFolder) && !projectFolder.endsWith("/")) { + projectFolder = projectFolder + "/"; + } + return projectFolder; + } + + public static Logger getLogger() { + return logger; + } + + public String getSendUserName() { + return sendUserName; + } + + public Boolean getDev() { + return dev; + } + + public String getQqAppId() { + return qqAppId; + } + + public String getQqAppKey() { + return qqAppKey; + } + + public String getQqUrlAuthorization() { + return qqUrlAuthorization; + } + + public String getQqUrlAccessToken() { + return qqUrlAccessToken; + } + + public String getQqUrlOpenId() { + return qqUrlOpenId; + } + + public String getQqUrlUserInfo() { + return qqUrlUserInfo; + } + + public String getQqUrlRedirect() { + return qqUrlRedirect; + } +} diff --git a/easypan-java/src/main/java/com/easypan/config/RedisConfig.java b/easypan-java/src/main/java/com/easypan/config/RedisConfig.java new file mode 100644 index 0000000..124c3a2 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/config/RedisConfig.java @@ -0,0 +1,27 @@ +package com.easypan.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.serializer.RedisSerializer; + +@Configuration +public class RedisConfig { + + @Bean + public RedisTemplate redisTemplate(RedisConnectionFactory factory) { + RedisTemplate template = new RedisTemplate<>(); + template.setConnectionFactory(factory); + // 设置key的序列化方式 + template.setKeySerializer(RedisSerializer.string()); + // 设置value的序列化方式 + template.setValueSerializer(RedisSerializer.json()); + // 设置hash的key的序列化方式 + template.setHashKeySerializer(RedisSerializer.string()); + // 设置hash的value的序列化方式 + template.setHashValueSerializer(RedisSerializer.json()); + template.afterPropertiesSet(); + return template; + } +} \ No newline at end of file diff --git a/easypan-java/src/main/java/com/easypan/controller/AGlobalExceptionHandlerController.java b/easypan-java/src/main/java/com/easypan/controller/AGlobalExceptionHandlerController.java new file mode 100644 index 0000000..a64b249 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/controller/AGlobalExceptionHandlerController.java @@ -0,0 +1,55 @@ +package com.easypan.controller; + +import com.easypan.controller.basecontroller.BaseController; +import com.easypan.entity.enums.ResponseCodeEnum; +import com.easypan.entity.vo.ResponseVO; +import com.easypan.exception.BusinessException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.dao.DuplicateKeyException; +import org.springframework.validation.BindException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException; +import org.springframework.web.servlet.NoHandlerFoundException; + +import javax.servlet.http.HttpServletRequest; + +@RestControllerAdvice +public class AGlobalExceptionHandlerController extends BaseController { + + private static final Logger logger = LoggerFactory.getLogger(AGlobalExceptionHandlerController.class); + + @ExceptionHandler(value = Exception.class) + Object handleException(Exception e, HttpServletRequest request) { + logger.error("请求错误,请求地址{},错误信息:", request.getRequestURL(), e); + ResponseVO ajaxResponse = new ResponseVO(); + //404 + if (e instanceof NoHandlerFoundException) { + ajaxResponse.setCode(ResponseCodeEnum.CODE_404.getCode()); + ajaxResponse.setInfo(ResponseCodeEnum.CODE_404.getMsg()); + ajaxResponse.setStatus(STATUC_ERROR); + } else if (e instanceof BusinessException) { + //业务错误 + BusinessException biz = (BusinessException) e; + ajaxResponse.setCode(biz.getCode() == null ? ResponseCodeEnum.CODE_600.getCode() : biz.getCode()); + ajaxResponse.setInfo(biz.getMessage()); + ajaxResponse.setStatus(STATUC_ERROR); + } else if (e instanceof BindException|| e instanceof MethodArgumentTypeMismatchException) { + //参数类型错误 + ajaxResponse.setCode(ResponseCodeEnum.CODE_600.getCode()); + ajaxResponse.setInfo(ResponseCodeEnum.CODE_600.getMsg()); + ajaxResponse.setStatus(STATUC_ERROR); + } else if (e instanceof DuplicateKeyException) { + //主键冲突 + ajaxResponse.setCode(ResponseCodeEnum.CODE_601.getCode()); + ajaxResponse.setInfo(ResponseCodeEnum.CODE_601.getMsg()); + ajaxResponse.setStatus(STATUC_ERROR); + } else { + ajaxResponse.setCode(ResponseCodeEnum.CODE_500.getCode()); + ajaxResponse.setInfo(ResponseCodeEnum.CODE_500.getMsg()); + ajaxResponse.setStatus(STATUC_ERROR); + } + return ajaxResponse; + } +} diff --git a/easypan-java/src/main/java/com/easypan/controller/AccountController.java b/easypan-java/src/main/java/com/easypan/controller/AccountController.java new file mode 100644 index 0000000..0f83406 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/controller/AccountController.java @@ -0,0 +1,283 @@ +package com.easypan.controller; + + +import com.easypan.annotation.GlobalInterceptor; +import com.easypan.annotation.VerifyParam; +import com.easypan.utils.RedisComponent; +import com.easypan.controller.basecontroller.BaseController; +import com.easypan.config.AppConfig; +import com.easypan.entity.constants.Constants; +import com.easypan.entity.dto.CreateImageCode; +import com.easypan.entity.dto.SessionWebUserDto; +import com.easypan.entity.enums.VerifyRegexEnum; +import com.easypan.entity.po.UserInfo; +import com.easypan.entity.vo.ResponseVO; +import com.easypan.exception.BusinessException; +import com.easypan.service.EmailCodeService; +import com.easypan.service.UserInfoService; +import com.easypan.utils.StringTools; +import lombok.extern.slf4j.Slf4j; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; +import java.io.File; +import java.io.IOException; +import java.io.PrintWriter; + + +@Slf4j +@RestController +public class AccountController extends BaseController { + + @Resource + private AppConfig appConfig; + + @Resource + private UserInfoService userInfoService; + + @Resource + private EmailCodeService emailCodeService; + + + @Resource + private RedisComponent redisComponent; + + private static final String CONTENT_TYPE = "Content-Type"; + + private static final String CONTENT_TYPE_VALUE = "application/json;charset=UTF-8"; + + + /** + * 根据请求类型返回验证码并存入session + * + * @param type 0:登录注册 1:邮箱验证码发送 默认0 + */ + @GetMapping("/checkCode") + public void checkCode(HttpServletResponse response, HttpSession session + , @RequestParam(value = "type", required = false) Integer type) throws IOException { + CreateImageCode vCode = new CreateImageCode(130, 38, 5, 10); + + response.setHeader("Pragma", "no-cache"); + response.setHeader("Cache-Control", "no-cache"); //响应消息不能缓存 + response.setDateHeader("Expires", 0); + response.setContentType("image/jpeg"); + + String code = vCode.getCode(); + if (type == null || type == 0) { + session.setAttribute(Constants.CHECK_CODE_KEY, code); + } else { + session.setAttribute(Constants.CHECK_CODE_KEY_EMAIL, code); + } + vCode.write(response.getOutputStream()); + } + + + /** + * @param email 需要接收验证码的邮箱 + * @param checkCode 发送给服务器的验证码 + * @param type 0:注册 1:找回密码 + */ + @PostMapping("/sendEmailCode") + @GlobalInterceptor(checkParams = true, checkLogin = false) + public ResponseVO sendEmailCode(HttpSession session, + @VerifyParam(required = true, regex = VerifyRegexEnum.EMAIL, max = 150) String email, + @VerifyParam(required = true) String checkCode, + @VerifyParam(required = true) Integer type) { + try { + // 如果验证码错误 + if (!checkCode.equals(session.getAttribute(Constants.CHECK_CODE_KEY_EMAIL))) { + throw new BusinessException("验证码错误"); + } + // 如果验证码正确,发送邮箱验证码 + emailCodeService.sendEmailCode(email, type); + return getSuccessResponseVO(null); + } finally { + // 删除session中保存的邮箱验证码 + session.removeAttribute(Constants.CHECK_CODE_KEY_EMAIL); + } + } + + @PostMapping("/register") + @GlobalInterceptor(checkParams = true, checkLogin = false) + public ResponseVO register(HttpSession session, + @VerifyParam(required = true, regex = VerifyRegexEnum.EMAIL, max = 150) String email, + @VerifyParam(required = true, max = 20) String nickName, + @VerifyParam(required = true, regex = VerifyRegexEnum.PASSWORD, min = 8, max = 18) String password, + @VerifyParam(required = true) String checkCode, + @VerifyParam(required = true) String emailCode) { + try { + if (!checkCode.equalsIgnoreCase((String) session.getAttribute(Constants.CHECK_CODE_KEY))) { + throw new BusinessException("图片验证码不正确"); + } + userInfoService.register(email, nickName, password, emailCode); + return getSuccessResponseVO(null); + } finally { + session.removeAttribute(Constants.CHECK_CODE_KEY); + } + } + + + @PostMapping("/login") + @GlobalInterceptor(checkParams = true, checkLogin = false) + public ResponseVO login(HttpSession session, + @VerifyParam(required = true) String email, + @VerifyParam(required = true) String password, + @VerifyParam(required = true) String checkCode) { + try { + if (!checkCode.equalsIgnoreCase((String) session.getAttribute(Constants.CHECK_CODE_KEY))) { + throw new BusinessException("图片验证码不正确"); + } + SessionWebUserDto sessionWebUserDto = userInfoService.login(email, password); + session.setAttribute(Constants.SESSION_KEY, sessionWebUserDto); + return getSuccessResponseVO(sessionWebUserDto); + } finally { + session.removeAttribute(Constants.CHECK_CODE_KEY); + } + } + + @RequestMapping("/resetPwd") + @GlobalInterceptor(checkParams = true, checkLogin = false) + public ResponseVO resetPwd(HttpSession session, + @VerifyParam(required = true, regex = VerifyRegexEnum.EMAIL, max = 150) String email, + @VerifyParam(required = true, regex = VerifyRegexEnum.PASSWORD, min = 8, max = 18) String password, + @VerifyParam(required = true) String checkCode, + @VerifyParam(required = true) String emailCode) { + try { + if (!checkCode.equalsIgnoreCase((String) session.getAttribute(Constants.CHECK_CODE_KEY))) { + throw new BusinessException("图片验证码不正确"); + } + userInfoService.resetPwd(email, password, emailCode); + return getSuccessResponseVO(null); + } finally { + session.removeAttribute(Constants.CHECK_CODE_KEY); + } + } + + @GetMapping("/updatePWD/{pwd}") + public ResponseVO resetPwd1(@PathVariable String pwd) { + userInfoService.resetPwd("test@qq.com", pwd, "123"); + return getSuccessResponseVO(null); + } + + + + + // 获取用户头像 + @GetMapping("/getAvatar/{userId}") + @GlobalInterceptor(checkParams = true, checkLogin = false) + public void getAvatar(HttpServletResponse response, + @VerifyParam(required = true) @PathVariable("userId") String userId) { + // 得到头像根目录 = /file + /avatar + String avatarFolderName = Constants.FILE_FOLDER_FILE + Constants.FILE_FOLDER_AVATAR_NAME; + // 从AppConfig中得到项目根目录,从而得到放置头像文件夹的绝对路径 + File folder = new File(appConfig.getProjectFolder() + avatarFolderName); + if (!folder.exists()) { + // 不存在就创建 + folder.mkdirs(); + } + + // 根据userId得到用户头像的绝对路径 = 放置头像文件夹的绝对路径 + userId + .jpg(统一后缀) + + String avatarPath = appConfig.getProjectFolder() + avatarFolderName + "/" + userId + Constants.AVATAR_SUFFIX; + File file = new File(avatarPath); + // 如果找不到该用户的头像 + if (!file.exists()) { + // 默认头 + avatarPath = appConfig.getProjectFolder() + avatarFolderName + "/" + Constants.AVATAR_DEFUALT; + // 获取系统默认头像 + if (!new File(avatarPath).exists()) { + // 获取默认头像失败 + printNoDefaultImage(response); + return; + } + + } + // 输出 + response.setContentType("image/jpg"); + readFile(response, avatarPath); + } + + + // 解决输出默认头像失败问题 + private void printNoDefaultImage(HttpServletResponse response) { + response.setHeader(CONTENT_TYPE, CONTENT_TYPE_VALUE); + response.setStatus(HttpStatus.OK.value()); + PrintWriter writer = null; + try { + writer = response.getWriter(); + writer.print("请在头像目录下放置默认头像default_avatar.jpg"); + writer.close(); + } catch (Exception e) { + log.error("输出无默认图失败", e); + } finally { + writer.close(); + } + } + + @GetMapping("/getUserInfo") + @GlobalInterceptor + public ResponseVO getUserInfo(HttpSession session) { + SessionWebUserDto sessionWebUserDto = getUserInfoFromSession(session); + return getSuccessResponseVO(sessionWebUserDto); + } + + @PostMapping("/getUseSpace") + @GlobalInterceptor + public ResponseVO getUseSpace(HttpSession session) { + SessionWebUserDto sessionWebUserDto = getUserInfoFromSession(session); + return getSuccessResponseVO(redisComponent.getUserSpaceUse(sessionWebUserDto.getUserId())); + } + + @PostMapping("/logout") + public ResponseVO logout(HttpSession session) { + session.invalidate(); + return getSuccessResponseVO(null); + } + + @PostMapping("/updateUserAvatar") + @GlobalInterceptor + public ResponseVO updateUserAvatar(HttpSession session, MultipartFile avatar) { + + SessionWebUserDto webUserDto = getUserInfoFromSession(session); + // 得到头像文件夹 + String baseFolder = appConfig.getProjectFolder() + Constants.FILE_FOLDER_FILE; + File targetFileFolder = new File(baseFolder + Constants.FILE_FOLDER_AVATAR_NAME); + // 如果不存在就创建 + if (!targetFileFolder.exists()) { + targetFileFolder.mkdirs(); + } + // 得到新头像绝对路径 + File targetFile = new File(targetFileFolder.getPath() + "/" + webUserDto.getUserId() + Constants.AVATAR_SUFFIX); + try { + // 输出 + avatar.transferTo(targetFile); + } catch (Exception e) { + log.error("上传头像失败", e); + } + + // 同时将数据库中qq头像设为空 + UserInfo userInfo = new UserInfo(); + userInfo.setQqAvatar(""); + userInfoService.updateUserInfoByUserId(userInfo, webUserDto.getUserId()); + webUserDto.setAvatar(null); + //更新session + session.setAttribute(Constants.SESSION_KEY, webUserDto); + return getSuccessResponseVO(null); + } + + @PostMapping("/updatePassword") + @GlobalInterceptor(checkParams = true) + public ResponseVO updatePassword(HttpSession session, + @VerifyParam(required = true, regex = VerifyRegexEnum.PASSWORD, min = 8, max = 18) String password) { + SessionWebUserDto sessionWebUserDto = getUserInfoFromSession(session); + UserInfo userInfo = new UserInfo(); + userInfo.setPassword(StringTools.encodeByMD5(password)); + userInfoService.updateUserInfoByUserId(userInfo, sessionWebUserDto.getUserId()); + return getSuccessResponseVO(null); + } + +} diff --git a/easypan-java/src/main/java/com/easypan/controller/AdminController.java b/easypan-java/src/main/java/com/easypan/controller/AdminController.java new file mode 100644 index 0000000..7982e90 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/controller/AdminController.java @@ -0,0 +1,154 @@ +package com.easypan.controller; + +import com.easypan.annotation.GlobalInterceptor; +import com.easypan.annotation.VerifyParam; +import com.easypan.entity.dto.SessionWebUserDto; +import com.easypan.utils.RedisComponent; +import com.easypan.controller.commonfilecontroller.CommonFileController; +import com.easypan.entity.dto.SysSettingsDto; +import com.easypan.entity.query.FileInfoQuery; +import com.easypan.entity.query.UserInfoQuery; +import com.easypan.entity.vo.PaginationResultVO; +import com.easypan.entity.vo.ResponseVO; +import com.easypan.entity.vo.UserInfoVO; +import com.easypan.service.FileInfoService; +import com.easypan.service.UserInfoService; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +@RestController +@RequestMapping("/admin") +public class AdminController extends CommonFileController { + + @Resource + private RedisComponent redisComponent; + + @Resource + private UserInfoService userInfoService; + + @Resource + private FileInfoService fileInfoService; + + @RequestMapping("/getSysSettings") + @GlobalInterceptor(checkParams = true, checkAdmin = true) + public ResponseVO getSysSettings() { + return getSuccessResponseVO(redisComponent.getSysSettingsDto()); + } + + + @RequestMapping("/saveSysSettings") + @GlobalInterceptor(checkParams = true, checkAdmin = true) + public ResponseVO saveSysSettings( + @VerifyParam(required = true) String registerEmailTitle, + @VerifyParam(required = true) String registerEmailContent, + @VerifyParam(required = true) Integer userInitUseSpace) { + SysSettingsDto sysSettingsDto = new SysSettingsDto(); + sysSettingsDto.setRegisterEmailTitle(registerEmailTitle); + sysSettingsDto.setRegisterEmailContent(registerEmailContent); + sysSettingsDto.setUserInitUseSpace(userInitUseSpace); + redisComponent.saveSysSettingsDto(sysSettingsDto); + return getSuccessResponseVO(null); + } + + @RequestMapping("/loadUserList") + @GlobalInterceptor(checkParams = true, checkAdmin = true) + public ResponseVO loadUser(UserInfoQuery userInfoQuery) { + userInfoQuery.setOrderBy("join_time desc"); + PaginationResultVO resultVO = userInfoService.findListByPage(userInfoQuery); + return getSuccessResponseVO(convert2PaginationVO(resultVO, UserInfoVO.class)); + } + + + @RequestMapping("/updateUserStatus") + @GlobalInterceptor(checkParams = true, checkAdmin = true) + public ResponseVO updateUserStatus(@VerifyParam(required = true) String userId, + @VerifyParam(required = true) Integer status) { + userInfoService.updateUserStatus(userId, status); + return getSuccessResponseVO(null); + } + + @RequestMapping("/updateUserSpace") + @GlobalInterceptor(checkParams = true, checkAdmin = true) + public ResponseVO updateUserSpace(@VerifyParam(required = true) String userId, @VerifyParam(required = true) Integer changeSpace) { + userInfoService.changeUserSpace(userId, changeSpace); + return getSuccessResponseVO(null); + } + + /** + * 查询所有文件 + * + * @param query + * @return + */ + @RequestMapping("/loadFileList") + @GlobalInterceptor(checkParams = true) + public ResponseVO loadDataList(FileInfoQuery query) { + query.setOrderBy("last_update_time desc"); + query.setQueryNickName(true); + PaginationResultVO resultVO = fileInfoService.findListByPage(query); + return getSuccessResponseVO(resultVO); + } + + @RequestMapping("/getFolderInfo") + @GlobalInterceptor(checkLogin = false, checkParams = true) + public ResponseVO getFolderInfo(@VerifyParam(required = true) String path) { + return super.getFolderInfo(path, null); + } + + + @RequestMapping("/getFile/{userId}/{fileId}") + @GlobalInterceptor(checkParams = true, checkAdmin = true) + public void getFile(HttpServletResponse response, + @PathVariable("userId") @VerifyParam(required = true) String userId, + @PathVariable("fileId") @VerifyParam(required = true) String fileId) { + super.getFile(response, fileId, userId); + } + + + @RequestMapping("/ts/getVideoInfo/{userId}/{fileId}") + @GlobalInterceptor(checkParams = true, checkAdmin = true) + public void getVideoInfo(HttpServletResponse response, + @PathVariable("userId") @VerifyParam(required = true) String userId, + @PathVariable("fileId") @VerifyParam(required = true) String fileId) { + super.getFile(response, fileId, userId); + } + + @RequestMapping("/createDownloadUrl/{userId}/{fileId}") + @GlobalInterceptor(checkParams = true, checkAdmin = true) + public ResponseVO createDownloadUrl(@PathVariable("userId") @VerifyParam(required = true) String userId, + @PathVariable("fileId") @VerifyParam(required = true) String fileId) { + return super.createDownloadUrl(fileId, userId); + } + + /** + * 下载 + * + * @param request + * @param response + * @throws Exception + */ + @RequestMapping("/download/{code}") + @GlobalInterceptor(checkLogin = false, checkParams = true) + public void download(HttpServletRequest request, HttpServletResponse response, + @PathVariable("code") @VerifyParam(required = true) String code) throws Exception { + super.download(request, response, code); + } + + + @RequestMapping("/delFile") + @GlobalInterceptor(checkParams = true, checkAdmin = true) + public ResponseVO delFile(@VerifyParam(required = true) String fileIdAndUserIds) { + String[] fileIdAndUserIdArray = fileIdAndUserIds.split(","); + for (String fileIdAndUserId : fileIdAndUserIdArray) { + String[] itemArray = fileIdAndUserId.split("_"); + fileInfoService.delFileBatch(itemArray[0], itemArray[1], true); + } + return getSuccessResponseVO(null); + } +} diff --git a/easypan-java/src/main/java/com/easypan/controller/FileInfoController.java b/easypan-java/src/main/java/com/easypan/controller/FileInfoController.java new file mode 100644 index 0000000..dff549b --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/controller/FileInfoController.java @@ -0,0 +1,195 @@ +package com.easypan.controller; + + +import com.easypan.annotation.GlobalInterceptor; +import com.easypan.annotation.VerifyParam; +import com.easypan.controller.basecontroller.BaseController; +import com.easypan.controller.commonfilecontroller.CommonFileController; +import com.easypan.entity.constants.Constants; +import com.easypan.entity.dto.SessionWebUserDto; +import com.easypan.entity.dto.UploadResultDto; +import com.easypan.entity.enums.FileCategoryEnums; +import com.easypan.entity.enums.FileDelFlagEnums; +import com.easypan.entity.enums.FileFolderTypeEnums; +import com.easypan.entity.po.FileInfo; +import com.easypan.entity.query.FileInfoQuery; +import com.easypan.entity.vo.FileInfoVO; +import com.easypan.entity.vo.PaginationResultVO; +import com.easypan.entity.vo.ResponseVO; +import com.easypan.service.FileInfoService; +import com.easypan.utils.CopyTools; +import com.easypan.utils.StringTools; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; +import java.util.List; + +/** + * 文件信息 Controller + */ +@RestController +@RequestMapping("/file") +public class FileInfoController extends CommonFileController { + + @Resource + private FileInfoService fileInfoService; + + + @PostMapping("/loadDataList") + @GlobalInterceptor + public ResponseVO loadDataList(HttpSession session, FileInfoQuery query, String category) { + FileCategoryEnums categoryEnum = FileCategoryEnums.getByCode(category); + if (categoryEnum != null) { + query.setFileCategory(categoryEnum.getCategory()); + } + query.setUserId(getUserInfoFromSession(session).getUserId()); + // 排序规则:先展示文件夹,然后按照修改时间排序 + query.setOrderBy(Constants.ORDER_RULE); + query.setDelFlag(FileDelFlagEnums.USING.getFlag()); + // 调用service方法得到分页对象,其中List + PaginationResultVO result = fileInfoService.findListByPage(query); + // 集合元素映射为FileInfoVO再返回 + return getSuccessResponseVO(convert2PaginationVO(result, FileInfoVO.class)); + } + + /** + * @param fileId 非必传,第一个分片文件不传 + * @param file 传的文件 + * @param fileName 文件名 + * @param filePid 在哪一个目录 + * @param fileMd5 前端做的 + * @param chunkIndex 第几个分片 + * @param chunks 总共有多少个分片 + * @return + */ + @PostMapping("/uploadFile") + @GlobalInterceptor(checkParams = true) + public ResponseVO uploadFile(HttpSession session, + String fileId, + MultipartFile file, + @VerifyParam(required = true) String fileName, + @VerifyParam(required = true) String filePid, + @VerifyParam(required = true) String fileMd5, + @VerifyParam(required = true) Integer chunkIndex, + @VerifyParam(required = true) Integer chunks) { + + // 从session中获取SessionWebUserDto对象 + SessionWebUserDto webUserDto = getUserInfoFromSession(session); + + UploadResultDto resultDto = fileInfoService.uploadFile(webUserDto, fileId, file, fileName, + filePid, fileMd5, chunkIndex, chunks); + + return getSuccessResponseVO(resultDto); + } + + // 得到缩略图 + @GetMapping("/getImage/{imageFolder}/{imageName}") + public void getImage(HttpServletResponse response, + @PathVariable("imageFolder") String imageFolder, + @PathVariable("imageName") String imageName) { + super.getImage(response, imageFolder, imageName); + } + + @GetMapping("/ts/getVideoInfo/{fileId}") + public void getVideoInfo(HttpServletResponse response, + HttpSession session, + @PathVariable("fileId") @VerifyParam(required = true) String fileId) { + SessionWebUserDto webUserDto = getUserInfoFromSession(session); + super.getFile(response, fileId, webUserDto.getUserId()); + } + + @RequestMapping("/getFile/{fileId}") + public void getFile(HttpServletResponse response, + HttpSession session, + @PathVariable("fileId") @VerifyParam(required = true) String fileId) { + SessionWebUserDto webUserDto = getUserInfoFromSession(session); + super.getFile(response, fileId, webUserDto.getUserId()); + } + + + @PostMapping("/newFoloder") + @GlobalInterceptor(checkParams = true) + public ResponseVO newFolder(HttpSession session, + @VerifyParam(required = true) String filePid, + @VerifyParam(required = true) String fileName) { + SessionWebUserDto webUserDto = getUserInfoFromSession(session); + FileInfo fileInfo = fileInfoService.newFolder(filePid, webUserDto.getUserId(), fileName); + return getSuccessResponseVO(fileInfo); + } + + /** + * @param path 目录1/目录2/目录3... + */ + @PostMapping("/getFolderInfo") + @GlobalInterceptor(checkParams = true) + public ResponseVO getFolderInfo(HttpSession session, + @VerifyParam(required = true) String path) { + return super.getFolderInfo(path, getUserInfoFromSession(session).getUserId()); + } + + @PostMapping("/rename") + @GlobalInterceptor(checkParams = true) + public ResponseVO rename(HttpSession session, + @VerifyParam(required = true) String fileId, + @VerifyParam(required = true) String fileName) { + SessionWebUserDto webUserDto = getUserInfoFromSession(session); + FileInfo fileInfo = fileInfoService.rename(fileId, webUserDto.getUserId(), fileName); + return getSuccessResponseVO(CopyTools.copy(fileInfo, FileInfoVO.class)); + } + + // 加载除自己外的文件夹 + @PostMapping("/loadAllFolder") + @GlobalInterceptor(checkParams = true) + public ResponseVO loadAllFolder(HttpSession session, + @VerifyParam(required = true) String filePid, + String currentFileIds) { + + List fileInfoList = fileInfoService.loadAllFolder( + getUserInfoFromSession(session).getUserId(), filePid, currentFileIds); + + return getSuccessResponseVO(CopyTools.copyList(fileInfoList, FileInfoVO.class)); + } + + @PostMapping("/changeFileFolder") + @GlobalInterceptor(checkParams = true) + public ResponseVO changeFileFolder(HttpSession session, + @VerifyParam(required = true) String fileIds, + @VerifyParam(required = true) String filePid) { + SessionWebUserDto webUserDto = getUserInfoFromSession(session); + fileInfoService.changeFileFolder(fileIds, filePid, webUserDto.getUserId()); + return getSuccessResponseVO(null); + } + + + @PostMapping("/createDownloadUrl/{fileId}") + @GlobalInterceptor(checkParams = true) + public ResponseVO createDownloadUrl(HttpSession session, + @PathVariable("fileId") @VerifyParam(required = true) String fileId) { + return super.createDownloadUrl(fileId, getUserInfoFromSession(session).getUserId()); + } + + // 无需登陆校验 + @GetMapping("/download/{code}") + @GlobalInterceptor(checkLogin = false, checkParams = true) + public void download(HttpServletRequest request, + HttpServletResponse response, + @PathVariable("code") @VerifyParam(required = true) String code) throws Exception { + super.download(request, response, code); + } + + @PostMapping("/delFile") + @GlobalInterceptor(checkParams = true) + public ResponseVO delFile(HttpSession session, + @VerifyParam(required = true) String fileIds) { + SessionWebUserDto webUserDto = getUserInfoFromSession(session); + fileInfoService.removeFile2RecycleBatch(webUserDto.getUserId(), fileIds); + return getSuccessResponseVO(null); + } + + + +} \ No newline at end of file diff --git a/easypan-java/src/main/java/com/easypan/controller/RecycleController.java b/easypan-java/src/main/java/com/easypan/controller/RecycleController.java new file mode 100644 index 0000000..838d1c8 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/controller/RecycleController.java @@ -0,0 +1,61 @@ +package com.easypan.controller; + +import com.easypan.annotation.GlobalInterceptor; +import com.easypan.annotation.VerifyParam; +import com.easypan.controller.basecontroller.BaseController; +import com.easypan.entity.dto.SessionWebUserDto; +import com.easypan.entity.enums.FileDelFlagEnums; +import com.easypan.entity.query.FileInfoQuery; +import com.easypan.entity.vo.FileInfoVO; +import com.easypan.entity.vo.PaginationResultVO; +import com.easypan.entity.vo.ResponseVO; +import com.easypan.service.FileInfoService; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.servlet.http.HttpSession; + +@RestController +@RequestMapping("/recycle") +public class RecycleController extends BaseController { + + @Resource + private FileInfoService fileInfoService; + + // 加载回收站列表 + @PostMapping("/loadRecycleList") + @GlobalInterceptor(checkParams = true) + public ResponseVO loadRecycleList(HttpSession session, Integer pageNo, Integer pageSize) { + FileInfoQuery query = new FileInfoQuery(); + query.setPageSize(pageSize); + query.setPageNo(pageNo); + query.setUserId(getUserInfoFromSession(session).getUserId()); + query.setOrderBy("recovery_time desc"); + query.setDelFlag(FileDelFlagEnums.RECYCLE.getFlag()); + PaginationResultVO result = fileInfoService.findListByPage(query); + return getSuccessResponseVO(convert2PaginationVO(result, FileInfoVO.class)); + } + + // 回收站文件还原到根目录 + @RequestMapping("/recoverFile") + @GlobalInterceptor(checkParams = true) + public ResponseVO recoverFile(HttpSession session, + @VerifyParam(required = true) String fileIds) { + SessionWebUserDto webUserDto = getUserInfoFromSession(session); + fileInfoService.recoverFileBatch(webUserDto.getUserId(), fileIds); + return getSuccessResponseVO(null); + } + + + @PostMapping("/delFile") + @GlobalInterceptor(checkParams = true) + public ResponseVO delFile(HttpSession session, + @VerifyParam(required = true) String fileIds) { + SessionWebUserDto webUserDto = getUserInfoFromSession(session); + fileInfoService.delFileBatch(webUserDto.getUserId(), fileIds, false); + return getSuccessResponseVO(null); + } + +} diff --git a/easypan-java/src/main/java/com/easypan/controller/ShareController.java b/easypan-java/src/main/java/com/easypan/controller/ShareController.java new file mode 100644 index 0000000..37310bf --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/controller/ShareController.java @@ -0,0 +1,62 @@ +package com.easypan.controller; + +import com.easypan.annotation.GlobalInterceptor; +import com.easypan.annotation.VerifyParam; +import com.easypan.controller.basecontroller.BaseController; +import com.easypan.entity.dto.SessionWebUserDto; +import com.easypan.entity.po.FileShare; +import com.easypan.entity.query.FileShareQuery; +import com.easypan.entity.vo.PaginationResultVO; +import com.easypan.entity.vo.ResponseVO; +import com.easypan.service.FileShareService; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.servlet.http.HttpSession; + +@RestController("shareController") +@RequestMapping("/share") +public class ShareController extends BaseController { + + @Resource + private FileShareService fileShareService; + + + @PostMapping("/loadShareList") + @GlobalInterceptor(checkParams = true) + public ResponseVO loadShareList(HttpSession session, FileShareQuery query) { + query.setOrderBy("share_time desc"); + SessionWebUserDto userDto = getUserInfoFromSession(session); + query.setUserId(userDto.getUserId()); + query.setQueryFileName(true); + PaginationResultVO resultVO = this.fileShareService.findListByPage(query); + return getSuccessResponseVO(resultVO); + } + + @PostMapping("/shareFile") + @GlobalInterceptor(checkParams = true) + public ResponseVO shareFile(HttpSession session, + @VerifyParam(required = true) String fileId, + @VerifyParam(required = true) Integer validType, + String code) { + SessionWebUserDto userDto = getUserInfoFromSession(session); + FileShare share = new FileShare(); + share.setFileId(fileId); + share.setValidType(validType); + share.setCode(code); + share.setUserId(userDto.getUserId()); + fileShareService.saveShare(share); + return getSuccessResponseVO(share); + } + + @PostMapping("/cancelShare") + @GlobalInterceptor(checkParams = true) + public ResponseVO cancelShare(HttpSession session, + @VerifyParam(required = true) String shareIds) { + SessionWebUserDto userDto = getUserInfoFromSession(session); + fileShareService.deleteFileShareBatch(shareIds.split(","), userDto.getUserId()); + return getSuccessResponseVO(null); + } +} diff --git a/easypan-java/src/main/java/com/easypan/controller/WebShareController.java b/easypan-java/src/main/java/com/easypan/controller/WebShareController.java new file mode 100644 index 0000000..842ceb7 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/controller/WebShareController.java @@ -0,0 +1,205 @@ +package com.easypan.controller; + +import com.easypan.annotation.GlobalInterceptor; +import com.easypan.annotation.VerifyParam; +import com.easypan.controller.commonfilecontroller.CommonFileController; +import com.easypan.entity.constants.Constants; +import com.easypan.entity.dto.SessionShareDto; +import com.easypan.entity.dto.SessionWebUserDto; +import com.easypan.entity.enums.FileDelFlagEnums; +import com.easypan.entity.enums.ResponseCodeEnum; +import com.easypan.entity.po.FileInfo; +import com.easypan.entity.po.FileShare; +import com.easypan.entity.po.UserInfo; +import com.easypan.entity.query.FileInfoQuery; +import com.easypan.entity.vo.FileInfoVO; +import com.easypan.entity.vo.PaginationResultVO; +import com.easypan.entity.vo.ResponseVO; +import com.easypan.entity.vo.ShareInfoVO; +import com.easypan.exception.BusinessException; +import com.easypan.service.FileShareService; +import com.easypan.service.UserInfoService; +import com.easypan.utils.CopyTools; +import com.easypan.utils.StringTools; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; +import java.util.Date; + +@RestController +@RequestMapping("/showShare") +public class WebShareController extends CommonFileController { + + @Resource + private FileShareService fileShareService; + + @Resource + private UserInfoService userInfoService; + + // + @PostMapping("/getShareLoginInfo") + @GlobalInterceptor(checkLogin = false, checkParams = true) + public ResponseVO getShareLoginInfo(HttpSession session, + @VerifyParam(required = true) String shareId) { + SessionShareDto shareSessionDto = getSessionShareFromSession(session, shareId); + if (shareSessionDto == null) { + return getSuccessResponseVO(null); + } + ShareInfoVO shareInfoVO = getShareInfoCommon(shareId); + //判断是否是当前用户分享的文件 + SessionWebUserDto userDto = getUserInfoFromSession(session); + + shareInfoVO.setCurrentUser(userDto != null && + userDto.getUserId().equals(shareSessionDto.getShareUserId())); + + return getSuccessResponseVO(shareInfoVO); + } + + /** + * 获取分享信息 + */ + @PostMapping("/getShareInfo") + @GlobalInterceptor(checkLogin = false, checkParams = true) + public ResponseVO getShareInfo(@VerifyParam(required = true) String shareId) { + return getSuccessResponseVO(getShareInfoCommon(shareId)); + } + + private ShareInfoVO getShareInfoCommon(String shareId) { + // 根据shareId获得FileShare + FileShare share = fileShareService.getFileShareByShareId(shareId); + // 如果FileShare为空或者已经过期 + if (share == null || (share.getExpireTime() != null && new Date().after(share.getExpireTime()))) { + throw new BusinessException(ResponseCodeEnum.CODE_902.getMsg()); + } + // FileShare映射为ShareInfoVO + ShareInfoVO shareInfoVO = CopyTools.copy(share, ShareInfoVO.class); + FileInfo fileInfo = fileInfoService.getFileInfoByFileIdAndUserId(share.getFileId(), share.getUserId()); + if (fileInfo == null || !FileDelFlagEnums.USING.getFlag().equals(fileInfo.getDelFlag())) { + throw new BusinessException(ResponseCodeEnum.CODE_902.getMsg()); + } + shareInfoVO.setFileName(fileInfo.getFileName()); + UserInfo userInfo = userInfoService.getUserInfoByUserId(share.getUserId()); + shareInfoVO.setNickName(userInfo.getNickName()); + shareInfoVO.setAvatar(userInfo.getQqAvatar()); + shareInfoVO.setUserId(userInfo.getUserId()); + return shareInfoVO; + } + + /** + * 校验分享码 + */ + @RequestMapping("/checkShareCode") + @GlobalInterceptor(checkLogin = false, checkParams = true) + public ResponseVO checkShareCode(HttpSession session, + @VerifyParam(required = true) String shareId, + @VerifyParam(required = true) String code) { + SessionShareDto shareSessionDto = fileShareService.checkShareCode(shareId, code); + session.setAttribute(Constants.SESSION_SHARE_KEY + shareId, shareSessionDto); + return getSuccessResponseVO(null); + } + + // 只能分享一个文件或者文件夹(可包含多个子文件夹和子文件) + @RequestMapping("/loadFileList") + @GlobalInterceptor(checkLogin = false, checkParams = true) + public ResponseVO loadFileList(HttpSession session, + @VerifyParam(required = true) String shareId, String filePid) { + // 查询出对应链接下的SessionShareDto + SessionShareDto shareSessionDto = checkShare(session, shareId); + FileInfoQuery query = new FileInfoQuery(); + + // 如果父目录不是根目录 + if (!StringTools.isEmpty(filePid) && !Constants.ZERO_STR.equals(filePid)) { +// fileInfoService.checkRootFilePid(shareSessionDto.getFileId(), shareSessionDto.getShareUserId(), filePid); + query.setFilePid(filePid); + } else { + // 如果是根目录 + query.setFileId(shareSessionDto.getFileId()); + } + query.setUserId(shareSessionDto.getShareUserId()); + query.setOrderBy("last_update_time desc"); + query.setDelFlag(FileDelFlagEnums.USING.getFlag()); + PaginationResultVO resultVO = fileInfoService.findListByPage(query); + return getSuccessResponseVO(convert2PaginationVO(resultVO, FileInfoVO.class)); + } + + + // 判断分享是否失效 + private SessionShareDto checkShare(HttpSession session, String shareId) { + SessionShareDto shareSessionDto = getSessionShareFromSession(session, shareId); + if (shareSessionDto == null) { + throw new BusinessException(ResponseCodeEnum.CODE_903); + } + if (shareSessionDto.getExpireTime() != null && new Date().after(shareSessionDto.getExpireTime())) { + throw new BusinessException(ResponseCodeEnum.CODE_902); + } + return shareSessionDto; + } + + @PostMapping("/getFolderInfo") + @GlobalInterceptor(checkLogin = false, checkParams = true) + public ResponseVO getFolderInfo(HttpSession session, + @VerifyParam(required = true) String shareId, + @VerifyParam(required = true) String path) { + SessionShareDto shareSessionDto = checkShare(session, shareId); + return super.getFolderInfo(path, shareSessionDto.getShareUserId()); + } + + @RequestMapping("/getFile/{shareId}/{fileId}") + public void getFile(HttpServletResponse response, HttpSession session, + @PathVariable("shareId") @VerifyParam(required = true) String shareId, + @PathVariable("fileId") @VerifyParam(required = true) String fileId) { + SessionShareDto shareSessionDto = checkShare(session, shareId); + super.getFile(response, fileId, shareSessionDto.getShareUserId()); + } + + @RequestMapping("/ts/getVideoInfo/{shareId}/{fileId}") + public void getVideoInfo(HttpServletResponse response, + HttpSession session, + @PathVariable("shareId") @VerifyParam(required = true) String shareId, + @PathVariable("fileId") @VerifyParam(required = true) String fileId) { + SessionShareDto shareSessionDto = checkShare(session, shareId); + super.getFile(response, fileId, shareSessionDto.getShareUserId()); + } + + @RequestMapping("/createDownloadUrl/{shareId}/{fileId}") + @GlobalInterceptor(checkLogin = false, checkParams = true) + public ResponseVO createDownloadUrl(HttpSession session, + @PathVariable("shareId") @VerifyParam(required = true) String shareId, + @PathVariable("fileId") @VerifyParam(required = true) String fileId) { + SessionShareDto shareSessionDto = checkShare(session, shareId); + return super.createDownloadUrl(fileId, shareSessionDto.getShareUserId()); + } + + @RequestMapping("/download/{code}") + @GlobalInterceptor(checkLogin = false, checkParams = true) + public void download(HttpServletRequest request, HttpServletResponse response, + @PathVariable("code") @VerifyParam(required = true) String code) throws Exception { + super.download(request, response, code); + } + + @RequestMapping("/saveShare") + @GlobalInterceptor(checkParams = true) + public ResponseVO saveShare(HttpSession session, + @VerifyParam(required = true) String shareId, + @VerifyParam(required = true) String shareFileIds, + @VerifyParam(required = true) String myFolderId) { + // 校验分享链接 + SessionShareDto shareSessionDto = checkShare(session, shareId); + // 校验登陆用户和分享用户 + SessionWebUserDto webUserDto = getUserInfoFromSession(session); + if (shareSessionDto.getShareUserId().equals(webUserDto.getUserId())) { + throw new BusinessException("自己分享的文件无法保存到自己的网盘"); + } + + fileInfoService.saveShare(shareSessionDto.getFileId(), shareFileIds, myFolderId, + shareSessionDto.getShareUserId(), webUserDto.getUserId()); + return getSuccessResponseVO(null); + } + +} diff --git a/easypan-java/src/main/java/com/easypan/controller/basecontroller/BaseController.java b/easypan-java/src/main/java/com/easypan/controller/basecontroller/BaseController.java new file mode 100644 index 0000000..5168803 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/controller/basecontroller/BaseController.java @@ -0,0 +1,100 @@ +package com.easypan.controller.basecontroller; + +import com.easypan.entity.constants.Constants; +import com.easypan.entity.dto.SessionShareDto; +import com.easypan.entity.dto.SessionWebUserDto; +import com.easypan.entity.enums.ResponseCodeEnum; +import com.easypan.entity.vo.PaginationResultVO; +import com.easypan.entity.vo.ResponseVO; +import com.easypan.utils.CopyTools; +import com.easypan.utils.StringTools; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; +import org.springframework.http.HttpStatus; + +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; +import java.io.*; + +public class BaseController { + + private static final Logger logger = LoggerFactory.getLogger(BaseController.class); + + protected static final String STATUC_SUCCESS = "success"; + + protected static final String STATUC_ERROR = "error"; + + protected ResponseVO getSuccessResponseVO(T t) { + ResponseVO responseVO = new ResponseVO<>(); + responseVO.setStatus(STATUC_SUCCESS); + responseVO.setCode(ResponseCodeEnum.CODE_200.getCode()); + responseVO.setInfo(ResponseCodeEnum.CODE_200.getMsg()); + responseVO.setData(t); + return responseVO; + } + + // 从session中获得SessionWebUserDto对象 + protected SessionWebUserDto getUserInfoFromSession(HttpSession session) { + SessionWebUserDto sessionWebUserDto = (SessionWebUserDto) session.getAttribute(Constants.SESSION_KEY); + return sessionWebUserDto; + } + + protected SessionShareDto getSessionShareFromSession(HttpSession session, String shareId) { + SessionShareDto sessionShareDto = (SessionShareDto) + session.getAttribute(Constants.SESSION_SHARE_KEY + shareId); + return sessionShareDto; + } + + + // 输出文件 + protected void readFile(HttpServletResponse response, String filePath) { + if (!StringTools.pathIsOk(filePath)) { + return; + } + OutputStream out = null; + FileInputStream in = null; + try { + File file = new File(filePath); + if (!file.exists()) { + return; + } + in = new FileInputStream(file); + byte[] byteData = new byte[1024]; + out = response.getOutputStream(); + int len = 0; + while ((len = in.read(byteData)) != -1) { + out.write(byteData, 0, len); + } + out.flush(); + } catch (Exception e) { + logger.error("读取文件异常", e); + } finally { + if (out != null) { + try { + out.close(); + } catch (IOException e) { + logger.error("IO异常", e); + } + } + if (in != null) { + try { + in.close(); + } catch (IOException e) { + logger.error("IO异常", e); + } + } + } + } + + + protected PaginationResultVO convert2PaginationVO(PaginationResultVO result, Class clazz) { + PaginationResultVO resultVO = new PaginationResultVO<>(); + resultVO.setList(CopyTools.copyList(result.getList(), clazz)); + resultVO.setPageNo(result.getPageNo()); + resultVO.setPageSize(result.getPageSize()); + resultVO.setPageTotal(result.getPageTotal()); + resultVO.setTotalCount(result.getTotalCount()); + return resultVO; + } +} diff --git a/easypan-java/src/main/java/com/easypan/controller/commonfilecontroller/CommonFileController.java b/easypan-java/src/main/java/com/easypan/controller/commonfilecontroller/CommonFileController.java new file mode 100644 index 0000000..2b63c06 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/controller/commonfilecontroller/CommonFileController.java @@ -0,0 +1,157 @@ +package com.easypan.controller.commonfilecontroller; + +import com.easypan.utils.RedisComponent; +import com.easypan.controller.basecontroller.BaseController; +import com.easypan.config.AppConfig; +import com.easypan.entity.constants.Constants; + +import com.easypan.entity.dto.DownloadFileDto; +import com.easypan.entity.enums.FileCategoryEnums; +import com.easypan.entity.enums.FileFolderTypeEnums; +import com.easypan.entity.enums.ResponseCodeEnum; +import com.easypan.entity.po.FileInfo; +import com.easypan.entity.query.FileInfoQuery; +import com.easypan.entity.vo.FolderVO; +import com.easypan.entity.vo.ResponseVO; +import com.easypan.exception.BusinessException; +import com.easypan.service.FileInfoService; +import com.easypan.utils.CopyTools; +import com.easypan.utils.StringTools; +import org.apache.commons.lang3.StringUtils; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.net.URLEncoder; +import java.util.List; + + +public class CommonFileController extends BaseController { + + @Resource + protected FileInfoService fileInfoService; + + @Resource + protected AppConfig appConfig; + + @Resource + private RedisComponent redisComponent; + + + // 获取缩略图 + public void getImage(HttpServletResponse response, String imageFolder, String imageName) { + if (StringTools.isEmpty(imageFolder) || StringUtils.isBlank(imageName)) { + return; + } + String imageSuffix = StringTools.getFileSuffix(imageName); + String filePath = appConfig.getProjectFolder() + Constants.FILE_FOLDER_FILE + + "/" + imageFolder + "/" + imageName; + imageSuffix = imageSuffix.replace(".", ""); + String contentType = "image/" + imageSuffix; + response.setContentType(contentType); + response.setHeader("Cache-Control", "max-age=2592000"); + readFile(response, filePath); + } + + + // 处理第一次获取.m3u8索引文件和后续获取.ts分片文件 + // 同时也处理其他文件 + protected void getFile(HttpServletResponse response, String fileId, String userId) { + String filePath = null; + if (fileId.endsWith(".ts")) { + // 如果是后去ts分片文件 + String[] tsAarray = fileId.split("_"); + String realFileId = tsAarray[0]; + FileInfo fileInfo = fileInfoService.getFileInfoByFileIdAndUserId(realFileId, userId); + if (fileInfo == null) { + return; + } + String fileName = fileInfo.getFilePath(); + fileName = StringTools.getFileNameNoSuffix(fileName) + "/" + fileId; + filePath = appConfig.getProjectFolder() + Constants.FILE_FOLDER_FILE + "/" + fileName; + } else { + // 第一次获取.m3u8索引文件 + FileInfo fileInfo = fileInfoService.getFileInfoByFileIdAndUserId(fileId, userId); + if (fileInfo == null) { + return; + } + //视频文件读取.m3u8文件 + if (FileCategoryEnums.VIDEO.getCategory().equals(fileInfo.getFileCategory())) { + //重新设置文件路径 + String fileNameNoSuffix = StringTools.getFileNameNoSuffix(fileInfo.getFilePath()); + filePath = appConfig.getProjectFolder() + Constants.FILE_FOLDER_FILE + + "/" + fileNameNoSuffix + "/" + Constants.M3U8_NAME; + } else { + // 处理其他文件 + filePath = appConfig.getProjectFolder() + Constants.FILE_FOLDER_FILE + + "/" + fileInfo.getFilePath(); + } + } + File file = new File(filePath); + if (!file.exists()) { + return; + } + readFile(response, filePath); + } + + + // 根据前端传来的path:{fileId1/fileId2/fileId3/...}进行查询排序 + protected ResponseVO getFolderInfo(String path, String userId) { + String[] pathArray = path.split("/"); + FileInfoQuery infoQuery = new FileInfoQuery(); + infoQuery.setUserId(userId); + infoQuery.setFolderType(FileFolderTypeEnums.FOLDER.getType()); + infoQuery.setFileIdArray(pathArray); + /** + * eg: + * StringUtils.join(["a", "b", "c"], "--") = "a--b--c" + */ + // order by field("fileId1", "fileId2" ....) + String orderBy = "field(file_id,\"" + StringUtils.join(pathArray, "\",\"") + "\")"; + infoQuery.setOrderBy(orderBy); + List fileInfoList = fileInfoService.findListByParam(infoQuery); + return getSuccessResponseVO(CopyTools.copyList(fileInfoList, FolderVO.class)); + } + + + protected ResponseVO createDownloadUrl(String fileId, String userId) { + FileInfo fileInfo = fileInfoService.getFileInfoByFileIdAndUserId(fileId, userId); + if (fileInfo == null) { + throw new BusinessException(ResponseCodeEnum.CODE_600); + } + // 不能下载文件夹 + if (FileFolderTypeEnums.FOLDER.getType().equals(fileInfo.getFolderType())) { + throw new BusinessException(ResponseCodeEnum.CODE_600); + } + // fileId正常,得到50位随机code + String code = StringTools.getRandomString(Constants.LENGTH_50); + DownloadFileDto downloadFileDto = new DownloadFileDto(); + downloadFileDto.setDownloadCode(code); + downloadFileDto.setFilePath(fileInfo.getFilePath()); + downloadFileDto.setFileName(fileInfo.getFileName()); + + redisComponent.saveDownloadCode(code, downloadFileDto); + + return getSuccessResponseVO(code); + } + + protected void download(HttpServletRequest request, HttpServletResponse response, String code) throws Exception { + DownloadFileDto downloadFileDto = redisComponent.getDownloadCode(code); + if (downloadFileDto == null) { + return; + } + String filePath = appConfig.getProjectFolder() + Constants.FILE_FOLDER_FILE + + "/" + downloadFileDto.getFilePath(); + String fileName = downloadFileDto.getFileName(); + response.setContentType("application/x-msdownload; charset=UTF-8"); + if (request.getHeader("User-Agent").toLowerCase().indexOf("msie") > 0) {//IE浏览器 + fileName = URLEncoder.encode(fileName, "UTF-8"); + } else { + fileName = new String(fileName.getBytes("UTF-8"), "ISO8859-1"); + } + response.setHeader("Content-Disposition", "attachment;filename=\"" + fileName + "\""); + readFile(response, filePath); + } + +} \ No newline at end of file diff --git a/easypan-java/src/main/java/com/easypan/entity/constants/Constants.java b/easypan-java/src/main/java/com/easypan/entity/constants/Constants.java new file mode 100644 index 0000000..f794a70 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/constants/Constants.java @@ -0,0 +1,83 @@ +package com.easypan.entity.constants; + +public class Constants { + + public static final String SESSION_SHARE_KEY = "session_share_key_"; + + public static final String CHECK_CODE_KEY = "check_code_key"; + + public static final String CHECK_CODE_KEY_EMAIL = "check_code_key_email"; + + public static final int REGISTER_ZERO = 0; + + + public static final Integer LENGTH_5 = 5; + + // redis中邮箱消息的键 + public static final String REDIS_KEY_SYS_SETTING = "easypan:syssetting"; + + // 邮箱验证码过期时间 + public static final Integer LENGTH_15 = 15; + + // id长度 + public static final Integer LENGTH_10 = 10; + + // 1MB大小 + public static final Long MB = 1024 * 1024L; + + /** + * redis key 相关 + */ + + /** + * 过期时间 1分钟 + */ + public static final Integer REDIS_KEY_EXPIRES_ONE_MIN = 60; + + /** + * 过期时间 1天 + */ + public static final Integer REDIS_KEY_EXPIRES_DAY = REDIS_KEY_EXPIRES_ONE_MIN * 60 * 24; + + + /** + * 过期时间 1 小时 + */ + public static final Integer REDIS_KEY_EXPIRES_ONE_HOUR = REDIS_KEY_EXPIRES_ONE_MIN * 60; + + /** + * 过期时间5分钟 + */ + public static final Integer REDIS_KEY_EXPIRES_FIVE_MIN = REDIS_KEY_EXPIRES_ONE_MIN * 5; + + + public static final String REDIS_KEY_DOWNLOAD = "easypan:download:"; + + + public static final String REDIS_KEY_USER_SPACE_USE = "easypan:user:spaceuse:"; + + public static final String REDIS_KEY_USER_FILE_TEMP_SIZE = "easypan:user:file:temp"; + + public static final String SESSION_KEY = "session_key"; + + // 头像 + public static final String AVATAR_SUFFIX = ".jpg"; + + public static final String FILE_FOLDER_AVATAR_NAME = "/avatar"; + + public static final String AVATAR_DEFUALT = "default_avatar.jpg"; + + public static final String FILE_FOLDER_FILE = "/file"; + public static final String FILE_FOLDER_TEMP = "/temp"; + + public static final String ORDER_RULE = "folder_type desc, last_update_time desc"; + + public static final String IMAGE_PNG_SUFFIX = ".png"; + public static final Integer LENGTH_150 = 150; + public static final String TS_NAME = "index.ts"; + + public static final String M3U8_NAME = "index.m3u8"; + public static final String ZERO_STR = "0"; + public static final Integer LENGTH_50 = 50; + public static final Integer LENGTH_20 = 20; +} diff --git a/easypan-java/src/main/java/com/easypan/entity/dto/CreateImageCode.java b/easypan-java/src/main/java/com/easypan/entity/dto/CreateImageCode.java new file mode 100644 index 0000000..1d74b43 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/dto/CreateImageCode.java @@ -0,0 +1,194 @@ +package com.easypan.entity.dto; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.io.OutputStream; +import java.util.Random; + +public class CreateImageCode { + // 图片的宽度。 + private int width = 160; + // 图片的高度。 + private int height = 40; + // 验证码字符个数 + private int codeCount = 4; + // 验证码干扰线数 + private int lineCount = 20; + // 验证码 + private String code = null; + // 验证码图片Buffer + private BufferedImage buffImg = null; + Random random = new Random(); + + public CreateImageCode() { + creatImage(); + } + + public CreateImageCode(int width, int height) { + this.width = width; + this.height = height; + creatImage(); + } + + public CreateImageCode(int width, int height, int codeCount) { + this.width = width; + this.height = height; + this.codeCount = codeCount; + creatImage(); + } + + public CreateImageCode(int width, int height, int codeCount, int lineCount) { + this.width = width; + this.height = height; + this.codeCount = codeCount; + this.lineCount = lineCount; + creatImage(); + } + + // 生成图片 + private void creatImage() { + int fontWidth = width / codeCount;// 字体的宽度 + int fontHeight = height - 5;// 字体的高度 + int codeY = height - 8; + + // 图像buffer + buffImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); + Graphics g = buffImg.getGraphics(); + //Graphics2D g = buffImg.createGraphics(); + // 设置背景色 + g.setColor(getRandColor(200, 250)); + g.fillRect(0, 0, width, height); + // 设置字体 + //Font font1 = getFont(fontHeight); + Font font = new Font("Fixedsys", Font.BOLD, fontHeight); + g.setFont(font); + + // 设置干扰线 + for (int i = 0; i < lineCount; i++) { + int xs = random.nextInt(width); + int ys = random.nextInt(height); + int xe = xs + random.nextInt(width); + int ye = ys + random.nextInt(height); + g.setColor(getRandColor(1, 255)); + g.drawLine(xs, ys, xe, ye); + } + + // 添加噪点 + float yawpRate = 0.01f;// 噪声率 + int area = (int) (yawpRate * width * height); + for (int i = 0; i < area; i++) { + int x = random.nextInt(width); + int y = random.nextInt(height); + buffImg.setRGB(x, y, random.nextInt(255)); + } + + String str1 = randomStr(codeCount);// 得到随机字符 + this.code = str1; + for (int i = 0; i < codeCount; i++) { + String strRand = str1.substring(i, i + 1); + g.setColor(getRandColor(1, 255)); + // g.drawString(a,x,y); + // a为要画出来的东西,x和y表示要画的东西最左侧字符的基线位于此图形上下文坐标系的 (x, y) 位置处 + + g.drawString(strRand, i * fontWidth + 3, codeY); + } + } + + // 得到随机字符 + private String randomStr(int n) { + String str1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890"; + String str2 = ""; + int len = str1.length() - 1; + double r; + for (int i = 0; i < n; i++) { + r = (Math.random()) * len; + str2 = str2 + str1.charAt((int) r); + } + return str2; + } + + // 得到随机颜色 + private Color getRandColor(int fc, int bc) {// 给定范围获得随机颜色 + if (fc > 255) fc = 255; + if (bc > 255) bc = 255; + int r = fc + random.nextInt(bc - fc); + int g = fc + random.nextInt(bc - fc); + int b = fc + random.nextInt(bc - fc); + return new Color(r, g, b); + } + + /** + * 产生随机字体 + */ + private Font getFont(int size) { + Random random = new Random(); + Font font[] = new Font[5]; + font[0] = new Font("Ravie", Font.PLAIN, size); + font[1] = new Font("Antique Olive Compact", Font.PLAIN, size); + font[2] = new Font("Fixedsys", Font.PLAIN, size); + font[3] = new Font("Wide Latin", Font.PLAIN, size); + font[4] = new Font("Gill Sans Ultra Bold", Font.PLAIN, size); + return font[random.nextInt(5)]; + } + + // 扭曲方法 + private void shear(Graphics g, int w1, int h1, Color color) { + shearX(g, w1, h1, color); + shearY(g, w1, h1, color); + } + + private void shearX(Graphics g, int w1, int h1, Color color) { + + int period = random.nextInt(2); + + boolean borderGap = true; + int frames = 1; + int phase = random.nextInt(2); + + for (int i = 0; i < h1; i++) { + double d = (double) (period >> 1) * Math.sin((double) i / (double) period + (6.2831853071795862D * (double) phase) / (double) frames); + g.copyArea(0, i, w1, 1, (int) d, 0); + if (borderGap) { + g.setColor(color); + g.drawLine((int) d, i, 0, i); + g.drawLine((int) d + w1, i, w1, i); + } + } + + } + + private void shearY(Graphics g, int w1, int h1, Color color) { + + int period = random.nextInt(40) + 10; // 50; + + boolean borderGap = true; + int frames = 20; + int phase = 7; + for (int i = 0; i < w1; i++) { + double d = (double) (period >> 1) * Math.sin((double) i / (double) period + (6.2831853071795862D * (double) phase) / (double) frames); + g.copyArea(i, 0, 1, h1, 0, (int) d); + if (borderGap) { + g.setColor(color); + g.drawLine(i, (int) d, i, 0); + g.drawLine(i, (int) d + h1, i, h1); + } + + } + + } + + public void write(OutputStream sos) throws IOException { + ImageIO.write(buffImg, "png", sos); + sos.close(); + } + + public BufferedImage getBuffImg() { + return buffImg; + } + + public String getCode() { + return code.toLowerCase(); + } +} \ No newline at end of file diff --git a/easypan-java/src/main/java/com/easypan/entity/dto/DownloadFileDto.java b/easypan-java/src/main/java/com/easypan/entity/dto/DownloadFileDto.java new file mode 100644 index 0000000..5470641 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/dto/DownloadFileDto.java @@ -0,0 +1,10 @@ +package com.easypan.entity.dto; + +import lombok.Data; + +@Data +public class DownloadFileDto { + private String downloadCode; + private String fileName; + private String filePath; +} diff --git a/easypan-java/src/main/java/com/easypan/entity/dto/SessionShareDto.java b/easypan-java/src/main/java/com/easypan/entity/dto/SessionShareDto.java new file mode 100644 index 0000000..f995435 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/dto/SessionShareDto.java @@ -0,0 +1,13 @@ +package com.easypan.entity.dto; + +import lombok.Data; + +import java.util.Date; + +@Data +public class SessionShareDto { + private String shareId; + private String shareUserId; + private Date expireTime; + private String fileId; +} diff --git a/easypan-java/src/main/java/com/easypan/entity/dto/SessionWebUserDto.java b/easypan-java/src/main/java/com/easypan/entity/dto/SessionWebUserDto.java new file mode 100644 index 0000000..64177cf --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/dto/SessionWebUserDto.java @@ -0,0 +1,13 @@ +package com.easypan.entity.dto; + +import lombok.Data; + +@Data +public class SessionWebUserDto { + private String nickName; + private String userId; + private Boolean isAdmin; + private Long useSpace; + private Long totalSpace; + private String avatar; +} diff --git a/easypan-java/src/main/java/com/easypan/entity/dto/SysSettingsDto.java b/easypan-java/src/main/java/com/easypan/entity/dto/SysSettingsDto.java new file mode 100644 index 0000000..31e4daf --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/dto/SysSettingsDto.java @@ -0,0 +1,30 @@ +package com.easypan.entity.dto; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.io.Serializable; + + + + +@JsonIgnoreProperties(ignoreUnknown = true) +@Data +public class SysSettingsDto implements Serializable { + + /** + * 注册发送邮件标题 + */ + private String registerEmailTitle = "邮箱验证码"; + + /** + * 注册发送邮件内容 + */ + private String registerEmailContent = "你好,您的邮箱验证码是:%s,15分钟有效"; + + /** + * 用户初始化空间大小 5M + */ + private Integer userInitUseSpace = 5; + +} diff --git a/easypan-java/src/main/java/com/easypan/entity/dto/UploadResultDto.java b/easypan-java/src/main/java/com/easypan/entity/dto/UploadResultDto.java new file mode 100644 index 0000000..d18df79 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/dto/UploadResultDto.java @@ -0,0 +1,13 @@ +package com.easypan.entity.dto; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.io.Serializable; + +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class UploadResultDto implements Serializable { + private String fileId; + private String status; +} diff --git a/easypan-java/src/main/java/com/easypan/entity/dto/UserSpaceDto.java b/easypan-java/src/main/java/com/easypan/entity/dto/UserSpaceDto.java new file mode 100644 index 0000000..b5290a7 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/dto/UserSpaceDto.java @@ -0,0 +1,14 @@ +package com.easypan.entity.dto; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class UserSpaceDto implements Serializable { + + private Long useSpace; + + private Long totalSpace; + +} diff --git a/easypan-java/src/main/java/com/easypan/entity/enums/DateTimePatternEnum.java b/easypan-java/src/main/java/com/easypan/entity/enums/DateTimePatternEnum.java new file mode 100644 index 0000000..3a43751 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/enums/DateTimePatternEnum.java @@ -0,0 +1,16 @@ +package com.easypan.entity.enums; + + +public enum DateTimePatternEnum { + YYYY_MM_DD_HH_MM_SS("yyyy-MM-dd HH:mm:ss"), YYYY_MM_DD("yyyy-MM-dd"), YYYYMM("yyyyMM"); + + private String pattern; + + DateTimePatternEnum(String pattern) { + this.pattern = pattern; + } + + public String getPattern() { + return pattern; + } +} diff --git a/easypan-java/src/main/java/com/easypan/entity/enums/FileCategoryEnums.java b/easypan-java/src/main/java/com/easypan/entity/enums/FileCategoryEnums.java new file mode 100644 index 0000000..f1d82e6 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/enums/FileCategoryEnums.java @@ -0,0 +1,37 @@ +package com.easypan.entity.enums; + + +public enum FileCategoryEnums { + VIDEO(1, "video", "视频"), + MUSIC(2, "music", "音频"), + IMAGE(3, "image", "图片"), + DOC(4, "doc", "文档"), + OTHERS(5, "others", "其他"); + + private Integer category; + private String code; + private String desc; + + FileCategoryEnums(Integer category, String code, String desc) { + this.category = category; + this.code = code; + this.desc = desc; + } + + public static FileCategoryEnums getByCode(String code) { + for (FileCategoryEnums item : FileCategoryEnums.values()) { + if (item.getCode().equals(code)) { + return item; + } + } + return null; + } + + public Integer getCategory() { + return category; + } + + public String getCode() { + return code; + } +} diff --git a/easypan-java/src/main/java/com/easypan/entity/enums/FileDelFlagEnums.java b/easypan-java/src/main/java/com/easypan/entity/enums/FileDelFlagEnums.java new file mode 100644 index 0000000..de96c60 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/enums/FileDelFlagEnums.java @@ -0,0 +1,24 @@ +package com.easypan.entity.enums; + + +public enum FileDelFlagEnums { + DEL(0, "删除"), + RECYCLE (1, "回收站"), + USING(2, "使用中");; + + private Integer flag; + private String desc; + + FileDelFlagEnums(Integer flag, String desc) { + this.flag = flag; + this.desc = desc; + } + + public Integer getFlag() { + return flag; + } + + public String getDesc() { + return desc; + } +} diff --git a/easypan-java/src/main/java/com/easypan/entity/enums/FileFolderTypeEnums.java b/easypan-java/src/main/java/com/easypan/entity/enums/FileFolderTypeEnums.java new file mode 100644 index 0000000..ac20eca --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/enums/FileFolderTypeEnums.java @@ -0,0 +1,23 @@ +package com.easypan.entity.enums; + + +public enum FileFolderTypeEnums { + FILE(0, "文件"), + FOLDER(1, "目录"); + + private Integer type; + private String desc; + + FileFolderTypeEnums(Integer type, String desc) { + this.type = type; + this.desc = desc; + } + + public Integer getType() { + return type; + } + + public String getDesc() { + return desc; + } +} diff --git a/easypan-java/src/main/java/com/easypan/entity/enums/FileStatusEnums.java b/easypan-java/src/main/java/com/easypan/entity/enums/FileStatusEnums.java new file mode 100644 index 0000000..1e22742 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/enums/FileStatusEnums.java @@ -0,0 +1,24 @@ +package com.easypan.entity.enums; + + +public enum FileStatusEnums { + TRANSFER(0, "转码中"), + TRANSFER_FAIL(1, "转码失败"), + USING(2, "使用中"); + + private Integer status; + private String desc; + + FileStatusEnums(Integer status, String desc) { + this.status = status; + this.desc = desc; + } + + public Integer getStatus() { + return status; + } + + public String getDesc() { + return desc; + } +} diff --git a/easypan-java/src/main/java/com/easypan/entity/enums/FileTypeEnums.java b/easypan-java/src/main/java/com/easypan/entity/enums/FileTypeEnums.java new file mode 100644 index 0000000..b333a2a --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/enums/FileTypeEnums.java @@ -0,0 +1,66 @@ +package com.easypan.entity.enums; + + +import org.apache.commons.lang3.ArrayUtils; + +public enum FileTypeEnums { + //1:视频 2:音频 3:图片 4:pdf 5:word 6:excel 7:txt 8:code 9:zip 10:其他文件 + VIDEO(FileCategoryEnums.VIDEO, 1, new String[]{".mp4", ".avi", ".rmvb", ".mkv", ".mov"}, "视频"), + MUSIC(FileCategoryEnums.MUSIC, 2, new String[]{".mp3", ".wav", ".wma", ".mp2", ".flac", ".midi", ".ra", ".ape", ".aac", ".cda"}, "音频"), + IMAGE(FileCategoryEnums.IMAGE, 3, new String[]{".jpeg", ".jpg", ".png", ".gif", ".bmp", ".dds", ".psd", ".pdt", ".webp", ".xmp", ".svg", ".tiff"}, "图片"), + PDF(FileCategoryEnums.DOC, 4, new String[]{".pdf", ".pptx"}, "pdf"), + WORD(FileCategoryEnums.DOC, 5, new String[]{".docx"}, "word"), + EXCEL(FileCategoryEnums.DOC, 6, new String[]{".xlsx"}, "excel"), + TXT(FileCategoryEnums.DOC, 7, new String[]{".txt"}, "txt文本"), + PROGRAME(FileCategoryEnums.OTHERS, 8, new String[]{".h", ".c", ".hpp", ".hxx", ".cpp", ".cc", ".c++", ".cxx", ".m", ".o", ".s", ".dll", ".cs", + ".java", ".class", ".js", ".ts", ".css", ".scss", ".vue", ".jsx", ".sql", ".md", ".json", ".html", ".xml"}, "CODE"), + ZIP(FileCategoryEnums.OTHERS, 9, new String[]{"rar", ".zip", ".7z", ".cab", ".arj", ".lzh", ".tar", ".gz", ".ace", ".uue", ".bz", ".jar", ".iso", + ".mpq"}, "压缩包"), + OTHERS(FileCategoryEnums.OTHERS, 10, new String[]{}, "其他"); + + private FileCategoryEnums category; + private Integer type; + private String[] suffixs; + private String desc; + + FileTypeEnums(FileCategoryEnums category, Integer type, String[] suffixs, String desc) { + this.category = category; + this.type = type; + this.suffixs = suffixs; + this.desc = desc; + } + + public static FileTypeEnums getFileTypeBySuffix(String suffix) { + for (FileTypeEnums item : FileTypeEnums.values()) { + if (ArrayUtils.contains(item.getSuffixs(), suffix)) { + return item; + } + } + return FileTypeEnums.OTHERS; + } + + public static FileTypeEnums getByType(Integer type) { + for (FileTypeEnums item : FileTypeEnums.values()) { + if (item.getType().equals(type)) { + return item; + } + } + return null; + } + + public String[] getSuffixs() { + return suffixs; + } + + public FileCategoryEnums getCategory() { + return category; + } + + public Integer getType() { + return type; + } + + public String getDesc() { + return desc; + } +} diff --git a/easypan-java/src/main/java/com/easypan/entity/enums/PageSize.java b/easypan-java/src/main/java/com/easypan/entity/enums/PageSize.java new file mode 100644 index 0000000..462215f --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/enums/PageSize.java @@ -0,0 +1,15 @@ +package com.easypan.entity.enums; + + +public enum PageSize { + SIZE15(15), SIZE20(20), SIZE30(30), SIZE40(40), SIZE50(50); + int size; + + private PageSize(int size) { + this.size = size; + } + + public int getSize() { + return this.size; + } +} diff --git a/easypan-java/src/main/java/com/easypan/entity/enums/ResponseCodeEnum.java b/easypan-java/src/main/java/com/easypan/entity/enums/ResponseCodeEnum.java new file mode 100644 index 0000000..b17be27 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/enums/ResponseCodeEnum.java @@ -0,0 +1,30 @@ +package com.easypan.entity.enums; + + +public enum ResponseCodeEnum { + CODE_200(200, "请求成功"), + CODE_404(404, "请求地址不存在"), + CODE_600(600, "请求参数错误"), + CODE_601(601, "信息已经存在"), + CODE_500(500, "服务器返回错误,请联系管理员"), + CODE_901(901, "登录超时,请重新登录"), + CODE_902(902, "分享连接不存在,或者已失效"), + CODE_903(903, "分享验证失效,请重新验证"), + CODE_904(904, "网盘空间不足,请扩容"); + private Integer code; + + private String msg; + + ResponseCodeEnum(Integer code, String msg) { + this.code = code; + this.msg = msg; + } + + public Integer getCode() { + return code; + } + + public String getMsg() { + return msg; + } +} diff --git a/easypan-java/src/main/java/com/easypan/entity/enums/ShareValidTypeEnums.java b/easypan-java/src/main/java/com/easypan/entity/enums/ShareValidTypeEnums.java new file mode 100644 index 0000000..90e1410 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/enums/ShareValidTypeEnums.java @@ -0,0 +1,41 @@ +package com.easypan.entity.enums; + + +public enum ShareValidTypeEnums { + DAY_1(0, 1, "1天"), + DAY_7(1, 7, "7天"), + DAY_30(2, 30, "30天"), + FOREVER(3, -1, "永久有效"); + + private Integer type; + private Integer days; + private String desc; + + ShareValidTypeEnums(Integer type, Integer days, String desc) { + this.type = type; + this.days = days; + this.desc = desc; + } + + + public static ShareValidTypeEnums getByType(Integer type) { + for (ShareValidTypeEnums typeEnums : ShareValidTypeEnums.values()) { + if (typeEnums.getType().equals(type)) { + return typeEnums; + } + } + return null; + } + + public Integer getType() { + return type; + } + + public Integer getDays() { + return days; + } + + public String getDesc() { + return desc; + } +} diff --git a/easypan-java/src/main/java/com/easypan/entity/enums/UploadStatusEnums.java b/easypan-java/src/main/java/com/easypan/entity/enums/UploadStatusEnums.java new file mode 100644 index 0000000..ebde854 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/enums/UploadStatusEnums.java @@ -0,0 +1,24 @@ +package com.easypan.entity.enums; + + +public enum UploadStatusEnums { + UPLOAD_SECONDS("upload_seconds", "秒传"), + UPLOADING("uploading", "上传中"), + UPLOAD_FINISH("upload_finish", "上传完成"); + + private String code; + private String desc; + + UploadStatusEnums(String code, String desc) { + this.code = code; + this.desc = desc; + } + + public String getCode() { + return code; + } + + public String getDesc() { + return desc; + } +} diff --git a/easypan-java/src/main/java/com/easypan/entity/enums/UserStatusEnum.java b/easypan-java/src/main/java/com/easypan/entity/enums/UserStatusEnum.java new file mode 100644 index 0000000..c4c65e4 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/enums/UserStatusEnum.java @@ -0,0 +1,38 @@ +package com.easypan.entity.enums; + + +public enum UserStatusEnum { + + DISABLE(0, "禁用"), + ENABLE(1, "启用"); + + + private Integer status; + private String desc; + + UserStatusEnum(Integer status, String desc) { + this.status = status; + this.desc = desc; + } + + public static UserStatusEnum getByStatus(Integer status) { + for (UserStatusEnum item : UserStatusEnum.values()) { + if (item.getStatus().equals(status)) { + return item; + } + } + return null; + } + + public Integer getStatus() { + return status; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } +} diff --git a/easypan-java/src/main/java/com/easypan/entity/enums/VerifyRegexEnum.java b/easypan-java/src/main/java/com/easypan/entity/enums/VerifyRegexEnum.java new file mode 100644 index 0000000..d98e525 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/enums/VerifyRegexEnum.java @@ -0,0 +1,24 @@ +package com.easypan.entity.enums; + +//正则校验 +public enum VerifyRegexEnum { + NO("", "不校验"), + EMAIL("^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$", "邮箱"), + PASSWORD("^(?=.*\\d)(?=.*[a-zA-Z])[\\da-zA-Z~!@#$%^&*_]{8,}$", "只能是数字,字母,特殊字符 8-18位"); + + private String regex; + private String desc; + + VerifyRegexEnum(String regex, String desc) { + this.regex = regex; + this.desc = desc; + } + + public String getRegex() { + return regex; + } + + public String getDesc() { + return desc; + } +} \ No newline at end of file diff --git a/easypan-java/src/main/java/com/easypan/entity/po/EmailCode.java b/easypan-java/src/main/java/com/easypan/entity/po/EmailCode.java new file mode 100644 index 0000000..a94d22a --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/po/EmailCode.java @@ -0,0 +1,38 @@ +package com.easypan.entity.po; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 邮箱验证码 + */ +@Data +public class EmailCode implements Serializable { + + /** + * 邮箱 + */ + private String email; + + /** + * 编号 + */ + private String code; + + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + /** + * 0:未使用 1:已使用 + */ + private Integer status; +} diff --git a/easypan-java/src/main/java/com/easypan/entity/po/FileInfo.java b/easypan-java/src/main/java/com/easypan/entity/po/FileInfo.java new file mode 100644 index 0000000..cd754fd --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/po/FileInfo.java @@ -0,0 +1,106 @@ +package com.easypan.entity.po; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文件信息 + */ +@Data +public class FileInfo implements Serializable { + + + /** + * 文件ID + */ + private String fileId; + + /** + * 用户ID + */ + private String userId; + + /** + * md5值,第一次上传记录 + */ + private String fileMd5; + + /** + * 父级ID + */ + private String filePid; + + /** + * 文件大小 + */ + private Long fileSize; + + /** + * 文件名称 + */ + private String fileName; + + /** + * 封面 + */ + private String fileCover; + + /** + * 文件路径 + */ + private String filePath; + + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + /** + * 最后更新时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date lastUpdateTime; + + /** + * 0:文件 1:目录 + */ + private Integer folderType; + + /** + * 1:视频 2:音频 3:图片 4:文档 5:其他 + */ + private Integer fileCategory; + + /** + * 1:视频 2:音频 3:图片 4:pdf 5:doc 6:excel 7:txt 8:code 9:zip 10:其他 + */ + private Integer fileType; + + /** + * 0:转码中 1转码失败 2:转码成功 + */ + private Integer status; + + /** + * 回收站时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date recoveryTime; + + /** + * 删除标记 0:删除 1:回收站 2:正常 + */ + private Integer delFlag; + + private String nickName; + +} diff --git a/easypan-java/src/main/java/com/easypan/entity/po/FileShare.java b/easypan-java/src/main/java/com/easypan/entity/po/FileShare.java new file mode 100644 index 0000000..c6c33ee --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/po/FileShare.java @@ -0,0 +1,84 @@ +package com.easypan.entity.po; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 分享信息 + */ +@Data +public class FileShare implements Serializable { + + + /** + * 分享ID + */ + private String shareId; + + /** + * 文件ID + */ + private String fileId; + + /** + * 用户ID + */ + private String userId; + + /** + * 有效期类型 0:1天 1:7天 2:30天 3:永久有效 + */ + private Integer validType; + + /** + * 失效时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date expireTime; + + /** + * 分享时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date shareTime; + + /** + * 提取码 + */ + private String code; + + /** + * 浏览次数 + */ + private Integer showCount; + + + private String fileName; + + /** + * 0:文件 1:目录 + */ + private Integer folderType; + + /** + * 1:视频 2:音频 3:图片 4:文档 5:其他 + */ + private Integer fileCategory; + + /** + * 1:视频 2:音频 3:图片 4:pdf 5:doc 6:excel 7:txt 8:code 9:zip 10:其他 + */ + private Integer fileType; + + /** + * 封面 + */ + private String fileCover; +} diff --git a/easypan-java/src/main/java/com/easypan/entity/po/UserInfo.java b/easypan-java/src/main/java/com/easypan/entity/po/UserInfo.java new file mode 100644 index 0000000..372bbd1 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/po/UserInfo.java @@ -0,0 +1,76 @@ +package com.easypan.entity.po; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 用户信息 + */ +@Data +public class UserInfo implements Serializable { + + + /** + * 用户ID + */ + private String userId; + + /** + * 昵称 + */ + private String nickName; + + /** + * 邮箱 + */ + private String email; + + /** + * qq 头像 + */ + private String qqAvatar; + + /** + * qq openID + */ + private String qqOpenId; + + /** + * 密码 + */ + private String password; + + /** + * 加入时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date joinTime; + + /** + * 最后登录时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date lastLoginTime; + + /** + * 0:禁用 1:正常 + */ + private Integer status; + + /** + * 使用空间单位byte + */ + private Long useSpace; + + /** + * 总空间单位byte + */ + private Long totalSpace; +} diff --git a/easypan-java/src/main/java/com/easypan/entity/query/BaseParam.java b/easypan-java/src/main/java/com/easypan/entity/query/BaseParam.java new file mode 100644 index 0000000..874ebaf --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/query/BaseParam.java @@ -0,0 +1,40 @@ +package com.easypan.entity.query; + + + public class BaseParam { + private SimplePage simplePage; + private Integer pageNo; + private Integer pageSize; + private String orderBy; + public SimplePage getSimplePage() { + return simplePage; + } + + public void setSimplePage(SimplePage simplePage) { + this.simplePage = simplePage; + } + + public Integer getPageNo() { + return pageNo; + } + + public void setPageNo(Integer pageNo) { + this.pageNo = pageNo; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public void setOrderBy(String orderBy){ + this.orderBy = orderBy; + } + + public String getOrderBy(){ + return this.orderBy; + } +} diff --git a/easypan-java/src/main/java/com/easypan/entity/query/EmailCodeQuery.java b/easypan-java/src/main/java/com/easypan/entity/query/EmailCodeQuery.java new file mode 100644 index 0000000..e8c2fa6 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/query/EmailCodeQuery.java @@ -0,0 +1,103 @@ +package com.easypan.entity.query; + + +/** + * 邮箱验证码参数 + */ +public class EmailCodeQuery extends BaseParam { + + + /** + * 邮箱 + */ + private String email; + + private String emailFuzzy; + + /** + * 编号 + */ + private String code; + + private String codeFuzzy; + + /** + * 创建时间 + */ + private String createTime; + + private String createTimeStart; + + private String createTimeEnd; + + /** + * 0:未使用 1:已使用 + */ + private Integer status; + + + public void setEmail(String email) { + this.email = email; + } + + public String getEmail() { + return this.email; + } + + public void setEmailFuzzy(String emailFuzzy) { + this.emailFuzzy = emailFuzzy; + } + + public String getEmailFuzzy() { + return this.emailFuzzy; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return this.code; + } + + public void setCodeFuzzy(String codeFuzzy) { + this.codeFuzzy = codeFuzzy; + } + + public String getCodeFuzzy() { + return this.codeFuzzy; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTimeStart(String createTimeStart) { + this.createTimeStart = createTimeStart; + } + + public String getCreateTimeStart() { + return this.createTimeStart; + } + + public void setCreateTimeEnd(String createTimeEnd) { + this.createTimeEnd = createTimeEnd; + } + + public String getCreateTimeEnd() { + return this.createTimeEnd; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Integer getStatus() { + return this.status; + } + +} diff --git a/easypan-java/src/main/java/com/easypan/entity/query/FileInfoQuery.java b/easypan-java/src/main/java/com/easypan/entity/query/FileInfoQuery.java new file mode 100644 index 0000000..1029081 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/query/FileInfoQuery.java @@ -0,0 +1,128 @@ +package com.easypan.entity.query; + +import lombok.Data; + +/** + * 文件信息参数 + */ +@Data +public class FileInfoQuery extends BaseParam { + + + /** + * 文件ID + */ + private String fileId; + + private String fileIdFuzzy; + + /** + * 用户ID + */ + private String userId; + + private String userIdFuzzy; + + /** + * md5值,第一次上传记录 + */ + private String fileMd5; + + private String fileMd5Fuzzy; + + /** + * 父级ID + */ + private String filePid; + + private String filePidFuzzy; + + /** + * 文件大小 + */ + private Long fileSize; + + /** + * 文件名称 + */ + private String fileName; + + private String fileNameFuzzy; + + /** + * 封面 + */ + private String fileCover; + + private String fileCoverFuzzy; + + /** + * 文件路径 + */ + private String filePath; + + private String filePathFuzzy; + + /** + * 创建时间 + */ + private String createTime; + + private String createTimeStart; + + private String createTimeEnd; + + /** + * 最后更新时间 + */ + private String lastUpdateTime; + + private String lastUpdateTimeStart; + + private String lastUpdateTimeEnd; + + /** + * 0:文件 1:目录 + */ + private Integer folderType; + + /** + * 1:视频 2:音频 3:图片 4:文档 5:其他 + */ + private Integer fileCategory; + + /** + * 1:视频 2:音频 3:图片 4:pdf 5:doc 6:excel 7:txt 8:code 9:zip 10:其他 + */ + private Integer fileType; + + /** + * 0:转码中 1转码失败 2:转码成功 + */ + private Integer status; + + /** + * 回收站时间 + */ + private String recoveryTime; + + private String recoveryTimeStart; + + private String recoveryTimeEnd; + + /** + * 删除标记 0:删除 1:回收站 2:正常 + */ + private Integer delFlag; + + private String[] fileIdArray; + + private String[] filePidArray; + + private String[] excludeFileIdArray; + + private Boolean queryExpire; + + private Boolean queryNickName; + +} diff --git a/easypan-java/src/main/java/com/easypan/entity/query/FileShareQuery.java b/easypan-java/src/main/java/com/easypan/entity/query/FileShareQuery.java new file mode 100644 index 0000000..9d49a81 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/query/FileShareQuery.java @@ -0,0 +1,203 @@ +package com.easypan.entity.query; + +/** + * 分享信息参数 + */ +public class FileShareQuery extends BaseParam { + + + /** + * 分享ID + */ + private String shareId; + + private String shareIdFuzzy; + + /** + * 文件ID + */ + private String fileId; + + private String fileIdFuzzy; + + /** + * 用户ID + */ + private String userId; + + private String userIdFuzzy; + + /** + * 有效期类型 0:1天 1:7天 2:30天 3:永久有效 + */ + private Integer validType; + + /** + * 失效时间 + */ + private String expireTime; + + private String expireTimeStart; + + private String expireTimeEnd; + + /** + * 分享时间 + */ + private String shareTime; + + private String shareTimeStart; + + private String shareTimeEnd; + + /** + * 提取码 + */ + private String code; + + private String codeFuzzy; + + /** + * 浏览次数 + */ + private Integer showCount; + + private Boolean queryFileName; + + public Boolean getQueryFileName() { + return queryFileName; + } + + public void setQueryFileName(Boolean queryFileName) { + this.queryFileName = queryFileName; + } + + public void setShareId(String shareId) { + this.shareId = shareId; + } + + public String getShareId() { + return this.shareId; + } + + public void setShareIdFuzzy(String shareIdFuzzy) { + this.shareIdFuzzy = shareIdFuzzy; + } + + public String getShareIdFuzzy() { + return this.shareIdFuzzy; + } + + public void setFileId(String fileId) { + this.fileId = fileId; + } + + public String getFileId() { + return this.fileId; + } + + public void setFileIdFuzzy(String fileIdFuzzy) { + this.fileIdFuzzy = fileIdFuzzy; + } + + public String getFileIdFuzzy() { + return this.fileIdFuzzy; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getUserId() { + return this.userId; + } + + public void setUserIdFuzzy(String userIdFuzzy) { + this.userIdFuzzy = userIdFuzzy; + } + + public String getUserIdFuzzy() { + return this.userIdFuzzy; + } + + public void setValidType(Integer validType) { + this.validType = validType; + } + + public Integer getValidType() { + return this.validType; + } + + public void setExpireTime(String expireTime) { + this.expireTime = expireTime; + } + + public String getExpireTime() { + return this.expireTime; + } + + public void setExpireTimeStart(String expireTimeStart) { + this.expireTimeStart = expireTimeStart; + } + + public String getExpireTimeStart() { + return this.expireTimeStart; + } + + public void setExpireTimeEnd(String expireTimeEnd) { + this.expireTimeEnd = expireTimeEnd; + } + + public String getExpireTimeEnd() { + return this.expireTimeEnd; + } + + public void setShareTime(String shareTime) { + this.shareTime = shareTime; + } + + public String getShareTime() { + return this.shareTime; + } + + public void setShareTimeStart(String shareTimeStart) { + this.shareTimeStart = shareTimeStart; + } + + public String getShareTimeStart() { + return this.shareTimeStart; + } + + public void setShareTimeEnd(String shareTimeEnd) { + this.shareTimeEnd = shareTimeEnd; + } + + public String getShareTimeEnd() { + return this.shareTimeEnd; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return this.code; + } + + public void setCodeFuzzy(String codeFuzzy) { + this.codeFuzzy = codeFuzzy; + } + + public String getCodeFuzzy() { + return this.codeFuzzy; + } + + public void setShowCount(Integer showCount) { + this.showCount = showCount; + } + + public Integer getShowCount() { + return this.showCount; + } + +} diff --git a/easypan-java/src/main/java/com/easypan/entity/query/SimplePage.java b/easypan-java/src/main/java/com/easypan/entity/query/SimplePage.java new file mode 100644 index 0000000..efa2a8b --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/query/SimplePage.java @@ -0,0 +1,101 @@ +package com.easypan.entity.query; +import com.easypan.entity.enums.PageSize; + + +public class SimplePage { + private int pageNo; + private int countTotal; + private int pageSize; + private int pageTotal; + private int start; + private int end; + + public SimplePage() { + } + + public SimplePage(Integer pageNo, int countTotal, int pageSize) { + if (null == pageNo) { + pageNo = 0; + } + this.pageNo = pageNo; + this.countTotal = countTotal; + this.pageSize = pageSize; + action(); + } + + public SimplePage(int start, int end) { + this.start = start; + this.end = end; + } + + public void action() { + if (this.pageSize <= 0) { + this.pageSize = PageSize.SIZE20.getSize(); + } + if (this.countTotal > 0) { + this.pageTotal = this.countTotal % this.pageSize == 0 ? this.countTotal / this.pageSize + : this.countTotal / this.pageSize + 1; + } else { + pageTotal = 1; + } + + if (pageNo <= 1) { + pageNo = 1; + } + if (pageNo > pageTotal) { + pageNo = pageTotal; + } + this.start = (pageNo - 1) * pageSize; + this.end = this.pageSize; + } + + public int getStart() { + return start; + } + + public int getEnd() { + return end; + } + + public int getPageTotal() { + return pageTotal; + } + + public int getPageNo() { + return pageNo; + } + + public void setPageNo(int pageNo) { + this.pageNo = pageNo; + } + + public void setPageTotal(int pageTotal) { + this.pageTotal = pageTotal; + } + + public int getCountTotal() { + return countTotal; + } + + public int getPageSize() { + return pageSize; + } + + public void setStart(int start) { + this.start = start; + } + + public void setEnd(int end) { + this.end = end; + } + + public void setCountTotal(int countTotal) { + this.countTotal = countTotal; + this.action(); + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/easypan-java/src/main/java/com/easypan/entity/query/UserInfoQuery.java b/easypan-java/src/main/java/com/easypan/entity/query/UserInfoQuery.java new file mode 100644 index 0000000..abbbd1e --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/query/UserInfoQuery.java @@ -0,0 +1,254 @@ +package com.easypan.entity.query; + + +/** + * + * 用户信息参数 + * + */ +public class UserInfoQuery extends BaseParam { + + + /** + * 用户ID + */ + private String userId; + + private String userIdFuzzy; + + /** + * 昵称 + */ + private String nickName; + + private String nickNameFuzzy; + + /** + * 邮箱 + */ + private String email; + + private String emailFuzzy; + + /** + * + */ + private String qqAvatar; + + private String qqAvatarFuzzy; + + /** + * + */ + private String qqOpenId; + + private String qqOpenIdFuzzy; + + /** + * 密码 + */ + private String password; + + private String passwordFuzzy; + + /** + * 加入时间 + */ + private String joinTime; + + private String joinTimeStart; + + private String joinTimeEnd; + + /** + * 最后登录时间 + */ + private String lastLoginTime; + + private String lastLoginTimeStart; + + private String lastLoginTimeEnd; + + /** + * 0:禁用 1:正常 + */ + private Integer status; + + /** + * + */ + private Long useSpace; + + /** + * + */ + private Long totalSpace; + + + public void setUserId(String userId){ + this.userId = userId; + } + + public String getUserId(){ + return this.userId; + } + + public void setUserIdFuzzy(String userIdFuzzy){ + this.userIdFuzzy = userIdFuzzy; + } + + public String getUserIdFuzzy(){ + return this.userIdFuzzy; + } + + public void setNickName(String nickName){ + this.nickName = nickName; + } + + public String getNickName(){ + return this.nickName; + } + + public void setNickNameFuzzy(String nickNameFuzzy){ + this.nickNameFuzzy = nickNameFuzzy; + } + + public String getNickNameFuzzy(){ + return this.nickNameFuzzy; + } + + public void setEmail(String email){ + this.email = email; + } + + public String getEmail(){ + return this.email; + } + + public void setEmailFuzzy(String emailFuzzy){ + this.emailFuzzy = emailFuzzy; + } + + public String getEmailFuzzy(){ + return this.emailFuzzy; + } + + public void setQqAvatar(String qqAvatar){ + this.qqAvatar = qqAvatar; + } + + public String getQqAvatar(){ + return this.qqAvatar; + } + + public void setQqAvatarFuzzy(String qqAvatarFuzzy){ + this.qqAvatarFuzzy = qqAvatarFuzzy; + } + + public String getQqAvatarFuzzy(){ + return this.qqAvatarFuzzy; + } + + public void setQqOpenId(String qqOpenId){ + this.qqOpenId = qqOpenId; + } + + public String getQqOpenId(){ + return this.qqOpenId; + } + + public void setQqOpenIdFuzzy(String qqOpenIdFuzzy){ + this.qqOpenIdFuzzy = qqOpenIdFuzzy; + } + + public String getQqOpenIdFuzzy(){ + return this.qqOpenIdFuzzy; + } + + public void setPassword(String password){ + this.password = password; + } + + public String getPassword(){ + return this.password; + } + + public void setPasswordFuzzy(String passwordFuzzy){ + this.passwordFuzzy = passwordFuzzy; + } + + public String getPasswordFuzzy(){ + return this.passwordFuzzy; + } + + public void setJoinTime(String joinTime){ + this.joinTime = joinTime; + } + + public String getJoinTime(){ + return this.joinTime; + } + + public void setJoinTimeStart(String joinTimeStart){ + this.joinTimeStart = joinTimeStart; + } + + public String getJoinTimeStart(){ + return this.joinTimeStart; + } + public void setJoinTimeEnd(String joinTimeEnd){ + this.joinTimeEnd = joinTimeEnd; + } + + public String getJoinTimeEnd(){ + return this.joinTimeEnd; + } + + public void setLastLoginTime(String lastLoginTime){ + this.lastLoginTime = lastLoginTime; + } + + public String getLastLoginTime(){ + return this.lastLoginTime; + } + + public void setLastLoginTimeStart(String lastLoginTimeStart){ + this.lastLoginTimeStart = lastLoginTimeStart; + } + + public String getLastLoginTimeStart(){ + return this.lastLoginTimeStart; + } + public void setLastLoginTimeEnd(String lastLoginTimeEnd){ + this.lastLoginTimeEnd = lastLoginTimeEnd; + } + + public String getLastLoginTimeEnd(){ + return this.lastLoginTimeEnd; + } + + public void setStatus(Integer status){ + this.status = status; + } + + public Integer getStatus(){ + return this.status; + } + + public void setUseSpace(Long useSpace){ + this.useSpace = useSpace; + } + + public Long getUseSpace(){ + return this.useSpace; + } + + public void setTotalSpace(Long totalSpace){ + this.totalSpace = totalSpace; + } + + public Long getTotalSpace(){ + return this.totalSpace; + } + +} diff --git a/easypan-java/src/main/java/com/easypan/entity/vo/FileInfoVO.java b/easypan-java/src/main/java/com/easypan/entity/vo/FileInfoVO.java new file mode 100644 index 0000000..8489f14 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/vo/FileInfoVO.java @@ -0,0 +1,64 @@ +package com.easypan.entity.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +@Data +public class FileInfoVO { + + /** + * 文件ID + */ + private String fileId; + + /** + * 父级ID + */ + private String filePid; + + /** + * 文件大小 + */ + private Long fileSize; + + /** + * 文件名称 + */ + private String fileName; + + /** + * 封面 + */ + private String fileCover; + + /** + * 最后更新时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date lastUpdateTime; + + /** + * 0:文件 1:目录 + */ + private Integer folderType; + + /** + * 1:视频 2:音频 3:图片 4:文档 5:其他 + */ + private Integer fileCategory; + + /** + * 1:视频 2:音频 3:图片 4:pdf 5:doc 6:excel 7:txt 8:code 9:zip 10:其他 + */ + private Integer fileType; + + /** + * 0:转码中 1转码失败 2:转码成功 + */ + private Integer status; + +} diff --git a/easypan-java/src/main/java/com/easypan/entity/vo/FolderVO.java b/easypan-java/src/main/java/com/easypan/entity/vo/FolderVO.java new file mode 100644 index 0000000..d032a19 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/vo/FolderVO.java @@ -0,0 +1,10 @@ +package com.easypan.entity.vo; + +import lombok.Data; + +@Data +public class FolderVO { + private String fileName; + private String fileId; + +} diff --git a/easypan-java/src/main/java/com/easypan/entity/vo/PaginationResultVO.java b/easypan-java/src/main/java/com/easypan/entity/vo/PaginationResultVO.java new file mode 100644 index 0000000..792b2b2 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/vo/PaginationResultVO.java @@ -0,0 +1,78 @@ +package com.easypan.entity.vo; +import java.util.ArrayList; +import java.util.List; + + +public class PaginationResultVO { + private Integer totalCount; + private Integer pageSize; + private Integer pageNo; + private Integer pageTotal; + private List list = new ArrayList(); + + public PaginationResultVO(Integer totalCount, Integer pageSize, Integer pageNo, List list) { + this.totalCount = totalCount; + this.pageSize = pageSize; + this.pageNo = pageNo; + this.list = list; + } + + public PaginationResultVO(Integer totalCount, Integer pageSize, Integer pageNo, Integer pageTotal, List list) { + if (pageNo == 0) { + pageNo = 1; + } + this.totalCount = totalCount; + this.pageSize = pageSize; + this.pageNo = pageNo; + this.pageTotal = pageTotal; + this.list = list; + } + + public PaginationResultVO(List list) { + this.list = list; + } + + public PaginationResultVO() { + + } + + public Integer getTotalCount() { + return totalCount; + } + + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public Integer getPageNo() { + return pageNo; + } + + public void setPageNo(Integer pageNo) { + this.pageNo = pageNo; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + public Integer getPageTotal() { + return pageTotal; + } + + public void setPageTotal(Integer pageTotal) { + this.pageTotal = pageTotal; + } +} diff --git a/easypan-java/src/main/java/com/easypan/entity/vo/ResponseVO.java b/easypan-java/src/main/java/com/easypan/entity/vo/ResponseVO.java new file mode 100644 index 0000000..3726ca4 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/vo/ResponseVO.java @@ -0,0 +1,41 @@ +package com.easypan.entity.vo; + + +public class ResponseVO { + private String status; + private Integer code; + private String info; + private T data; + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public T getData() { + return data; + } + + public void setData(T data) { + this.data = data; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } +} diff --git a/easypan-java/src/main/java/com/easypan/entity/vo/ShareInfoVO.java b/easypan-java/src/main/java/com/easypan/entity/vo/ShareInfoVO.java new file mode 100644 index 0000000..faad82c --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/vo/ShareInfoVO.java @@ -0,0 +1,21 @@ +package com.easypan.entity.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +@Data +public class ShareInfoVO { + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date shareTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date expireTime; + private String nickName; + private String fileName; + private Boolean currentUser; + private String fileId; + private String avatar; + private String userId; +} diff --git a/easypan-java/src/main/java/com/easypan/entity/vo/UserInfoVO.java b/easypan-java/src/main/java/com/easypan/entity/vo/UserInfoVO.java new file mode 100644 index 0000000..4303c99 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/entity/vo/UserInfoVO.java @@ -0,0 +1,136 @@ +package com.easypan.entity.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 用户信息 + */ +public class UserInfoVO implements Serializable { + + + /** + * 用户ID + */ + private String userId; + + /** + * 昵称 + */ + private String nickName; + + /** + * 邮箱 + */ + private String email; + + /** + * qq 头像 + */ + private String qqAvatar; + + /** + * 加入时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date joinTime; + + /** + * 最后登录时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date lastLoginTime; + + /** + * 0:禁用 1:正常 + */ + private Integer status; + + /** + * 使用空间单位byte + */ + private Long useSpace; + + /** + * 总空间单位byte + */ + private Long totalSpace; + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getQqAvatar() { + return qqAvatar; + } + + public void setQqAvatar(String qqAvatar) { + this.qqAvatar = qqAvatar; + } + + public Date getJoinTime() { + return joinTime; + } + + public void setJoinTime(Date joinTime) { + this.joinTime = joinTime; + } + + public Date getLastLoginTime() { + return lastLoginTime; + } + + public void setLastLoginTime(Date lastLoginTime) { + this.lastLoginTime = lastLoginTime; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Long getUseSpace() { + return useSpace; + } + + public void setUseSpace(Long useSpace) { + this.useSpace = useSpace; + } + + public Long getTotalSpace() { + return totalSpace; + } + + public void setTotalSpace(Long totalSpace) { + this.totalSpace = totalSpace; + } +} diff --git a/easypan-java/src/main/java/com/easypan/exception/BusinessException.java b/easypan-java/src/main/java/com/easypan/exception/BusinessException.java new file mode 100644 index 0000000..a516a4d --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/exception/BusinessException.java @@ -0,0 +1,61 @@ +package com.easypan.exception; +import com.easypan.entity.enums.ResponseCodeEnum; + + +public class BusinessException extends RuntimeException { + + private ResponseCodeEnum codeEnum; + + private Integer code; + + private String message; + + public BusinessException(String message, Throwable e) { + super(message, e); + this.message = message; + } + + public BusinessException(String message) { + super(message); + this.message = message; + } + + public BusinessException(Throwable e) { + super(e); + } + + public BusinessException(ResponseCodeEnum codeEnum) { + super(codeEnum.getMsg()); + this.codeEnum = codeEnum; + this.code = codeEnum.getCode(); + this.message = codeEnum.getMsg(); + } + + public BusinessException(Integer code, String message) { + super(message); + this.code = code; + this.message = message; + } + + public ResponseCodeEnum getCodeEnum() { + return codeEnum; + } + + public Integer getCode() { + return code; + } + + @Override + public String getMessage() { + return message; + } + + /** + * 重写fillInStackTrace 业务异常不需要堆栈信息,提高效率. + */ + @Override + public Throwable fillInStackTrace() { + return this; + } + +} diff --git a/easypan-java/src/main/java/com/easypan/mappers/BaseMapper.java b/easypan-java/src/main/java/com/easypan/mappers/BaseMapper.java new file mode 100644 index 0000000..a53e516 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/mappers/BaseMapper.java @@ -0,0 +1,42 @@ +package com.easypan.mappers; + + +import org.apache.ibatis.annotations.Param; + +import java.util.List; + + interface BaseMapper { + /** + * insert:(插入).
+ */ + Integer insert(@Param("bean") T t); + + + /** + * insertOrUpdate:(插入或者更新).
+ */ + Integer insertOrUpdate(@Param("bean") T t); + + + /** + * insertBatch:(批量插入).
+ */ + Integer insertBatch(@Param("list") List list); + + + /** + * insertOrUpdateBatch:(批量插入或更新).
+ */ + Integer insertOrUpdateBatch(@Param("list") List list); + + + /** + * selectList:(根据参数查询集合).
+ */ + List selectList(@Param("query") P p); + + /** + * selectCount:(根据集合查询数量).
+ */ + Integer selectCount(@Param("query") P p); +} diff --git a/easypan-java/src/main/java/com/easypan/mappers/EmailCodeMapper.java b/easypan-java/src/main/java/com/easypan/mappers/EmailCodeMapper.java new file mode 100644 index 0000000..6a15088 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/mappers/EmailCodeMapper.java @@ -0,0 +1,29 @@ +package com.easypan.mappers; + +import org.apache.ibatis.annotations.Param; + +/** + * 邮箱验证码 数据库操作接口 + */ +public interface EmailCodeMapper extends BaseMapper { + + /** + * 根据EmailAndCode更新 + */ + Integer updateByEmailAndCode(@Param("bean") T t, @Param("email") String email, @Param("code") String code); + + + /** + * 根据EmailAndCode删除 + */ + Integer deleteByEmailAndCode(@Param("email") String email, @Param("code") String code); + + + /** + * 根据EmailAndCode获取对象 + */ + T selectByEmailAndCode(@Param("email") String email, @Param("code") String code); + + void disableEmailCode(@Param("email") String email); + +} diff --git a/easypan-java/src/main/java/com/easypan/mappers/FileInfoMapper.java b/easypan-java/src/main/java/com/easypan/mappers/FileInfoMapper.java new file mode 100644 index 0000000..5fc78fb --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/mappers/FileInfoMapper.java @@ -0,0 +1,50 @@ +package com.easypan.mappers; + +import com.easypan.entity.po.FileInfo; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 文件信息 数据库操作接口 + */ +public interface FileInfoMapper extends BaseMapper { + + /** + * 根据FileIdAndUserId更新 + */ + Integer updateByFileIdAndUserId(@Param("bean") T t, @Param("fileId") String fileId, @Param("userId") String userId); + + + /** + * 根据FileIdAndUserId删除 + */ + Integer deleteByFileIdAndUserId(@Param("fileId") String fileId, @Param("userId") String userId); + + + /** + * 根据FileIdAndUserId获取对象 + */ + T selectByFileIdAndUserId(@Param("fileId") String fileId, @Param("userId") String userId); + + + void updateFileStatusWithOldStatus(@Param("fileId") String fileId, @Param("userId") String userId, @Param("bean") T t, + @Param("oldStatus") Integer oldStatus); + + void updateFileDelFlagBatch(@Param("bean") FileInfo fileInfo, + @Param("userId") String userId, + @Param("filePidList") List filePidList, + @Param("fileIdList") List fileIdList, + @Param("oldDelFlag") Integer oldDelFlag); + + + void delFileBatch(@Param("userId") String userId, + @Param("filePidList") List filePidList, + @Param("fileIdList") List fileIdList, + @Param("oldDelFlag") Integer oldDelFlag); + + Long selectUseSpace(@Param("userId") String userId); + + void deleteFileByUserId(@Param("userId") String userId); + +} diff --git a/easypan-java/src/main/java/com/easypan/mappers/FileShareMapper.java b/easypan-java/src/main/java/com/easypan/mappers/FileShareMapper.java new file mode 100644 index 0000000..90c1577 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/mappers/FileShareMapper.java @@ -0,0 +1,30 @@ +package com.easypan.mappers; + +import org.apache.ibatis.annotations.Param; + +/** + * 分享信息 数据库操作接口 + */ +public interface FileShareMapper extends BaseMapper { + + /** + * 根据ShareId更新 + */ + Integer updateByShareId(@Param("bean") T t, @Param("shareId") String shareId); + + + /** + * 根据ShareId删除 + */ + Integer deleteByShareId(@Param("shareId") String shareId); + + + /** + * 根据ShareId获取对象 + */ + T selectByShareId(@Param("shareId") String shareId); + + Integer deleteFileShareBatch(@Param("shareIdArray") String[] shareIdArray, @Param("userId") String userId); + + void updateShareShowCount(@Param("shareId") String shareId); +} diff --git a/easypan-java/src/main/java/com/easypan/mappers/UserInfoMapper.java b/easypan-java/src/main/java/com/easypan/mappers/UserInfoMapper.java new file mode 100644 index 0000000..b6c8db2 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/mappers/UserInfoMapper.java @@ -0,0 +1,85 @@ +package com.easypan.mappers; + +import com.easypan.entity.po.UserInfo; +import org.apache.ibatis.annotations.Param; + +/** + * 用户信息 数据库操作接口 + */ +public interface UserInfoMapper extends BaseMapper { + + /** + * 根据UserId更新 + */ + Integer updateByUserId(@Param("bean") T t, @Param("userId") String userId); + + + /** + * 根据UserId删除 + */ + Integer deleteByUserId(@Param("userId") String userId); + + + /** + * 根据UserId获取对象 + */ + T selectByUserId(@Param("userId") String userId); + + + /** + * 根据Email更新 + */ + Integer updateByEmail(@Param("bean") T t, @Param("email") String email); + + + /** + * 根据Email删除 + */ + Integer deleteByEmail(@Param("email") String email); + + + /** + * 根据Email获取对象 + */ + T selectByEmail(@Param("email") String email); + + + /** + * 根据NickName更新 + */ + Integer updateByNickName(@Param("bean") T t, @Param("nickName") String nickName); + + + /** + * 根据NickName删除 + */ + Integer deleteByNickName(@Param("nickName") String nickName); + + + /** + * 根据NickName获取对象 + */ + T selectByNickName(@Param("nickName") String nickName); + + + /** + * 根据QqOpenId更新 + */ + Integer updateByQqOpenId(@Param("bean") T t, @Param("qqOpenId") String qqOpenId); + + + /** + * 根据QqOpenId删除 + */ + Integer deleteByQqOpenId(@Param("qqOpenId") String qqOpenId); + + + /** + * 根据QqOpenId获取对象 + */ + T selectByQqOpenId(@Param("qqOpenId") String qqOpenId); + + + Integer updateUserSpace(@Param("userId") String userId, @Param("useSpace") Long useSpace, @Param("totalSpace") Long totalSpace); + +} diff --git a/easypan-java/src/main/java/com/easypan/service/EmailCodeService.java b/easypan-java/src/main/java/com/easypan/service/EmailCodeService.java new file mode 100644 index 0000000..71d57ce --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/service/EmailCodeService.java @@ -0,0 +1,11 @@ +package com.easypan.service; + +/** + * 邮箱验证码 业务接口 + */ +public interface EmailCodeService { + + void sendEmailCode(String toEmail, Integer type); + + void checkCode(String email, String code); +} \ No newline at end of file diff --git a/easypan-java/src/main/java/com/easypan/service/FileInfoService.java b/easypan-java/src/main/java/com/easypan/service/FileInfoService.java new file mode 100644 index 0000000..2cc5bbf --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/service/FileInfoService.java @@ -0,0 +1,48 @@ +package com.easypan.service; + +import com.easypan.entity.dto.SessionWebUserDto; +import com.easypan.entity.dto.UploadResultDto; +import com.easypan.entity.po.FileInfo; +import com.easypan.entity.query.FileInfoQuery; +import com.easypan.entity.vo.PaginationResultVO; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + + +/** + * 文件信息 业务接口 + */ +public interface FileInfoService { + + FileInfo rename(String fileId, String userId, String fileName); + + + PaginationResultVO findListByPage(FileInfoQuery param); + + + UploadResultDto uploadFile(SessionWebUserDto webUserDto, String fileId, MultipartFile file, + String fileName, String filePid, String fileMd5, Integer chunkIndex, Integer chunks); + + + FileInfo getFileInfoByFileIdAndUserId(String realFileId, String userId); + + FileInfo newFolder(String filePid, String userId, String fileName); + + List findListByParam(FileInfoQuery param); + + List loadAllFolder(String userId, String filePid, String currentFileIds); + + void changeFileFolder(String fileIds, String filePid, String userId); + + void removeFile2RecycleBatch(String userId, String fileIds); + + void recoverFileBatch(String userId, String fileIds); + + void delFileBatch(String userId, String fileIds, boolean b); + + void saveShare(String shareRootFilePid, String shareFileIds, String myFolderId, String shareUserId, String currentUserId); + + void deleteFileByUserId(String userId); + +} \ No newline at end of file diff --git a/easypan-java/src/main/java/com/easypan/service/FileShareService.java b/easypan-java/src/main/java/com/easypan/service/FileShareService.java new file mode 100644 index 0000000..eb18c04 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/service/FileShareService.java @@ -0,0 +1,69 @@ +package com.easypan.service; + +import com.easypan.entity.dto.SessionShareDto; +import com.easypan.entity.po.FileShare; +import com.easypan.entity.query.FileShareQuery; +import com.easypan.entity.vo.PaginationResultVO; + +import java.util.List; + + +/** + * 分享信息 业务接口 + */ +public interface FileShareService { + + /** + * 根据条件查询列表 + */ + List findListByParam(FileShareQuery param); + + /** + * 根据条件查询列表 + */ + Integer findCountByParam(FileShareQuery param); + + /** + * 分页查询 + */ + PaginationResultVO findListByPage(FileShareQuery param); + + /** + * 新增 + */ + Integer add(FileShare bean); + + /** + * 批量新增 + */ + Integer addBatch(List listBean); + + /** + * 批量新增/修改 + */ + Integer addOrUpdateBatch(List listBean); + + /** + * 根据ShareId查询对象 + */ + FileShare getFileShareByShareId(String shareId); + + + /** + * 根据ShareId修改 + */ + Integer updateFileShareByShareId(FileShare bean, String shareId); + + + /** + * 根据ShareId删除 + */ + Integer deleteFileShareByShareId(String shareId); + + + void deleteFileShareBatch(String[] shareIdArray, String userId); + + void saveShare(FileShare share); + + SessionShareDto checkShareCode(String shareId, String code); +} \ No newline at end of file diff --git a/easypan-java/src/main/java/com/easypan/service/UserInfoService.java b/easypan-java/src/main/java/com/easypan/service/UserInfoService.java new file mode 100644 index 0000000..8ec7102 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/service/UserInfoService.java @@ -0,0 +1,37 @@ +package com.easypan.service; + + +import com.easypan.entity.dto.SessionWebUserDto; +import com.easypan.entity.po.UserInfo; +import com.easypan.entity.query.UserInfoQuery; +import com.easypan.entity.vo.PaginationResultVO; + +import java.util.List; + +/** + * 用户信息 业务接口 + */ +public interface UserInfoService { + void register(String email, String nickName, String password, String emailCode); + + SessionWebUserDto login(String email, String password); + + void resetPwd(String email, String password, String emailCode); + + void updateUserInfoByUserId(UserInfo userInfo, String userId); + + UserInfo getUserInfoByUserId(String userId); + + PaginationResultVO findListByPage(UserInfoQuery userInfoQuery); + + Integer findCountByParam(UserInfoQuery param); + + List findListByParam(UserInfoQuery param); + + void updateUserStatus(String userId, Integer status); + + void changeUserSpace(String userId, Integer changeSpace); + + + +} \ No newline at end of file diff --git a/easypan-java/src/main/java/com/easypan/service/impl/EmailCodeServiceImpl.java b/easypan-java/src/main/java/com/easypan/service/impl/EmailCodeServiceImpl.java new file mode 100644 index 0000000..98a2061 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/service/impl/EmailCodeServiceImpl.java @@ -0,0 +1,131 @@ +package com.easypan.service.impl; + + +import com.easypan.utils.RedisComponent; +import com.easypan.config.AppConfig; +import com.easypan.entity.constants.Constants; +import com.easypan.entity.dto.SysSettingsDto; +import com.easypan.entity.po.EmailCode; +import com.easypan.entity.po.UserInfo; +import com.easypan.entity.query.EmailCodeQuery; +import com.easypan.entity.query.UserInfoQuery; +import com.easypan.exception.BusinessException; +import com.easypan.mappers.EmailCodeMapper; +import com.easypan.mappers.UserInfoMapper; +import com.easypan.service.EmailCodeService; +import com.easypan.utils.StringTools; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.mail.javamail.JavaMailSender; +import org.springframework.mail.javamail.MimeMessageHelper; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import javax.mail.internet.MimeMessage; +import java.util.Date; + + +/** + * 邮箱验证码 业务接口实现 + */ +@Service +public class EmailCodeServiceImpl implements EmailCodeService { + + private static final Logger logger = LoggerFactory.getLogger(EmailCodeServiceImpl.class); + + @Resource + private JavaMailSender javaMailSender; + @Resource + private EmailCodeMapper emailCodeMapper; + + @Resource + private UserInfoMapper userInfoMapper; + + @Resource + private AppConfig appConfig; + @Resource + private RedisComponent redisComponent; + + + /** + * 真正发送邮件验证码 + * @param toEmail 发送到德邮箱 + * @param code 需要发送的验证码 + */ + private void sendEmailCode(String toEmail, String code) { + try { + MimeMessage message = javaMailSender.createMimeMessage(); + + MimeMessageHelper helper = new MimeMessageHelper(message, true); + //邮件发件人 + helper.setFrom(appConfig.getSendUserName()); + //邮件收件人 1或多个 + helper.setTo(toEmail); + + SysSettingsDto sysSettingsDto = redisComponent.getSysSettingsDto(); + + //邮件主题 + helper.setSubject(sysSettingsDto.getRegisterEmailTitle()); + //邮件内容 + helper.setText(String.format(sysSettingsDto.getRegisterEmailContent(), code)); + //邮件发送时间 + helper.setSentDate(new Date()); + //发送 + javaMailSender.send(message); + } catch (Exception e) { + logger.error("邮件发送失败", e); + throw new BusinessException("邮件发送失败"); + } + } + + /** + * 发送邮箱验证码的前置和后置工作 + * @param toEmail 发送的邮箱地址 + * @param type 0:注册 1:找回密码 + */ + @Override + @Transactional + public void sendEmailCode(String toEmail, Integer type) { + //如果是注册,校验邮箱是否已存在 + if (type == Constants.REGISTER_ZERO) { + UserInfo userInfo = userInfoMapper.selectByEmail(toEmail); + if (null != userInfo) { + throw new BusinessException("邮箱已经存在"); + } + } + + String code = StringTools.getRandomNumber(Constants.LENGTH_5); + sendEmailCode(toEmail, code); + + // 数据库中的其他验证码置于不可用 + emailCodeMapper.disableEmailCode(toEmail); + + // 封装EmailCode对象 + EmailCode emailCode = new EmailCode(); + emailCode.setCode(code); + emailCode.setEmail(toEmail); + emailCode.setStatus(Constants.REGISTER_ZERO); + emailCode.setCreateTime(new Date()); + + // 插入数据库 + emailCodeMapper.insert(emailCode); + } + + @Override + public void checkCode(String email, String code) { + EmailCode emailCode = emailCodeMapper.selectByEmailAndCode(email, code); + // 如果没查到数据 + if (emailCode == null) { + throw new BusinessException("邮箱验证码不正确"); + } + // 如果已经失效或超时 + if (emailCode.getStatus() == 1 || System.currentTimeMillis() - emailCode.getCreateTime() + .getTime() > Constants.LENGTH_15 * 1000 * 60) { + throw new BusinessException("邮箱验证已失效"); + } + + emailCodeMapper.disableEmailCode(email); + } + +} \ No newline at end of file diff --git a/easypan-java/src/main/java/com/easypan/service/impl/FileInfoServiceImpl.java b/easypan-java/src/main/java/com/easypan/service/impl/FileInfoServiceImpl.java new file mode 100644 index 0000000..00d10e7 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/service/impl/FileInfoServiceImpl.java @@ -0,0 +1,829 @@ +package com.easypan.service.impl; + + +import com.easypan.utils.RedisComponent; +import com.easypan.config.AppConfig; +import com.easypan.entity.constants.Constants; +import com.easypan.entity.dto.SessionWebUserDto; +import com.easypan.entity.dto.UploadResultDto; +import com.easypan.entity.dto.UserSpaceDto; +import com.easypan.entity.enums.*; +import com.easypan.entity.po.FileInfo; +import com.easypan.entity.po.UserInfo; +import com.easypan.entity.query.FileInfoQuery; +import com.easypan.entity.query.SimplePage; +import com.easypan.entity.query.UserInfoQuery; +import com.easypan.entity.vo.PaginationResultVO; +import com.easypan.exception.BusinessException; +import com.easypan.mappers.FileInfoMapper; +import com.easypan.mappers.UserInfoMapper; +import com.easypan.service.FileInfoService; +import com.easypan.utils.DateUtil; +import com.easypan.utils.ProcessUtils; +import com.easypan.utils.ScaleFilter; +import com.easypan.utils.StringTools; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.FileUtils; +import org.springframework.context.annotation.Lazy; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.support.TransactionSynchronization; +import org.springframework.transaction.support.TransactionSynchronizationManager; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import java.io.File; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + + +/** + * 文件信息 业务接口实现 + */ +@Service +@Slf4j +public class FileInfoServiceImpl implements FileInfoService { + + @Resource + private FileInfoMapper fileInfoMapper; + + @Resource + private RedisComponent redisComponent; + + @Resource + private UserInfoMapper userInfoMapper; + + @Resource + private AppConfig appConfig; + + @Resource + @Lazy + private FileInfoServiceImpl fileInfoService; + + + @Override + public FileInfo getFileInfoByFileIdAndUserId(String fileId, String userId) { + return fileInfoMapper.selectByFileIdAndUserId(fileId, userId); + } + + /** + * 创建文件夹 + */ + @Override +// @Transactional + public FileInfo newFolder(String filePid, String userId, String folderName) { + // 检查是否还有同名文件夹 + checkFileName(filePid, userId, folderName, FileFolderTypeEnums.FOLDER.getType()); + + Date curDate = new Date(); + FileInfo fileInfo = new FileInfo(); + fileInfo.setFileId(StringTools.getRandomString(Constants.LENGTH_10)); + fileInfo.setUserId(userId); + fileInfo.setFilePid(filePid); + fileInfo.setFileName(folderName); + fileInfo.setFolderType(FileFolderTypeEnums.FOLDER.getType()); + fileInfo.setCreateTime(curDate); + fileInfo.setLastUpdateTime(curDate); + fileInfo.setStatus(FileStatusEnums.USING.getStatus()); + fileInfo.setDelFlag(FileDelFlagEnums.USING.getFlag()); + fileInfoMapper.insert(fileInfo); + return fileInfo; + } + + @Override + public List findListByParam(FileInfoQuery param) { + return fileInfoMapper.selectList(param); + } + + @Override + public List loadAllFolder(String userId, String filePid, String currentFileIds) { + FileInfoQuery query = new FileInfoQuery(); + query.setUserId(userId); + query.setFilePid(filePid); + query.setFolderType(FileFolderTypeEnums.FOLDER.getType()); + if (!StringTools.isEmpty(currentFileIds)) { + query.setExcludeFileIdArray(currentFileIds.split(",")); + } + query.setDelFlag(FileDelFlagEnums.USING.getFlag()); + query.setOrderBy("create_time desc"); + return fileInfoService.findListByParam(query); + + } + + // 移动文件到指定文件夹 + @Override + public void changeFileFolder(String fileIds, String filePid, String userId) { + if (fileIds.equals(filePid)) { + //移动到自己 + throw new BusinessException(ResponseCodeEnum.CODE_600); + } + // 以filePid当做fileId加上userId查询 + if (!Constants.ZERO_STR.equals(filePid)) { + FileInfo fileInfo = getFileInfoByFileIdAndUserId(filePid, userId); + // 当前用户移动到的目录不存在或者不是目录 + if (fileInfo == null || !FileDelFlagEnums.USING.getFlag().equals(fileInfo.getDelFlag())) { + throw new BusinessException(ResponseCodeEnum.CODE_600); + } + } + // fileIds -> {fileId1,fileId2,fileId3...} + String[] fileIdArray = fileIds.split(","); + + // 如果移动到的目录正常,查询出toFile下的所有文件 + FileInfoQuery query = new FileInfoQuery(); + query.setFilePid(filePid); + query.setUserId(userId); + List dbFileList = findListByParam(query); + + // 将查询出的list集合收集为以fileName为key, 以集合元素fileInfo为值 + // (file1, file2) -> file2) 如果两个文件名字相同,取第二个 + Map dbFileNameMap = dbFileList.stream() + .collect(Collectors.toMap(FileInfo::getFileName, + Function.identity(), + (file1, file2) -> file2)); + //查询选中的文件 + query = new FileInfoQuery(); + query.setUserId(userId); + query.setFileIdArray(fileIdArray); + List selectFileList = findListByParam(query); + + //如果存在名字相同,则将所选文件重命名 + for (FileInfo item : selectFileList) { + FileInfo rootFileInfo = dbFileNameMap.get(item.getFileName()); + FileInfo updateInfo = new FileInfo(); + if (rootFileInfo != null) { + //文件名已经存在,重命名被还原的文件名 + String fileName = StringTools.rename(item.getFileName()); + updateInfo.setFileName(fileName); + } + updateInfo.setFilePid(filePid); + fileInfoMapper.updateByFileIdAndUserId(updateInfo, item.getFileId(), userId); + } + } + + + private List selectListByIdsAndDelFlag(String userId, String fileIds, Integer delFlag) { + String[] fileIdArray = fileIds.split(","); + FileInfoQuery query = new FileInfoQuery(); + query.setUserId(userId); + query.setFileIdArray(fileIdArray); + query.setDelFlag(delFlag); + return fileInfoMapper.selectList(query); + } + + // 批量将文件放入回收站 + @Override + @Transactional + public void removeFile2RecycleBatch(String userId, String fileIds) { + // 查询该用户需删除的fileIds并且状态为使用中的文件 + List fileInfoList = selectListByIdsAndDelFlag(userId, fileIds, FileDelFlagEnums.USING.getFlag()); + if (fileInfoList.isEmpty()) { + return; + } + // 如果不为空 + List delFilePidList = new ArrayList<>(); + fileInfoList.stream() + .filter(fileInfo -> + fileInfo.getFolderType().equals(FileFolderTypeEnums.FOLDER.getType())) + .forEach(fileInfo -> + findAllSubFolderFileIdList(delFilePidList, userId, fileInfo.getFileId(), FileDelFlagEnums.USING.getFlag())); + + //将目录下的所有文件更新为已删除 + if (!delFilePidList.isEmpty()) { + FileInfo updateInfo = new FileInfo(); + updateInfo.setDelFlag(FileDelFlagEnums.DEL.getFlag()); + this.fileInfoMapper.updateFileDelFlagBatch(updateInfo, userId, delFilePidList, + null, FileDelFlagEnums.USING.getFlag()); + } + + //将选中的文件更新为回收站 + List delFileIdList = Arrays.asList(fileIds.split(",")); + FileInfo fileInfo = new FileInfo(); + fileInfo.setRecoveryTime(new Date()); + fileInfo.setDelFlag(FileDelFlagEnums.RECYCLE.getFlag()); + this.fileInfoMapper.updateFileDelFlagBatch(fileInfo, userId, null, + delFileIdList, FileDelFlagEnums.USING.getFlag()); + } + + // 回收站还原 + @Override + @Transactional + public void recoverFileBatch(String userId, String fileIds) { + + // 首先将选中的需还原的文件查找出来 + List fileInfoList = selectListByIdsAndDelFlag(userId, fileIds, FileDelFlagEnums.RECYCLE.getFlag()); + + //delFileSubFolderFileIdList为所有文件夹的id + List delFileSubFolderFileIdList = new ArrayList<>(); + //找到所选文件子目录文件ID + + // 如果是文件夹,递归找出该文件夹中的所有文件夹 + fileInfoList.stream() + .filter(fileInfo -> + fileInfo.getFolderType().equals(FileFolderTypeEnums.FOLDER.getType())) + .forEach(fileInfo -> + findAllSubFolderFileIdList(delFileSubFolderFileIdList, userId, + fileInfo.getFileId(), FileDelFlagEnums.USING.getFlag())); + + // 查询所有跟目录的文件准备判断是否需要重命名 + FileInfoQuery query = new FileInfoQuery(); + query = new FileInfoQuery(); + query.setUserId(userId); + query.setDelFlag(FileDelFlagEnums.USING.getFlag()); + query.setFilePid(Constants.ZERO_STR); + List allRootFileList = this.fileInfoMapper.selectList(query); + + Map rootFileMap = + allRootFileList.stream(). + collect(Collectors.toMap(FileInfo::getFileName, Function.identity(), (file1, file2) -> file2)); + + // 将目录下的所有删除的文件更新为正常 + if (!delFileSubFolderFileIdList.isEmpty()) { + FileInfo fileInfo = new FileInfo(); + fileInfo.setDelFlag(FileDelFlagEnums.USING.getFlag()); + this.fileInfoMapper.updateFileDelFlagBatch(fileInfo, userId, delFileSubFolderFileIdList, + null, FileDelFlagEnums.DEL.getFlag()); + } + + // 将选中的文件更新为正常,且父级目录到跟目录 + List delFileIdList = Arrays.asList(fileIds.split(",")); + FileInfo fileInfo = new FileInfo(); + fileInfo.setDelFlag(FileDelFlagEnums.USING.getFlag()); + fileInfo.setFilePid(Constants.ZERO_STR); + fileInfo.setLastUpdateTime(new Date()); + this.fileInfoMapper.updateFileDelFlagBatch(fileInfo, userId, null, delFileIdList, + FileDelFlagEnums.RECYCLE.getFlag()); + + //将所选文件重命名 + for (FileInfo item : fileInfoList) { + // 从map中查找名字相同的文件 + FileInfo rootFileInfo = rootFileMap.get(item.getFileName()); + //文件名已经存在,重命名被还原的文件名 + if (rootFileInfo != null) { + String fileName = StringTools.rename(item.getFileName()); + FileInfo updateInfo = new FileInfo(); + updateInfo.setFileName(fileName); + this.fileInfoMapper.updateByFileIdAndUserId(updateInfo, item.getFileId(), userId); + } + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delFileBatch(String userId, String fileIds, boolean adminOp) { + + List fileInfoList = selectListByIdsAndDelFlag(userId, fileIds, FileDelFlagEnums.RECYCLE.getFlag()); + + List delFileSubFolderFileIdList = new ArrayList<>(); + //找到所选文件子目录文件ID + fileInfoList.stream() + .filter(fileInfo -> + fileInfo.getFolderType().equals(FileFolderTypeEnums.FOLDER.getType())) + .forEach(fileInfo -> + findAllSubFolderFileIdList(delFileSubFolderFileIdList, userId, + fileInfo.getFileId(), FileDelFlagEnums.DEL.getFlag())); + + + //删除所选文件,子目录中的文件 + if (!delFileSubFolderFileIdList.isEmpty()) { + this.fileInfoMapper.delFileBatch(userId, delFileSubFolderFileIdList, null, adminOp + ? null : FileDelFlagEnums.DEL.getFlag()); + } + //删除所选文件 + this.fileInfoMapper.delFileBatch(userId, null, Arrays.asList(fileIds.split(",")), + adminOp ? null : FileDelFlagEnums.RECYCLE.getFlag()); + + Long useSpace = this.fileInfoMapper.selectUseSpace(userId); + UserInfo userInfo = new UserInfo(); + userInfo.setUseSpace(useSpace); + userInfoMapper.updateByUserId(userInfo, userId); + + //设置缓存 + UserSpaceDto userSpaceDto = redisComponent.getUserSpaceUse(userId); + userSpaceDto.setUseSpace(useSpace); + redisComponent.saveUserSpaceUse(userId, userSpaceDto); + + } + + @Override + public void saveShare(String shareRootFilePid, String shareFileIds, String myFolderId, + String shareUserId, String currentUserId) { + String[] shareFileIdArray = shareFileIds.split(","); + //目标目录文件列表 + FileInfoQuery fileInfoQuery = new FileInfoQuery(); + fileInfoQuery.setUserId(currentUserId); + fileInfoQuery.setFilePid(myFolderId); + // 目标文件夹下所有文件 + List currentFileList = this.fileInfoMapper.selectList(fileInfoQuery); + // 映射成map + Map currentFileMap = + currentFileList.stream() + .collect(Collectors.toMap(FileInfo::getFileName, Function.identity(), (file1, file2) -> file2)); + //选择的文件 + fileInfoQuery = new FileInfoQuery(); + fileInfoQuery.setUserId(shareUserId); + fileInfoQuery.setFileIdArray(shareFileIdArray); + // 选中的所有文件 + List shareFileList = this.fileInfoMapper.selectList(fileInfoQuery); + + //重命名选择的文件 + List copyFileList = new ArrayList<>(); + Date curDate = new Date(); + for (FileInfo item : shareFileList) { + FileInfo haveFile = currentFileMap.get(item.getFileName()); + if (haveFile != null) { + item.setFileName(StringTools.rename(item.getFileName())); + } + // 需要找出所有文件复制 + findAllSubFile(copyFileList, item, shareUserId, currentUserId, curDate, myFolderId); + } +// System.out.println(copyFileList.size()); + this.fileInfoMapper.insertBatch(copyFileList); + } + + @Override + public void deleteFileByUserId(String userId) { + this.fileInfoMapper.deleteFileByUserId(userId); + } + + private void findAllSubFile(List copyFileList, FileInfo fileInfo, String sourceUserId, + String currentUserId, Date curDate, String newFilePid) { + // 将文件添加进集合 + String sourceFileId = fileInfo.getFileId(); + fileInfo.setCreateTime(curDate); + fileInfo.setLastUpdateTime(curDate); + fileInfo.setFilePid(newFilePid); + fileInfo.setUserId(currentUserId); + String newFileId = StringTools.getRandomString(Constants.LENGTH_10); + fileInfo.setFileId(newFileId); + copyFileList.add(fileInfo); + // 如果是目录的话,递归添加 + if (FileFolderTypeEnums.FOLDER.getType().equals(fileInfo.getFolderType())) { + FileInfoQuery query = new FileInfoQuery(); + query.setFilePid(sourceFileId); + query.setUserId(sourceUserId); + List sourceFileList = this.fileInfoMapper.selectList(query); + + sourceFileList.forEach(item -> findAllSubFile(copyFileList, item, sourceUserId, currentUserId, curDate, newFileId)); + } + } +// +// /** +// * 前端传参: String shareId, String filePid +// * shareId -> shareSessionDto +// * @param rootFilePid shareSessionDto.getFileId() +// * @param userId shareSessionDto.getShareUserId() +// * @param fileId filePid +// */ +// @Override +// public void checkRootFilePid(String rootFilePid, String userId, String fileId) { +// if (StringTools.isEmpty(fileId)) { +// throw new BusinessException(ResponseCodeEnum.CODE_600); +// } +// if (rootFilePid.equals(fileId)) { +// return; +// } +// checkFilePid(rootFilePid, fileId, userId); +// } + +// private void checkFilePid(String rootFilePid, String fileId, String userId) { +// FileInfo fileInfo = this.fileInfoMapper.selectByFileIdAndUserId(fileId, userId); +// if (fileInfo == null) { +// throw new BusinessException(ResponseCodeEnum.CODE_600); +// } +// if (Constants.ZERO_STR.equals(fileInfo.getFilePid())) { +// throw new BusinessException(ResponseCodeEnum.CODE_600); +// } +// if (fileInfo.getFilePid().equals(rootFilePid)) { +// return; +// } +// checkFilePid(rootFilePid, fileInfo.getFilePid(), userId); +// } + + // 递归查找文件夹下的所有文件 + private void findAllSubFolderFileIdList(List fileIdList, String userId, String fileId, Integer delFlag) { + // 首先将自己添加进删除集合 + fileIdList.add(fileId); + + // 然后查找自己下面的所有的文件夹 + FileInfoQuery query = new FileInfoQuery(); + query.setUserId(userId); + query.setFilePid(fileId); + query.setDelFlag(delFlag); + query.setFolderType(FileFolderTypeEnums.FOLDER.getType()); + List fileInfoList = this.fileInfoMapper.selectList(query); + + for (FileInfo fileInfo : fileInfoList) { + findAllSubFolderFileIdList(fileIdList, userId, fileInfo.getFileId(), delFlag); + } + } + + private void checkFileName(String filePid, String userId, + String fileName, Integer folderType) { + FileInfoQuery fileInfoQuery = new FileInfoQuery(); + fileInfoQuery.setFolderType(folderType); + fileInfoQuery.setFileName(fileName); + fileInfoQuery.setFilePid(filePid); + fileInfoQuery.setUserId(userId); + fileInfoQuery.setDelFlag(FileDelFlagEnums.USING.getFlag()); + Integer count = this.fileInfoMapper.selectCount(fileInfoQuery); + if (count > 0) { + throw new BusinessException("此目录下已存在同名文件,请修改名称"); + } + } + + @Override + public FileInfo rename(String fileId, String userId, String fileName) { + FileInfo fileInfo = this.fileInfoMapper.selectByFileIdAndUserId(fileId, userId); + if (fileInfo == null) { + throw new BusinessException("文件不存在"); + } + String filePid = fileInfo.getFilePid(); + checkFileName(filePid, userId, fileName, fileInfo.getFolderType()); + //文件获取后缀 + if (FileFolderTypeEnums.FILE.getType().equals(fileInfo.getFolderType())) { + fileName = fileName + StringTools.getFileSuffix(fileInfo.getFileName()); + } + Date curDate = new Date(); + FileInfo dbInfo = new FileInfo(); + dbInfo.setFileName(fileName); + dbInfo.setLastUpdateTime(curDate); + fileInfoMapper.updateByFileIdAndUserId(dbInfo, fileId, userId); + + fileInfo.setFileName(fileName); + fileInfo.setLastUpdateTime(curDate); + return fileInfo; + } + + /** + * 分页查询方法 + */ + @Override + public PaginationResultVO findListByPage(FileInfoQuery param) { + // 记录条数 + int count = fileInfoMapper.selectCount(param); + // 如果未选择页面大小则使用默认的15 + int pageSize = param.getPageSize() == null ? PageSize.SIZE15.getSize() : param.getPageSize(); + + /** + * param.getPageNo() 第几页 + * count 共多少条记录 + * pageSize 一页显示多少页 + */ + SimplePage page = new SimplePage(param.getPageNo(), count, pageSize); + param.setSimplePage(page); + List list = fileInfoMapper.selectList(param); + PaginationResultVO result = new PaginationResultVO(count, + page.getPageSize(), page.getPageNo(), page.getPageTotal(), list); + return result; + } + + /** + * 实现上传核心方法 uploadFile -> transferFile -> union -> 生成缩略图 + * + * @param webUserDto 用户信息 + * @param fileId 非必传,第一个分片文件不传 + * @param file 传的文件 + * @param fileName 文件名 + * @param filePid 在哪一个目录 + * @param fileMd5 前端做的 + * @param chunkIndex 第几个分片 + * @param chunks 总共有多少个分片 + */ + @Override + @Transactional + public UploadResultDto uploadFile(SessionWebUserDto webUserDto, String fileId, MultipartFile file, + String fileName, String filePid, String fileMd5, Integer chunkIndex, Integer chunks) { + + UploadResultDto uploadResultDto = new UploadResultDto(); + boolean uploadSuccess = true; + File tempFileFolder = null; + Date curDate = new Date(); + try { + if (StringTools.isEmpty(fileId)) { + fileId = StringTools.getRandomString(Constants.LENGTH_10); + } + uploadResultDto.setFileId(fileId); + + // 获取用户可用空间 + String userId = webUserDto.getUserId(); + UserSpaceDto userSpaceDto = redisComponent.getUserSpaceUse(userId); + // 第一个文件,判断是否可秒传 + if (chunkIndex == 0) { + // 封装查询条件 + FileInfoQuery fileInfoQuery = new FileInfoQuery(); + // 文件MD5值 + fileInfoQuery.setFileMd5(fileMd5); + // 只取第一条 + fileInfoQuery.setSimplePage(new SimplePage(0, 1)); + // 转码成功,使用中 + fileInfoQuery.setStatus(FileStatusEnums.USING.getStatus()); + // 查询 + List dbFileList = fileInfoMapper.selectList(fileInfoQuery); + if (!dbFileList.isEmpty()) { + // 数据库中找到,可秒传 + FileInfo dbFile = dbFileList.get(0); + // 判断文件大小 + if (dbFile.getFileSize() + userSpaceDto.getUseSpace() > userSpaceDto.getTotalSpace()) { + // 空间不足 + throw new BusinessException(ResponseCodeEnum.CODE_904); + } + + dbFile.setFileId(fileId); + dbFile.setFilePid(filePid); + dbFile.setUserId(userId); + dbFile.setCreateTime(curDate); + dbFile.setLastUpdateTime(curDate); + dbFile.setStatus(FileStatusEnums.USING.getStatus()); + dbFile.setDelFlag(FileDelFlagEnums.USING.getFlag()); + dbFile.setFileMd5(fileMd5); + // 文件自动重命名 + fileName = autoRename(filePid, userId, fileName); + dbFile.setFileName(fileName); + // 更新数据库中的文件信息 + fileInfoMapper.insert(dbFile); + + uploadResultDto.setStatus(UploadStatusEnums.UPLOAD_SECONDS.getCode()); + // 更新用户使用空间 + updateUserSpace(webUserDto, dbFile.getFileSize()); + return uploadResultDto; + } + } + + // 判断磁盘空间(分片 + 临时 + 已使用 > 总 ? 抛异常 : 继续) + Long currentTempSize = redisComponent.getFileTempSize(userId, fileId); + if (file.getSize() + currentTempSize + userSpaceDto.getUseSpace() > + userSpaceDto.getTotalSpace()) { + //空间不足 + throw new BusinessException(ResponseCodeEnum.CODE_904); + } + + // 暂存临时目录 e:/webser/web_app/easypan/temp/ + String tempFolderName = appConfig.getProjectFolder() + Constants.FILE_FOLDER_TEMP; + // userId + fileId + String currentUserFolderName = webUserDto.getUserId() + fileId; + + // e:/webser/web_app/easypan/temp/{userId}/{fileId} + tempFileFolder = new File(tempFolderName + "/" + currentUserFolderName); + if (!tempFileFolder.exists()) { + tempFileFolder.mkdirs(); + } + + File newFile = new File(tempFileFolder.getPath() + "/" + chunkIndex); + file.transferTo(newFile); + + redisComponent.saveFileTempSize(userId, fileId, file.getSize()); + if (chunkIndex < chunks - 1) { + uploadResultDto.setStatus(UploadStatusEnums.UPLOADING.getCode()); + return uploadResultDto; + } + + // 如果是最后一个分片,上传完成,记录数据库,异步合并分片 + String month = DateUtil.format(new Date(), DateTimePatternEnum.YYYYMM.getPattern()); + String fileSuffix = StringTools.getFileSuffix(fileName); + // 真实文件名 + // userId + fileId.fileSuffix + String realFileName = currentUserFolderName + fileSuffix; + // 根据后缀从枚举类中获取文件类别 + FileTypeEnums fileTypeEnums = FileTypeEnums.getFileTypeBySuffix(fileSuffix); + + //自动重命名 + fileName = autoRename(filePid, userId, fileName); + FileInfo fileInfo = new FileInfo(); + fileInfo.setFileId(fileId); + fileInfo.setUserId(userId); + fileInfo.setFileMd5(fileMd5); + fileInfo.setFileName(fileName); + fileInfo.setFilePath(month + "/" + realFileName); + fileInfo.setFilePid(filePid); + fileInfo.setCreateTime(curDate); + fileInfo.setLastUpdateTime(curDate); + fileInfo.setFileCategory(fileTypeEnums.getCategory().getCategory()); + fileInfo.setFileType(fileTypeEnums.getType()); + fileInfo.setStatus(FileStatusEnums.TRANSFER.getStatus()); + fileInfo.setFolderType(FileFolderTypeEnums.FILE.getType()); + fileInfo.setDelFlag(FileDelFlagEnums.USING.getFlag()); + this.fileInfoMapper.insert(fileInfo); + + Long totalSize = redisComponent.getFileTempSize(webUserDto.getUserId(), fileId); + updateUserSpace(webUserDto, totalSize); + + uploadResultDto.setStatus(UploadStatusEnums.UPLOAD_FINISH.getCode()); + + // 事务提交后执行 + TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() { + @Override + public void afterCommit() { + fileInfoService.transferFile(fileInfo.getFileId(), webUserDto); + redisComponent.removeFileTempSize(userId, fileInfo.getFileId()); + } + }); + + } catch (BusinessException e) { + log.error("文件上传失败"); + uploadSuccess = false; + throw e; + } catch (Exception e) { + log.error("文件上传失败"); + uploadSuccess = false; + } finally { + //如果上传失败,清除临时目录 + if (tempFileFolder != null && !uploadSuccess) { + try { + FileUtils.deleteDirectory(tempFileFolder); + } catch (IOException e) { + log.error("删除临时目录失败"); + } + } + } + return uploadResultDto; + + } + + // 转码 + @Async + public void transferFile(String fileId, SessionWebUserDto webUserDto) { + boolean transferSuccess = true; + String targetFilePath = null; + String cover = null; + FileTypeEnums fileTypeEnum = null; + FileInfo fileInfo = fileInfoMapper.selectByFileIdAndUserId(fileId, webUserDto.getUserId()); + try { + if (fileInfo == null || !FileStatusEnums.TRANSFER.getStatus().equals(fileInfo.getStatus())) { + return; + } + //临时目录 + String tempFolderName = appConfig.getProjectFolder() + Constants.FILE_FOLDER_TEMP; + String currentUserFolderName = webUserDto.getUserId() + fileId; + File fileFolder = new File(tempFolderName + "/" + currentUserFolderName); + if (!fileFolder.exists()) { + fileFolder.mkdirs(); + } + //文件后缀 + String fileSuffix = StringTools.getFileSuffix(fileInfo.getFileName()); + String month = DateUtil.format(fileInfo.getCreateTime(), DateTimePatternEnum.YYYYMM.getPattern()); + //目标目录 e:/webser/web_app/easypan + /file + /{month} + String targetFolderName = appConfig.getProjectFolder() + Constants.FILE_FOLDER_FILE; + File targetFolder = new File(targetFolderName + "/" + month); + if (!targetFolder.exists()) { + targetFolder.mkdirs(); + } + //真实文件名 {userId+fileId} + String realFileName = currentUserFolderName + fileSuffix; + //真实文件路径 + targetFilePath = targetFolder.getPath() + "/" + realFileName; + //合并文件 + /** + * fileFolder.getPath() 临时目录 + * targetFilePath 目标目录 + * fileInfo.getFileName() 文件名 + * delSource + */ + union(fileFolder.getPath(), targetFilePath, fileInfo.getFileName(), true); + fileTypeEnum = FileTypeEnums.getFileTypeBySuffix(fileSuffix); + if (FileTypeEnums.VIDEO == fileTypeEnum) { + //视频文件切割 + cutFile4Video(fileId, targetFilePath); + //视频生成缩略图 + cover = month + "/" + currentUserFolderName + Constants.IMAGE_PNG_SUFFIX; + String coverPath = targetFolderName + "/" + cover; + ScaleFilter.createCover4Video(new File(targetFilePath), Constants.LENGTH_150, new File(coverPath)); + } else if (FileTypeEnums.IMAGE == fileTypeEnum) { + //生成缩略图 + cover = month + "/" + realFileName.replace(".", "_."); + String coverPath = targetFolderName + "/" + cover; + Boolean created = ScaleFilter.createThumbnailWidthFFmpeg(new File(targetFilePath), Constants.LENGTH_150, new File(coverPath), false); + // 如果没有生成缩略图,直接将原图复制当做缩略图 + if (!created) { + FileUtils.copyFile(new File(targetFilePath), new File(coverPath)); + } + } + } catch (Exception e) { + log.error("文件转码失败,文件Id:{},userId:{}", fileId, webUserDto.getUserId(), e); + transferSuccess = false; + } finally { + FileInfo updateInfo = new FileInfo(); + updateInfo.setFileSize(new File(targetFilePath).length()); + updateInfo.setFileCover(cover); + updateInfo.setStatus(transferSuccess ? FileStatusEnums.USING.getStatus() : FileStatusEnums.TRANSFER_FAIL.getStatus()); + fileInfoMapper.updateFileStatusWithOldStatus(fileId, webUserDto.getUserId(), updateInfo, FileStatusEnums.TRANSFER.getStatus()); + } + } + + public static void union(String dirPath, String toFilePath, String fileName, boolean delSource) + throws BusinessException { + // 目录不存在,直接抛异常 + File dir = new File(dirPath); + if (!dir.exists()) { + throw new BusinessException("目录不存在"); + } + // 取出temp目录下的所有文件 + File[] fileList = dir.listFiles(); + File targetFile = new File(toFilePath); + // RandomAccessFile支持"随机访问"的方式,程序可以直接跳转到文件的任意地方来读写数据。 + RandomAccessFile writeFile = null; + try { + // 目标目录 + writeFile = new RandomAccessFile(targetFile, "rw"); + byte[] b = new byte[1024 * 10]; + for (int i = 0; i < fileList.length; i++) { + int len = -1; + //创建读块文件的对象,分别取出 0, 1, 2 ... + File chunkFile = new File(dirPath + File.separator + i); + RandomAccessFile readFile = null; + try { + readFile = new RandomAccessFile(chunkFile, "r"); + while ((len = readFile.read(b)) != -1) { + writeFile.write(b, 0, len); + } + } catch (Exception e) { + log.error("合并分片失败", e); + throw new BusinessException("合并文件失败"); + } finally { + if (readFile != null) { + readFile.close(); + } + } + } + } catch (Exception e) { + log.error("合并文件:{}失败", fileName, e); + throw new BusinessException("合并文件" + fileName + "出错了"); + } finally { + try { + if (writeFile != null) { + writeFile.close(); + } + } catch (IOException e) { + log.error("关闭流失败", e); + } + if (delSource) { + if (dir.exists()) { + try { + // 以递归方式删除目录。 + FileUtils.deleteDirectory(dir); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + } + + + // 利用java代码操作命令行窗口执行FFmpeg对视频进行切割,生成.m3u8索引文件和.ts切片文件 + + private void cutFile4Video(String fileId, String videoFilePath) { + //创建同名切片目录 + File tsFolder = new File(videoFilePath.substring(0, videoFilePath.lastIndexOf("."))); + if (!tsFolder.exists()) { + tsFolder.mkdirs(); + } + final String CMD_TRANSFER_2TS = "ffmpeg -y -i %s -vcodec copy -acodec copy -vbsf h264_mp4toannexb %s"; + final String CMD_CUT_TS = "ffmpeg -i %s -c copy -map 0 -f segment -segment_list %s -segment_time 30 %s/%s_%%4d.ts"; + + String tsPath = tsFolder + "/" + Constants.TS_NAME; + //生成index.ts + String cmd = String.format(CMD_TRANSFER_2TS, videoFilePath, tsPath); + ProcessUtils.executeCommand(cmd, false); + //生成索引文件.m3u8 和切片.ts + cmd = String.format(CMD_CUT_TS, tsPath, tsFolder.getPath() + "/" + Constants.M3U8_NAME, tsFolder.getPath(), fileId); + ProcessUtils.executeCommand(cmd, false); + //删除index.ts + new File(tsPath).delete(); + } + + private void updateUserSpace(SessionWebUserDto webUserDto, Long useSpace) { + Integer count = userInfoMapper.updateUserSpace(webUserDto.getUserId(), + useSpace, null); + // 更新失败,使用空间超过总空间 + if (count == 0) { + throw new BusinessException(ResponseCodeEnum.CODE_904); + } + // 更新成功,同时更新redis中的缓存 + String userId = webUserDto.getUserId(); + UserSpaceDto spaceDto = redisComponent.getUserSpaceUse(userId); + spaceDto.setUseSpace(spaceDto.getUseSpace() + useSpace); + redisComponent.saveUserSpaceUse(userId, spaceDto); + + } + + private String autoRename(String filePid, String userId, String fileName) { + // 封装查询条件,如果查询出数据,则需要重命名 + FileInfoQuery fileInfoQuery = new FileInfoQuery(); + fileInfoQuery.setUserId(userId); + fileInfoQuery.setFilePid(filePid); + fileInfoQuery.setDelFlag(FileDelFlagEnums.USING.getFlag()); + fileInfoQuery.setFileName(fileName); + Integer count = this.fileInfoMapper.selectCount(fileInfoQuery); + if (count > 0) { + return StringTools.rename(fileName); + } + + return fileName; + } + + +} \ No newline at end of file diff --git a/easypan-java/src/main/java/com/easypan/service/impl/FileShareServiceImpl.java b/easypan-java/src/main/java/com/easypan/service/impl/FileShareServiceImpl.java new file mode 100644 index 0000000..d97c239 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/service/impl/FileShareServiceImpl.java @@ -0,0 +1,170 @@ +package com.easypan.service.impl; + +import com.easypan.entity.constants.Constants; +import com.easypan.entity.dto.SessionShareDto; +import com.easypan.entity.enums.PageSize; +import com.easypan.entity.enums.ResponseCodeEnum; +import com.easypan.entity.enums.ShareValidTypeEnums; +import com.easypan.entity.po.FileShare; +import com.easypan.entity.query.FileShareQuery; +import com.easypan.entity.query.SimplePage; +import com.easypan.entity.vo.PaginationResultVO; +import com.easypan.exception.BusinessException; +import com.easypan.mappers.FileShareMapper; +import com.easypan.service.FileShareService; +import com.easypan.utils.DateUtil; +import com.easypan.utils.StringTools; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + + +/** + * 分享信息 业务接口实现 + */ +@Service("fileShareService") +public class FileShareServiceImpl implements FileShareService { + + @Resource + private FileShareMapper fileShareMapper; + + /** + * 根据条件查询列表 + */ + @Override + public List findListByParam(FileShareQuery param) { + return this.fileShareMapper.selectList(param); + } + + /** + * 根据条件查询列表 + */ + @Override + public Integer findCountByParam(FileShareQuery param) { + return this.fileShareMapper.selectCount(param); + } + + /** + * 分页查询方法 + */ + @Override + public PaginationResultVO findListByPage(FileShareQuery param) { + int count = this.findCountByParam(param); + int pageSize = param.getPageSize() == null ? PageSize.SIZE15.getSize() : param.getPageSize(); + + SimplePage page = new SimplePage(param.getPageNo(), count, pageSize); + param.setSimplePage(page); + List list = this.findListByParam(param); + PaginationResultVO result = new PaginationResultVO(count, page.getPageSize(), page.getPageNo(), page.getPageTotal(), list); + return result; + } + + /** + * 新增 + */ + @Override + public Integer add(FileShare bean) { + return this.fileShareMapper.insert(bean); + } + + /** + * 批量新增 + */ + @Override + public Integer addBatch(List listBean) { + if (listBean == null || listBean.isEmpty()) { + return 0; + } + return this.fileShareMapper.insertBatch(listBean); + } + + /** + * 批量新增或者修改 + */ + @Override + public Integer addOrUpdateBatch(List listBean) { + if (listBean == null || listBean.isEmpty()) { + return 0; + } + return this.fileShareMapper.insertOrUpdateBatch(listBean); + } + + /** + * 根据ShareId获取对象 + */ + @Override + public FileShare getFileShareByShareId(String shareId) { + return this.fileShareMapper.selectByShareId(shareId); + } + + /** + * 根据ShareId修改 + */ + @Override + public Integer updateFileShareByShareId(FileShare bean, String shareId) { + return this.fileShareMapper.updateByShareId(bean, shareId); + } + + /** + * 根据ShareId删除 + */ + @Override + public Integer deleteFileShareByShareId(String shareId) { + return this.fileShareMapper.deleteByShareId(shareId); + } + + + @Override + @Transactional + public void deleteFileShareBatch(String[] shareIdArray, String userId) { + Integer count = fileShareMapper.deleteFileShareBatch(shareIdArray, userId); + if (count != shareIdArray.length) { + throw new BusinessException(ResponseCodeEnum.CODE_600); + } + } + + @Override + public void saveShare(FileShare share) { + ShareValidTypeEnums typeEnum = ShareValidTypeEnums.getByType(share.getValidType()); + if (null == typeEnum) { + throw new BusinessException(ResponseCodeEnum.CODE_600); + } + // 设置过期时间 + if (typeEnum != ShareValidTypeEnums.FOREVER) { + share.setExpireTime(DateUtil.getAfterDate(typeEnum.getDays())); + } + Date curDate = new Date(); + // 设置分享时间 + share.setShareTime(curDate); + if (StringTools.isEmpty(share.getCode())) { + share.setCode(StringTools.getRandomString(Constants.LENGTH_5)); + } + share.setShareId(StringTools.getRandomString(Constants.LENGTH_20)); + this.fileShareMapper.insert(share); + } + + @Override + public SessionShareDto checkShareCode(String shareId, String code) { + FileShare share = this.fileShareMapper.selectByShareId(shareId); + if (null == share || (share.getExpireTime() != null && new Date().after(share.getExpireTime()))) { + throw new BusinessException(ResponseCodeEnum.CODE_902); + } + if (!share.getCode().equals(code)) { + throw new BusinessException("提取码错误"); + } + + //更新浏览次数 + this.fileShareMapper.updateShareShowCount(shareId); + + SessionShareDto shareSessionDto = new SessionShareDto(); + shareSessionDto.setShareId(shareId); + shareSessionDto.setShareUserId(share.getUserId()); + shareSessionDto.setFileId(share.getFileId()); + shareSessionDto.setExpireTime(share.getExpireTime()); + return shareSessionDto; + } + +} \ No newline at end of file diff --git a/easypan-java/src/main/java/com/easypan/service/impl/UserInfoServiceImpl.java b/easypan-java/src/main/java/com/easypan/service/impl/UserInfoServiceImpl.java new file mode 100644 index 0000000..7fcac7e --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/service/impl/UserInfoServiceImpl.java @@ -0,0 +1,202 @@ +package com.easypan.service.impl; + + +import com.easypan.utils.RedisComponent; +import com.easypan.config.AppConfig; +import com.easypan.entity.constants.Constants; +import com.easypan.entity.dto.SessionWebUserDto; +import com.easypan.entity.dto.SysSettingsDto; +import com.easypan.entity.dto.UserSpaceDto; +import com.easypan.entity.enums.PageSize; +import com.easypan.entity.enums.UserStatusEnum; +import com.easypan.entity.po.FileInfo; +import com.easypan.entity.po.UserInfo; +import com.easypan.entity.query.FileInfoQuery; +import com.easypan.entity.query.SimplePage; +import com.easypan.entity.query.UserInfoQuery; +import com.easypan.entity.vo.PaginationResultVO; +import com.easypan.exception.BusinessException; +import com.easypan.mappers.FileInfoMapper; +import com.easypan.mappers.UserInfoMapper; +import com.easypan.service.EmailCodeService; +import com.easypan.service.FileInfoService; +import com.easypan.service.UserInfoService; +import com.easypan.utils.StringTools; +import org.apache.commons.lang3.ArrayUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + + +/** + * 用户信息 业务接口实现 + */ +@Service +public class UserInfoServiceImpl implements UserInfoService { + + @Resource + private UserInfoMapper userInfoMapper; + + @Resource + private EmailCodeService emailCodeService; + + @Resource + private FileInfoMapper fileInfoMapper; + + @Resource + private RedisComponent redisComponent; + + @Resource + private AppConfig appConfig; + + @Resource + private FileInfoService fileInfoService; + + // 注册 + @Override + @Transactional + public void register(String email, String nickName, String password, String emailCode) { + UserInfo userInfo = this.userInfoMapper.selectByEmail(email); + if (null != userInfo) { + throw new BusinessException("邮箱账号已经存在"); + } + UserInfo nickNameUser = this.userInfoMapper.selectByNickName(nickName); + if (null != nickNameUser) { + throw new BusinessException("昵称已经存在"); + } + //校验邮箱验证码 + emailCodeService.checkCode(email, emailCode); + // 获取随机id + String userId = StringTools.getRandomNumber(Constants.LENGTH_10); + // 根据输入的信息封装UserInfo对象 + userInfo = new UserInfo(); + + userInfo.setUserId(userId); + userInfo.setNickName(nickName); + userInfo.setEmail(email); + userInfo.setPassword(StringTools.encodeByMD5(password)); + userInfo.setJoinTime(new Date()); + + userInfo.setStatus(UserStatusEnum.ENABLE.getStatus()); + // 从redis中取出系统设置 + SysSettingsDto sysSettingsDto = redisComponent.getSysSettingsDto(); + // 用户空间 + userInfo.setTotalSpace(sysSettingsDto.getUserInitUseSpace() * Constants.MB); + userInfo.setUseSpace(fileInfoMapper.selectUseSpace(userId)); + this.userInfoMapper.insert(userInfo); + } + + @Override + public SessionWebUserDto login(String email, String password) { + UserInfo userInfo = userInfoMapper.selectByEmail(email); + if (userInfo == null || !userInfo.getPassword().equals(password)) { + throw new BusinessException("账号或者密码错误"); + } + // 如果账户被禁用 + if (UserStatusEnum.DISABLE.getStatus().equals(userInfo.getStatus())) { + throw new BusinessException("账号已禁用"); + } + + UserInfo updateInfo = new UserInfo(); + updateInfo.setLastLoginTime(new Date()); + // 根据id更新用户最后一次操作时间 + String userId = userInfo.getUserId(); + userInfoMapper.updateByUserId(updateInfo, userId); + + SessionWebUserDto sessionWebUserDto = new SessionWebUserDto(); + sessionWebUserDto.setNickName(userInfo.getNickName()); + sessionWebUserDto.setUserId(userId); + if (ArrayUtils.contains(appConfig.getAdminEmails().split(","), email)) { + sessionWebUserDto.setIsAdmin(true); + } else { + sessionWebUserDto.setIsAdmin(false); + } + // 用户空间 + UserSpaceDto userSpaceDto = new UserSpaceDto(); + userSpaceDto.setUseSpace(fileInfoMapper.selectUseSpace(userId)); + userSpaceDto.setTotalSpace(userInfo.getTotalSpace()); + redisComponent.saveUserSpaceUse(userId, userSpaceDto); + return sessionWebUserDto; + + } + + @Override + @Transactional + public void resetPwd(String email, String password, String emailCode) { + // 判断邮箱账号是否存在 + UserInfo userInfo = userInfoMapper.selectByEmail(email); + if (userInfo == null) { + throw new BusinessException("邮箱账号不存在"); + } + + // 判断邮箱验证码是否正确 + emailCodeService.checkCode(email, emailCode); + + // 邮箱验证码正确可重置密码 + UserInfo updateInfo = new UserInfo(); + updateInfo.setPassword(StringTools.encodeByMD5(password)); + userInfoMapper.updateByEmail(updateInfo, email);; + + } + + @Override + public void updateUserInfoByUserId(UserInfo bean, String userId) { + userInfoMapper.updateByUserId(bean, userId); + } + + @Override + public UserInfo getUserInfoByUserId(String userId) { + return this.userInfoMapper.selectByUserId(userId); + } + + @Override + public PaginationResultVO findListByPage(UserInfoQuery param) { + int count = this.findCountByParam(param); + int pageSize = param.getPageSize() == null ? PageSize.SIZE15.getSize() : param.getPageSize(); + + SimplePage page = new SimplePage(param.getPageNo(), count, pageSize); + param.setSimplePage(page); + List list = this.findListByParam(param); + PaginationResultVO result = new PaginationResultVO(count, page.getPageSize(), page.getPageNo(), page.getPageTotal(), list); + return result; + } + + @Override + public Integer findCountByParam(UserInfoQuery param) { + return this.userInfoMapper.selectCount(param); + } + + @Override + public List findListByParam(UserInfoQuery param) { + return this.userInfoMapper.selectList(param); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateUserStatus(String userId, Integer status) { + UserInfo userInfo = new UserInfo(); + userInfo.setStatus(status); + String email = userInfoMapper.selectByUserId(userId).getEmail(); + + if (ArrayUtils.contains(appConfig.getAdminEmails().split(","), email)) { + throw new BusinessException("不可更改管理员状态"); + } + if (UserStatusEnum.DISABLE.getStatus().equals(status)) { + userInfo.setUseSpace(0L); + fileInfoService.deleteFileByUserId(userId); + } + userInfoMapper.updateByUserId(userInfo, userId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void changeUserSpace(String userId, Integer changeSpace) { + Long space = changeSpace * Constants.MB; + this.userInfoMapper.updateUserSpace(userId, null, space); + redisComponent.resetUserSpaceUse(userId); + } + +} \ No newline at end of file diff --git a/easypan-java/src/main/java/com/easypan/task/FileCleanTask.java b/easypan-java/src/main/java/com/easypan/task/FileCleanTask.java new file mode 100644 index 0000000..620140c --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/task/FileCleanTask.java @@ -0,0 +1,42 @@ +package com.easypan.task; + +import com.easypan.entity.enums.FileDelFlagEnums; +import com.easypan.entity.po.FileInfo; +import com.easypan.entity.query.FileInfoQuery; +import com.easypan.service.FileInfoService; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * + */ + +@Component +public class FileCleanTask { + + @Resource + private FileInfoService fileInfoService; + + @Scheduled(fixedDelay = 1000 * 60 * 3) + public void execute() { + FileInfoQuery fileInfoQuery = new FileInfoQuery(); + fileInfoQuery.setDelFlag(FileDelFlagEnums.RECYCLE.getFlag()); + fileInfoQuery.setQueryExpire(true); + List fileInfoList = fileInfoService.findListByParam(fileInfoQuery); + // 根据用户id进行分组 + Map> fileInfoMap = fileInfoList.stream() + .collect(Collectors.groupingBy(FileInfo::getUserId)); + + for (Map.Entry> entry : fileInfoMap.entrySet()) { + + List fileIds = entry.getValue().stream(). + map(FileInfo::getFileId).collect(Collectors.toList()); + fileInfoService.delFileBatch(entry.getKey(), String.join(",", fileIds), false); + } + } +} diff --git a/easypan-java/src/main/java/com/easypan/utils/CopyTools.java b/easypan-java/src/main/java/com/easypan/utils/CopyTools.java new file mode 100644 index 0000000..5c221ea --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/utils/CopyTools.java @@ -0,0 +1,48 @@ +package com.easypan.utils; + +import org.springframework.beans.BeanUtils; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * 利用spring提供的BeenUtils工具类实现集合元素映射以及单个对象映射 + */ +public class CopyTools { + public static List copyList(List list, Class clazz) { + return list.stream().map(s -> { + T t = null; + try { + t = clazz.newInstance(); + } catch (Exception e) { + throw new RuntimeException(e); + } + BeanUtils.copyProperties(s, t); + return t; + }).collect(Collectors.toList()); + /*List list = new ArrayList(); + for (S s : sList) { + T t = null; + try { + t = clazz.newInstance(); + } catch (Exception e) { + e.printStackTrace(); + } + BeanUtils.copyProperties(s, t); + list.add(t); + } + return list; + */ + } + + public static T copy(S s, Class clazz) { + T t = null; + try { + t = clazz.newInstance(); + } catch (Exception e) { + e.printStackTrace(); + } + BeanUtils.copyProperties(s, t); + return t; + } +} diff --git a/easypan-java/src/main/java/com/easypan/utils/DateUtil.java b/easypan-java/src/main/java/com/easypan/utils/DateUtil.java new file mode 100644 index 0000000..de6f027 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/utils/DateUtil.java @@ -0,0 +1,60 @@ +package com.easypan.utils; + + +import com.easypan.entity.enums.DateTimePatternEnum; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +public class DateUtil { + + private static final Object lockObj = new Object(); + private static Map> sdfMap = new HashMap>(); + + private static SimpleDateFormat getSdf(final String pattern) { + ThreadLocal tl = sdfMap.get(pattern); + if (tl == null) { + synchronized (lockObj) { + tl = sdfMap.get(pattern); + if (tl == null) { + tl = new ThreadLocal() { + @Override + protected SimpleDateFormat initialValue() { + return new SimpleDateFormat(pattern); + } + }; + sdfMap.put(pattern, tl); + } + } + } + + return tl.get(); + } + + public static String format(Date date, String pattern) { + return getSdf(pattern).format(date); + } + + public static Date parse(String dateStr, String pattern) { + try { + return getSdf(pattern).parse(dateStr); + } catch (ParseException e) { + e.printStackTrace(); + } + return new Date(); + } + + public static Date getAfterDate(Integer day) { + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.DAY_OF_YEAR, day); + return calendar.getTime(); + } + + public static void main(String[] args) { + System.out.println(format(getAfterDate(1), DateTimePatternEnum.YYYY_MM_DD_HH_MM_SS.getPattern())); + } +} diff --git a/easypan-java/src/main/java/com/easypan/utils/ProcessUtils.java b/easypan-java/src/main/java/com/easypan/utils/ProcessUtils.java new file mode 100644 index 0000000..46e151b --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/utils/ProcessUtils.java @@ -0,0 +1,112 @@ +package com.easypan.utils; + +import com.easypan.exception.BusinessException; +import lombok.extern.slf4j.Slf4j; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; + +//java执行cmd命令 +@Slf4j +public class ProcessUtils { + + public static String executeCommand(String cmd, Boolean outprintLog) throws BusinessException { + if (StringTools.isEmpty(cmd)) { + log.error("--- 指令执行失败,因为要执行的FFmpeg指令为空! ---"); + return null; + } + + Runtime runtime = Runtime.getRuntime(); + Process process = null; + try { + process = Runtime.getRuntime().exec(cmd); + // 执行ffmpeg指令 + // 取出输出流和错误流的信息 + // 注意:必须要取出ffmpeg在执行命令过程中产生的输出信息,如果不取的话当输出流信息填满jvm存储输出留信息的缓冲区时,线程就回阻塞住 + PrintStream errorStream = new PrintStream(process.getErrorStream()); + PrintStream inputStream = new PrintStream(process.getInputStream()); + errorStream.start(); + inputStream.start(); + // 等待ffmpeg命令执行完 + process.waitFor(); + // 获取执行结果字符串 + String result = errorStream.stringBuffer.append(inputStream.stringBuffer + "\n").toString(); + // 输出执行的命令信息 + + if (outprintLog) { + log.info("执行命令:{},已执行完毕,执行结果:{}", cmd, result); + } else { + log.info("执行命令:{},已执行完毕", cmd); + } + return result; + } catch (Exception e) { + // logger.error("执行命令失败:{} ", e.getMessage()); + e.printStackTrace(); + throw new BusinessException("视频转换失败"); + } finally { + if (null != process) { + ProcessKiller ffmpegKiller = new ProcessKiller(process); + runtime.addShutdownHook(ffmpegKiller); + } + } + } + + /** + * 在程序退出前结束已有的FFmpeg进程 + */ + private static class ProcessKiller extends Thread { + private Process process; + + public ProcessKiller(Process process) { + this.process = process; + } + + @Override + public void run() { + this.process.destroy(); + } + } + + + /** + * 用于取出ffmpeg线程执行过程中产生的各种输出和错误流的信息 + */ + static class PrintStream extends Thread { + InputStream inputStream = null; + BufferedReader bufferedReader = null; + StringBuffer stringBuffer = new StringBuffer(); + + public PrintStream(InputStream inputStream) { + this.inputStream = inputStream; + } + + @Override + public void run() { + try { + if (null == inputStream) { + return; + } + bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); + String line = null; + while ((line = bufferedReader.readLine()) != null) { + stringBuffer.append(line); + } + } catch (Exception e) { + log.error("读取输入流出错了!错误信息:" + e.getMessage()); + } finally { + try { + if (null != bufferedReader) { + bufferedReader.close(); + } + if (null != inputStream) { + inputStream.close(); + } + } catch (IOException e) { + log.error("调用PrintStream读取输出流后,关闭流时出错!"); + } + } + } + } +} diff --git a/easypan-java/src/main/java/com/easypan/utils/RedisComponent.java b/easypan-java/src/main/java/com/easypan/utils/RedisComponent.java new file mode 100644 index 0000000..07b919b --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/utils/RedisComponent.java @@ -0,0 +1,123 @@ +package com.easypan.utils; + +import com.easypan.entity.constants.Constants; +import com.easypan.entity.dto.DownloadFileDto; +import com.easypan.entity.dto.SysSettingsDto; +import com.easypan.entity.dto.UserSpaceDto; +import com.easypan.entity.po.FileInfo; +import com.easypan.entity.po.UserInfo; +import com.easypan.entity.query.FileInfoQuery; +import com.easypan.entity.query.UserInfoQuery; +import com.easypan.mappers.FileInfoMapper; +import com.easypan.mappers.UserInfoMapper; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; + +@Component +public class RedisComponent { + + @Resource + private RedisUtils redisUtils; + + @Resource + private FileInfoMapper fileInfoMapper; + + @Resource + private UserInfoMapper userInfoMapper; + + /** + * 获取系统设置 + * 如果不存在就新建 + */ + public SysSettingsDto getSysSettingsDto() { + SysSettingsDto sysSettingsDto = (SysSettingsDto) redisUtils.get(Constants.REDIS_KEY_SYS_SETTING); + if (sysSettingsDto == null) { + sysSettingsDto = new SysSettingsDto(); + saveSysSettingsDto(sysSettingsDto); + } + return sysSettingsDto; + } + + /** + * 保存设置 + * + * @param sysSettingsDto + */ + public void saveSysSettingsDto(SysSettingsDto sysSettingsDto) { + redisUtils.set(Constants.REDIS_KEY_SYS_SETTING, sysSettingsDto); + } + + /** + * 保存已使用的空间 + * + * @param userId + */ + public void saveUserSpaceUse(String userId, UserSpaceDto userSpaceDto) { + redisUtils.setex(Constants.REDIS_KEY_USER_SPACE_USE + userId, + userSpaceDto, Constants.REDIS_KEY_EXPIRES_DAY); + } + + /** + * 获取用户使用的空间 + */ + public UserSpaceDto getUserSpaceUse(String userId) { + UserSpaceDto spaceDto = (UserSpaceDto) redisUtils.get(Constants.REDIS_KEY_USER_SPACE_USE + userId); + if (null == spaceDto) { + spaceDto = new UserSpaceDto(); + Long useSpace = this.fileInfoMapper.selectUseSpace(userId); + spaceDto.setUseSpace(useSpace); + spaceDto.setTotalSpace(getSysSettingsDto().getUserInitUseSpace() * Constants.MB); + redisUtils.setex(Constants.REDIS_KEY_USER_SPACE_USE + userId, spaceDto, Constants.REDIS_KEY_EXPIRES_DAY); + } + return spaceDto; + } + + //保存文件临时大小 + public void saveFileTempSize(String userId, String fileId, Long fileSize) { + Long currentSize = getFileTempSize(userId, fileId); + redisUtils.setex(Constants.REDIS_KEY_USER_FILE_TEMP_SIZE + userId + fileId, + currentSize + fileSize, Constants.REDIS_KEY_EXPIRES_ONE_HOUR); + } + + public void removeFileTempSize(String userId, String fileId) { + redisUtils.delete(Constants.REDIS_KEY_USER_FILE_TEMP_SIZE + userId + fileId); + } + + public Long getFileTempSize(String userId, String fileId) { +// Long currentSize = getFileSizeFromRedis(Constants.REDIS_KEY_USER_FILE_TEMP_SIZE + userId + fileId); +// return currentSize; + String key = Constants.REDIS_KEY_USER_FILE_TEMP_SIZE + userId + fileId; + Object sizeObj = redisUtils.get(key); + if (sizeObj == null) { + return 0L; + } + if (sizeObj instanceof Integer) { + return ((Integer) sizeObj).longValue(); + } else if (sizeObj instanceof Long) { + return (Long) sizeObj; + } + + return 0L; + + } + + public void saveDownloadCode(String code, DownloadFileDto downloadFileDto) { + redisUtils.setex(Constants.REDIS_KEY_DOWNLOAD + code, + downloadFileDto, Constants.REDIS_KEY_EXPIRES_FIVE_MIN); + } + + public DownloadFileDto getDownloadCode(String code) { + return (DownloadFileDto) redisUtils.get(Constants.REDIS_KEY_DOWNLOAD + code); + } + public UserSpaceDto resetUserSpaceUse(String userId) { + UserSpaceDto spaceDto = new UserSpaceDto(); + Long useSpace = this.fileInfoMapper.selectUseSpace(userId); + spaceDto.setUseSpace(useSpace); + + UserInfo userInfo = this.userInfoMapper.selectByUserId(userId); + spaceDto.setTotalSpace(userInfo.getTotalSpace()); + redisUtils.setex(Constants.REDIS_KEY_USER_SPACE_USE + userId, spaceDto, Constants.REDIS_KEY_EXPIRES_DAY); + return spaceDto; + } +} diff --git a/easypan-java/src/main/java/com/easypan/utils/RedisUtils.java b/easypan-java/src/main/java/com/easypan/utils/RedisUtils.java new file mode 100644 index 0000000..6a5b22f --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/utils/RedisUtils.java @@ -0,0 +1,79 @@ +package com.easypan.utils; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import java.util.Collection; +import java.util.concurrent.TimeUnit; + +@Component +public class RedisUtils { + + @Resource + private RedisTemplate redisTemplate; + + + private static final Logger logger = LoggerFactory.getLogger(RedisUtils.class); + + /** + * 删除缓存 + * + * @param key 可以传一个值 或多个 + */ + public void delete(String... key) { + if (key != null && key.length > 0) { + if (key.length == 1) { + redisTemplate.delete(key[0]); + } else { + redisTemplate.delete((Collection) CollectionUtils.arrayToList(key)); + } + } + } + + public V get(String key) { + return key == null ? null : redisTemplate.opsForValue().get(key); + } + + /** + * 普通缓存放入 + * + * @param key 键 + * @param value 值 + * @return true成功 false失败 + */ + public boolean set(String key, V value) { + try { + redisTemplate.opsForValue().set(key, value); + return true; + } catch (Exception e) { + logger.error("设置redisKey:{},value:{}失败", key, value); + return false; + } + } + + /** + * 普通缓存放入并设置时间 + * + * @param key 键 + * @param value 值 + * @param time 时间(秒) time要大于0 如果time小于等于0 将设置无限期 + * @return true成功 false 失败 + */ + public boolean setex(String key, V value, long time) { + try { + if (time > 0) { + redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS); + } else { + set(key, value); + } + return true; + } catch (Exception e) { + logger.error("设置redisKey:{},value:{}失败", key, value); + return false; + } + } +} diff --git a/easypan-java/src/main/java/com/easypan/utils/ScaleFilter.java b/easypan-java/src/main/java/com/easypan/utils/ScaleFilter.java new file mode 100644 index 0000000..53ca1bd --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/utils/ScaleFilter.java @@ -0,0 +1,71 @@ +package com.easypan.utils; + +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.FileUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.File; +import java.math.BigDecimal; + +@Slf4j +public class ScaleFilter { + + + public static Boolean createThumbnailWidthFFmpeg(File file, int thumbnailWidth, File targetFile, Boolean delSource) { + try { + BufferedImage src = ImageIO.read(file); + //thumbnailWidth 缩略图的宽度 thumbnailHeight 缩略图的高度 + int sorceW = src.getWidth(); + int sorceH = src.getHeight(); + //小于 指定高宽不压缩 + if (sorceW <= thumbnailWidth) { + return false; + } + compressImage(file, thumbnailWidth, targetFile, delSource); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + return false; + } + + public static void compressImageWidthPercentage(File sourceFile, BigDecimal widthPercentage, File targetFile) { + try { + BigDecimal widthResult = widthPercentage.multiply(new BigDecimal(ImageIO.read(sourceFile).getWidth())); + compressImage(sourceFile, widthResult.intValue(), targetFile, true); + } catch (Exception e) { + log.error("压缩图片失败"); + } + } + + public static void createCover4Video(File sourceFile, Integer width, File targetFile) { + try { + String cmd = "ffmpeg -i %s -y -vframes 1 -vf scale=%d:%d/a %s"; + ProcessUtils.executeCommand(String.format(cmd, sourceFile.getAbsoluteFile(), width, width, targetFile.getAbsoluteFile()), false); + } catch (Exception e) { + log.error("生成视频封面失败", e); + } + } + + public static void compressImage(File sourceFile, Integer width, File targetFile, Boolean delSource) { + try { + String cmd = "ffmpeg -i %s -vf scale=%d:-1 %s -y"; + ProcessUtils.executeCommand(String.format(cmd, sourceFile.getAbsoluteFile(), width, targetFile.getAbsoluteFile()), false); + if (delSource) { + FileUtils.forceDelete(sourceFile); + } + } catch (Exception e) { + log.error("压缩图片失败"); + } + } + + public static void main(String[] args) { + compressImageWidthPercentage(new File("C:\\Users\\Administrator\\Pictures\\微信图片_20230107141436.png"), new BigDecimal(0.7), + new File("C:\\Users\\Administrator" + + "\\Pictures" + + "\\微信图片_202106281029182.jpg")); + } +} \ No newline at end of file diff --git a/easypan-java/src/main/java/com/easypan/utils/StringTools.java b/easypan-java/src/main/java/com/easypan/utils/StringTools.java new file mode 100644 index 0000000..89de555 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/utils/StringTools.java @@ -0,0 +1,88 @@ +package com.easypan.utils; + + +import com.easypan.entity.constants.Constants; +import org.apache.commons.codec.digest.DigestUtils; +import org.apache.commons.lang3.RandomStringUtils; + +public class StringTools { + + public static String encodeByMD5(String originString) { + return StringTools.isEmpty(originString) ? null : DigestUtils.md5Hex(originString); + } + + public static boolean isEmpty(String str) { + + if (null == str || "".equals(str) || "null".equals(str) || "\u0000".equals(str)) { + return true; + } else if ("".equals(str.trim())) { + return true; + } + return false; + } + + public static String getFileSuffix(String fileName) { + Integer index = fileName.lastIndexOf("."); + if (index == -1) { + return ""; + } + String suffix = fileName.substring(index); + return suffix; + } + + + public static String getFileNameNoSuffix(String fileName) { + Integer index = fileName.lastIndexOf("."); + if (index == -1) { + return fileName; + } + fileName = fileName.substring(0, index); + return fileName; + } + + public static String rename(String fileName) { + // 获取不加后缀的文件名 + String fileNameReal = getFileNameNoSuffix(fileName); + // 获取文件的后缀名 + String suffix = getFileSuffix(fileName); + return fileNameReal + "_" + getRandomString(Constants.LENGTH_5) + suffix; + } + + public static final String getRandomString(Integer count) { + return RandomStringUtils.random(count, true, true); + } + + public static final String getRandomNumber(Integer count) { + return RandomStringUtils.random(count, false, true); + } + + + public static String escapeTitle(String content) { + if (isEmpty(content)) { + return content; + } + content = content.replace("<", "<"); + return content; + } + + + public static String escapeHtml(String content) { + if (isEmpty(content)) { + return content; + } + content = content.replace("<", "<"); + content = content.replace(" ", " "); + content = content.replace("\n", "
"); + return content; + } + + public static boolean pathIsOk(String path) { + if (StringTools.isEmpty(path)) { + return true; + } + if (path.contains("../") || path.contains("..\\")) { + return false; + } + return true; + } +} diff --git a/easypan-java/src/main/java/com/easypan/utils/VerifyUtils.java b/easypan-java/src/main/java/com/easypan/utils/VerifyUtils.java new file mode 100644 index 0000000..393fbc5 --- /dev/null +++ b/easypan-java/src/main/java/com/easypan/utils/VerifyUtils.java @@ -0,0 +1,25 @@ +package com.easypan.utils; + + +import com.easypan.entity.enums.VerifyRegexEnum; + +import java.io.File; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class VerifyUtils { + + public static boolean verify(String regex, String value) { + if (StringTools.isEmpty(value)) { + return false; + } + Pattern pattern = Pattern.compile(regex); + Matcher matcher = pattern.matcher(value); + return matcher.matches(); + } + + public static boolean verify(VerifyRegexEnum regex, String value) { + return verify(regex.getRegex(), value); + } +} + diff --git a/easypan-java/src/main/resources/application.properties b/easypan-java/src/main/resources/application.properties new file mode 100644 index 0000000..0732c37 --- /dev/null +++ b/easypan-java/src/main/resources/application.properties @@ -0,0 +1,54 @@ +# 应用服务 WEB 访问端口 +server.port=7090 +server.servlet.context-path=/api +#session过期时间 60M 一个小时 +server.servlet.session.timeout=PT60M +#处理favicon +spring.mvc.favicon.enable=false + +#异常处理 +spring.mvc.throw-exception-if-no-handler-found=true +spring.web.resources.add-mappings=false + +#数据库配置 +spring.datasource.url=jdbc:mysql://localhost:3306/pan?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true +spring.datasource.username=root +spring.datasource.password=qgs123 +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.type=com.alibaba.druid.pool.DruidDataSource + +#发送邮件配置相关 +# 配置邮件服务器的地址 smtp.qq.com +spring.mail.host=smtp.qq.com +# 配置邮件服务器的端口(465或587) +spring.mail.port=465 +# 配置用户的账号 +spring.mail.username=2923503420@qq.com +# 配置用户的密码 +spring.mail.password=*************** +# 配置默认编码 +spring.mail.default-encoding=UTF-8 +# SSL 连接配置 +spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory +# 开启 debug +spring.mail.properties.mail.debug=true +#邮件配置结束 + +#设置单个文件的大小 +spring.servlet.multipart.max-file-size=10MB +#设置单次请求的文件的总大小 +spring.servlet.multipart.max-request-size=10MB + +#Spring redis配置 +# Redis数据库索引(默认为0,端口6379) +spring.redis.database=0 +spring.redis.host=127.0.0.1 +spring.redis.port=6379 +# 连接超时时间(毫秒) +spring.redis.timeout=3000 +#项目目录 +project.folder=D:/Temp +#日志级别配置 +log.root.level=info +#超级管理员id +admin.emails=1913324165@qq.com diff --git a/easypan-java/src/main/resources/com/easypan/mappers/EmailCodeMapper.xml b/easypan-java/src/main/resources/com/easypan/mappers/EmailCodeMapper.xml new file mode 100644 index 0000000..623a393 --- /dev/null +++ b/easypan-java/src/main/resources/com/easypan/mappers/EmailCodeMapper.xml @@ -0,0 +1,242 @@ + + + + + + + + + + + + + + + + + + + + email + ,code,create_time,status + + + + + and email = #{query.email} + + + and code = #{query.code} + + + + + + and status = #{query.status} + + + + + + + + + + + + + + + and email like concat('%', #{query.emailFuzzy}, '%') + + + and code like concat('%', #{query.codeFuzzy}, '%') + + + =str_to_date(#{query.createTimeStart}, '%Y-%m-%d') ]]> + + + + + + + + + + + + + + + + INSERT INTO email_code + + + email, + + + code, + + + create_time, + + + status, + + + + + #{bean.email}, + + + #{bean.code}, + + + #{bean.createTime}, + + + #{bean.status}, + + + + + + + INSERT INTO email_code + + + email, + + + code, + + + create_time, + + + status, + + + + + #{bean.email}, + + + #{bean.code}, + + + #{bean.createTime}, + + + #{bean.status}, + + + on DUPLICATE key update + + + email = VALUES(email), + + + code = VALUES(code), + + + create_time = VALUES(create_time), + + + status = VALUES(status), + + + + + + + INSERT INTO email_code( + email, + code, + create_time, + status + )values + + ( + #{item.email}, + #{item.code}, + #{item.createTime}, + #{item.status} + ) + + + + + + INSERT INTO email_code( + email, + code, + create_time, + status + )values + + ( + #{item.email}, + #{item.code}, + #{item.createTime}, + #{item.status} + ) + + on DUPLICATE key update + email = VALUES(email), + code = VALUES(code), + create_time = VALUES(create_time), + status = VALUES(status) + + + + + UPDATE email_code + + + create_time = #{bean.createTime}, + + + status = #{bean.status}, + + + where email=#{email} and code=#{code} + + + + + delete + from email_code + where email = #{email} + and code = #{code} + + + + + + + update email_code + set status = 1 + where email = #{email} + and status = 0 + + \ No newline at end of file diff --git a/easypan-java/src/main/resources/com/easypan/mappers/FileInfoMapper.xml b/easypan-java/src/main/resources/com/easypan/mappers/FileInfoMapper.xml new file mode 100644 index 0000000..f4bd618 --- /dev/null +++ b/easypan-java/src/main/resources/com/easypan/mappers/FileInfoMapper.xml @@ -0,0 +1,759 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + file_id + ,user_id,file_md5,file_pid,file_size, + file_name,file_cover,file_path,create_time,last_update_time, + folder_type,file_category,file_type,status,recovery_time, + del_flag + + + + + and file_id = #{query.fileId} + + + and user_id = #{query.userId} + + + and file_md5 = #{query.fileMd5} + + + and file_pid = #{query.filePid} + + + and file_size = #{query.fileSize} + + + and file_name = #{query.fileName} + + + and file_cover = #{query.fileCover} + + + and file_path = #{query.filePath} + + + + + + + + + and folder_type = #{query.folderType} + + + and file_category = #{query.fileCategory} + + + and file_type = #{query.fileType} + + + and status = #{query.status} + + + + + + and del_flag = #{query.delFlag} + + + and file_id in(#{item}) + + + and file_pid in(#{item}) + + + and file_id not in( + #{item}) + + + + + + + + + + + + + + + and file_id like concat('%', #{query.fileIdFuzzy}, '%') + + + and user_id like concat('%', #{query.userIdFuzzy}, '%') + + + and file_md5 like concat('%', #{query.fileMd5Fuzzy}, '%') + + + and file_pid like concat('%', #{query.filePidFuzzy}, '%') + + + and file_name like concat('%', #{query.fileNameFuzzy}, '%') + + + and file_cover like concat('%', #{query.fileCoverFuzzy}, '%') + + + and file_path like concat('%', #{query.filePathFuzzy}, '%') + + + =str_to_date(#{query.createTimeStart}, '%Y-%m-%d') ]]> + + + + + + =str_to_date(#{query.lastUpdateTimeStart}, '%Y-%m-%d') ]]> + + + + + + =str_to_date(#{query.recoveryTimeStart}, '%Y-%m-%d') ]]> + + + + + + + + + + + + + + + + + + + INSERT INTO file_info + + + file_id, + + + user_id, + + + file_md5, + + + file_pid, + + + file_size, + + + file_name, + + + file_cover, + + + file_path, + + + create_time, + + + last_update_time, + + + folder_type, + + + file_category, + + + file_type, + + + status, + + + recovery_time, + + + del_flag, + + + + + #{bean.fileId}, + + + #{bean.userId}, + + + #{bean.fileMd5}, + + + #{bean.filePid}, + + + #{bean.fileSize}, + + + #{bean.fileName}, + + + #{bean.fileCover}, + + + #{bean.filePath}, + + + #{bean.createTime}, + + + #{bean.lastUpdateTime}, + + + #{bean.folderType}, + + + #{bean.fileCategory}, + + + #{bean.fileType}, + + + #{bean.status}, + + + #{bean.recoveryTime}, + + + #{bean.delFlag}, + + + + + + + INSERT INTO file_info + + + file_id, + + + user_id, + + + file_md5, + + + file_pid, + + + file_size, + + + file_name, + + + file_cover, + + + file_path, + + + create_time, + + + last_update_time, + + + folder_type, + + + file_category, + + + file_type, + + + status, + + + recovery_time, + + + del_flag, + + + + + #{bean.fileId}, + + + #{bean.userId}, + + + #{bean.fileMd5}, + + + #{bean.filePid}, + + + #{bean.fileSize}, + + + #{bean.fileName}, + + + #{bean.fileCover}, + + + #{bean.filePath}, + + + #{bean.createTime}, + + + #{bean.lastUpdateTime}, + + + #{bean.folderType}, + + + #{bean.fileCategory}, + + + #{bean.fileType}, + + + #{bean.status}, + + + #{bean.recoveryTime}, + + + #{bean.delFlag}, + + + on DUPLICATE key update + + + file_id = VALUES(file_id), + + + user_id = VALUES(user_id), + + + file_md5 = VALUES(file_md5), + + + file_pid = VALUES(file_pid), + + + file_size = VALUES(file_size), + + + file_name = VALUES(file_name), + + + file_cover = VALUES(file_cover), + + + file_path = VALUES(file_path), + + + create_time = VALUES(create_time), + + + last_update_time = VALUES(last_update_time), + + + folder_type = VALUES(folder_type), + + + file_category = VALUES(file_category), + + + file_type = VALUES(file_type), + + + status = VALUES(status), + + + recovery_time = VALUES(recovery_time), + + + del_flag = VALUES(del_flag), + + + + + + + INSERT INTO file_info( + file_id, + user_id, + file_md5, + file_pid, + file_size, + file_name, + file_cover, + file_path, + create_time, + last_update_time, + folder_type, + file_category, + file_type, + status, + recovery_time, + del_flag + )values + + ( + #{item.fileId}, + #{item.userId}, + #{item.fileMd5}, + #{item.filePid}, + #{item.fileSize}, + #{item.fileName}, + #{item.fileCover}, + #{item.filePath}, + #{item.createTime}, + #{item.lastUpdateTime}, + #{item.folderType}, + #{item.fileCategory}, + #{item.fileType}, + #{item.status}, + #{item.recoveryTime}, + #{item.delFlag} + ) + + + + + + INSERT INTO file_info( + file_id, + user_id, + file_md5, + file_pid, + file_size, + file_name, + file_cover, + file_path, + create_time, + last_update_time, + folder_type, + file_category, + file_type, + status, + recovery_time, + del_flag + )values + + ( + #{item.fileId}, + #{item.userId}, + #{item.fileMd5}, + #{item.filePid}, + #{item.fileSize}, + #{item.fileName}, + #{item.fileCover}, + #{item.filePath}, + #{item.createTime}, + #{item.lastUpdateTime}, + #{item.folderType}, + #{item.fileCategory}, + #{item.fileType}, + #{item.status}, + #{item.recoveryTime}, + #{item.delFlag} + ) + + on DUPLICATE key update + file_id = VALUES(file_id), + user_id = VALUES(user_id), + file_md5 = VALUES(file_md5), + file_pid = VALUES(file_pid), + file_size = VALUES(file_size), + file_name = VALUES(file_name), + file_cover = VALUES(file_cover), + file_path = VALUES(file_path), + create_time = VALUES(create_time), + last_update_time = VALUES(last_update_time), + folder_type = VALUES(folder_type), + file_category = VALUES(file_category), + file_type = VALUES(file_type), + status = VALUES(status), + recovery_time = VALUES(recovery_time), + del_flag = VALUES(del_flag) + + + + + UPDATE file_info + + + file_md5 = #{bean.fileMd5}, + + + file_pid = #{bean.filePid}, + + + file_size = #{bean.fileSize}, + + + file_name = #{bean.fileName}, + + + file_cover = #{bean.fileCover}, + + + file_path = #{bean.filePath}, + + + create_time = #{bean.createTime}, + + + last_update_time = #{bean.lastUpdateTime}, + + + folder_type = #{bean.folderType}, + + + file_category = #{bean.fileCategory}, + + + file_type = #{bean.fileType}, + + + status = #{bean.status}, + + + recovery_time = #{bean.recoveryTime}, + + + del_flag = #{bean.delFlag}, + + + where file_id=#{fileId} and user_id=#{userId} + + + + + delete + from file_info + where file_id = #{fileId} + and user_id = #{userId} + + + + + + + update file_info + + + file_md5 = #{bean.fileMd5}, + + + file_pid = #{bean.filePid}, + + + file_size = #{bean.fileSize}, + + + file_name = #{bean.fileName}, + + + file_cover = #{bean.fileCover}, + + + file_path = #{bean.filePath}, + + + create_time = #{bean.createTime}, + + + last_update_time = #{bean.lastUpdateTime}, + + + folder_type = #{bean.folderType}, + + + file_category = #{bean.fileCategory}, + + + file_type = #{bean.fileType}, + + + status = #{bean.status}, + + + recovery_time = #{bean.recoveryTime}, + + + del_flag = #{bean.delFlag}, + + + where file_id = #{fileId} + and user_id = #{userId} + and status = #{oldStatus} + + + + + update file_info + + + file_md5 = #{bean.fileMd5}, + + + file_pid = #{bean.filePid}, + + + file_size = #{bean.fileSize}, + + + file_name = #{bean.fileName}, + + + file_cover = #{bean.fileCover}, + + + file_path = #{bean.filePath}, + + + create_time = #{bean.createTime}, + + + last_update_time = #{bean.lastUpdateTime}, + + + folder_type = #{bean.folderType}, + + + file_category = #{bean.fileCategory}, + + + file_type = #{bean.fileType}, + + + status = #{bean.status}, + + + recovery_time = #{bean.recoveryTime}, + + + del_flag = #{bean.delFlag}, + + + where user_id = #{userId} + + and file_pid in(#{item}) + + + and file_id in(#{item}) + + + and del_flag = #{oldDelFlag} + + + + + delete from file_info where user_id = #{userId} + + and file_pid in(#{item}) + + + and file_id in(#{item}) + + + and del_flag = #{oldDelFlag} + + + + + + + delete + from file_info + where user_id = #{userId} + + + + + + + + + \ No newline at end of file diff --git a/easypan-java/src/main/resources/com/easypan/mappers/FileShareMapper.xml b/easypan-java/src/main/resources/com/easypan/mappers/FileShareMapper.xml new file mode 100644 index 0000000..21b532d --- /dev/null +++ b/easypan-java/src/main/resources/com/easypan/mappers/FileShareMapper.xml @@ -0,0 +1,389 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + share_id + ,s.file_id,s.user_id,valid_type,expire_time, + share_time,code,show_count + + + + + and share_id = #{query.shareId} + + + and s.file_id = #{query.fileId} + + + and s.user_id = #{query.userId} + + + and valid_type = #{query.validType} + + + + + + + + + and code = #{query.code} + + + and show_count = #{query.showCount} + + + + + + + + + + + + + + + and share_id like concat('%', #{query.shareIdFuzzy}, '%') + + + and s.file_id like concat('%', #{query.fileIdFuzzy}, '%') + + + and s.user_id like concat('%', #{query.userIdFuzzy}, '%') + + + =str_to_date(#{query.expireTimeStart}, '%Y-%m-%d') ]]> + + + + + + =str_to_date(#{query.shareTimeStart}, '%Y-%m-%d') ]]> + + + + + + and code like concat('%', #{query.codeFuzzy}, '%') + + + + + + + + + + + + + INSERT INTO file_share + + + share_id, + + + file_id, + + + user_id, + + + valid_type, + + + expire_time, + + + share_time, + + + code, + + + show_count, + + + + + #{bean.shareId}, + + + #{bean.fileId}, + + + #{bean.userId}, + + + #{bean.validType}, + + + #{bean.expireTime}, + + + #{bean.shareTime}, + + + #{bean.code}, + + + #{bean.showCount}, + + + + + + + INSERT INTO file_share + + + share_id, + + + file_id, + + + user_id, + + + valid_type, + + + expire_time, + + + share_time, + + + code, + + + show_count, + + + + + #{bean.shareId}, + + + #{bean.fileId}, + + + #{bean.userId}, + + + #{bean.validType}, + + + #{bean.expireTime}, + + + #{bean.shareTime}, + + + #{bean.code}, + + + #{bean.showCount}, + + + on DUPLICATE key update + + + share_id = VALUES(share_id), + + + file_id = VALUES(file_id), + + + user_id = VALUES(user_id), + + + valid_type = VALUES(valid_type), + + + expire_time = VALUES(expire_time), + + + share_time = VALUES(share_time), + + + code = VALUES(code), + + + show_count = VALUES(show_count), + + + + + + + INSERT INTO file_share( + share_id, + file_id, + user_id, + valid_type, + expire_time, + share_time, + code, + show_count + )values + + ( + #{item.shareId}, + #{item.fileId}, + #{item.userId}, + #{item.validType}, + #{item.expireTime}, + #{item.shareTime}, + #{item.code}, + #{item.showCount} + ) + + + + + + INSERT INTO file_share( + share_id, + file_id, + user_id, + valid_type, + expire_time, + share_time, + code, + show_count + )values + + ( + #{item.shareId}, + #{item.fileId}, + #{item.userId}, + #{item.validType}, + #{item.expireTime}, + #{item.shareTime}, + #{item.code}, + #{item.showCount} + ) + + on DUPLICATE key update + share_id = VALUES(share_id), + file_id = VALUES(file_id), + user_id = VALUES(user_id), + valid_type = VALUES(valid_type), + expire_time = VALUES(expire_time), + share_time = VALUES(share_time), + code = VALUES(code), + show_count = VALUES(show_count) + + + + + UPDATE file_share + + + file_id = #{bean.fileId}, + + + user_id = #{bean.userId}, + + + valid_type = #{bean.validType}, + + + expire_time = #{bean.expireTime}, + + + share_time = #{bean.shareTime}, + + + code = #{bean.code}, + + + show_count = #{bean.showCount}, + + + where share_id=#{shareId} + + + + + delete + from file_share + where share_id = #{shareId} + + + + + + + delete from file_share where user_id = #{userId} + and share_id in(#{item}) + + + + update file_share + set show_count = show_count + 1 + where share_id = #{shareId} + + \ No newline at end of file diff --git a/easypan-java/src/main/resources/com/easypan/mappers/UserInfoMapper.xml b/easypan-java/src/main/resources/com/easypan/mappers/UserInfoMapper.xml new file mode 100644 index 0000000..0fc84ea --- /dev/null +++ b/easypan-java/src/main/resources/com/easypan/mappers/UserInfoMapper.xml @@ -0,0 +1,628 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + user_id + ,nick_name,email,qq_open_id,qq_avatar, + password,join_time,last_login_time,status,use_space, + total_space + + + + + and user_id = #{query.userId} + + + and nick_name = #{query.nickName} + + + and email = #{query.email} + + + and qq_open_id = #{query.qqOpenId} + + + and qq_avatar = #{query.qqAvatar} + + + and password = #{query.password} + + + + + + + + + and status = #{query.status} + + + and use_space = #{query.useSpace} + + + and total_space = #{query.totalSpace} + + + + + + + + + + + + + + + and user_id like concat('%', #{query.userIdFuzzy}, '%') + + + and nick_name like concat('%', #{query.nickNameFuzzy}, '%') + + + and email like concat('%', #{query.emailFuzzy}, '%') + + + and qq_open_id like concat('%', #{query.qqOpenIdFuzzy}, '%') + + + and qq_avatar like concat('%', #{query.qqAvatarFuzzy}, '%') + + + and password like concat('%', #{query.passwordFuzzy}, '%') + + + =str_to_date(#{query.joinTimeStart}, '%Y-%m-%d') ]]> + + + + + + =str_to_date(#{query.lastLoginTimeStart}, '%Y-%m-%d') ]]> + + + + + + + + + + + + + + + + INSERT INTO user_info + + + user_id, + + + nick_name, + + + email, + + + qq_open_id, + + + qq_avatar, + + + password, + + + join_time, + + + last_login_time, + + + status, + + + use_space, + + + total_space, + + + + + #{bean.userId}, + + + #{bean.nickName}, + + + #{bean.email}, + + + #{bean.qqOpenId}, + + + #{bean.qqAvatar}, + + + #{bean.password}, + + + #{bean.joinTime}, + + + #{bean.lastLoginTime}, + + + #{bean.status}, + + + #{bean.useSpace}, + + + #{bean.totalSpace}, + + + + + + + INSERT INTO user_info + + + user_id, + + + nick_name, + + + email, + + + qq_open_id, + + + qq_avatar, + + + password, + + + join_time, + + + last_login_time, + + + status, + + + use_space, + + + total_space, + + + + + #{bean.userId}, + + + #{bean.nickName}, + + + #{bean.email}, + + + #{bean.qqOpenId}, + + + #{bean.qqAvatar}, + + + #{bean.password}, + + + #{bean.joinTime}, + + + #{bean.lastLoginTime}, + + + #{bean.status}, + + + #{bean.useSpace}, + + + #{bean.totalSpace}, + + + on DUPLICATE key update + + + user_id = VALUES(user_id), + + + nick_name = VALUES(nick_name), + + + email = VALUES(email), + + + qq_open_id = VALUES(qq_open_id), + + + qq_avatar = VALUES(qq_avatar), + + + password = VALUES(password), + + + join_time = VALUES(join_time), + + + last_login_time = VALUES(last_login_time), + + + status = VALUES(status), + + + use_space = VALUES(use_space), + + + total_space = VALUES(total_space), + + + + + + + INSERT INTO user_info( + user_id, + nick_name, + email, + qq_open_id, + qq_avatar, + password, + join_time, + last_login_time, + status, + use_space, + total_space + )values + + ( + #{item.userId}, + #{item.nickName}, + #{item.email}, + #{item.qqOpenId}, + #{item.qqAvatar}, + #{item.password}, + #{item.joinTime}, + #{item.lastLoginTime}, + #{item.status}, + #{item.useSpace}, + #{item.totalSpace} + ) + + + + + + INSERT INTO user_info( + user_id, + nick_name, + email, + qq_open_id, + qq_avatar, + password, + join_time, + last_login_time, + status, + use_space, + total_space + )values + + ( + #{item.userId}, + #{item.nickName}, + #{item.email}, + #{item.qqOpenId}, + #{item.qqAvatar}, + #{item.password}, + #{item.joinTime}, + #{item.lastLoginTime}, + #{item.status}, + #{item.useSpace}, + #{item.totalSpace} + ) + + on DUPLICATE key update + user_id = VALUES(user_id), + nick_name = VALUES(nick_name), + email = VALUES(email), + qq_open_id = VALUES(qq_open_id), + qq_avatar = VALUES(qq_avatar), + password = VALUES(password), + join_time = VALUES(join_time), + last_login_time = VALUES(last_login_time), + status = VALUES(status), + use_space = VALUES(use_space), + total_space = VALUES(total_space) + + + + + UPDATE user_info + + + nick_name = #{bean.nickName}, + + + email = #{bean.email}, + + + qq_open_id = #{bean.qqOpenId}, + + + qq_avatar = #{bean.qqAvatar}, + + + password = #{bean.password}, + + + join_time = #{bean.joinTime}, + + + last_login_time = #{bean.lastLoginTime}, + + + status = #{bean.status}, + + + use_space = #{bean.useSpace}, + + + total_space = #{bean.totalSpace}, + + + where user_id=#{userId} + + + + + delete + from user_info + where user_id = #{userId} + + + + + + + + UPDATE user_info + + + user_id = #{bean.userId}, + + + nick_name = #{bean.nickName}, + + + qq_open_id = #{bean.qqOpenId}, + + + qq_avatar = #{bean.qqAvatar}, + + + password = #{bean.password}, + + + join_time = #{bean.joinTime}, + + + last_login_time = #{bean.lastLoginTime}, + + + status = #{bean.status}, + + + use_space = #{bean.useSpace}, + + + total_space = #{bean.totalSpace}, + + + where email=#{email} + + + + + delete + from user_info + where email = #{email} + + + + + + + + UPDATE user_info + + + user_id = #{bean.userId}, + + + email = #{bean.email}, + + + qq_open_id = #{bean.qqOpenId}, + + + qq_avatar = #{bean.qqAvatar}, + + + password = #{bean.password}, + + + join_time = #{bean.joinTime}, + + + last_login_time = #{bean.lastLoginTime}, + + + status = #{bean.status}, + + + use_space = #{bean.useSpace}, + + + total_space = #{bean.totalSpace}, + + + where nick_name=#{nickName} + + + + + delete + from user_info + where nick_name = #{nickName} + + + + + + + + UPDATE user_info + + + user_id = #{bean.userId}, + + + nick_name = #{bean.nickName}, + + + email = #{bean.email}, + + + qq_avatar = #{bean.qqAvatar}, + + + password = #{bean.password}, + + + join_time = #{bean.joinTime}, + + + last_login_time = #{bean.lastLoginTime}, + + + status = #{bean.status}, + + + use_space = #{bean.useSpace}, + + + total_space = #{bean.totalSpace}, + + + where qq_open_id=#{qqOpenId} + + + + + delete + from user_info + where qq_open_id = #{qqOpenId} + + + + + + + update user_info + + + use_space = use_space + #{useSpace}, + + + total_space = total_space + #{totalSpace}, + + + where user_id = #{userId} + + + + + = use_space ]]> + + + \ No newline at end of file diff --git a/easypan-java/src/main/resources/logback-spring.xml b/easypan-java/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..303e69d --- /dev/null +++ b/easypan-java/src/main/resources/logback-spring.xml @@ -0,0 +1,38 @@ + + + + + %d{yyyy-MM-dd HH:mm:ss,GMT+8} [%p][%c][%M][%L]-> %m%n + + + + + + + + + + + ${log.path}/${LOG_FOLDER}/${LOG_FILE_NAME} + + ${log.path}/${LOG_FOLDER}/${LOG_FILE_NAME}.%d{yyyyMMdd}.%i + true + + 20MB + + 30 + + + utf-8 + %d{yyyy-MM-dd HH:mm:ss,GMT+8} [%p][%c][%M][%L]-> %m%n + + false + false + + + + + + + +