diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 9d554936..92509691 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1 +1,3 @@ +github: ciderapp ko_fi: cryptofyre +open_collective: ciderapp diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..6cfbfc73 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,39 @@ +--- +name: Bug Report +about: If you encounter an issue whilst using our app, please use this template to help improve the app. +title: "[BUG] " +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Environment Information** + - OS *(e.g. Linux/Mac/Windows)*: + - Application Version *(e.g. 2.5.0)*: + +**Additional context** +Add any other context about the problem here. + +**Have you followed the troubleshooting guide and checked for any outstanding/pinned issues that can help?** +*Troubleshooting guide can be found [here](https://github.com/Apple-Music-Electron/Apple-Music-Electron/wiki/Troubleshooting).* +Yes/No + +**Log File** +Follow [this](https://github.com/Apple-Music-Electron/Apple-Music-Electron/wiki/FAQs#2-how-to-find-the-log-file) to find your log file. +Attach your log file to the post but make sure to remove any LastFM keys that are in the file. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..715514a3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "[Enhancement]" +labels: enhancement +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.gitignore b/.gitignore index 7f791b82..e1bcb518 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,310 @@ -node_modules +# Building dist -.idea -yarn.lock +*.lock +yarn* package-lock.json -.DS_Store -yarn-error.log .yarnclean + +# Misc +.idea +.vscode auth.json -musickit.js \ No newline at end of file +musickit.js + +# Microsoft Store Package Configs +msft-package.json + +## Node GitIgnore ## + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp +.cache + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +## JetBrains GitIgnore ## + +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + + +## macOS GitIgnore ## + +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + + +## VSCode GitIgnore ## + +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + +## Sublime Text GitIgnore ## + +# Cache files for Sublime Text +*.tmlanguage.cache +*.tmPreferences.cache +*.stTheme.cache + +# Workspace files are user-specific +*.sublime-workspace + +# Project files should be checked into the repository, unless a significant +# proportion of contributors will probably not be using Sublime Text +# *.sublime-project + +# SFTP configuration file +sftp-config.json +sftp-config-alt*.json + +# Package control specific files +Package Control.last-run +Package Control.ca-list +Package Control.ca-bundle +Package Control.system-ca-bundle +Package Control.cache/ +Package Control.ca-certs/ +Package Control.merged-ca-bundle +Package Control.user-ca-bundle +oscrypto-ca-bundle.crt +bh_unicode_properties.cache + +# Sublime-github package stores a github token in this file +# https://packagecontrol.io/packages/sublime-github +GitHub.sublime-settings + +#Service Worker mappings +src/renderer/sw.js.map +src/renderer/workbox-962786f2.js.map \ No newline at end of file diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 1faf6c9c..00000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "resources/themes"] - path = resources/themes - url = https://github.com/Apple-Music-Electron/Apple-Music-Electron-Themes.git diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index 931e3602..00000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "Cider (Debug)", - "type": "shell", - "command": "yarn start" - }, - { - "label": "Cider (Build)", - "type": "shell", - "command": "yarn dist" - } - ] -} \ No newline at end of file diff --git a/LICENSE b/LICENSE index f288702d..d159169d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,622 +1,281 @@ GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 + Version 2, June 1991 - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to this License. - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. - 13. Use with the GNU Affero General Public License. +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. - 14. Revised Versions of this License. +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. + NO WARRANTY - 15. Disclaimer of Warranty. + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS @@ -628,15 +287,15 @@ free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least +convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) - This program is free software: you can redistribute it and/or modify + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or + the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -644,31 +303,37 @@ the "copyright" line and a pointer to where the full notice is found. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see . + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/README.md b/README.md index 68cba3d5..941ad929 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,15 @@

- Banner

- GitHub Releases - GitHub Stars - GitHub Forks - GitHub Downloads - Depfu Dependencies - Buy Me A Coffee + Banner

+ GitHub Releases + GitHub Stars + GitHub Forks + GitHub Downloads +
+ Buy Me A Coffee + Open Collective
Discord - Twitter + Twitter Reddit

Windows Build Status @@ -25,7 +26,9 @@ ### Install Sources [![Get it from Github](https://img.shields.io/badge/Get_It_From_GitHub-100000?style=for-the-badge&logo=github&logoColor=white)](https://github.com/ciderapp/cider/releases/latest) - - AME Remote - ${encoded} - http://applemusicelectron.com - AME - AME - 3.0 - ${'http://' + getIp()} - manufacturer's serial number - uuid:75ebacfb-e890-4a21-a913-9a16858e9270 - Universal Product Code - - - urn:schemas-upnp-org:service:AVTransport:1 - urn:upnp-org:serviceId:AVTransport - - - - - - - - - ` - res.status(200).send(data); - }); - - let SSDP = require('node-ssdp').Server - , server = new SSDP({ - location : 'http://' + getIp() + `:${ssdpRemotePort}`, - allowWildcards : true, - adInterval : 5000, - - }) - ; - - // server.addUSN('upnp:rootdevice'); - server.addUSN('urn:schemas-upnp-org:device:MediaRenderer:1'); - server.addUSN('urn:schemas-upnp-org:service:AVTransport:1'); - - server.start().catch(e => { - console.log('Failed to start server:', e) - }) - .then(() => { - console.log('Server started.') - }) - - - process.on('exit', function(){ - server.stop() // advertise shutting down and stop listening - }) - } - - function searchForGCDevices() { - try { - - let browser = mdns.createBrowser(mdns.tcp('googlecast')); - browser.on('ready', browser.discover); - - browser.on('update', (service) => { - if (service.addresses && service.fullname) { - ondeviceup(service.addresses[0], service.fullname.substring(0, service.fullname.indexOf("._googlecast")) + " " + (service.type[0].description ?? ""), '', 'googlecast'); - } - }); - - // also do a SSDP/UPnP search - let ssdpBrowser = new Client(); - ssdpBrowser.on('response', (headers, statusCode, rinfo) => { - var location = getLocation(headers); - if (location != null) { - getServiceDescription(location, rinfo.address); - } - - }); - - function getLocation(headers) { - let location = null; - if (headers["LOCATION"] != null ){location = headers["LOCATION"]} - else if (headers["Location"] != null ){location = headers["Location"]} - return location; - } - - ssdpBrowser.search('urn:dial-multiscreen-org:device:dial:1'); - - // actual upnp devices - if (app.cfg.get("audio.enableDLNA")) { - let ssdpBrowser2 = new Client(); - ssdpBrowser2.on('response', (headers, statusCode, rinfo) => { - var location = getLocation(headers); - if (location != null) { - getServiceDescription(location, rinfo.address); - } - - }); - ssdpBrowser2.search('urn:schemas-upnp-org:device:MediaRenderer:1'); - - } - - - } catch (e) { - console.log('Search GC err', e); - } - } - - function setupGCServer() { - return new Promise((resolve, reject) => { - getPort() - .then(port2 => { - port = port2; - server = audioserver.listen(port, () => { - console.info('Example app listening at http://%s:%s', getIp(), port); - }); - GCRunning = true; - resolve() - }) - .catch(reject); - }); - } - broadcastRemote(); - function parseServiceDescription(body, address, url) { - const parseString = require('xml2js').parseString; - parseString(body, (err, result) => { - if (!err && result && result.root && result.root.device) { - const device = result.root.device[0]; - console.log('device', device); - let devicetype = 'googlecast'; - console.log() - if (device.deviceType && device.deviceType.toString() === 'urn:schemas-upnp-org:device:MediaRenderer:1') { - devicetype = 'upnp'; - } - ondeviceup(address, device.friendlyName.toString(), url, devicetype); - } - }); - } - - function loadMedia(client, song, artist, album, albumart, cb) { - const u = 'http://' + getIp() + ':' + server.address().port + '/'; - client.launch(DefaultMediaReceiver, (err, player) => { - if (err) { - console.log(err); - return; - } - let media = { - // Here you can plug an URL to any mp4, webm, mp3 or jpg file with the proper contentType. - contentId: u, - contentType: 'audio/wav', - streamType: 'LIVE', // or LIVE - - // Title and cover displayed while buffering - metadata: { - type: 0, - metadataType: 3, - title: song ?? "", - albumName: album ?? "", - artist: artist ?? "", - images: [ - {url: albumart ?? ""}] - } - }; - // ipcMain.on('setupNewTrack', function (event, song, artist, album, albumart) { - // try { - - // let newmedia = { - // // Here you can plug an URL to any mp4, webm, mp3 or jpg file with the proper contentType. - // contentId: u, - // contentType: 'audio/wav', - // streamType: 'LIVE', // or LIVE - - // // Title and cover displayed while buffering - // metadata: { - // type: 0, - // metadataType: 3, - // title: song ?? "", - // albumName: album ?? '', - // artist: artist ?? '', - // images: [ - // {url: albumart ?? ''}] - // } - // }; - // headerSent = false; - - // player.queueUpdate(newmedia, { - // autoplay: true - // }, (err, status) => { - // console.log('media loaded playerState=%s', status); - // }); - - // } catch (e) { - // console.log('GCerror', e) - // } - // }); - - - player.on('status', status => { - console.log('status broadcast playerState=%s', status); - }); - - console.log('app "%s" launched, loading media %s ...', player, media); - - player.load(media, { - autoplay: true - }, (err, status) => { - console.log('media loaded playerState=%s', status); - }); - - - client.getStatus((x, status) => { - if (status && status.volume) { - client.volume = status.volume.level; - client.muted = status.volume.muted; - client.stepInterval = status.volume.stepInterval; - } - }) - - }); - } - - function getIp() { - let ip = false; - let alias = 0; - let ifaces = os.networkInterfaces(); - for (var dev in ifaces) { - ifaces[dev].forEach(details => { - if (details.family === 'IPv4') { - if (!/(loopback|vmware|internal|hamachi|vboxnet|virtualbox)/gi.test(dev + (alias ? ':' + alias : ''))) { - if (details.address.substring(0, 8) === '192.168.' || - details.address.substring(0, 7) === '172.16.' || - details.address.substring(0, 3) === '10.' - ) { - ip = details.address; - ++alias; - } - } - } - }); - } - return ip; - } - - function stream(device, song, artist, album, albumart) { - let castMode = 'googlecast'; - let UPNPDesc = ''; - castMode = device.type; - UPNPDesc = device.location; - - let client; - if (castMode === 'googlecast') { - let client = new audioClient(); - client.volume = 100; - client.stepInterval = 0.5; - client.muted = false; - - client.connect(device.host, () => { - console.log('connected, launching app ...', 'http://' + getIp() + ':' + server.address().port + '/'); - if (!connectedHosts[device.host]) { - connectedHosts[device.host] = client; - activeConnections.push(client); - } - loadMedia(client, song, artist, album, albumart); - }); - - client.on('close', () => { - console.info("Client Closed"); - for (let i = activeConnections.length - 1; i >= 0; i--) { - if (activeConnections[i] === client) { - activeConnections.splice(i, 1); - return; - } - } - }); - - client.on('error', err => { - console.log('Error: %s', err.message); - client.close(); - delete connectedHosts[device.host]; - }); - - } else { - // upnp devices - try { - client = new MediaRendererClient(UPNPDesc); - const options = { - autoplay: true, - contentType: 'audio/x-wav', - dlnaFeatures: 'DLNA.ORG_PN=-;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=01700000000000000000000000000000', - metadata: { - title: 'Apple Music Electron', - creator: 'Streaming ...', - type: 'audio', // can be 'video', 'audio' or 'image' - // url: 'http://' + getIp() + ':' + server.address().port + '/', - // protocolInfo: 'DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000; - } - }; - - client.load('http://' + getIp() + ':' + server.address().port + '/a.wav', options, function (err, _result) { - if (err) throw err; - console.log('playing ...'); - }); - - } catch (e) { - } - } - } - - ipcMain.on('getKnownCastDevices', function (event) { - event.returnValue = castDevices - }); - - ipcMain.on('performGCCast', function (event, device, song, artist, album, albumart) { - setupGCServer().then(function () { - app.win.webContents.setAudioMuted(true); - console.log(device); - stream(device, song, artist, album, albumart); - }) - }); - - ipcMain.on('getChromeCastDevices', function (_event, _data) { - searchForGCDevices(); - }); - - ipcMain.on('stopGCast', function (_event) { - app.win.webContents.setAudioMuted(false); - GCRunning = false; - expectedConnections = 0; - currentConnections = 0; - activeConnections = []; - requests = []; - GCstream = new Stream.PassThrough(); - connectedHosts = {}; - port = false; - server = false; - bufcount = 0; - bufcount2 = 0; - headerSent = false; - }) - } -} - -module.exports = handler diff --git a/oldshit/resources/functions/init.js b/oldshit/resources/functions/init.js deleted file mode 100644 index 3da8779e..00000000 --- a/oldshit/resources/functions/init.js +++ /dev/null @@ -1,234 +0,0 @@ -const {app, nativeTheme, nativeImage, Tray} = require("electron"), - {join, resolve} = require("path"), - os = require("os"), - {existsSync, readdirSync} = require("fs"), - regedit = require("regedit"), - {initAnalytics} = require('./utils'); -initAnalytics(); - -const init = { - - BaseInit: () => { - const censoredConfig = app.cfg.store; - censoredConfig.tokens = {}; - - console.log('---------------------------------------------------------------------') - console.log(`${app.getName()} has started.`); - console.log(`Version: ${app.getVersion()} | Electron Version: ${process.versions.electron}`) - console.log(`Type: ${os.type} | Release: ${os.release()} ${app.ame.utils.fetchOperatingSystem() ? `(${app.ame.utils.fetchOperatingSystem()})` : ""} | Platform: ${os.platform()}`) - console.log(`User Data Path: '${app.getPath('userData')}'`) - console.log(`Current Configuration: ${JSON.stringify(censoredConfig)}`) - console.log("---------------------------------------------------------------------") - if (app.cfg.get('general.analyticsEnabled') && app.isPackaged) console.log('[Sentry] Sentry logging is enabled, any errors you receive will be presented to the development team to fix for the next release.') - console.verbose('[InitializeBase] Started.'); - - // Disable CORS - app.commandLine.appendSwitch('disable-features', 'OutOfBlinkCors') - app.commandLine.appendSwitch('high-dpi-support', 'true') - if (process.platform === "win32") { - app.commandLine.appendSwitch('force-device-scale-factor', '1') - } - - if (app.cfg.get('advanced.verboseLogging')) { - app.commandLine.appendSwitch('--enable-logging'); - app.commandLine.appendSwitch('--log-file', join(app.getPath('userData'), 'logs', 'renderer.log')); - console.verbose(`[InitializeBase] Renderer logging setup at ${join(app.getPath('userData'), 'logs', 'renderer.log')}`); - } - - // Media Key Hijacking - if (app.cfg.get('advanced.preventMediaKeyHijacking')) { - console.log("[Apple-Music-Electron] Hardware Media Key Handling disabled.") - app.commandLine.appendSwitch('disable-features', 'HardwareMediaKeyHandling,MediaSessionService'); - } - - // GPU Hardware Acceleration - if (!app.cfg.get('advanced.hardwareAcceleration')) { - app.commandLine.appendSwitch('disable-gpu') - } - - // Registry - if (process.platform === "win32") { - regedit.setExternalVBSLocation("resources/regedit/vbs") - } - - // Sets the ModelId (For windows notifications) - if (process.platform === "win32") app.setAppUserModelId(app.getName()); - - // Disable the Media Session to allow MPRIS to be the primary service - if (process.platform === "linux") app.commandLine.appendSwitch('disable-features', 'MediaSessionService'); - - // Assign Default Variables - app.isQuiting = (app.isQuiting ? app.isQuiting : false); - app.win = ''; - app.ipc = { - existingNotification: false - }; - - if (app.cfg.get('general.incognitoMode')) { - console.log("[Incognito] Incognito Mode enabled. DiscordRPC and LastFM updates are ignored.") - } - - /* Protocols for Link Handling */ - if (process.defaultApp) { - if (process.argv.length >= 2) { - app.setAsDefaultProtocolClient('ame', process.execPath, [resolve(process.argv[1])]) - app.setAsDefaultProtocolClient('itms', process.execPath, [resolve(process.argv[1])]) - app.setAsDefaultProtocolClient('itmss', process.execPath, [resolve(process.argv[1])]) - app.setAsDefaultProtocolClient('musics', process.execPath, [resolve(process.argv[1])]) - app.setAsDefaultProtocolClient('music', process.execPath, [resolve(process.argv[1])]) - } - } else { - app.setAsDefaultProtocolClient('ame') // Custom AME Protocol - app.setAsDefaultProtocolClient('itms') // iTunes HTTP Protocol - app.setAsDefaultProtocolClient('itmss') // iTunes HTTPS Protocol - app.setAsDefaultProtocolClient('musics') // macOS Client Protocol - app.setAsDefaultProtocolClient('music') // macOS Client Protocol - } - - app.on('open-url', (event, url) => { - event.preventDefault() - if (url.includes('ame://') || url.includes('itms://') || url.includes('itmss://') || url.includes('musics://') || url.includes('music://')) { - app.ame.handler.LinkHandler(url) - } - }) - - // Running the Application on Login - if (app.cfg.get('window.appStartupBehavior')) { - app.setLoginItemSettings({ - openAtLogin: true, - args: [ - '--process-start-args', `${app.cfg.get('window.appStartupBehavior') === 'hidden' ? "--hidden" : (app.cfg.get('window.appStartupBehavior') === 'minimized' ? "--minimized" : "")}` - ] - }) - } - - // Set Max Listener - require('events').EventEmitter.defaultMaxListeners = Infinity; - }, - - LoggingInit: () => { - app.log = require("electron-log"); - - if (app.commandLine.hasSwitch('verbose')) { - app.verboseLaunched = true - } - - app.log.transports.file.resolvePath = (vars) => { - return join(app.getPath('userData'), 'logs', vars.fileName); - } - - Object.assign(console, app.log.functions); - - console.verbose = () => { - }; - - if (app.cfg.get('advanced.verboseLogging') || app.verboseLaunched) { - console.verbose = app.log.debug - } else { - console.verbose = function (_data) { - return false - }; - } - }, - - ThemeInstallation: () => { - const themesPath = join(app.getPath('userData'), "themes"); - - // Check if the themes folder exists and check permissions - if (existsSync(join(themesPath, 'README.md'))) { - console.verbose('[ThemeInstallation] Themes Directory Exists. Running Permission Check.') - app.ame.utils.permissionsCheck(themesPath, 'README.md') - } else { - app.ame.utils.updateThemes().catch(err => console.error(err)) - } - - // Save all the file names to array and log it - if (existsSync(themesPath)) { - console.log(`[InitializeTheme] Files found in Themes Directory: [${readdirSync(themesPath).join(', ')}]`) - } - - // Set the default theme - if (app.cfg.get('advanced.forceApplicationMode')) { - nativeTheme.themeSource = app.cfg.get('advanced.forceApplicationMode') - } - }, - - PluginInstallation: () => { - if (!existsSync(resolve(app.getPath("userData"), "plugins"))) { - return; - } - - // Check if the plugins folder exists and check permissions - app.pluginsEnabled = true; - console.log("[PluginInstallation][existsSync] Plugins folder exists!"); - app.ame.utils.permissionsCheck(app.userPluginsPath, '/'); - app.ame.utils.fetchPluginsListing(); - - // Save all the file names to array and log it - console.log(`[PluginInstallation] Files found in Plugins Directory: [${readdirSync(resolve(app.getPath("userData"), "plugins")).join(', ')}]`); - }, - - AppReady: () => { - console.verbose('[ApplicationReady] Started.'); - app.pluginsEnabled = false; - - // Run the Functions - init.ThemeInstallation() - init.PluginInstallation() - init.TrayInit() - - app.ame.mpris.connect(); // M.P.R.I.S - app.ame.lastfm.authenticate(); // LastFM - app.ame.discord.connect(app.cfg.get('general.discordRPC') === 'ame-title' ? '911790844204437504' : '886578863147192350'); // Discord - - app.isAuthorized = false; - app.isMiniplayerActive = false; - app.injectedCSS = {} - app.media = {status: false, playParams: {id: 'no-id-found'}}; - - /** wsapi */ - // app.ame.wsapi.inAppUI() - /** wsapi */ - }, - - TrayInit: () => { - console.verbose('[InitializeTray] Started.'); - - const winTray = nativeImage.createFromPath(join(__dirname, `../icons/icon.ico`)).resize({ - width: 32, - height: 32 - }) - const macTray = nativeImage.createFromPath(join(__dirname, `../icons/icon.png`)).resize({ - width: 20, - height: 20 - }) - const linuxTray = nativeImage.createFromPath(join(__dirname, `../icons/icon.png`)).resize({ - width: 32, - height: 32 - }) - let trayIcon; - if (process.platform === "win32") { - trayIcon = winTray - } else if (process.platform === "linux") { - trayIcon = linuxTray - } else if (process.platform === "darwin") { - trayIcon = macTray - } - - app.tray = new Tray(trayIcon) - app.tray.setToolTip(app.getName()); - app.ame.win.SetContextMenu(true); - - app.tray.on('double-click', () => { - if (typeof app.win.show === 'function') { - if (app.win.isVisible()) { - app.win.focus() - } else { - app.win.show() - } - } - }) - } -} - -module.exports = init \ No newline at end of file diff --git a/oldshit/resources/functions/load.js b/oldshit/resources/functions/load.js deleted file mode 100644 index 83c4678b..00000000 --- a/oldshit/resources/functions/load.js +++ /dev/null @@ -1,238 +0,0 @@ -const {join, resolve} = require("path"), - {app, ipcMain, systemPreferences} = require("electron"), - {readFile, constants, chmodSync, existsSync, watch} = require("fs"), - {initAnalytics} = require('./utils'); -initAnalytics(); - -module.exports = { - - LoadCSS: function (path, theme, important) { - const fileName = path - if (theme) { - path = join(app.userThemesPath, path.toLowerCase()); - } else { - path = join(join(__dirname, '../css/'), path) - } - - // Check that the file exists - if (!existsSync(path)) { - console.warn(`[LoadCSS] ${path} not found.`) - return - } - - // Remove previous inject (If there is one) - if (app.injectedCSS[path]) { - app.win.webContents.removeInsertedCSS(app.injectedCSS[fileName]).then(r => { if (r) console.error(r); }); - } - - // Get the CSS to inject - readFile(path, "utf-8", function (error, data) { - if (error) { - console.error(`[LoadCSS] Error while injecting: '${path}' - ${error}`) - try { - chmodSync(path, constants.S_IRUSR | constants.S_IWUSR); - } catch (err) { - console.error(`[LoadCSS] ${err}`) - } - } else { - let formattedData = data.replace(/\s{2,10}/g, ' ').trim(); - app.win.webContents.insertCSS(formattedData, {cssOrigin: (important ? 'user' : 'author')}).then((key) => { - console.verbose(`[${theme ? 'LoadTheme' : 'LoadCSS'}] '${fileName}' successfully injected.`) - app.injectedCSS[fileName] = key - }); - } - }); - }, - - LoadJS: function (path, formatting = true) { - const fileName = path; - path = join(join(__dirname, '../js/'), path) - - readFile(path, "utf-8", function (error, data) { - if (!error) { - try { - let formattedData = data - if (formatting) { - formattedData = data.replace(/\s{2,10}/g, ' ').trim(); - } - app.win.webContents.executeJavaScript(formattedData).then(() => { - console.verbose(`[LoadJSFile] '${fileName}' successfully injected.`) - }); - } catch (err) { - console.error(`[LoadJSFile] Error while injecting: '${fileName}' - Error: ${err}`) - } - } else { - console.error(`[LoadJSFile] Error while reading: '${fileName}' - Error: ${error}`) - } - }); - }, - - LoadWebsite: function (win) { - if (!win) return; - - app.storefront = app.cfg.get('general.storefront'); - const urlBase = app.cfg.get('advanced.useBetaSite') ? 'https://beta.music.apple.com' : 'https://music.apple.com/' + app.cfg.get('general.storefront'), - urlFallback = `https://music.apple.com/`; - - ipcMain.once('userAuthorized', (e, args) => { - app.isAuthorized = true - console.log(`[LoadWebsite] User Authenticated. Setting page to: ${args}`) - win.webContents.clearHistory() - }) - - win.loadURL(urlBase).then(() => { - app.ame.load.LoadJS('checkAuth.js') - }).catch((err) => { - win.loadURL(urlFallback).then(() => console.error(`[LoadWebsite] '${urlBase}' was unavailable, falling back to '${urlFallback}' | ${err}`)) - }) - }, - - LoadFiles: function () { - app.ame.load.LoadJS('settingsPage.js'); - if (app.cfg.get('visual.removeAppleLogo')) { - app.win.webContents.insertCSS(` - @media only screen and (max-width: 483px) { - .web-navigation__nav-list { - margin-top: 50px; - } - } - } - `).catch((e) => console.error(e)); - } - - if (app.cfg.get('visual.useOperatingSystemAccent') && (process.platform === "win32" || process.platform === "darwin")) { - if (systemPreferences.getAccentColor()) { - const accent = '#' + systemPreferences.getAccentColor().slice(0, -2) - app.win.webContents.insertCSS(` - :root { - --keyColor: ${accent} !important; - --systemAccentBG: ${accent} !important; - --systemAccentBG-pressed: rgba(${app.ame.utils.hexToRgb(accent).r}, ${app.ame.utils.hexToRgb(accent).g}, ${app.ame.utils.hexToRgb(accent).b}, 0.75) !important; - --keyColor-rgb: ${app.ame.utils.hexToRgb(accent).r} ${app.ame.utils.hexToRgb(accent).g} ${app.ame.utils.hexToRgb(accent).b} !important; - }`).then((key) => { - app.injectedCSS['useOperatingSystemAccent'] = key - }) - } - } else { - app.ame.win.removeInsertedCSS('useOperatingSystemAccent') - } - - /* Load Window Frame */ - if (app.cfg.get('visual.frameType') === 'mac') { - app.ame.load.LoadJS('frame_macOS.js') - } else if ((app.cfg.get('visual.frameType') === 'mac-right')) { - app.ame.load.LoadJS('frame_Windows.js') - } else if (process.platform === 'darwin' && !app.cfg.get('visual.frameType')) { - app.ame.load.LoadJS('frame_macOS.js') - } else if (process.platform === 'win32' && !app.cfg.get('visual.frameType')) { - app.ame.load.LoadJS('frame_Windows.js') - if (app.win.isMaximized()) { - app.win.webContents.executeJavaScript(`if (document.querySelector("#maximize")) { document.querySelector("#maximize").classList.add("maxed"); }`).catch((e) => console.error(e)); - } - } - - const BackButtonChecks = (url) => { - if (!app.win.webContents.canGoBack()) return false - const backButtonBlacklist = [`*music.apple.com/*/listen-now*`, `*music.apple.com/*/browse*`, `*music.apple.com/*/radio*`, `*music.apple.com/*/search*`, `*music.apple.com/library/recently-added?l=*`, `*music.apple.com/library/albums?l=*`, `*music.apple.com/library/songs?l=*`, `*music.apple.com/library/made-for-you?l=*`, `*music.apple.com/library/recently-added`, `*music.apple.com/library/albums`, `*music.apple.com/library/made-for-you`, `*music.apple.com/library/songs*`, `*music.apple.com/library/artists/*`, `*music.apple.com/library/playlist/*`]; - let blacklistPassed = true - backButtonBlacklist.forEach((item) => { - if (!blacklistPassed) return; - if (app.ame.utils.matchRuleShort(url, item) || url === item) { - blacklistPassed = false - } - }); - return blacklistPassed - } - - /* Load Back Button */ - if (BackButtonChecks(app.win.webContents.getURL())) { - app.ame.load.LoadJS('backButton.js') - app.win.webContents.executeJavaScript(`document.body.setAttribute('back-button', 1)`) - } else { /* Removes the button if the check failed. */ - app.win.webContents.executeJavaScript(`if (document.querySelector('#backButtonBar')) { document.getElementById('backButtonBar').remove() };`).catch((e) => console.error(e)); - app.win.webContents.executeJavaScript(`document.body.removeAttribute('back-button')`) - } - - /* Load the Startup JavaScript Function */ - app.win.webContents.executeJavaScript('if (AMJavaScript) { AMJavaScript.LoadCustom(); }').catch((e) => console.error(e)); - }, - - LoadOneTimeFiles: function () { - // Inject the custom stylesheet - app.ame.load.LoadCSS('custom-stylesheet.css') - app.ame.load.LoadCSS('ameframework.css') - - // Inject Plugin Interaction - if (app.pluginsEnabled) { - app.ame.load.LoadJS('pluginSystem.js', false) - } - // Load this first so it doesn't stuck - app.ame.load.LoadJS('OpusMediaRecorder.umd.js') - app.ame.load.LoadJS('encoderWorker.umd.js') - - - // Lyrics - app.ame.load.LoadJS('lyrics.js') - - // Vue Test - app.ame.load.LoadJS('vue.js') - app.ame.load.LoadJS('utils.js', false) - app.ame.load.LoadJS('tests.js', false) - // wsapi - app.ame.load.LoadJS('WSAPI_Interop.js', false) - // wsapi - - // Bulk JavaScript Functions - app.ame.load.LoadJS('custom.js') - - // Audio Manuipulation Stuff - - app.ame.load.LoadJS('eq.js') - - - // Window Frames - if (app.cfg.get('visual.frameType') === 'mac') { - app.ame.load.LoadCSS('frame_macOS_emulation.css') - } else if (app.cfg.get('visual.frameType') === 'mac-right') { - app.ame.load.LoadCSS('frame_macOS_emulation_right.css') - } else if (process.platform === 'win32' && !app.cfg.get('visual.frameType')) { - app.ame.load.LoadCSS('frame_Windows.css') - } - - // Set the settings variables if needed - if (app.cfg.get('visual.frameType') === 'mac' || app.cfg.get('visual.frameType') === 'mac-right') { - app.cfg.set('visual.removeUpsell', true); - app.cfg.set('visual.removeAppleLogo', true); - } - - // Streamer Mode - if (app.cfg.get('visual.streamerMode')) { - app.ame.load.LoadCSS('streamerMode.css') - } - - /* Remove the Scrollbar */ - if (app.cfg.get('visual.removeScrollbars')) { - app.win.webContents.insertCSS('::-webkit-scrollbar { display: none; }').then() - } else { - app.ame.load.LoadCSS('macosScrollbar.css') - } - - /* Inject the MusicKitInterop file */ - app.win.webContents.executeJavaScript('MusicKitInterop.init()').catch((e) => console.error(e)); - - /* Watches for changes to a theme */ - if (app.watcher) { - app.watcher.close(); - console.verbose('[Watcher] Removed old watcher.') - } - - if (existsSync(resolve(app.getPath('userData'), 'themes', `${app.cfg.get('visual.theme')}.css`)) && app.cfg.get('visual.theme') !== "default" && app.cfg.get('visual.theme')) { - app.watcher = watch(resolve(app.getPath('userData'), 'themes', `${app.cfg.get('visual.theme')}.css`), (event, fileName) => { - if (event === "change" && fileName === `${app.cfg.get('visual.theme')}.css`) { - app.win.webContents.executeJavaScript(`AMStyling.loadTheme("${app.cfg.get('visual.theme')}", true);`).catch((err) => console.error(err)); - } - }); - console.verbose(`[Watcher] Watching for changes: 'themes/${app.cfg.get('visual.theme')}.css'`) - } - } -} \ No newline at end of file diff --git a/oldshit/resources/functions/media/discordrpc.js b/oldshit/resources/functions/media/discordrpc.js deleted file mode 100644 index ea611201..00000000 --- a/oldshit/resources/functions/media/discordrpc.js +++ /dev/null @@ -1,121 +0,0 @@ -const {app} = require('electron'), - DiscordRPC = require('discord-rpc'), - {initAnalytics} = require('../utils'); -initAnalytics(); - -module.exports = { - connect: function (clientId) { - app.discord = {isConnected: false}; - if (!app.cfg.get('general.discordRPC')) return; - - DiscordRPC.register(clientId) // Apparently needed for ask to join, join, spectate etc. - const client = new DiscordRPC.Client({ transport: "ipc" }); - app.discord = Object.assign(client,{error: false, activityCache: null, isConnected: false}); - - // Login to Discord - app.discord.login({ clientId }) - .then(() => { - app.discord.isConnected = true; - }) - .catch((e) => console.error(`[DiscordRPC][connect] ${e}`)); - - app.discord.on('ready', () => { - console.log(`[DiscordRPC][connect] Successfully Connected to Discord. Authed for user: ${client.user.username} (${client.user.id})`); - - if (app.discord.activityCache) { - client.setActivity(app.discord.activityCache).catch((e) => console.error(e)); - app.discord.activityCache = null; - } - }) - - // Handles Errors - app.discord.on('error', err => { - console.error(`[DiscordRPC] ${err}`); - this.disconnect() - app.discord.isConnected = false; - }); - }, - - disconnect: function () { - if (!app.cfg.get('general.discordRPC') || !app.discord.isConnected) return; - - try { - app.discord.destroy().then(() => { - app.discord.isConnected = false; - console.verbose('[DiscordRPC][disconnect] Disconnected from discord.') - }).catch((e) => console.error(`[DiscordRPC][disconnect] ${e}`)); - } catch (err) { - console.error(err) - } - }, - - updateActivity: function (attributes) { - if (!app.cfg.get('general.discordRPC') || app.cfg.get('general.incognitoMode')) return; - - if (!app.discord.isConnected) { - this.connect() - } - - if (!app.discord.isConnected) return; - - console.verbose('[DiscordRPC][updateActivity] Updating Discord Activity.') - - const listenURL = `https://applemusicelectron.com/p?id=${attributes.playParams.id}` - - let ActivityObject = { - details: attributes.name, - state: `by ${attributes.artistName}`, - startTimestamp: attributes.startTime, - endTimestamp: attributes.endTime, - largeImageKey: ((app.cfg.get('general.discordRPC') === 'am-title') ? 'apple' : 'cider'), - largeImageText: attributes.albumName, - smallImageKey: (attributes.status ? 'play' : 'pause'), - smallImageText: (attributes.status ? 'Playing': 'Paused'), - instance: true, - buttons: [ - {label: "Listen on Cider", url: listenURL}, - ] - }; - console.verbose(`[LinkHandler] Listening URL has been set to: ${listenURL}`); - - if (app.cfg.get('general.discordClearActivityOnPause')) { - delete ActivityObject.smallImageKey - delete ActivityObject.smallImageText - } - - // Check all the values work - if (!((new Date(attributes.endTime)).getTime() > 0)) { - delete ActivityObject.startTimestamp - delete ActivityObject.endTimestamp - } - if (!attributes.artistName) { - delete ActivityObject.state - } - if (!ActivityObject.largeImageText || ActivityObject.largeImageText.length < 2) { - delete ActivityObject.largeImageText - } - - // Clear if if needed - if (!attributes.status) { - if (app.cfg.get('general.discordClearActivityOnPause')) { - app.discord.clearActivity().catch((e) => console.error(`[DiscordRPC][clearActivity] ${e}`)); - ActivityObject = null - } else { - delete ActivityObject.startTimestamp - delete ActivityObject.endTimestamp - ActivityObject.smallImageKey = 'pause' - ActivityObject.smallImageText = 'Paused' - } - } - - if (ActivityObject) { - try { - console.verbose(`[DiscordRPC][setActivity] Setting activity to ${JSON.stringify(ActivityObject)}`); - app.discord.setActivity(ActivityObject) - } catch (err) { - console.error(`[DiscordRPC][setActivity] ${err}`) - } - - } - }, -} \ No newline at end of file diff --git a/oldshit/resources/functions/media/lastfm.js b/oldshit/resources/functions/media/lastfm.js deleted file mode 100644 index 993ca75d..00000000 --- a/oldshit/resources/functions/media/lastfm.js +++ /dev/null @@ -1,155 +0,0 @@ -const {app, Notification} = require('electron'), - fs = require('fs'), - {resolve} = require('path'), - sessionPath = resolve(app.getPath('userData'), 'session.json'), - apiCredentials = require('../../lfmApiCredentials.json'), - LastfmAPI = require('lastfmapi'), - {initAnalytics} = require('../utils'); -initAnalytics(); - -const lfm = { - authenticateFromFile: function () { - let sessionData = require(sessionPath) - console.log("[LastFM][authenticateFromFile] Logging in with Session Info.") - app.lastfm.setSessionCredentials(sessionData.name, sessionData.key) - console.log("[LastFM][authenticateFromFile] Logged in.") - }, - - authenticate: function () { - if (app.cfg.get('tokens.lastfm')) { - app.cfg.set('general.lastfm', true); - } - - if (!app.cfg.get('general.lastfm') || !app.cfg.get('tokens.lastfm')) { - app.cfg.set('general.lastfm', false); - return - } - - const lfmAPI = new LastfmAPI({ - 'api_key': apiCredentials.key, - 'secret': apiCredentials.secret - }); - - app.lastfm = Object.assign(lfmAPI, {cachedAttributes: false, cachedNowPlayingAttributes: false}); - - fs.stat(sessionPath, function (err) { - if (err) { - console.error("[LastFM][Session] Session file couldn't be opened or doesn't exist,", err) - console.log("[LastFM][Auth] Beginning authentication from configuration") - app.lastfm.authenticate(app.cfg.get('tokens.lastfm'), function (err, session) { - if (err) { - throw err; - } - console.log("[LastFM] Successfully obtained LastFM session info,", session); // {"name": "LASTFM_USERNAME", "key": "THE_USER_SESSION_KEY"} - console.log("[LastFM] Saving session info to disk.") - let tempData = JSON.stringify(session) - fs.writeFile(sessionPath, tempData, (err) => { - if (err) - console.log("[LastFM][fs]", err) - else { - console.log("[LastFM][fs] File was written successfully.") - lfm.authenticateFromFile() - new Notification({ - title: app.getName(), - body: "Successfully logged into LastFM using Authentication Key." - }).show() - } - }) - }); - } else { - lfm.authenticateFromFile() - } - }) - }, - - scrobbleSong: async function (attributes) { - await new Promise(resolve => setTimeout(resolve, app.cfg.get('general.lastfmScrobbleDelay') * 1000)); - const currentAttributes = app.media; - - if (!app.lastfm || app.lastfm.cachedAttributes === attributes || app.cfg.get('general.incognitoMode')) { - return - } - - if (app.lastfm.cachedAttributes) { - if (app.lastfm.cachedAttributes.playParams.id === attributes.playParams.id) return; - } - - if (currentAttributes.status && currentAttributes === attributes) { - if (fs.existsSync(sessionPath)) { - // Scrobble playing song. - if (attributes.status === true) { - app.lastfm.track.scrobble({ - 'artist': lfm.filterArtistName(attributes.artistName), - 'track': attributes.name, - 'album': attributes.albumName, - 'albumArtist': this.filterArtistName(attributes.artistName), - 'timestamp': new Date().getTime() / 1000 - }, function (err, scrobbled) { - if (err) { - return console.error('[LastFM] An error occurred while scrobbling', err); - } - - console.verbose('[LastFM] Successfully scrobbled: ', scrobbled); - }); - app.lastfm.cachedAttributes = attributes - } - } else { - this.authenticate(); - } - } else { - return console.verbose('[LastFM] Did not add ', attributes.name , '-' , lfm.filterArtistName(attributes.artistName), 'because now playing a other song.'); - } - }, - - filterArtistName: function (artist) { - if (!app.cfg.get('general.lastfmRemoveFeaturingArtists')) return artist; - - artist = artist.split(' '); - if (artist.includes('&')) { - artist.length = artist.indexOf('&'); - } - if (artist.includes('and')) { - artist.length = artist.indexOf('and'); - } - artist = artist.join(' '); - if (artist.includes(',')) { - artist = artist.split(',') - artist = artist[0] - } - return artist.charAt(0).toUpperCase() + artist.slice(1); - }, - - updateNowPlayingSong: function (attributes) { - if (!app.lastfm ||app.lastfm.cachedNowPlayingAttributes === attributes || app.cfg.get('general.incognitoMode') || !app.cfg.get('general.lastfmNowPlaying')) { - return - } - - if (app.lastfm.cachedNowPlayingAttributes) { - if (app.lastfm.cachedNowPlayingAttributes.playParams.id === attributes.playParams.id) return; - } - - if (fs.existsSync(sessionPath)) { - // update Now Playing - if (attributes.status === true) { - app.lastfm.track.updateNowPlaying({ - 'artist': lfm.filterArtistName(attributes.artistName), - 'track': attributes.name, - 'album': attributes.albumName, - 'albumArtist': this.filterArtistName(attributes.artistName) - }, function (err, nowPlaying) { - if (err) { - return console.error('[LastFM] An error occurred while updating nowPlayingSong', err); - } - - console.verbose('[LastFM] Successfully updated nowPlayingSong', nowPlaying); - }); - app.lastfm.cachedNowPlayingAttributes = attributes - } - - } else { - this.authenticate() - } - } -} - -module.exports = lfm; \ No newline at end of file diff --git a/oldshit/resources/functions/media/mpris.js b/oldshit/resources/functions/media/mpris.js deleted file mode 100644 index 3c57e2fb..00000000 --- a/oldshit/resources/functions/media/mpris.js +++ /dev/null @@ -1,119 +0,0 @@ -const {app} = require('electron'), - Player = require('mpris-service'), - {initAnalytics} = require('../utils'); -initAnalytics(); - -// Remember to use playerctl when debugging this. -// I'm just putting this here as I keep forgetting the command. - -module.exports = { - connect: function () { - if (process.platform !== "linux") { - app.mpris = {active: false} - return; - } - console.log('[MPRIS][connect] Initializing Connection.') - - try { - app.mpris = Player({ - name: 'AppleMusic', - identity: 'Apple Music', - supportedUriSchemes: [], - supportedMimeTypes: [], - supportedInterfaces: ['player'] - }); - app.mpris = Object.assign(app.mpris, { active: false, canQuit: true, canControl: true, canPause: true, canPlay: true, canGoNext: true }) - } catch (err) { - app.mpris.active = false - console.error(`[MPRIS][connect] ${err}`) - return - } - - let pos_atr = {durationInMillis: 0}; - app.mpris.getPosition = function () { - const durationInMicro = pos_atr.durationInMillis * 1000; - const percentage = parseFloat(0) || 0; - return durationInMicro * percentage; - } - - app.mpris.active = true - - this.clearActivity() - this.stateHandler() - }, - - stateHandler: function () { - app.mpris.on('playpause', async () => { - app.win.webContents.executeJavaScript('MusicKitInterop.pausePlay()').catch(err => console.error(err)) - }); - - app.mpris.on('play', async () => { - app.win.webContents.executeJavaScript('MusicKitInterop.pausePlay()').catch(err => console.error(err)) - }); - - app.mpris.on('pause', async () => { - app.win.webContents.executeJavaScript('MusicKitInterop.pausePlay()').catch(err => console.error(err)) - }); - - app.mpris.on('next', async () => { - app.win.webContents.executeJavaScript('MusicKitInterop.nextTrack()').catch(err => console.error(err)) - }); - - app.mpris.on('previous', async () => { - app.win.webContents.executeJavaScript('MusicKitInterop.previousTrack()').catch(err => console.error(err)) - }); - }, - - updateActivity: function (attributes) { - if (!app.mpris.active) return; - - console.verbose('[MPRIS][updateActivity] Updating Song Activity.') - - const MetaData = { - 'mpris:trackid': app.mpris.objectPath(`track/${attributes.playParams.id.replace(/[.]+/g, "")}`), - 'mpris:length': attributes.durationInMillis * 1000, // In microseconds - 'mpris:artUrl': (attributes.artwork.url.replace('/{w}x{h}bb', '/512x512bb')).replace('/2000x2000bb', '/35x35bb'), - 'xesam:title': `${attributes.name}`, - 'xesam:album': `${attributes.albumName}`, - 'xesam:artist': [`${attributes.artistName}`,], - 'xesam:genre': attributes.genreNames - } - - if (app.mpris.metadata["mpris:trackid"] === MetaData["mpris:trackid"]) { - return - } - - app.mpris.metadata = MetaData - }, - - updateState: function (attributes) { - if (!app.mpris.active) return; - - console.verbose('[MPRIS][updateState] Updating Song Playback State.') - - function setPlaybackIfNeeded(status) { - if (app.mpris.playbackStatus === status) { - return - } - app.mpris.playbackStatus = status; - } - - switch (attributes.status) { - case true: // Playing - setPlaybackIfNeeded('Playing'); - break; - case false: // Paused - setPlaybackIfNeeded('Paused'); - break; - default: // Stopped - setPlaybackIfNeeded('Stopped'); - break; - } - }, - - clearActivity: function () { - if (!app.mpris.active) return; - app.mpris.metadata = {'mpris:trackid': '/org/mpris/MediaPlayer2/TrackList/NoTrack'} - app.mpris.playbackStatus = 'Stopped'; - }, -} \ No newline at end of file diff --git a/oldshit/resources/functions/splash.js b/oldshit/resources/functions/splash.js deleted file mode 100644 index 4ce20375..00000000 --- a/oldshit/resources/functions/splash.js +++ /dev/null @@ -1,30 +0,0 @@ -const { - BrowserWindow -} = require('electron'); - -const SplashScreen = { - win: null, - show: function () { - this.win = new BrowserWindow({ - width: 300, - height: 300, - resizable: false, - show: true, - center: true, - transparent: true, - frame: false, - alwaysOnTop: true, - // skipTaskbar: true, - webPreferences: { - nodeIntegration: true - } - }) - this.win.show() - this.win.loadFile('./resources/splash/index_old.html') - this.win.on("closed", () => { - this.win = null - }) - } -} - -module.exports = SplashScreen \ No newline at end of file diff --git a/oldshit/resources/functions/utils.js b/oldshit/resources/functions/utils.js deleted file mode 100644 index b73d7fe7..00000000 --- a/oldshit/resources/functions/utils.js +++ /dev/null @@ -1,395 +0,0 @@ -const {app, nativeImage, nativeTheme, Notification, dialog} = require("electron"), - {existsSync, readFileSync, readdirSync, constants, access, writeFileSync, copyFileSync} = require("fs"), - {readdir, mkdir} = require("fs/promises"), - {join, resolve} = require("path"), - {autoUpdater} = require("electron-updater"), - os = require("os"), - rimraf = require("rimraf"), - chmod = require("chmodr"), - clone = require("git-clone/promise"), - trayIconDir = (nativeTheme.shouldUseDarkColors ? join(__dirname, `../icons/media/light/`) : join(__dirname, `../icons/media/dark/`)), - ElectronSentry = require("@sentry/electron"); - -const Utils = { - - /* hexToRgb - Converts hex codes to rgb */ - hexToRgb: (hex) => { - const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); - return result ? { - r: parseInt(result[1], 16), - g: parseInt(result[2], 16), - b: parseInt(result[3], 16) - } : null; - }, - - /* matchRuleShort - Used for wildcards */ - matchRuleShort: (str, rule) => { - var escapeRegex = (str) => str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); - return new RegExp("^" + rule.split("*").map(escapeRegex).join(".*") + "$").test(str); - }, - - /* isVibrancySupported - Checks if the operating system support electron-acrylic-window (Windows 10 or greater) */ - isVibrancySupported: () => { - return (process.platform === 'win32' && parseInt(os.release().split('.')[0]) >= 10) - }, - - /* isAcrylicSupported - Checks if the operating system supports the acrylic transparency affect (Windows RS3 (Redstone 3) 1709 or Greater) */ - isAcrylicSupported: () => { - return (process.platform === 'win32' && parseInt(os.release().replace(/\./g, "").replace(',', '.')) >= 10016299) - }, - - /* fetchThemeMeta - Fetches the meta data associated to a theme */ - fetchThemeMeta: (fileName) => { - const filePath = resolve(app.getPath("userData"), "themes", `${fileName}.css`); - - let fileMeta = { - name: null, - author: null, - description: null, - transparency: {dark: null, light: null}, - options: [] - }; - - if (!existsSync(filePath)) return fileMeta; - const file = readFileSync(filePath, "utf8"); - if (!file) return; - - file.split(/\r?\n/).forEach((line) => { - if (line.includes("@name")) { - fileMeta.name = line.split("@name ")[1].trim(); - } - - if (line.includes("@author")) { - fileMeta.author = line.split("@author ")[1].trim(); - } - - if (line.includes("@description")) { - fileMeta.description = line.split("@description ")[1] - } - - if (line.includes("@option")) { - var themeOption = line.split("@option ")[1].trim().split("|") - fileMeta.options.push({ - key: themeOption[0], - name: themeOption[1], - defaultValue: themeOption[2] - }) - } - - if (line.includes("--lightTransparency")) { - fileMeta.transparency.light = line.split("--lightTransparency: ")[1].trim().split(' ')[0]; - } - - if (line.includes("--darkTransparency")) { - fileMeta.transparency.dark = line.split("--darkTransparency: ")[1].trim().split(' ')[0]; - } - - if (fileMeta.transparency.dark && fileMeta.transparency.light) { - fileMeta.transparency = nativeTheme.shouldUseDarkColors ? fileMeta.transparency.dark : fileMeta.transparency.light - } - - if (!fileMeta.transparency.dark || !fileMeta.transparency.light) { - if (line.includes("--transparency")) { - fileMeta.transparency = line.split("--transparency: ")[1].split(' ')[0]; - } - } - }); - - if (typeof fileMeta.transparency == "object") { - if (!fileMeta.transparency.dark || !fileMeta.transparency.light) { - fileMeta.transparency = false; - } - } - - console.verbose(`[fetchThemeMeta] Returning ${JSON.stringify(fileMeta)}`); - return fileMeta - }, - - /* fetchTransparencyOptions - Fetches the transparency options */ - fetchTransparencyOptions: () => { - if (process.platform === "darwin" && (!app.cfg.get('visual.transparencyEffect') || !Utils.isVibrancySupported())) { - app.transparency = true; - return "fullscreen-ui" - } else if (!app.cfg.get('visual.transparencyEffect') || !Utils.isVibrancySupported()) { - console.verbose(`[fetchTransparencyOptions] Vibrancy not created. Required options not met. (transparencyEffect: ${app.cfg.get('visual.transparencyEffect')} | isVibrancySupported: ${Utils.isVibrancySupported()})`); - app.transparency = false; - return false - } else if (process.platform === "win32" && app.cfg.get('visual.transparencyEffect') === "mica") { - return false - } - - console.log('[fetchTransparencyOptions] Fetching Transparency Options') - let transparencyOptions = { - theme: null, - effect: app.cfg.get('visual.transparencyEffect'), - debug: app.cfg.get('advanced.verboseLogging'), - } - - //------------------------------------------ - // Disable on blur for acrylic - //------------------------------------------ - if (app.cfg.get('visual.transparencyEffect') === 'acrylic') { - transparencyOptions.disableOnBlur = app.cfg.get('visual.transparencyDisableBlur'); - } - - //------------------------------------------ - // Set the transparency theme - //------------------------------------------ - if (app.cfg.get('visual.transparencyTheme') === 'appearance-based') { - if (app.cfg.get('visual.theme') && app.cfg.get('visual.theme') !== "default") { - transparencyOptions.theme = Utils.fetchThemeMeta(app.cfg.get('visual.theme')).transparency; /* Fetch the Transparency from the Themes Folder */ - } else if ((!app.cfg.get('visual.theme') || app.cfg.get('visual.theme') === "default") && app.cfg.get('visual.transparencyEffect') === 'acrylic') { - transparencyOptions.theme = (nativeTheme.shouldUseDarkColors ? '#3C3C4307' : '#EBEBF507') /* Default Theme when Using Acrylic */ - } else { // Fallback - transparencyOptions.theme = (nativeTheme.shouldUseDarkColors ? 'dark' : 'light') - } - } else { - transparencyOptions.theme = app.cfg.get('visual.transparencyTheme'); - } - - //------------------------------------------ - // Set the refresh rate - //------------------------------------------ - if (app.cfg.get('visual.transparencyMaximumRefreshRate')) { - transparencyOptions.useCustomWindowRefreshMethod = true - transparencyOptions.maximumRefreshRate = app.cfg.get('visual.transparencyMaximumRefreshRate') - } - - app.transparency = true - console.log(`[fetchTransparencyOptions] Returning: ${JSON.stringify(transparencyOptions)}`) - return transparencyOptions - }, - - /* fetchThemesListing - Fetches the themes directory listing (Lists .css files) */ - fetchThemesListing: () => { - if (!existsSync(resolve(app.getPath("userData"), "themes"))) return; - - let themesFileNames = [], themesListing = {}; - - - readdirSync(resolve(app.getPath("userData"), "themes")).forEach((value) => { - if (value.split('.').pop() === 'css') { - themesFileNames.push(value.split('.').shift()) - } - }); - - // Get the Info - themesFileNames.forEach((themeFileName) => { - const themeData = Utils.fetchThemeMeta(themeFileName); - if (themeData && themeData.name && themeData.description && themeData.author) { - themesListing[themeFileName] = themeData; - } - }) - - return themesListing - }, - - /* fetchPluginsListing - Fetches the plugins directory listing (Lists .js files) */ - fetchPluginsListing: () => { - if (!existsSync(resolve(app.getPath("userData"), "plugins"))) return; - - let pluginsFileNames = [], pluginsListing = {}; - - - readdirSync(resolve(app.getPath("userData"), "plugins")).forEach((value) => { - if (value.split('.').pop() === 'js') { - pluginsFileNames.push(value.split('.').shift()) - } - }); - - console.log(pluginsFileNames) - - return pluginsFileNames - }, - - /* fetchOperatingSystem - Fetches the operating system name */ - fetchOperatingSystem: () => { - if (process.platform === "win32") { - const release = parseInt(os.release().replaceAll('.', '')) - if (release >= 10022000) { - return 'Windows 11' - } else if (release < 10022000 && release >= 10010240) { - return 'Windows 10' - } - } - }, - - /* updateThemes - Purges the themes directory and clones a fresh copy of the themes */ - updateThemes: async () => { - if (app.watcher) { - app.watcher.close() - } - - const tmpDir = join(os.tmpdir(), "ame-themes") - const themesDir = join(app.getPath("userData"), "themes") - - if (existsSync(themesDir)) { - if (existsSync(tmpDir)) { - rimraf(tmpDir, [], async (err) => { - if (err) return err - await clone('https://github.com/Apple-Music-Electron/Apple-Music-Electron-Themes', tmpDir, [], (err) => console.log(err)) - }) - } else { - await mkdir(tmpDir, {recursive: true}) - await clone('https://github.com/Apple-Music-Electron/Apple-Music-Electron-Themes', tmpDir, [], (err) => console.log(err)) - } - - // Base Line Directory Comparison - const updateList = await readdir(tmpDir); - const foundChanges = {}; - - for (const file of updateList) { - if (file.split('.').pop() === 'css' && file !== "Template.css") { // Reduces listing compare down to css files - console.verbose(`[compareDirectories] Comparing ${file}`) - - if (!existsSync(join(themesDir, file))) { - copyFileSync(join(tmpDir, file), join(themesDir, file)) - foundChanges[file] = 'added' - } else { - const updateFile = readFileSync(join(tmpDir, file)); - const origFile = readFileSync(join(themesDir, file)); - - if (origFile.toString() !== updateFile.toString()) { - writeFileSync(join(themesDir, file), updateFile) - foundChanges[file] = 'updated' - } - } - } - } - - return foundChanges - } else { - await mkdir(tmpDir, {recursive: true}) - await clone('https://github.com/Apple-Music-Electron/Apple-Music-Electron-Themes', themesDir, [], (err) => console.log(err)) - return {'initial': true} - } - - - }, - - /* permissionsCheck - Checks of the file can be read and written to, if it cannot be chmod -r is run on the directory */ - permissionsCheck: (folder, file) => { - console.verbose(`[permissionsCheck] Running check on ${join(folder, file)}`) - access(join(folder, file), constants.R_OK | constants.W_OK, (err) => { - if (err) { // File cannot be read after cloning - console.error(`[permissionsCheck][access] ${err}`) - chmod(folder, 0o777, (err) => { - if (err) { - console.error(`[permissionsCheck][chmod] ${err} - Theme set to default to prevent application launch halt.`); - } - }); - } else { - console.verbose('[permissionsCheck] Check passed.') - } - }) - }, - - /* initAnalytics - Sentry Analytics */ - initAnalytics: () => { - if (app.cfg.get('general.analyticsEnabled') && app.isPackaged) { - ElectronSentry.init({dsn: "https://20e1c34b19d54dfcb8231e3ef7975240@o954055.ingest.sentry.io/5903033"}); - } - }, - - /* checkForUpdates - Checks for update using electron-updater (Part of electron-builder) */ - checkForUpdates: (manual) => { - if (!app.isPackaged || process.env.NODE_ENV !== 'production') return; - - autoUpdater.logger = require("electron-log"); - autoUpdater.logger.transports.file.resolvePath = (vars) => { - return join(app.getPath('userData'), 'logs', vars.fileName); - } - autoUpdater.logger.transports.file.level = "info"; - - if (app.cfg.get('advanced.autoUpdaterBetaBuilds')) { - autoUpdater.allowPrerelease = true - autoUpdater.allowDowngrade = false - } - - autoUpdater.on('update-not-available', () => { - if (manual === true) { - let bodyVer = `You are on the latest version. (v${app.getVersion()})` - new Notification({title: "Apple Music", body: bodyVer}).show() - } - }) - - autoUpdater.on('download-progress', (progress) => { - let convertedProgress = parseFloat(progress); - app.win.setProgressBar(convertedProgress) - }) - - autoUpdater.on("error", function (error) { - console.error(`[checkForUpdates] Error ${error}`) - }); - - autoUpdater.on('update-downloaded', (updateInfo) => { - console.warn('[checkForUpdates] New version downloaded. Starting user prompt.'); - - dialog.showMessageBox({ - type: 'info', - title: 'Updates Available', - message: `Update was found and downloaded, would you like to install the update now?`, - details: updateInfo, - buttons: ['Sure', 'No'] - }).then(({response}) => { - if (response === 0) { - const isSilent = true; - const isForceRunAfter = true; - autoUpdater.quitAndInstall(isSilent, isForceRunAfter); - } else { - updater.enabled = true - updater = null - } - }) - - }) - - autoUpdater.checkForUpdates() - .then(r => { - console.verbose(`[checkForUpdates] Check for updates completed. Response: ${r}`) - }) - .catch(err => { - console.error(`[checkUpdates] An error occurred while checking for updates: ${err}`) - }) - }, - - /* Media Controlling Functions (Pause/Play/Skip/Previous) */ - media: { - pausePlay() { - console.verbose('[AppleMusic] pausePlay run.') - app.win.webContents.executeJavaScript("MusicKitInterop.pausePlay()").catch((err) => console.error(err)) - }, - - nextTrack() { - console.verbose('[AppleMusic] nextTrack run.') - app.win.webContents.executeJavaScript("MusicKitInterop.nextTrack()").catch((err) => console.error(err)) - }, - - previousTrack() { - console.verbose('[AppleMusic] previousTrack run.') - app.win.webContents.executeJavaScript("MusicKitInterop.previousTrack()").catch((err) => console.error(err)) - } - }, - - /* Media-associated Icons (Used for Thumbar and TouchBar) */ - icons: { - pause: nativeImage.createFromPath(join(trayIconDir, 'pause.png')).resize({width: 32, height: 32}), - play: nativeImage.createFromPath(join(trayIconDir, 'play.png')).resize({width: 32, height: 32}), - nextTrack: nativeImage.createFromPath(join(trayIconDir, 'next.png')).resize({width: 32, height: 32}), - previousTrack: nativeImage.createFromPath(join(trayIconDir, 'previous.png')).resize({width: 32, height: 32}), - inactive: { - play: nativeImage.createFromPath(join(trayIconDir, 'play-inactive.png')).resize({width: 32, height: 32}), - nextTrack: nativeImage.createFromPath(join(trayIconDir, 'next-inactive.png')).resize({ - width: 32, - height: 32 - }), - previousTrack: nativeImage.createFromPath(join(trayIconDir, 'previous-inactive.png')).resize({ - width: 32, - height: 32 - }), - } - } -} - -Utils.initAnalytics() -module.exports = Utils; \ No newline at end of file diff --git a/oldshit/resources/functions/win.js b/oldshit/resources/functions/win.js deleted file mode 100644 index ca5ee26e..00000000 --- a/oldshit/resources/functions/win.js +++ /dev/null @@ -1,407 +0,0 @@ -const {app, Menu, Notification, TouchBar, BrowserWindow} = require("electron"), - {TouchBarButton, TouchBarLabel, TouchBarSpacer} = TouchBar, - {join} = require("path"), - windowStateKeeper = require("electron-window-state"), - {initAnalytics} = require('./utils'); -initAnalytics(); - -module.exports = { - - SetApplicationMenu: () => { - if (process.platform !== "darwin") return; - - Menu.setApplicationMenu(Menu.buildFromTemplate([ - { - label: app.getName(), - submenu: [ - { role: 'about' }, - { type: 'separator' }, - { role: 'services' }, - { type: 'separator' }, - { role: 'hide' }, - { role: 'hideOthers' }, - { role: 'unhide' }, - { type: 'separator' }, - { role: 'quit' } - ] - }, - { - label: 'View', - submenu: [ - { role: 'reload' }, - { role: 'forceReload' }, - { role: 'toggleDevTools' }, - { type: 'separator' }, - { role: 'resetZoom' }, - { role: 'zoomIn' }, - { role: 'zoomOut' }, - { type: 'separator' }, - { role: 'togglefullscreen' } - ] - }, - { - label: 'Window', - role: 'window', - submenu: [ - { role: 'minimize' }, - { role: 'zoom' }, - { type: 'separator' }, - { role: 'front' }, - { type: 'separator' }, - { role: 'window' } - ] - }, - { - label: 'Support', - role: 'help', - submenu: [ - { - label: 'Discord', - click() { - require("shell").openExternal("https://discord.gg/CezHYdXHEM") - } - }, - { - label: 'GitHub Wiki', - click() { - require("shell").openExternal("https://github.com/Apple-Music-Electron/Apple-Music-Electron/wiki") - } - }, - { type: 'separator' }, - { - label: 'View License', - click() { - require("shell").openExternal("https://github.com/Apple-Music-Electron/Apple-Music-Electron/blob/master/LICENSE") - } - }, - { type: 'separator' }, - { - label: 'Toggle Developer Tools', - accelerator: 'Option+CommandOrControl+I', - click() { - app.win.webContents.openDevTools() - } - }, - { - label: 'Open Configuration File in Editor', - click() { - app.cfg.openInEditor() - } - } - ] - }, - ])); - }, - - SetContextMenu: (visibility) => { - - if (visibility) { - app.tray.setContextMenu(Menu.buildFromTemplate([ - { - label: 'Check for Updates', - click: function () { - app.ame.utils.checkForUpdates(true) - } - }, - { - label: 'Minimize to Tray', - click: function () { - if (typeof app.win.hide === 'function') { - app.win.hide(); - } - } - }, - { - label: 'Quit', - click: function () { - app.quit(); - } - } - ])); - } else { - app.tray.setContextMenu(Menu.buildFromTemplate([ - { - label: 'Check for Updates', - click: function () { - app.ame.utils.checkForUpdates(true) - } - }, - { - label: `Show ${app.getName()}`, - click: function () { - if (typeof app.win.show === 'function') { - app.win.show(); - } - } - }, - { - label: 'Quit', - click: function () { - app.quit(); - } - } - ])); - } - return true - - }, - - SetTaskList: () => { - if (process.platform !== "win32") return; - - app.setUserTasks([ - { - program: process.execPath, - arguments: '--force-quit', - iconPath: process.execPath, - iconIndex: 0, - title: `Quit ${app.getName()}` - } - ]); - return true - }, - - SetButtons: () => { - - if (process.platform === 'win32') { // Set the Windows Thumbnail Toolbar Buttons - if (app.media.playParams.id !== 'no-id-found') { - app.win.setThumbarButtons([ - { - tooltip: 'Previous', - icon: app.ame.utils.icons.previousTrack, - click() { - app.ame.utils.media.previousTrack() - } - }, - { - tooltip: app.media.status ? 'Pause' : 'Play', - icon: app.media.status ? app.ame.utils.icons.pause : app.ame.utils.icons.play, - click() { - app.ame.utils.media.pausePlay() - } - }, - { - tooltip: 'Next', - icon: app.ame.utils.icons.nextTrack, - click() { - app.ame.utils.media.nextTrack() - } - } - ]); - } else { - app.win.setThumbarButtons([ - { - tooltip: 'Previous', - icon: app.ame.utils.icons.inactive.previousTrack, - flags: ["disabled"] - }, - { - tooltip: 'Play', - icon: app.ame.utils.icons.inactive.play, - flags: ["disabled"] - }, - { - tooltip: 'Next', - icon: app.ame.utils.icons.inactive.nextTrack, - flags: ["disabled"] - } - ]); - } - } else if (process.platform === 'darwin') { // Set the macOS Touchbar - if (!app.media || app.media.playParams.id === 'no-id-found') return; - - const nextTrack = new TouchBarButton({ - icon: app.ame.utils.icons.nextTrack, - click: () => { - app.ame.utils.media.nextTrack() - } - }) - - const previousTrack = new TouchBarButton({ - icon: app.ame.utils.icons.previousTrack, - click: () => { - app.ame.utils.media.previousTrack() - } - }) - - const playPause = new TouchBarButton({ - icon: app.media.status ? app.ame.utils.icons.pause : app.ame.utils.icons.play, - click: () => { - app.ame.utils.media.pausePlay() - } - }) - - const trackInfo = new TouchBarLabel({ - label: app.media.name ? `${app.media.name} by ${app.media.artistName}` : `Nothing is Playing` - }) - - const touchBar = new TouchBar({ - items: [ - previousTrack, - playPause, - nextTrack, - new TouchBarSpacer({size: 'flexible'}), - trackInfo, - new TouchBarSpacer({size: 'flexible'}) - ] - }) - - app.win.setTouchBar(touchBar) - } - }, - - SetTrayTooltip: (attributes) => { - if (!app.cfg.get('general.trayTooltipSongName')) return; - - console.verbose(`[UpdateTooltip] Updating Tooltip for ${attributes.name} to ${attributes.status}`) - - if (attributes.status === true) { - app.tray.setToolTip(`Playing ${attributes.name} by ${attributes.artistName} on ${attributes.albumName}`); - } else { - app.tray.setToolTip(`Paused ${attributes.name} by ${attributes.artistName} on ${attributes.albumName}`); - } - }, - - CreateNotification: (attributes) => { - if (!Notification.isSupported() || !(app.cfg.get('general.playbackNotifications') || app.cfg.get('general.playbackNotifications') === 'minimized')) return; - - if (app.cfg.get('general.playbackNotifications') === "minimized" && !(!app.win.isVisible() || app.win.isMinimized())) { - return; - } - - console.verbose(`[CreateNotification] Notification Generating | Function Parameters: SongName: ${attributes.name} | Artist: ${attributes.artistName} | Album: ${attributes.albumName}`) - - if (app.ipc.existingNotification) { - console.log("[CreateNotification] Existing Notification Found - Removing. ") - app.ipc.existingNotification.close() - app.ipc.existingNotification = false - } - - const NOTIFICATION_OBJECT = { - title: attributes.name, - body: `${attributes.artistName} - ${attributes.albumName}`, - silent: true, - icon: join(__dirname, '../icons/icon.png'), - actions: [{ - type: 'button', - text: 'Skip' - }] - } - - app.ipc.existingNotification = new Notification(NOTIFICATION_OBJECT) - app.ipc.existingNotification.show() - - - app.ipc.existingNotification.addListener('action', (_event) => { - app.ame.utils.media.nextTrack() - }); - }, - - CreateBrowserWindow: () => { - console.log('[CreateBrowserWindow] Initializing Browser Window Creation.') - // Set default window sizes - const mainWindowState = windowStateKeeper({ - defaultWidth: 1024, - defaultHeight: 600 - }); - - const options = { - icon: join(__dirname, `../icons/icon.ico`), - width: mainWindowState.width, - height: mainWindowState.height, - x: mainWindowState.x, - y: mainWindowState.y, - minWidth: (app.cfg.get('visual.streamerMode') ? 400 : 300), - minHeight: ((app.cfg.get('visual.frameType') === 'mac' || app.cfg.get('visual.frameType') === 'mac-right') ? (app.cfg.get('visual.streamerMode')? 55 : 300) : (app.cfg.get('visual.streamerMode') ? 115 : 300)), - frame: (process.platform !== 'win32' && !(app.cfg.get('visual.frameType') === 'mac' || app.cfg.get('visual.frameType') === 'mac-right')), - title: app.getName(), - resizable: true, - // Enables DRM - webPreferences: { - plugins: true, - preload: join(__dirname, '../js/MusicKitInterop.js'), - allowRunningInsecureContent: true, - nodeIntegration: false, - nodeIntegrationInWorker: false, - contextIsolation: false, - webSecurity: true, - sandbox: true, - nativeWindowOpen: true - } - }; - - // Fetch the transparency options - const transparencyOptions = app.ame.utils.fetchTransparencyOptions() - - if (process.platform === 'darwin' && !app.cfg.get('visual.frameType')) { // macOS Frame and transparency - options.titleBarStyle = 'hidden' - options.titleBarOverlay = true - options.frame = true - options.trafficLightPosition = {x: 20, y: 20} - options.transparent = (app.transparency && transparencyOptions) - } - - // Create the Browser Window - console.log('[CreateBrowserWindow] Creating BrowserWindow.') - let win; - if (process.platform === "darwin" || process.platform === "linux") { - win = new BrowserWindow(options) - } else { - const {BrowserWindow} = require("electron-acrylic-window"); - if (app.transparency && transparencyOptions) { - console.log('[CreateBrowserWindow] Setting Vibrancy') - options.vibrancy = transparencyOptions - } - win = new BrowserWindow(options) - } - - // Set the transparency - if (app.transparency && transparencyOptions && process.platform === "darwin") { - console.log('[CreateBrowserWindow] Setting Vibrancy') - win.setVibrancy(transparencyOptions) - } - - // alwaysOnTop - if (!app.cfg.get('window.alwaysOnTop')) { - win.setAlwaysOnTop(false) - } else { - win.setAlwaysOnTop(true) - } - - win.setMenuBarVisibility(false); // Hide that nasty menu bar - if (app.cfg.get('advanced.devToolsOnStartup')) win.webContents.openDevTools({mode: 'detach'}); // Enables Detached DevTools - - // Register listeners on Window to track size and position of the Window. - mainWindowState.manage(win); - - // Load the Website - app.ame.load.LoadWebsite(win) - - return win - }, - - HandleBrowserWindow: () => { - // Detect if the application has been opened with --minimized - if (app.commandLine.hasSwitch('minimized') || process.argv.includes('--minimized')) { - console.log("[Apple-Music-Electron] Application opened with '--minimized'"); - if (typeof app.win.minimize === 'function') { - app.win.minimize(); - } - } - - // Detect if the application has been opened with --hidden - if (app.commandLine.hasSwitch('hidden') || process.argv.includes('--hidden')) { - console.log("[Apple-Music-Electron] Application opened with '--hidden'"); - if (typeof app.win.hide === 'function') { - app.win.hide() - } - } - }, - - removeInsertedCSS: (index) => { - if (app.injectedCSS[index]) { - app.win.webContents.removeInsertedCSS(app.injectedCSS[index]).then(r => { if (r) { console.error(r); }}); - } - - } -} \ No newline at end of file diff --git a/oldshit/resources/functions/wsapi.js b/oldshit/resources/functions/wsapi.js deleted file mode 100644 index 44039ac6..00000000 --- a/oldshit/resources/functions/wsapi.js +++ /dev/null @@ -1,321 +0,0 @@ -const ws = require('ws'); -const http = require('http'); -const WebSocketServer = ws.Server; -const WebSocket = ws.WebSocket; -const url = require('url'); -const fs = require('fs'); -const path = require('path'); -const port = process.argv[2] || 9000; -const express = require('express'); -const router = express.Router(); -const getPort = require('get-port'); -const { - ipcMain, - app, - BrowserWindow -} = require('electron'); - -const wsapi = { - standardResponse: function (status, data, message, type = "generic") { - this.status = status; - this.message = message; - this.data = data; - this.type = type; - }, - port: 26369, - wss: null, - clients: [], - createId() { - // create random guid - return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { - var r = Math.random() * 16 | 0, - v = c == 'x' ? r : (r & 0x3 | 0x8); - return v.toString(16); - }); - }, - async InitWebSockets () { - ipcMain.on('wsapi-updatePlaybackState', (event, arg) => { - wsapi.updatePlaybackState(arg); - }) - - ipcMain.on('wsapi-returnQueue', (event, arg) => { - wsapi.returnQueue(JSON.parse(arg)); - }); - - ipcMain.on('wsapi-returnSearch', (event, arg) => { - wsapi.returnSearch(JSON.parse(arg)); - }); - - ipcMain.on('wsapi-returnSearchLibrary', (event, arg) => { - wsapi.returnSearchLibrary(JSON.parse(arg)); - }); - - ipcMain.on('wsapi-returnDynamic', (event, arg, type) => { - wsapi.returnDynamic(JSON.parse(arg), type); - }); - - ipcMain.on('wsapi-returnMusicKitApi', (event, arg, method) => { - wsapi.returnMusicKitApi(JSON.parse(arg), method); - }); - - ipcMain.on('wsapi-returnLyrics', (event, arg) => { - wsapi.returnLyrics(JSON.parse(arg)); - }); - var safeport = await getPort({port : 26369}); - wss = new WebSocketServer({ - port: safeport, - perMessageDeflate: { - zlibDeflateOptions: { - // See zlib defaults. - chunkSize: 1024, - memLevel: 7, - level: 3 - }, - zlibInflateOptions: { - chunkSize: 10 * 1024 - }, - // Other options settable: - clientNoContextTakeover: true, // Defaults to negotiated value. - serverNoContextTakeover: true, // Defaults to negotiated value. - serverMaxWindowBits: 10, // Defaults to negotiated value. - // Below options specified as default values. - concurrencyLimit: 10, // Limits zlib concurrency for perf. - threshold: 1024 // Size (in bytes) below which messages - // should not be compressed if context takeover is disabled. - } - }) - console.log(`WebSocketServer started on port: ${safeport}`); - - const defaultResponse = new wsapi.standardResponse(0, {}, "OK"); - - - wss.on('connection', function connection(ws) { - ws.id = wsapi.createId(); - console.log(`Client ${ws.id} connected`) - wsapi.clients.push(ws); - ws.on('message', function incoming(message) { - - }); - // ws on message - ws.on('message', function incoming(message) { - let data = JSON.parse(message); - let response = new wsapi.standardResponse(0, {}, "OK");; - if (data.action) { - data.action.toLowerCase(); - } - switch (data.action) { - default: - response.message = "Action not found"; - break; - case "identify": - response.message = "Thanks for identifying!" - response.data = { - id: ws.id - } - ws.identity = { - name: data.name, - author: data.author, - description: data.description, - version: data.version - } - break; - case "play-next": - app.win.webContents.executeJavaScript(`wsapi.playNext(\`${data.type}\`,\`${data.id}\`)`); - response.message = "Play Next"; - break; - case "play-later": - app.win.webContents.executeJavaScript(`wsapi.playLater(\`${data.type}\`,\`${data.id}\`)`); - response.message = "Play Later"; - break; - case "quick-play": - app.win.webContents.executeJavaScript(`wsapi.quickPlay(\`${data.term}\`)`); - response.message = "Quick Play"; - break; - case "get-lyrics": - app.win.webContents.executeJavaScript(`wsapi.getLyrics()`); - break; - case "shuffle": - app.win.webContents.executeJavaScript(`wsapi.toggleShuffle()`); - break; - case "set-shuffle": - if(data.shuffle == true) { - app.win.webContents.executeJavaScript(`MusicKit.getInstance().shuffleMode = 1`); - }else{ - app.win.webContents.executeJavaScript(`MusicKit.getInstance().shuffleMode = 0`); - } - break; - case "repeat": - app.win.webContents.executeJavaScript(`wsapi.toggleRepeat()`); - break; - case "seek": - app.win.webContents.executeJavaScript(`MusicKit.getInstance().seekToTime(${parseFloat(data.time)})`); - response.message = "Seek"; - break; - case "pause": - app.win.webContents.executeJavaScript(`MusicKit.getInstance().pause()`); - response.message = "Paused"; - break; - case "play": - app.win.webContents.executeJavaScript(`MusicKit.getInstance().play()`); - response.message = "Playing"; - break; - case "stop": - app.win.webContents.executeJavaScript(`MusicKit.getInstance().stop()`); - response.message = "Stopped"; - break; - case "volume": - app.win.webContents.executeJavaScript(`MusicKit.getInstance().volume = ${parseFloat(data.volume)}`); - response.message = "Volume"; - break; - case "mute": - app.win.webContents.executeJavaScript(`MusicKit.getInstance().mute()`); - response.message = "Muted"; - break; - case "unmute": - app.win.webContents.executeJavaScript(`MusicKit.getInstance().unmute()`); - response.message = "Unmuted"; - break; - case "next": - app.win.webContents.executeJavaScript(`MusicKit.getInstance().skipToNextItem()`); - response.message = "Next"; - break; - case "previous": - app.win.webContents.executeJavaScript(`MusicKit.getInstance().skipToPreviousItem()`); - response.message = "Previous"; - break; - case "musickit-api": - app.win.webContents.executeJavaScript(`wsapi.musickitApi(\`${data.method}\`, \`${data.id}\`, ${JSON.stringify(data.params)})`); - break; - case "musickit-library-api": - break; - case "set-autoplay": - app.win.webContents.executeJavaScript(`wsapi.setAutoplay(${data.autoplay})`); - break; - case "queue-move": - app.win.webContents.executeJavaScript(`wsapi.moveQueueItem(${data.from},${data.to})`); - break; - case "get-queue": - app.win.webContents.executeJavaScript(`wsapi.getQueue()`); - break; - case "search": - if (!data.limit) { - data.limit = 10; - } - app.win.webContents.executeJavaScript(`wsapi.search(\`${data.term}\`, \`${data.limit}\`)`); - break; - case "library-search": - if (!data.limit) { - data.limit = 10; - } - app.win.webContents.executeJavaScript(`wsapi.searchLibrary(\`${data.term}\`, \`${data.limit}\`)`); - break; - case "show-window": - app.win.show() - break; - case "hide-window": - app.win.hide() - break; - case "play-mediaitem": - app.win.webContents.executeJavaScript(`wsapi.playTrackById(${data.id}, \`${data.kind}\`)`); - response.message = "Playing track"; - break; - case "get-status": - response.data = { - isAuthorized: true - }; - response.message = "Status"; - break; - case "get-currentmediaitem": - app.win.webContents.executeJavaScript(`wsapi.getPlaybackState()`); - break; - } - ws.send(JSON.stringify(response)); - }); - - ws.on('close', function close() { - // remove client from list - wsapi.clients.splice(wsapi.clients.indexOf(ws), 1); - console.log(`Client ${ws.id} disconnected`); - }); - ws.send(JSON.stringify(defaultResponse)); - }); - }, - sendToClient(id) { - // replace the clients.forEach with a filter to find the client that requested - }, - win: null, - inAppUI() { - // create a browserwindow and load "localhost:8090" - this.win = new BrowserWindow({ - width: 800, - height: 600, - webPreferences: { - nodeIntegration: true - } - }); - this.win.loadURL(`http://localhost:${this.webRemotePort}`); - this.win.show() - this.win.on('closed', () => { - this.win = null; - }); - }, - updatePlaybackState(attr) { - const response = new wsapi.standardResponse(0, attr, "OK", "playbackStateUpdate"); - wsapi.clients.forEach(function each(client) { - client.send(JSON.stringify(response)); - }); - }, - returnMusicKitApi(results, method) { - const response = new wsapi.standardResponse(0, results, "OK", `musickitapi.${method}`); - wsapi.clients.forEach(function each(client) { - client.send(JSON.stringify(response)); - }); - }, - returnDynamic(results, type) { - const response = new wsapi.standardResponse(0, results, "OK", type); - wsapi.clients.forEach(function each(client) { - client.send(JSON.stringify(response)); - }); - }, - returnLyrics(results) { - const response = new wsapi.standardResponse(0, results, "OK", "lyrics"); - wsapi.clients.forEach(function each(client) { - client.send(JSON.stringify(response)); - }); - }, - returnSearch(results) { - const response = new wsapi.standardResponse(0, results, "OK", "searchResults"); - wsapi.clients.forEach(function each(client) { - client.send(JSON.stringify(response)); - }); - }, - returnSearchLibrary(results) { - const response = new wsapi.standardResponse(0, results, "OK", "searchResultsLibrary"); - wsapi.clients.forEach(function each(client) { - client.send(JSON.stringify(response)); - }); - }, - returnQueue(queue) { - const response = new wsapi.standardResponse(0, queue, "OK", "queue"); - wsapi.clients.forEach(function each(client) { - client.send(JSON.stringify(response)); - }); - }, - webRemotePort: 8090, - async InitWebServer() { - const webRemotePort = await getPort({port : wsapi.webRemotePort}); - // Web Remote - // express server that will serve static files in the "../web-remote" folder - const webapp = express(); - const webRemotePath = path.join(__dirname, '../web-remote'); - webapp.use(express.static(webRemotePath)); - webapp.get('/', function (req, res) { - res.sendFile(path.join(webRemotePath, 'index_old.html')); - }); - webapp.listen(webRemotePort, function () { - console.log(`Web Remote listening on port ${webRemotePort}`); - }); - } -} - -module.exports = wsapi \ No newline at end of file diff --git a/oldshit/resources/html/cast_device.html b/oldshit/resources/html/cast_device.html deleted file mode 100644 index efe83135..00000000 --- a/oldshit/resources/html/cast_device.html +++ /dev/null @@ -1,86 +0,0 @@ -

-
-
-
- -
-
- Cast To Device -
-
- -
-
-
-
-
Chromecast
-
- - -
-
AirPlay
-
-
-
- AirPlay is still under development -
-
-
-
- -
- \ No newline at end of file diff --git a/oldshit/resources/html/eq.html b/oldshit/resources/html/eq.html deleted file mode 100644 index 0a558d7b..00000000 --- a/oldshit/resources/html/eq.html +++ /dev/null @@ -1,45 +0,0 @@ -
-
-
-
-
- -
-
- Equalizer -
-
- -
-
-
-
-
-
-
Bass ({{ bass }})
-
- -
-
-
-
Treble ({{ treble }})
-
- -
-
-
-
Gain ({{ gain }})
-
- -
-
-
-
- -
-
\ No newline at end of file diff --git a/oldshit/resources/html/itunes_remote.html b/oldshit/resources/html/itunes_remote.html deleted file mode 100644 index fa4e72aa..00000000 --- a/oldshit/resources/html/itunes_remote.html +++ /dev/null @@ -1,80 +0,0 @@ -
-
-
-
- -
-
- Add Remote for iPhone, Apple Watch, iPod touch & iPad -
-
- -
-
-
-
-
-
Please enter the passcode displayed on "Device Name" to allow it to control
Apple Music Electron.
-
-
- -
-
- -
-
- -
-
- -
-
-
-
- Please wait... -
-
- There was an error pairing to your remote, please try again. - -
-
- Your Remote is now able to control Apple Music Electron. - -
-
- -
- - \ No newline at end of file diff --git a/oldshit/resources/html/oobe.html b/oldshit/resources/html/oobe.html deleted file mode 100644 index 97b67d74..00000000 --- a/oldshit/resources/html/oobe.html +++ /dev/null @@ -1,827 +0,0 @@ -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/oldshit/resources/html/outputdevice.html b/oldshit/resources/html/outputdevice.html deleted file mode 100644 index f2df20d4..00000000 --- a/oldshit/resources/html/outputdevice.html +++ /dev/null @@ -1,23 +0,0 @@ -
-
-

Output Device

-
-
-
-
- - -
-
-
- -
\ No newline at end of file diff --git a/oldshit/resources/html/preferences-footer.html b/oldshit/resources/html/preferences-footer.html deleted file mode 100644 index 2c489314..00000000 --- a/oldshit/resources/html/preferences-footer.html +++ /dev/null @@ -1,31 +0,0 @@ - - \ No newline at end of file diff --git a/oldshit/resources/html/preferences-main.html b/oldshit/resources/html/preferences-main.html deleted file mode 100644 index 4d9353b4..00000000 --- a/oldshit/resources/html/preferences-main.html +++ /dev/null @@ -1,768 +0,0 @@ -
-
-
-
-

General Settings

-
-
-
    -
  • - Incognito Mode - - Music played in this app will not be viewable by your followers on Apple Music and will no longer influence the recommendations you get in 'Listen Now'. - This will also disable updates to various additions in the application. (Such as DiscordRPC and LastFM). -
  • -
  • - - - Enabling this means you will get notifications when - you change song. The minimized option forces notifications to only appear if the app is hidden / - minimized. -
  • -
  • - Show song name as tray icon tooltip - - Enabling this option allows you to see the song - name in the tooltip on the taskbar when the application is minimized to the tray. -
  • -
  • - - - Select what page you wish to be placed on when you - start the application. -
  • -
  • - Allow statistics to be collected when errors or crashes - occur - - These logs when enabled allow us to fix bugs and - errors that may occur during your listening sessions to better improve the application. We - understand if you're not comfortable with them on, but it helps us out immensely in figuring out - widespread issues. (Note: We do not gather personal information, only stuff that shows to you as an - error in the code.) -
  • -
  • -

    Discord Rich Presence

    - These settings are for managing how you display - your status on Discord. You must have 'Display current activity as status message.' turned on in - your Discord settings for the song to be shown. -
  • -
  • - - -
  • -
  • - Clear activity on pause - - With this disabled your status will show a - Pause/Play icon whenever you are playing or have a song paused. When you enable this, it is replaced - with a branch icon (Nightly / Stable) and a version title when you hover. -
  • -
  • -

    LastFM

    -
  • -
  • - LastFM Account - -
  • -
  • - Remove featuring artists from song title - - Enabling this will remove the featuring artists - from the scrobbled data, meaning on LastFM only the primary artist will be shown. -
  • -
  • - Enable now playing - - Enabling this will display what song you are - playing on LastFM. -
  • -
  • - - - Sets the wait time before current song is added to scrobble list. -
  • -
-
-
-
-
-

Appearance

-
-
-
    -
  • - - - You will need to restart the application in order - for the default themes to be populated. You can preview all the themes here. -
  • -
  • - Theme Options - - Configure the selected theme -
  • -
  • - Update Themes - - Running this will - delete the 'themes' directory. If you have made a theme, store it elsewhere until it says - Updated. -
  • -
  • - - - macOS Emulation shows the 'stoplights' that are - well known for all macOS users and adjusts other UI elements to resemble the macOS Music App. - Selecting the right option shows a more Windows-like representation with the stoplights replacing - the usual close, minimize and maximize buttons. For macOS users its suggested that you disable this - for the best experience. Having this disabled will make the application use the operating system's - frame. -
  • -
  • -

    Transparency Configuration

    - Here you can configure the transparency options for - the window. Transparency only works on certain systems, so read the descriptions of each setting. It - is not advised to use transparency on platforms other than Windows or macOS. -
  • -
  • - - - Sets the type of Windows transparency effect, - either 'acrylic', 'blur' or leave it empty to disable it. Changing the transparency blur type can - improve performance and compatibility with older hardware and systems. -
  • -
  • - - - Sets color of acrylic effect. Can be 'light', - 'dark', 'appearance-based' or a hex color code with alpha ('#0f0f0f00'). -
  • -
  • - Disable Transparency when Unfocused (Acrylic Only) - - If enabled, acrylic effect will be disabled when - the window loses focus, to mimic the behaviour of normal UWP apps. -
  • -
  • - - - Use custom window resize/move handler for - performance. You can set the maximum refresh rate that the application uses. Disabled would default - to 60hz. -
  • -
  • -

    Lyrics

    -
  • -
  • - Enable Musixmatch Lyrics - - Less stable, but allows for lyrics translation and - better lyrics detection -
  • -
  • - Enable Youtube Lyrics (MVs only) - - (NOT RECOMMENDED!) Better timings on some Music Video, also better lyrics on Selected Tracks (e.g JP AMVs) -
  • -
  • - - - (Only when Musixmatch Lyrics / Youtube Lyrics is enabled) Select the - targeted language for translated lyrics -
  • -
  • -

    Miscellaneous Options

    - Various options allowing you to adjust the user - interface to your preference. -
  • -
  • - Streaming Mode - - Removes certain UI elements and has unique scaling - properties. -
  • -
  • - Remove Upsell - - Removes the Open in iTunes and Exit Beta - Buttons. -
  • -
  • - Remove Apple Music Logo - - Removes the Apple Music Logo and moves search bar - up. -
  • -
  • - Remove Footer - - Removes the Apple Music footer. -
  • -
  • - Remove Scrollbars - - Currently, the scrollbar is experimental and - incomplete. It is recommended to leave this on. -
  • -
  • - Use OS Accent as Application Accent - - Force the application to use your operating - systems' accent. -
  • -
  • - - - Set the scale that you would like the interface sized at. -
  • -
-
-
-
-
-

Audio Settings

-
-
-
    -
  • - - - Allows the user to select a preferred audio bitrate - for music playback. NOTE: This may not work on all songs. Extreme mode can have the side effects of - high CPU Usage. -
  • -
  • - Seamless Audio Transitions - - Reduces or completely removes the delay between - songs providing a smooth audio experience. -
  • -
  • - - - Audio Casting bit-depth, all devices should support 16-bit - audio, however 24-bit preserves quality from original audio (it is sometimes not - supported by cheap / old Chromecast devices). - -
  • -
  • - Enable DLNA casting - - DLNA is supported by a wide variety of devices, however a large - number of them don't support live radio (e.g LG TVs). - -
  • -
-
-
-
-
-

Startup and Window Behavior

-
-
-
    -
  • - - -
  • -
  • - Close button should minimize Apple Music - -
  • -
  • - Show window always on top - - This will make the application persist above all - other windows. Best used for mini player usage. -
  • -
-
-
-
-
-

Advanced Settings

-
- Open Category -
-
    -
  • - - -
  • -
  • - Hardware Acceleration - - Turn on Hardware Acceleration, which uses your GPU to make the application smoother. Turn it off to reduce the overall resource consumption of the application, at the cost of some rendering not being as smooth. -
  • -
  • - Verbose Logging - - When enabled more logs will be posted, used for - debugging. -
  • - -
  • - Copy Log File to Clipboard - - Copy your log file to your clipboard, so you can easily paste it into the Discord server or GitHub. -
  • - -
  • - Auto Update Beta Builds - - This will make the autoUpdater perform updates when - a new pre-release is made on GitHub. -
  • -
  • - Use Apple Music Beta Site - - Enabling this makes the application load beta.music.apple.com instead of music.apple.com. Disabling this will provide a limited - experience on the app. -
  • -
  • - Prevent Media Key Hijacking - - This prevents the Chromium window from hijacking - your media key. If you experience issues with pausing or playing videos/media on other applications, - enable this. -
  • -
  • -

    Advanced Development Settings

    - These settings are for the use of application - developers. -
  • -
  • - Open DevTools on Startup - - This makes the Chromium Dev Tools appear on startup. Read more about them here. -
  • -
  • - Allow Multiple Instances - - Allows multiple instance of the application to be - opened. -
  • -
-
-
\ No newline at end of file diff --git a/oldshit/resources/html/theme-options.html b/oldshit/resources/html/theme-options.html deleted file mode 100644 index c1547247..00000000 --- a/oldshit/resources/html/theme-options.html +++ /dev/null @@ -1,29 +0,0 @@ -
-
-
-
- -
-
- {{ theme }} -
-
- -
-
-
-
-
-
-
- {{ option.name }} -
-
- -
-
-
-
- -
\ No newline at end of file diff --git a/oldshit/resources/html/usermenu.html b/oldshit/resources/html/usermenu.html deleted file mode 100644 index 6adf9745..00000000 --- a/oldshit/resources/html/usermenu.html +++ /dev/null @@ -1,55 +0,0 @@ -
- -
- - \ No newline at end of file diff --git a/oldshit/resources/html/zoo.html b/oldshit/resources/html/zoo.html deleted file mode 100644 index ec3a7be1..00000000 --- a/oldshit/resources/html/zoo.html +++ /dev/null @@ -1,32 +0,0 @@ -
-
-

Header

-
-
- - - -
-
-
Switch
-
- -
-
-
-
Select
-
- -
-
-
-
- -
\ No newline at end of file diff --git a/oldshit/resources/js/MusicKitInterop.js b/oldshit/resources/js/MusicKitInterop.js deleted file mode 100644 index 9606cecf..00000000 --- a/oldshit/resources/js/MusicKitInterop.js +++ /dev/null @@ -1,148 +0,0 @@ -// preload.js -const electron = require('electron'); - - - -let cache = {playParams: {id: 0}, status: null, remainingTime: 0}, - playbackCache = {status: null, time: Date.now()}; - -const MusicKitInterop = { - init: function () { - const self = this; - MusicKit.getInstance().addEventListener(MusicKit.Events.playbackStateDidChange, () => { - /** wsapi */ - ipcRenderer.send('wsapi-updatePlaybackState', self.getAttributes()); - /** wsapi */ - - if (MusicKitInterop.filterTrack(MusicKitInterop.getAttributes(), true, false)) { - global.ipcRenderer.send('playbackStateDidChange', MusicKitInterop.getAttributes()) - if (typeof _plugins != "undefined") { - _plugins.execute("OnPlaybackStateChanged", {Attributes: MusicKitInterop.getAttributes()}) - } - const nowPlayingItem = MusicKit.getInstance().nowPlayingItem; - if (typeof nowPlayingItem != "undefined") { - if (nowPlayingItem["type"] === "musicVideo") { - document.querySelector(`.web-chrome`).setAttribute('style', 'height: 20px !important'); - document.querySelector(`#MVLyricsBox`).style.display = 'block'; - } else { - document.querySelector(`.web-chrome`).setAttribute('style', 'height: 55px !important'); - if (nowPlayingItem["type"] !== "song"){ - document.querySelector(`.web-chrome__grid-container`).setAttribute('style', 'margin: 15px auto 0') - } else { - document.querySelector(`.web-chrome__grid-container`).setAttribute('style', 'margin: dsds');} - document.querySelector(`#MVLyricsBox`).style.display = 'none'; - } - } - } else { - document.querySelector(`.web-chrome`).setAttribute('style', 'height: 55px !important'); - document.querySelector(`#MVLyricsBox`).style.display = 'none'; - try { - const nowPlayingItem = MusicKit.getInstance().nowPlayingItem; - if (typeof nowPlayingItem != "undefined") { - if (nowPlayingItem["type"] === "musicVideo") { - document.querySelector(`.web-chrome`).setAttribute('style', 'height: 20px !important'); - document.querySelector(`#MVLyricsBox`).style.display = 'block'; - } else { - document.querySelector(`.web-chrome`).setAttribute('style', 'height: 55px !important'); - if (nowPlayingItem["type"] !== "song"){ - document.querySelector(`.web-chrome__grid-container`).setAttribute('style', 'margin: 15px auto 0') - } else { - document.querySelector(`.web-chrome__grid-container`).setAttribute('style', 'margin: dsds');} - document.querySelector(`#MVLyricsBox`).style.display = 'none'; - } - } - } catch (e) { - console.error(e); - } - } - }); - - /** wsapi */ - MusicKit.getInstance().addEventListener(MusicKit.Events.playbackTimeDidChange, () => { - ipcRenderer.send('wsapi-updatePlaybackState', self.getAttributes()); - }); - /** wsapi */ - - MusicKit.getInstance().addEventListener(MusicKit.Events.nowPlayingItemDidChange, () => { - if (MusicKitInterop.filterTrack(MusicKitInterop.getAttributes(), false, true)) { - global.ipcRenderer.send('nowPlayingItemDidChange', MusicKitInterop.getAttributes()); - AMStyling.updateMeta() - } - }); - - MusicKit.getInstance().addEventListener(MusicKit.Events.authorizationStatusDidChange, () => { - global.ipcRenderer.send('authorizationStatusDidChange', MusicKit.getInstance().authorizationStatus) - }) - - MusicKit.getInstance().addEventListener(MusicKit.Events.mediaPlaybackError, (e) => { - console.warn(`[mediaPlaybackError] ${e}`); - }) - }, - - getAttributes: function () { - const mk = MusicKit.getInstance(); - const nowPlayingItem = mk.nowPlayingItem; - const isPlayingExport = mk.isPlaying; - const remainingTimeExport = mk.currentPlaybackTimeRemaining; - const attributes = (nowPlayingItem != null ? nowPlayingItem.attributes : {}); - - attributes.status = isPlayingExport ? isPlayingExport : false; - attributes.name = attributes.name ? attributes.name : 'No Title Found'; - attributes.artwork = attributes.artwork ? attributes.artwork : {url: ''}; - attributes.artwork.url = attributes.artwork.url ? attributes.artwork.url : ''; - attributes.playParams = attributes.playParams ? attributes.playParams : {id: 'no-id-found'}; - attributes.playParams.id = attributes.playParams.id ? attributes.playParams.id : 'no-id-found'; - attributes.albumName = attributes.albumName ? attributes.albumName : ''; - attributes.artistName = attributes.artistName ? attributes.artistName : ''; - attributes.genreNames = attributes.genreNames ? attributes.genreNames : []; - attributes.remainingTime = remainingTimeExport ? (remainingTimeExport * 1000) : 0; - attributes.durationInMillis = attributes.durationInMillis ? attributes.durationInMillis : 0; - attributes.startTime = Date.now(); - attributes.endTime = Math.round((attributes.playParams.id === cache.playParams.id ? (Date.now() + attributes.remainingTime) : (attributes.startTime + attributes.durationInMillis))); - attributes.endTime = attributes.endTime ? attributes.endTime : Date.now(); - attributes.volume = mk.volume; - attributes.shuffleMode = mk.shuffleMode; - attributes.repeatMode = mk.repeatMode; - attributes.autoplayEnabled = mk.autoplayEnabled; - return attributes - }, - - filterTrack: function (a, playbackCheck, mediaCheck) { - if (a.title === "No Title Found" || a.playParams.id === "no-id-found") { - return; - } else if (mediaCheck && a.playParams.id === cache.playParams.id) { - return; - } else if (playbackCheck && a.status === playbackCache.status) { - return; - } else if (playbackCheck && !a.status && a.remainingTime === playbackCache.time) { /* Pretty much have to do this to prevent multiple runs when a song starts playing */ - return; - } - cache = a; - if (playbackCheck) playbackCache = {status: a.status, time: a.remainingTime}; - return true; - }, - - pausePlay: function () { - if (MusicKit.getInstance().isPlaying) { - MusicKit.getInstance().pause(); - } else if (MusicKit.getInstance().nowPlayingItem != null) { - MusicKit.getInstance().play().then(r => console.log(`[MusicKitInterop] Playing ${r}`)); - } - }, - - nextTrack: function () { - MusicKit.getInstance().skipToNextItem().then(r => console.log(`[MusicKitInterop] Skipping to Next ${r}`)); - }, - - previousTrack: function () { - MusicKit.getInstance().skipToPreviousItem().then(r => console.log(`[MusicKitInterop] Skipping to Previous ${r}`)); - } - -} - -process.once('loaded', () => { - global.ipcRenderer = electron.ipcRenderer; - global.MusicKitInterop = MusicKitInterop; -}); -// MusicKit.getInstance().addEventListener( MusicKit.Events.queueItemsDidChange,logIt ); -// MusicKit.getInstance().addEventListener( MusicKit.Events.queuePositionDidChange, logIt ); \ No newline at end of file diff --git a/oldshit/resources/js/OpusMediaRecorder.umd.js b/oldshit/resources/js/OpusMediaRecorder.umd.js deleted file mode 100644 index c87ff372..00000000 --- a/oldshit/resources/js/OpusMediaRecorder.umd.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.OpusMediaRecorder=t():e.OpusMediaRecorder=t()}("undefined"!=typeof self?self:this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){(function(t){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var s,a=e[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};s(this,f);var o=n.mimeType,i=n.audioBitsPerSecond,a=(n.videoBitsPerSecond,n.bitsPerSecond),c=r.encoderWorkerFactory,u=r.OggOpusEncoderWasmPath,p=r.WebMOpusEncoderWasmPath;if((t=l.call(this))._stream=e,t._state="inactive",t._mimeType=o||"",t._audioBitsPerSecond=i||a,t.workerState="inactive",!f.isTypeSupported(t._mimeType))throw new TypeError("invalid arguments, a MIME Type is not supported");switch(f._parseType(t._mimeType).subtype){case"wave":case"wav":t._mimeType="audio/wave";break;case"webm":t._mimeType="audio/webm";break;case"ogg":t._mimeType="audio/ogg";break;default:switch(m&&m.name){case"chrome":t._mimeType="audio/webm";break;case"firefox":t._mimeType="audio/ogg";break;case"edge":t._mimeType="audio/webm";break;case"ios":case"safari":t._mimeType="audio/wave";break;default:t._mimeType="audio/webm"}}switch(t._mimeType){case"audio/wave":t._wasmPath="";break;case"audio/webm":t._wasmPath=p||"";break;case"audio/ogg":t._wasmPath=u||"";break;default:throw new Error("Internal Error: Unexpected MIME Type: ".concat(t._mimeType))}var d="";return document.currentScript?d=document.currentScript.src:self.location&&(d=self.location.href),d=d.substr(0,d.lastIndexOf("/"))+"/encoderWorker.umd.js","function"==typeof f.encoderWorker&&(d=URL.createObjectURL(new Blob(["(".concat(f.encoderWorker,")()")]))),t._workerFactory="function"==typeof c?c:function(e){return new Worker(d)},t._spawnWorker(),t}return n=f,i=[{key:"isTypeSupported",value:function(e){if("string"==typeof e&&!e)return!0;try{var t=f._parseType(e),n=t.type,r=t.subtype,o=t.codec}catch(e){return!1}if("audio"!==n||"ogg"!==r&&"webm"!==r&&"wave"!==r&&"wav"!==r)return!1;switch(r){case"ogg":case"webm":if("opus"!==o&&o)return!1;break;case"wave":case"wav":if(o)return!1}return!0}},{key:"_parseType",value:function(e){try{var t=o(e.match(/^(\w+)\/(\w+)(;\s*codecs=(\w+))?$/),5),n=t[1],r=t[2],i=t[4]}catch(t){return"string"!=typeof e||e?null:{type:"",subtype:"",codec:""}}return{type:n,subtype:r,codec:i}}}],(r=[{key:"_spawnWorker",value:function(){var e=this;this.worker=this._workerFactory(),this.worker.onmessage=function(t){return e._onmessageFromWorker(t)},this.worker.onerror=function(t){return e._onerrorFromWorker(t)},this._postMessageToWorker("loadEncoder",{mimeType:this._mimeType,wasmPath:this._wasmPath})}},{key:"_postMessageToWorker",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e){case"loadEncoder":var r=n.mimeType,o=n.wasmPath;this.worker.postMessage({command:e,mimeType:r,wasmPath:o});break;case"init":var i=n.sampleRate,s=n.channelCount,a=n.bitsPerSecond;this.worker.postMessage({command:e,sampleRate:i,channelCount:s,bitsPerSecond:a}),this.workerState="encoding",this.source.connect(this.processor),this.processor.connect(this.context.destination);var c=new t.Event("start");this.dispatchEvent(c);break;case"pushInputData":var u=n.channelBuffers,l=n.length,f=n.duration;this.worker.postMessage({command:e,channelBuffers:u,length:l,duration:f});break;case"getEncodedData":case"done":this.worker.postMessage({command:e});break;default:throw new Error("Internal Error: Incorrect postMessage requested.")}}},{key:"_onmessageFromWorker",value:function(e){var n,r=e.data,o=r.command,i=r.buffers;switch(o){case"readyToInit":var s=this.sampleRate,a=this.channelCount;this.workerState="readyToInit","recording"===this.state&&this._postMessageToWorker("init",{sampleRate:s,channelCount:a,bitsPerSecond:this.audioBitsPerSecond});break;case"encodedData":case"lastEncodedData":var c=new Blob(i,{type:this._mimeType});(n=new t.Event("dataavailable")).data=c,this.dispatchEvent(n),"lastEncodedData"===o&&(n=new t.Event("stop"),this.dispatchEvent(n),this.workerState="closed")}}},{key:"_onerrorFromWorker",value:function(e){this.source.disconnect(),this.processor.disconnect(),this.worker.terminate(),this.workerState="closed";var n=["FileName: "+e.filename,"LineNumber: "+e.lineno,"Message: "+e.message].join(" - "),r=new t.Event("error");r.name="UnknownError",r.message=n,this.dispatchEvent(r)}},{key:"_enableAudioProcessCallback",value:function(e){var t=this,n=0;this.processor.onaudioprocess=function(r){for(var o=r.inputBuffer,i=(r.playbackTime,o.sampleRate,o.length),s=o.duration,a=o.numberOfChannels,c=new Array(a),u=0;u=e&&(t._postMessageToWorker("getEncodedData"),n=0)}}},{key:"start",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.MAX_SAFE_INTEGER;if("inactive"!==this.state)throw new Error("DOMException: INVALID_STATE_ERR, state must be inactive.");if(e<0)throw new TypeError("invalid arguments, timeslice should be 0 or higher.");e/=1e3,"closed"===this.workerState&&this._spawnWorker(),this.context=new v;var t=this.stream.getAudioTracks();if(!t[0])throw new Error("DOMException: UnkownError, media track not found.");if(this.channelCount=t[0].getSettings().channelCount||1,this.sampleRate=this.context.sampleRate,this.source=this.context.createMediaStreamSource(this.stream),this.processor=this.context.createScriptProcessor(4096,this.channelCount,this.channelCount),this._state="recording",this._enableAudioProcessCallback(e),"readyToInit"===this.workerState){var n=this.sampleRate,r=this.channelCount;this._postMessageToWorker("init",{sampleRate:n,channelCount:r,bitsPerSecond:this.audioBitsPerSecond})}}},{key:"stop",value:function(){if("inactive"===this.state)throw new Error("DOMException: INVALID_STATE_ERR, state must NOT be inactive.");this.source.disconnect(),this.processor.disconnect(),this.context.close(),this._postMessageToWorker("done"),this._state="inactive"}},{key:"pause",value:function(){if("inactive"===this.state)throw new Error("DOMException: INVALID_STATE_ERR, state must NOT be inactive.");this.source.disconnect(),this.processor.disconnect();var e=new t.Event("pause");this.dispatchEvent(e),this._state="paused"}},{key:"resume",value:function(){if("inactive"===this.state)throw new Error("DOMException: INVALID_STATE_ERR, state must NOT be inactive.");this.source.connect(this.processor),this.processor.connect(this.context.destination);var e=new t.Event("resume");this.dispatchEvent(e),this._state="recording"}},{key:"requestData",value:function(){if("inactive"===this.state)throw new Error("DOMException: INVALID_STATE_ERR, state must NOT be inactive.");this._postMessageToWorker("getEncodedData")}},{key:"stream",get:function(){return this._stream}},{key:"mimeType",get:function(){return this._mimeType}},{key:"state",get:function(){return this._state}},{key:"videoBitsPerSecond",get:function(){}},{key:"audioBitsPerSecond",get:function(){return this._audioBitsPerSecond}}])&&a(n.prototype,r),i&&a(n,i),f}(h);["start","stop","dataavailable","pause","resume","error"].forEach((function(e){return y(w.prototype,e)})),m&&"edge"===m.name&&(p=Worker.prototype.postMessage,Worker.prototype.postMessage=function(e){p.apply(this,[e])}),e.exports=w}).call(this,n(1))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.r(t),n.d(t,"defineEventAttribute",(function(){return y})),n.d(t,"EventTarget",(function(){return v}));const r=new WeakMap,o=new WeakMap;function i(e){const t=r.get(e);return console.assert(null!=t,"'this' is expected an Event object, but got",e),t}function s(e,t){r.set(this,{eventTarget:e,event:t,eventPhase:2,currentTarget:e,canceled:!1,stopped:!1,passiveListener:null,timeStamp:t.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});const n=Object.keys(t);for(let e=0;e0){const e=new Array(arguments.length);for(let t=0;t1)for(var n=1;n{ - ipcRenderer.send('wsapi-returnSearch', JSON.stringify(results)) - }) - }, - searchLibrary(term, limit) { - MusicKit.getInstance().api.library.search(term, {limit: limit, types: 'library-songs,library-artists,library-albums'}).then((results)=>{ - ipcRenderer.send('wsapi-returnSearchLibrary', JSON.stringify(results)) - }) - }, - moveQueueItem(oldPosition, newPosition) { - MusicKit.getInstance().queue._queueItems.splice(newPosition,0,MusicKit.getInstance().queue._queueItems.splice(oldPosition,1)[0]) - MusicKit.getInstance().queue._reindex() - }, - setAutoplay(value) { - MusicKit.getInstance().autoplayEnabled = value - }, - returnDynamic(data, type) { - ipcRenderer.send('wsapi-returnDynamic', JSON.stringify(data), type) - }, - musickitApi(method, id, params) { - MusicKit.getInstance().api[method](id, params).then((results)=>{ - ipcRenderer.send('wsapi-returnMusicKitApi', JSON.stringify(results), method) - }) - }, - getPlaybackState () { - ipcRenderer.send('wsapi-updatePlaybackState', MusicKitInterop.getAttributes()); - }, - getLyrics() { - _lyrics.GetLyrics(1, false) - }, - getQueue() { - ipcRenderer.send('wsapi-returnQueue', JSON.stringify(MusicKit.getInstance().queue)) - }, - playNext(type, id) { - var request = {} - request[type] = id - MusicKit.getInstance().playNext(request) - }, - playLater(type, id) { - var request = {} - request[type] = id - MusicKit.getInstance().playLater(request) - }, - love() { - - }, - playTrackById(id, kind = "song") { - MusicKit.getInstance().setQueue({ [kind]: id }).then(function (queue) { - MusicKit.getInstance().play() - }) - }, - quickPlay(term) { - // Quick play by song name - MusicKit.getInstance().api.search(term, { limit: 2, types: 'songs' }).then(function (data) { - MusicKit.getInstance().setQueue({ song: data["songs"][0]["id"] }).then(function (queue) { - MusicKit.getInstance().play() - }) - }) - }, - toggleShuffle() { - MusicKit.getInstance().shuffleMode = MusicKit.getInstance().shuffleMode === 0 ? 1 : 0 - }, - toggleRepeat() { - if(MusicKit.getInstance().repeatMode == 0) { - MusicKit.getInstance().repeatMode = 2 - }else if(MusicKit.getInstance().repeatMode == 2){ - MusicKit.getInstance().repeatMode = 1 - }else{ - MusicKit.getInstance().repeatMode = 0 - } - } -} \ No newline at end of file diff --git a/oldshit/resources/js/backButton.js b/oldshit/resources/js/backButton.js deleted file mode 100644 index 424d5091..00000000 --- a/oldshit/resources/js/backButton.js +++ /dev/null @@ -1,32 +0,0 @@ -try { - if (MusicKit.getInstance().isAuthorized) { - - if (!document.querySelector('#backButtonBar')) { - document.getElementById('web-main').insertAdjacentHTML("afterbegin", ` -
-
- Back Button -
-
- `); - } - - if (document.getElementsByClassName('dragDiv right-aligned').length > 0) { - document.getElementById('backButtonBar').style.top = '25px' - } - - document.getElementById('web-main').addEventListener('scroll', function () { - if (document.getElementById('web-main').scrollTop > 80) { - document.getElementById('backButtonBar').style.backgroundColor = 'var(--playerBackground)'; - document.getElementById('backButtonBar').style.position = 'fixed'; - } else { - document.getElementById('backButtonBar').style.backgroundColor = 'transparent'; - document.getElementById('backButtonBar').style.position = 'absolute'; - } - }); - - - } -} catch (e) { - console.error("[JS] Error while trying to apply backButton.js", e); -} \ No newline at end of file diff --git a/oldshit/resources/js/checkAuth.js b/oldshit/resources/js/checkAuth.js deleted file mode 100644 index ba77412e..00000000 --- a/oldshit/resources/js/checkAuth.js +++ /dev/null @@ -1,19 +0,0 @@ -try { - const preferences = ipcRenderer.sendSync('getStore'); - - if (MusicKit.getInstance().isAuthorized) { - let url = window.location.href; - if (preferences.general.startupPage !== "browse") { - if (preferences.general.startupPage.includes('library/')) { - url = `${window.location.origin}/${preferences.general.startupPage}`; - } else { - url = `${window.location.origin}/${MusicKit.getInstance().storefrontId}/${preferences.general.startupPage}`; - } - window.location.href = url; - } - - ipcRenderer.send('userAuthorized', url); - } -} catch (e) { - console.error("[JS] Error while trying to apply CheckAuth.js", e); -} \ No newline at end of file diff --git a/oldshit/resources/js/custom.js b/oldshit/resources/js/custom.js deleted file mode 100644 index 090140a8..00000000 --- a/oldshit/resources/js/custom.js +++ /dev/null @@ -1,1466 +0,0 @@ - -try { - /* Add AM Lyrics Font JP, JR */ - var headID = document.getElementsByTagName('head')[0]; - var link = document.createElement('link'); - link.type = 'text/css'; - link.rel = 'stylesheet'; - link.setAttribute('name','fonts'); - headID.appendChild(link); - link.href = "//www.apple.com/wss/fonts?families=SF+Pro,v3|SF+Pro+Icons,v3|SF+Pro+KR,v2|SF+Pro+JP,v1"; - function GetXPath(path) { - return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; - } - - var setInnerHTML = function (elm, html) { - elm.innerHTML = html; - Array.from(elm.querySelectorAll("script")).forEach(oldScript => { - const newScript = document.createElement("script"); - Array.from(oldScript.attributes).forEach(attr => newScript.setAttribute(attr.name, attr.value)); - newScript.appendChild(document.createTextNode(oldScript.innerHTML)); - oldScript.parentNode.replaceChild(newScript, oldScript); - }); - }; - - function matchRuleShort(str, rule) { - var escapeRegex = (str) => str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); - return new RegExp("^" + rule.split("*").map(escapeRegex).join(".*") + "$").test(str); - } - - if (typeof activeEventListeners == "undefined") { - var activeEventListeners = {} - } - - var preferences = ipcRenderer.sendSync('getStore'); - - /* Variables that are utilised by the renderer */ - if (typeof AM == "undefined") { - var AM = { - acrylicSupported: false, - themesListing: [], - } - } - - /* Create the miniPlayer Functions */ - if (typeof _miniPlayer == "undefined") { - var _miniPlayer = { - active: false, - init() { - const webChrome = document.querySelector(".web-chrome"); - const elements = { - artwork: document.createElement("div"), - webNavContainer: document.querySelector("#web-navigation-container"), - menuicon: document.querySelector(".menuicon") - }; - elements.artwork.classList.add("miniPlayerArtwork"); - elements.artwork.style.display = "none"; - elements.artwork.addEventListener("contextmenu", () => { - ipcRenderer.send("show-miniplayer-menu"); - }); - elements.artwork.addEventListener("click", () => { - if (webChrome.style.display === "") { - webChrome.style.display = "flex"; - } else { - webChrome.style.display = ""; - } - }); - document.querySelector("#web-main").appendChild(elements.artwork); - if (window.innerWidth < 500) { - /* Resize if window was closed in Mini Player */ - ipcRenderer.send("resize-window", 1024, 600); - } - }, - setMiniPlayer(val) { - const webChrome = document.querySelector(".web-chrome"); - const artwork = document.querySelector(".miniPlayerArtwork"); - if (val) { - self.active = true; - document.body.setAttribute("data-miniplayer", 1); - artwork.style.display = "block"; - } else { - self.active = false; - webChrome.style.display = ""; - document.body.removeAttribute("data-miniplayer"); - artwork.style.display = "none"; - } - } - }; - } - - /* Lyrics Functions */ - if (typeof _lyrics == "undefined") { - var _lyrics = { - current: [], - events: [], - onchange (fn = ()=>{}) { - this.events.push(fn) - }, - setLyrics(lyrics) { - this.current = lyrics; - this.events.forEach((event)=>{ - event(lyrics); - }); - }, - CreateButton: () => { - - const mediaControlsElement = document.querySelector('.web-chrome-controls-container'); - - /* Chromecast / Airplay Button */ - if (!document.querySelector('#airplayButton') && mediaControlsElement) { - const lyricsButton = document.createElement("div"); - lyricsButton.style.height = "22px"; - lyricsButton.style.width = "30px"; - lyricsButton.style.marginInlineEnd = "12px"; - lyricsButton.style.zIndex = "9999"; - lyricsButton.innerHTML = ``; - lyricsButton.id = "airplayButton"; - lyricsButton.className = "web-chrome-playback-controls__platter-toggle-buttons web-chrome-playback-controls__meta-btn"; - mediaControlsElement.insertBefore(lyricsButton, mediaControlsElement.childNodes[4]); - } - /* Create the Button */ - if (!document.querySelector('[aria-label="Lyrics"]') && mediaControlsElement) { - const lyricsButton = document.createElement("div"); - lyricsButton.classList.add('web-chrome-playback-controls__platter-toggle-buttons', 'web-chrome-playback-control__lyrics-button'); - lyricsButton.style.marginInlineEnd = "0"; - lyricsButton.style.width = "auto"; - lyricsButton.style.zIndex = "9999"; - lyricsButton.innerHTML = ` - - `; - mediaControlsElement.insertBefore(lyricsButton, mediaControlsElement.childNodes[5]); - - - - let clonedElement2; - - clonedElement2 = document.querySelector('#airplayButton').cloneNode(true); - document.querySelector('#airplayButton').replaceWith(clonedElement2); - - document.getElementById("airplayButton").addEventListener('click', function () { - try{AudioOutputs.castUI(); - }catch(e){} - }); - - - /* Lyric View for MV */ - if (!document.querySelector('#MVLyricsBox')){ - const lyricsMV = document.createElement("div"); - lyricsMV.id = "MVLyricsBox"; - lyricsMV.style.zIndex = 9999999; - lyricsMV.style.backgroundColor= "rgba(0,0,0,0.7)"; - lyricsMV.style.display = "none"; - lyricsMV.style.color = "yellow"; - try{ - document.body.appendChild(lyricsMV);} - catch(e){} - lyricsMV.innerHTML = `
`; - - } - - /* Lyrics Button Click Event Handling */ - - const upNextSideBarToggle = mediaControlsElement.childNodes[6].getElementsByTagName('button')[0]; - let clonedElement; - if (document.querySelector("#lyricsButton") && upNextSideBarToggle) { - - function openLyrics() { - document.body.classList.add("web-chrome-drawer-open"); - document.body.classList.remove("web-chrome-drawer-opening"); - document.querySelector('.web-chrome-drawer').removeEventListener('animationend', openLyrics, true); - document.querySelector('#lyricsButton').style.fill = 'var(--playerPlatterButtonIconFill)'; - document.querySelector('#lyricsButton').style.boxShadow = '0 1px 1px rgb(0 0 0 / 10%)'; - document.querySelector('#lyricsButton').style.background = 'var(--playerPlatterButtonBGFill)'; - if (MusicKit.getInstance().nowPlayingItem == null) { - try { - document.getElementById('lyrics_none').classList.remove('lyrics_none_hidden'); - } catch (e) { - } - } else { - try { - document.getElementById('lyrics_none').classList.add('lyrics_none_hidden'); - } catch (e) { - } - } - if (document.getElementById('lyricer').childNodes[0].childNodes.length == null || document.getElementById('lyricer').childNodes[0].childNodes.length <= 1) { - _lyrics.GetLyrics(1, false); - } - } - function closeLyrics() { - document.body.classList.remove("web-chrome-drawer-open"); - document.body.classList.remove("web-chrome-drawer-closing"); - document.querySelector('.web-chrome-drawer').removeEventListener('animationend', closeLyrics, true); - document.querySelector('#lyricsButton').style.fill = 'var(--systemSecondary)'; - document.querySelector('#lyricsButton').style.boxShadow = 'none'; - document.querySelector('#lyricsButton').style.background = '0 0'; - } - - clonedElement = document.querySelector('#lyricsButton').cloneNode(true); - document.querySelector('#lyricsButton').replaceWith(clonedElement); - - - if (!document.getElementById("lyricer")) { - - const sidebar = document.querySelector('.web-chrome-drawer'); - if (sidebar) { - sidebar.innerHTML = `
Play a song to see the lyrics here.
`; - } - - let text = ""; - let lrc = new Lyricer(); - ipcRenderer.on('truelyrics', function (event, lrcfile) { - if (lrcfile.startsWith("netease=")) { - ipcRenderer.send('NetEaseLyricsHandler', lrcfile); - } else { - if (lrcfile!= null && lrcfile.length > 0) - - lrc.setLrc(lrcfile); - - } - }); - - ipcRenderer.on('lyricstranslation', function (event, data) { - lrc.setMXMTranslation(data); - }); - - ipcRenderer.on('backuplyrics', function (_event, _data) { - _lyrics.GetLyrics(1, true); - }); - - ipcRenderer.on('backuplyricsMV', function (_event, _data) { - _lyrics.GetLyrics(1, false); - }); - - ipcRenderer.on('ProgressTimeUpdate', function (event, data) { - if (data < 0) { - data = 0 - } - lrc.move(data); - }); - - - lrc.setLrc(text); - document.addEventListener("lyricerclick", function (e) { - ipcRenderer.send('ProgressTimeUpdateFromLyrics', e.detail.time); - document.body.setAttribute("background-color", `var(--systemToolbarTitlebarMaterialSover-inactive)`); - }); - - _lyrics.GetLyrics(2, false); - } - - document.getElementById("lyricsButton").addEventListener('click', function () { - if (document.querySelector('.web-chrome-drawer').querySelector('.web-navigation__up-next.web-chrome-up-next.up-next') == null) { - - if (document.getElementsByClassName("web-chrome-drawer-open").length === 0) { - document.querySelector('.web-chrome-drawer').addEventListener('animationend', openLyrics, true); - document.body.classList.add("web-chrome-drawer-opening"); - } else { - document.querySelector('.web-chrome-drawer').addEventListener('animationend', closeLyrics, true); - document.body.classList.add("web-chrome-drawer-closing"); - } - } else { - try { - /* Checks for clicks on the up next sidebar toggle button */ - if (upNextSideBarToggle.classList.contains('active')) { - upNextSideBarToggle.click(); - document.querySelector('.web-chrome-drawer').addEventListener('animationend', openLyrics, true); - document.body.classList.add("web-chrome-drawer-opening"); - } else { - document.querySelector('.web-chrome-drawer').style.backgroundColor = ""; - document.querySelector('.web-chrome-drawer').removeEventListener('animationend', openLyrics, true); - document.querySelector('.web-chrome-drawer').removeEventListener('animationend', closeLyrics, true); - } - } catch (e) { - console.error(e); - } - } - if (!document.getElementById("lyricer")) { - - const sidebar = document.querySelector('.web-chrome-drawer'); - if (sidebar) { - sidebar.innerHTML = `
Play a song to see the lyrics here.
`; - } - - let text = ""; - let lrc = new Lyricer(); - ipcRenderer.on('truelyrics', function (event, lrcfile) { - if (lrcfile.startsWith("netease=")) { - ipcRenderer.send('NetEaseLyricsHandler', lrcfile); - } else { - if (lrcfile!= null && lrcfile.length > 0) - lrc.setLrc(lrcfile); - } - }); - - ipcRenderer.on('lyricstranslation', function (event, data) { - lrc.setMXMTranslation(data); - }); - - ipcRenderer.on('backuplyrics', function (_event, _data) { - _lyrics.GetLyrics(1, true); - }); - - ipcRenderer.on('backuplyricsMV', function (_event, _data) { - _lyrics.GetLyrics(1, false); - }); - - ipcRenderer.on('ProgressTimeUpdate', function (event, data) { - if (data < 0) { - data = 0 - } - lrc.move(data); - }); - - - lrc.setLrc(text); - document.addEventListener("lyricerclick", function (e) { - ipcRenderer.send('ProgressTimeUpdateFromLyrics', e.detail.time); - document.body.setAttribute("background-color", `var(--systemToolbarTitlebarMaterialSover-inactive)`); - }); - - _lyrics.GetLyrics(2, false); - } - }, false); - - - upNextSideBarToggle.addEventListener('click', function () { - if (document.querySelector('#lyricsButton').style.fill === "var(--playerPlatterButtonIconFill)") { - document.querySelector('#lyricsButton').style.fill = 'var(--systemSecondary)'; - document.querySelector('#lyricsButton').style.boxShadow = 'none'; - document.querySelector('#lyricsButton').style.background = '0 0'; - } - }, false); - } - }}, - - GetLyrics: (mode, mxmfail) => { - const musicType = (MusicKit.getInstance().nowPlayingItem != null) ? MusicKit.getInstance().nowPlayingItem["type"] ?? '' : ''; - const trackName = encodeURIComponent((MusicKit.getInstance().nowPlayingItem != null) ? MusicKit.getInstance().nowPlayingItem.title ?? '' : ''); - const artistName = encodeURIComponent((MusicKit.getInstance().nowPlayingItem != null) ? MusicKit.getInstance().nowPlayingItem.artistName ?? '' : ''); - const songID = (MusicKit.getInstance().nowPlayingItem != null) ? MusicKit.getInstance().nowPlayingItem["_songId"] ?? -1 : -1; - const duration = encodeURIComponent(Math.round(MusicKitInterop.getAttributes()["durationInMillis"] / 1000)); - if (trackName !== '' && !(trackName === "No Title Found" && artistName === '')) { - /* MusixMatch Lyrics*/ - if(musicType === "musicVideo" && preferences.visual.yton){ - ipcRenderer.send('YTTranslation', trackName, artistName, preferences.visual.mxmlanguage); - } else/* MusixMatch Lyrics*/ - if (!mxmfail && preferences.visual.mxmon) { - ipcRenderer.send('MXMTranslation', trackName, artistName, preferences.visual.mxmlanguage, duration); - } - /* Apple Lyrics (from api lyric query) */ - else if (songID !== -1) { - MusicKit.getInstance().api.lyric(songID) - .then((response) => { - let seconds, - minutes, - hours, - rawTime, - milliseconds, - lrcTime; - - try { - const ttmlLyrics = response["ttml"]; - let lyrics = ""; - let synced = true; - const parser = new DOMParser(); - const doc = parser.parseFromString(ttmlLyrics, "text/xml"); - console.log('sdx',doc.getElementsByTagName('tt')[0].getAttribute("itunes:timing") === "None"); - if (doc.getElementsByTagName('tt')[0].getAttribute("itunes:timing") === "None"){ - synced = false; - } - const lyricsLines = doc.getElementsByTagName('p'); - const endTime = [0]; - if (synced) { - try { - for (let element of lyricsLines) { - rawTime = element.getAttribute('begin').match(/(\d+:)?(\d+:)?(\d+)(\.\d+)?/); - hours = (rawTime[2] != null) ? (rawTime[1].replace(":", "")) : "0"; - minutes = (rawTime[2] != null) ? (hours * 60 + rawTime[2].replace(":", "") * 1 + ":") : ((rawTime[1] != null) ? rawTime[1] : "00:"); - seconds = (rawTime[3] != null) ? (rawTime[3]) : "00"; - milliseconds = (rawTime[4] != null) ? (rawTime[4]) : ".000"; - lrcTime = minutes + seconds + milliseconds; - const rawTime2 = element.getAttribute('end').match(/(\d+:)?(\d+:)?(\d+)(\.\d+)?/); - const hours2 = (rawTime2[2] != null) ? (rawTime2[1].replace(":", "")) : "0"; - const minutes2 = (rawTime2[2] != null) ? (hours2 * 60 + rawTime2[2].replace(":", "") * 1 + ":") : ((rawTime2[1] != null) ? rawTime2[1] : "00:"); - const seconds2 = (rawTime2[3] != null) ? (rawTime2[3]) : "00"; - const milliseconds2 = (rawTime2[4] != null) ? (rawTime2[4]) : ".000"; - const lrcTime2 = minutes2 + seconds2 + milliseconds2; - if (minutes.replace(":", "") * 60 + seconds * 1 - endTime[endTime.length - 1] > 10) { - const time = endTime[endTime.length - 1]; - const minutes = Math.floor(time / 60); - const secs = time - minutes * 60; - lyrics = lyrics.concat(`[${minutes}:${secs}]lrcInstrumental` + "\r\n"); - } - endTime.push(minutes2.replace(":", "") * 60 + seconds2 * 1); - lyrics = lyrics.concat(`[${lrcTime}]${element.textContent}` + "\r\n"); - } - } catch { - lyrics = ""; - for (let element of lyricsLines) { - rawTime = element.getAttribute('begin').match(/(\d+:)?(\d+:)?(\d+)(\.\d+)?/); - hours = (rawTime[2] != null) ? (rawTime[1].replace(":", "")) : "0"; - minutes = (rawTime[2] != null) ? (hours * 60 + rawTime[2].replace(":", "") * 1 + ":") : ((rawTime[1] != null) ? rawTime[1] : "00:"); - seconds = (rawTime[3] != null) ? (rawTime[3]) : "00"; - milliseconds = (rawTime[4] != null) ? (rawTime[4]) : ".000"; - lrcTime = minutes + seconds + milliseconds; - lyrics = lyrics.concat(`[${lrcTime}]${element.textContent}` + "\r\n"); - } - }} - else { - try{ - var body = doc.getElementsByTagName('body')[0].innerHTML; - if (document.getElementById("lyricer")) { - var u = document.createElement('div'); - u.id = "unsynced"; - u.innerHTML = body; - if (!document.getElementById("unsynced")){ - document.getElementById("lyricer").appendChild(u);} else {console.log('duped')} - } - } catch(e){} - - } - let artworkURL = ((MusicKit.getInstance().nowPlayingItem != null) ? MusicKit.getInstance().nowPlayingItem.artworkURL : '').replace("{w}", 256).replace("{h}", 256); - if (artworkURL == null) { - artworkURL = "https://beta.music.apple.com/assets/product/MissingArtworkMusic.svg"; - } - if (mode === 1) { - ipcRenderer.send('LyricsUpdate', lyrics, artworkURL); - } else { - ipcRenderer.send('LyricsHandler', lyrics, artworkURL); - } - } catch (e) { - console.error(e); - if (mode === 1) { - ipcRenderer.send('LyricsUpdate', "netease=" + trackName + " " + artistName, artworkURL); - } else { - ipcRenderer.send('LyricsHandler', "netease=" + trackName + " " + artistName, artworkURL); - } - } - }) - .catch((err) => { - console.log(err); - let artworkURL = (MusicKitInterop.getAttributes()["artwork"]["url"]).replace("{w}", 256).replace("{h}", 256); - if (artworkURL == null) { - artworkURL = "https://beta.music.apple.com/assets/product/MissingArtworkMusic.svg"; - } - if (mode === 1) { - ipcRenderer.send('LyricsUpdate', "netease=" + trackName + " " + artistName, artworkURL); - } else { - ipcRenderer.send('LyricsHandler', "netease=" + trackName + " " + artistName, artworkURL); - } - }); - } - /* Apple Lyrics (from api song query */ - else { - try { - MusicKit.getInstance().api.library.song(MusicKit.getInstance().nowPlayingItem.id).then((data) => { - try { - if (data != null && data !== "") { - artworkURL = data["artwork"]["url"]; - } else { - artworkURL = "https://beta.music.apple.com/assets/product/MissingArtworkMusic.svg"; - } - } catch (e) { - artworkURL = "https://beta.music.apple.com/assets/product/MissingArtworkMusic.svg"; - } - if (mode === 1) { - ipcRenderer.send('LyricsUpdate', "netease=" + trackName + " " + artistName, artworkURL); - } else { - ipcRenderer.send('LyricsHandler', "netease=" + trackName + " " + artistName, artworkURL); - } - }); - } catch (e) { - console.error(e); - if (mode === 1) { - ipcRenderer.send('LyricsUpdate', "netease=" + trackName + " " + artistName, ''); - } else { - ipcRenderer.send('LyricsHandler', "netease=" + trackName + " " + artistName, ''); - } - } - } - } - } - } - - } - - /* Create the AMStyling Functions */ - if (typeof AMStyling == "undefined") { - var AMStyling = { - _styleSheets: { - Transparency: new CSSStyleSheet(), - Theme: new CSSStyleSheet(), - Meta: new CSSStyleSheet(), - Metrics: new CSSStyleSheet(), - Scaling: new CSSStyleSheet() - }, - wallpaper: "", - lastTheme: "", - micaActive: false, - metrics: { - lastScreenX: 0, - lastScreenY: 0 - }, - showThemeOptions() { - function throwNoTheme() { - new AMEModal({ - content: `
This theme has no available options.
`, - Style: { - width: "325px", - height: "200px" - } - }); - } - - if (this.lastTheme === "default" || this.lastTheme === "") { - throwNoTheme(); - return; - } - if (AM.themesListing[AMStyling.lastTheme]["options"].length === 0) { - throwNoTheme(); - return; - } - AMJavaScript.getRequest("ameres://html/theme-options.html", (content) => { - var vm = new Vue({ - data: { - options: AM.themesListing[AMStyling.lastTheme]["options"], - userOptions: AMStyling.getThemeOptions(AMStyling.lastTheme), - theme: AM.themesListing[AMStyling.lastTheme]["name"] - }, - methods: { - saveOptions() { - AMStyling.setThemeOptions(AMStyling.lastTheme, this.userOptions); - }, - close() { - modal.close(); - } - } - }); - var modal = new AMEModal({ - content: content, - CloseButton: false, - OnCreate() { - vm.$mount("#themeOptions-vue") - }, - OnClose() { - _vues.destroy(vm) - }, - Style: { - width: "50%", - height: "80%" - } - }) - }); - }, - getThemeOptions(theme) { - if (!localStorage.getItem("ThemeOptions")) { - localStorage.setItem("ThemeOptions", "{}"); - } - var userOptions = JSON.parse(localStorage.getItem("ThemeOptions")); - if (!userOptions[theme]) { - userOptions[theme] = {}; - } - - function parseBool(val) { - return !(val === 0 || val === "false" || val === false); - } - - AM.themesListing[theme]["options"].forEach((option) => { - if (typeof userOptions[theme][option.key] == "undefined" || userOptions[theme][option.key] == null) { - userOptions[theme][option.key] = parseBool(option.defaultValue); - } - }); - localStorage.setItem("ThemeOptions", JSON.stringify(userOptions)); - return userOptions[theme]; - }, - setThemeOptions(theme, options = {}) { - if (!localStorage.getItem("ThemeOptions")) { - localStorage.setItem("ThemeOptions", "{}"); - } - let userOptions = JSON.parse(localStorage.getItem("ThemeOptions")); - if (!userOptions[theme]) { - userOptions[theme] = {}; - } - userOptions[theme] = options; - localStorage.setItem("ThemeOptions", JSON.stringify(userOptions)); - this.refresh(); - }, - getWallpaper() { - this.wallpaper = ipcRenderer.sendSync("get-wallpaper"); - this.updateMetrics() - }, - updateMetrics() { - this._styleSheets.Metrics.replaceSync(` - :root { - --user-wallpaper: url('${this.wallpaper}'); - --screenX: ${window.screenX}px; - --screenY: ${window.screenY}px; - --screenHeight: ${screen.height}px; - --screenWidth: ${screen.width}px; - } - body::before { - display: none; - } - `); - this.refresh(); - }, - windowsWallpaperStyles: { - fill: 10, - fit: 6, - stretch: 2, - tile: 0, - span: 22 - }, - updateMica() { - if (!this.micaActive) { - return; - } - var micaElement = document.querySelector(".micaBackground"); - var style = ipcRenderer.sendSync("get-wallpaper-style"); - switch (style) { - default: - case 0: - case 2: - case 6: - case 10: - micaElement.style.backgroundSize = "repeat"; - break; - case 22: - micaElement.style.backgroundSize = "cover"; - break; - } - - }, - setMica(val = false) { - if (val) { - this.enableMica(); - } else { - this.disableMica(); - } - }, - disableMica() { - if (!this.micaActive) { - return; - } - this.micaActive = false; - document.querySelector(".micaBackground").remove(); - }, - enableMica() { - let self = this; - if (this.micaActive) { - console.log("Mica is already active"); - return; - } - if (this.lastTheme !== "winui") { - if (confirm("This feature currently requires the Eleven theme, enable now?")) { - this.loadTheme("winui"); - } - } - this.micaActive = true; - var micaDOM = document.createElement("div"); - micaDOM.classList.add("micaBackground"); - document.body.appendChild(micaDOM); - this.getWallpaper(); - this.setTransparency(false); - - function onScreenMove(cb) { - let lastScreenX; - let lastScreenY; - - function detectScreenMove() { - if (lastScreenY !== window.screenY || lastScreenX !== window.screenX) { - lastScreenY = window.screenY; - lastScreenX = window.screenX; - cb(); - } - if (self.micaActive) { - requestAnimationFrame(detectScreenMove); - } - } - - if (self.micaActive) { - requestAnimationFrame(detectScreenMove); - } - } - - onScreenMove(function () { - micaDOM.style.backgroundPosition = `${window.screenX * -1}px ${window.screenY * -1}px`; - /**micaDOM.style.backgroundSize = `${screen.width}px ${screen.height}px`;**/ - micaDOM.style.backgroundSize = `cover`; - }); - }, - loadTheme(path = "", reload = false) { - if (path === this.lastTheme && !reload) { - return; - } - this.lastTheme = path; - let self = this; - if (path === "" || path === " " || path === "default") { - self._styleSheets.Theme.replaceSync(""); - self.refresh(); - return; - } - - ipcRenderer.invoke('themeFileExists', path).then((r) => { - if (r) { - const xhttp = new XMLHttpRequest(); - xhttp.onload = function () { - self._styleSheets.Theme.replaceSync(this.responseText); - self.refresh(); - }; - xhttp.open("GET", `themes://${path}.css`, true); - xhttp.send(); - console.warn("[Custom] Applied Theme"); - } else { - console.error(`[Custom] ${path} does not exist.`) - } - }) - - - }, - updateMeta() { - - if (MusicKit.getInstance().nowPlayingItem == null) { - try { - document.getElementById('lyrics_none').classList.remove('lyrics_none_hidden'); - } catch (e) { - } - } else { - try { - document.getElementById('lyrics_none').classList.add('lyrics_none_hidden'); - } catch (e) { - } - } - - console.warn("[Custom] Refreshed Meta CSS"); - /** Exposes artwork and other metadata to CSS for themes */ - let artwork = MusicKit.getInstance().nowPlayingItem["attributes"]["artwork"]["url"]; - /* Fix Itunes Match album arts not showing */ - if (artwork === '' || !artwork) { - try { - MusicKit.getInstance().api.library.song(MusicKit.getInstance().nowPlayingItem.id).then((data) => { - if (data !== "") { - artwork = data["artwork"]["url"]; - document.querySelector('#ember13').getElementsByTagName('img')[0].src = artwork; - this._styleSheets.Meta.replaceSync(` - :root { - --musicKit-artwork-64: url("${artwork.replace("{w}", 64).replace("{h}", 64)}"); - --musicKit-artwork-256: url("${artwork.replace("{w}", 256).replace("{h}", 256)}"); - --musicKit-artwork-512: url("${artwork.replace("{w}", 512).replace("{h}", 512)}"); - --musicKit-artwork: url("${artwork.replace("{w}", 2000).replace("{h}", 2000)}"); - } - `); - - if (MusicKit.getInstance().nowPlayingItem.title != "" & !(MusicKit.getInstance().nowPlayingItem.title == "No Title Found" && MusicKit.getInstance().nowPlayingItem.artistName == "")){ - ipcRenderer.send('updateMiniPlayerArt',artwork.replace("{w}", 2000).replace("{h}", 2000)); - ipcRenderer.send('updateMiniPlayerMetaData',MusicKit.getInstance().nowPlayingItem.title,MusicKit.getInstance().nowPlayingItem.artistName,MusicKit.getInstance().nowPlayingItem.albumName); - ipcRenderer.send('setupNewTrack',MusicKit.getInstance().nowPlayingItem.title,MusicKit.getInstance().nowPlayingItem.artistName,MusicKit.getInstance().nowPlayingItem.albumName,artwork.replace("{w}", 256).replace("{h}", 256));} - - - this.refresh(); - } - }); - } catch (e) { - console.error(e); - } - } - - this._styleSheets.Meta.replaceSync(` - :root { - --musicKit-artwork-64: url("${artwork.replace("{w}", 64).replace("{h}", 64)}"); - --musicKit-artwork-256: url("${artwork.replace("{w}", 256).replace("{h}", 256)}"); - --musicKit-artwork-512: url("${artwork.replace("{w}", 512).replace("{h}", 512)}"); - --musicKit-artwork: url("${artwork.replace("{w}", 2000).replace("{h}", 2000)}"); - } - `); - if ( (artwork === '' || !artwork) && MusicKit.getInstance().nowPlayingItem.title != "" & !(MusicKit.getInstance().nowPlayingItem.title == "No Title Found" && MusicKit.getInstance().nowPlayingItem.artistName == "")){ - ipcRenderer.send('updateMiniPlayerArt',artwork.replace("{w}", 2000).replace("{h}", 2000)); - ipcRenderer.send('updateMiniPlayerMetaData',MusicKit.getInstance().nowPlayingItem.title,MusicKit.getInstance().nowPlayingItem.artistName,MusicKit.getInstance().nowPlayingItem.albumName); - ipcRenderer.send('setupNewTrack',MusicKit.getInstance().nowPlayingItem.title,MusicKit.getInstance().nowPlayingItem.artistName,MusicKit.getInstance().nowPlayingItem.albumName,artwork.replace("{w}", 256).replace("{h}", 256));} - - this.refresh(); - }, - setTransparency(val) { - let self = this; - if (val) { - const xhttp = new XMLHttpRequest(); - xhttp.onload = function () { - self._styleSheets.Transparency.replaceSync(this.responseText); - self.refresh(); - }; - xhttp.open("GET", `ameres://css/transparency.css`, true); - xhttp.send(); - } else { - self._styleSheets.Transparency.replaceSync(`html body { background-color: var(--pageBG) !important; }`); - } - }, - refresh() { - document.adoptedStyleSheets = Object.values(this._styleSheets); - /** Theme Options **/ - if (AM.themesListing[this.lastTheme]) { - var themeOptions = (this.getThemeOptions(this.lastTheme)); - Object.keys(themeOptions).forEach((option) => { - if (themeOptions[option]) { - document.body.setAttribute(`theme-${option}`, 1); - } else { - document.body.removeAttribute(`theme-${option}`); - } - }) - } - }, - lerp: (start, end, l) => { - return start + (end - start) * l; - } - }; - } - - /* Bulk AME JavaScript Functions */ - if (typeof AMJavaScript == "undefined") { - var AMJavaScript = { - getQuery(q) { - return (window.location.search.match(new RegExp('[?&]' + q + '=([^&]+)')) || [undefined, null])[1]; - }, - getRequest: (url, callback = () => { - }) => { - const xhttp = new XMLHttpRequest(); - xhttp.onload = function () { - callback(this.responseText); - }; - xhttp.open("GET", url, true); - xhttp.send(); - }, - LoadCustomStartup: async () => { - const preferences = ipcRenderer.sendSync('getStore'); - - /** Plugins */ - if (typeof _plugins != "undefined") { - await ipcRenderer.invoke("fetchPluginsListing").then((plugins) => { - console.log(plugins); - plugins.forEach((plugin) => { - _plugins.loadPlugin(plugin); - }); - }) - } - /** End Plugins */ - - /** Expose platform to CSS */ - document.body.setAttribute("platform", navigator.platform); - - if (preferences.visual.frameType === "") { - document.body.setAttribute("frame-type", "disabled"); - } else { - document.body.setAttribute("frame-type", preferences.visual.frameType); - } - - /* MiniPlayer Event Listener */ - MusicKit.getInstance().addEventListener(MusicKit.Events.mediaElementCreated, () => { - if (!document.querySelector('.media-artwork-v2__image').classList.contains('media-artwork-v2__image--fallback')) { - const artwork = document.querySelector('#ember13'); - artwork.onclick = function () { - ipcRenderer.send("set-miniplayer", true); - }; - /* Picture-in-picture icon should be overlayed over artwork when mouse over */ - } - }); - - /* Audio Quality Selector */ - if (preferences.audio.audioQuality === 'extreme') { - console.warn("[Custom] Setting bitrate to 990."); - MusicKit.getInstance().bitrate = 990; - } else if (preferences.audio.audioQuality === 'high') { - console.warn("[Custom] Setting bitrate to 256."); - MusicKit.getInstance().bitrate = 256; - } else if (preferences.audio.audioQuality === 'standard') { - console.warn("[Custom] Setting bitrate to 64."); - MusicKit.getInstance().bitrate = 64; - } - - /* Seamless (Apple dont know how to spell) Audio Playback */ - if (preferences.audio.seamlessAudioTransitions) { - console.warn("[Custom] Seamless Audio Transitions enabled."); - MusicKit.getInstance()._bag.features["seamless-audio-transitions"] = true; - } - - /* Incognito Mode */ - if (preferences.general.incognitoMode) { - MusicKit.privateEnabled = true - } - - /* Event Listener for Lyrics Update */ - MusicKit.getInstance().addEventListener(MusicKit.Events.playbackTimeDidChange, function () { - ipcRenderer.send('LyricsTimeUpdate', MusicKit.getInstance().currentPlaybackTime + 0.250); - }); - MusicKit.getInstance().addEventListener(MusicKit.Events.nowPlayingItemDidChange, function () { - var EAtmpdisable = false; - var tempOutputID = -1; - try{ - if (MusicKit.getInstance().nowPlayingItem["type"] === "musicVideo") { - try{ - if(!GCOverride ){ - MVsource = AMEx.context.createMediaElementSource(document.querySelector('apple-music-video-player').shadowRoot.querySelector('amp-video-player-internal').shadowRoot.querySelector('amp-video-player').shadowRoot.getElementById('apple-music-video-player')); - MVsource.connect(windowAudioNode); - } - - } catch(e){console.log(e);} - } else{ - if (!GCOverride ) { - try{ - AMEx.result.source.connect(windowAudioNode);} - catch(e){}} - } - }catch(e){} - try{ - if (MusicKit.getInstance().nowPlayingItem["type"] === "musicVideo") { - document.querySelector(`#MVLyricsBox`).style.display = 'block'; - } else { - document.querySelector(`#MVLyricsBox`).style.display = 'none'; - } - document.querySelector(`#MVLyricsBox`).childNodes[0].innerHTML= ""; - document.querySelector(`#MVLyricsBox`).childNodes[1].innerHTML= ""; - } - catch (e){} - try { - GetXPath("/html/body/div[4]/div[3]/div[3]/div/div[2]/div[1]/img").src = "https://music.apple.com/assets/product/MissingArtworkMusic.svg"; - } catch (e) { - } - try { - let lrc = new Lyricer(); - lrc.setLrc(""); - lrc = null; - } catch (e) { - } - - const sidebar = document.querySelector('.web-chrome-drawer'); - if ((sidebar && document.body.classList.contains('web-chrome-drawer-open')) || (MusicKit.getInstance().nowPlayingItem != null && MusicKit.getInstance().nowPlayingItem["type"] == "musicVideo")) { - _lyrics.GetLyrics(1, false); - } - - - }); - - /* Mutation Observer to disable "seek error" alert */ - let observer = new MutationObserver(function (mutationList) { - for (const mutation of mutationList) { - for (const child of mutation.addedNodes) { - try { - if (document.getElementById("mk-dialog-title").textContent === "cancelled" || document.getElementById("mk-dialog-title").textContent.includes("The play") || document.getElementById("mk-dialog-title").textContent.includes("MEDIA_KEY")) { - document.getElementById("musickit-dialog").remove(); - document.getElementById("musickit-dialog-scrim").remove(); - break; - } - } catch (e) { - break; - } - } - } - - }); - observer.observe(document.body, {childList: true}); - - /* Load Themes and Transparency */ - AMStyling.loadTheme(preferences["visual"]["theme"]); - if (preferences["visual"]["transparencyEffect"] !== "" && preferences["visual"]["transparencyEffect"] !== "mica") { - AMStyling.setTransparency(true); - } else { - AMStyling.setTransparency(false); - } - - if (preferences["visual"]["transparencyEffect"] === "mica") { - AMStyling.setMica(true); - } else { - AMStyling.setMica(false); - } - - AM.themesListing = await ipcRenderer.invoke('updateThemesListing'); - AM.acrylicSupported = await ipcRenderer.invoke('isAcrylicSupported'); - - if (await ipcRenderer.invoke('getStoreValue', 'general.storefront') !== MusicKit.getInstance().storefrontId) { - await ipcRenderer.invoke('setStoreValue', 'general.storefront', MusicKit.getInstance().storefrontId); - } - - /** Need a better way to find the user menu asap, this is embarrassing **/ - if(MusicKit.getInstance().authorizationStatus !== 0) { - var checkForUserMenu = setInterval(function () { - if (document.querySelectorAll(".web-chrome-controls-container>.web-navigation__auth").length) { - _tests.usermenuinit(); - clearInterval(checkForUserMenu); - } - }, 100); - } - - }, - LoadCustom: () => { - const preferences = ipcRenderer.sendSync('getStore'); - - /* Execute plugins OnNavigation */ - if (typeof _plugins != "undefined") { - _plugins.execute("OnNavigation"); - } - - /* Remove the Region Banner */ - while (document.getElementsByClassName('locale-switcher-banner').length > 0) { - document.getElementsByClassName('locale-switcher-banner')[0].remove() - } - - /* Create the Custom Settings Context Menu */ - const buttonPath = (preferences.visual.frameType === 'mac-right' ? '//*[@id="web-main"]/div[4]/div/div[3]/div[3]/button' : '//*[@id="web-main"]/div[3]/div/div[3]/div[3]/button'); - if (GetXPath(buttonPath)) { - GetXPath(buttonPath).addEventListener('click', function () { - try { - if (document.querySelector('.context-menu__option--app-settings')) { - if (preferences.advanced.verboseLogging) console.log("[settingsInit] Preventing second button."); - return; - } - - const ul = GetXPath("/html/body/div[6]/ul"); - - const amPreferences = GetXPath('/html/body/div[6]/ul/li[2]'); - GetXPath('/html/body/div[6]/ul/li[2]/span/span').innerHTML = 'Preferences'; - ul.insertBefore(amPreferences, ul.childNodes[9]); - - const amSettings = document.createElement("li"); - amSettings.innerHTML = ` - - Account Settings - - - - - - `; - amSettings.classList.add("context-menu__option--am-settings"); - amSettings.classList.add("context-menu__option"); - amSettings.onclick = function () { - window.open(`https://music.apple.com/account/settings`) - }; - ul.insertBefore(amSettings, ul.childNodes[8]); - - const amDiscord = document.createElement("li"); - amDiscord.innerHTML = ` - - Discord - - - - - `; - amDiscord.classList.add("context-menu__option--am-discord"); - amDiscord.classList.add("context-menu__option"); - amDiscord.onclick = function () { - window.open(`https://discord.gg/CezHYdXHEM`) - }; - ul.insertBefore(amDiscord, ul.childNodes[4]); - - if (typeof _plugins != "undefined") { - /** Plugin menu items */ - _plugins.menuitems.forEach((item) => { - var element = document.createElement("li"); - var textSpan = document.createElement("span"); - textSpan.classList.add("context-menu__option-text"); - element.appendChild(textSpan); - textSpan.innerHTML = item.Text; - element.addEventListener("click", item.OnClick); - element.addEventListener("click", () => { - document.querySelector(".context-menu-outside-click-area").dispatchEvent(new Event("click")); - }); - element.classList.add("context-menu__option"); - ul.appendChild(element); - }); - /** End plugin menu items */ - } - } catch (e) {}}); - } - - /* Scroll Volume */ - if (document.querySelector('.web-chrome-playback-lcd__volume') && typeof volumeChange === 'undefined' && document.querySelector('.web-chrome-playback-lcd__volume').getAttribute('listener') !== 'true' && !activeEventListeners['web-chrome-playback-lcd__volume']) { - function checkScrollDirectionIsUp(event) { - if (event.wheelDelta) { - return event.wheelDelta > 0; - } - return event.deltaY < 0; - } - - function volumeChange(event) { - if (checkScrollDirectionIsUp(event)) { - if (MusicKit.getInstance().volume <= 1) { - if ((MusicKit.getInstance().volume + 0.05) > 1) { - MusicKit.getInstance().volume = 1 - } else { - MusicKit.getInstance().volume += 0.05; - } - } - } else { - if (MusicKit.getInstance().volume >= 0) { - if ((MusicKit.getInstance().volume - 0.05) < 0) { - MusicKit.getInstance().volume = 0; - } else { - MusicKit.getInstance().volume -= 0.05; - } - } - } - } - - document.getElementsByClassName('web-chrome-playback-lcd__volume')[0].addEventListener('wheel', volumeChange); - activeEventListeners['web-chrome-playback-lcd__volume'] = true - } - - /* Context Menu Creation (From PR #221 by @SiverDX) */ - const SongContextMenu = { - simulateClick: (element, clientX, clientY) => { - let event = new MouseEvent('click', { - clientX: clientX, - clientY: clientY - }); - - element.dispatchEvent(event); - }, - - createListeners: () => { - /* Check if the user is on the library song list or on playlist/album */ - const clickRegion = (document.getElementsByClassName("songs-list-row").length === 0 ? document.getElementsByClassName("library-track") : document.getElementsByClassName("songs-list-row")); - - /* Loop through each row/song and add event listener */ - for (let area of clickRegion) { - area.addEventListener('contextmenu', function (event) { - event.preventDefault(); - - let control = area.getElementsByClassName("context-menu__overflow ")[0]; - - if (control) { - SongContextMenu.simulateClick(control, event.clientX, event.clientY); - } - }); - } - - } - }; - SongContextMenu.createListeners(); - - /* Remove Apple Logo */ - if (preferences['visual']['removeAppleLogo']) { - while (document.getElementsByClassName('web-navigation__header web-navigation__header--logo').length > 0) { - document.getElementsByClassName('web-navigation__header web-navigation__header--logo')[0].remove(); - } - } - - /* Remove Footer */ - if (!matchRuleShort(window.location.href, '*settings*') && document.getElementsByClassName('application-preferences').length === 0) { - if (preferences['visual']['removeFooter'] && document.querySelector('footer').style.display !== "none") { - document.querySelector('.dt-footer').style.display = "none"; - } else if (!preferences['visual']['removeFooter'] && document.querySelector('footer').style.display === "none") { - document.querySelector('.dt-footer').style.display = "block"; - } - } - - - /* Remove Upsell */ - if (preferences['visual']['removeUpsell']) { - while (document.getElementsByClassName('web-navigation__native-upsell').length > 0) { - document.getElementsByClassName('web-navigation__native-upsell')[0].remove(); - } - } - - /* Initialize the miniPlayer */ - _miniPlayer.init(); - - /* Create the Lyrics Button */ - _lyrics.CreateButton(); - - if(typeof wsapi !== "undefined") { - _lyrics.onchange((lyrics)=>{ - ipcRenderer.send('wsapi-returnLyrics', JSON.stringify(lyrics)); - }); - }else{ - console.warn("WSAPI not found"); - } - } - }; - - /* Load the Startup Files as This is the First Time its been Run */ - AMJavaScript.LoadCustomStartup().catch((e) => console.error(e)); - } - - /* Functions used in Settings Page */ - if (typeof AMSettings == "undefined") { - var AMSettings = { - revealCollapse: () => { - const elem = document.querySelector('#advanced'); - if (elem.classList.contains('revealed')) { - /* Collapse Category */ - elem.classList.remove('revealed'); - document.querySelector('.header-nav-image').src = 'ameres://icons/webui/down.svg'; - } else { - /* Reveal the Category */ - elem.classList.add('revealed'); - document.querySelector('.header-nav-image').src = 'ameres://icons/webui/up.svg'; - } - }, - - lastfm: { - LastFMDeauthorize: () => { - ipcRenderer.invoke('setStoreValue', 'general.lastfm', false).catch((e) => console.error(e)); - ipcRenderer.invoke('setStoreValue', 'tokens.lastfm', '').catch((e) => console.error(e)); - const element = document.getElementById('lfmConnect'); - element.innerHTML = 'Connect'; - element.onclick = AMSettings.lastfm.LastFMAuthenticate; - }, - LastFMAuthenticate: () => { - const element = document.getElementById('lfmConnect'); - window.open('https://www.last.fm/api/auth?api_key=174905d201451602407b428a86e8344d&cb=ame://auth/lastfm'); - element.innerText = 'Connecting...'; - - /* Just a timeout for the button */ - setTimeout(() => { - if (element.innerText === 'Connecting...') { - element.innerText = 'Connect'; - console.warn('[LastFM] Attempted connection timed out.'); - } - }, 20000); - - ipcRenderer.on('LastfmAuthenticated', function (_event, lfmAuthKey) { - element.innerHTML = `Disconnect\n

(Authed: ${lfmAuthKey})

`; - element.onclick = AMSettings.lastfm.LastFMDeauthorize; - }); - } - }, - - createNotification: (changed) => { - if (typeof changed !== 'object' || !changed || (Object.keys(changed).length === 0 && changed.constructor === Object)) { - return; - } - - let changedHTML = ``, - changedFull = ``, - addedHTML = ``, - addedFull = ``; - - for (let [key, value] of Object.entries(changed)) { - key = key.split('.')[0]; - key = key.charAt(0).toUpperCase() + key.slice(1); - - if (value === 'updated') { - changedHTML += `
  • ${key}
  • `; - } else if (value === 'added') { - addedHTML += `
  • ${key}
  • `; - } - } - - if (changedHTML !== '') { - changedFull = ` -

    The following themes have been updated:

    -
      - ${changedHTML} -
    - ` - } - - if (addedHTML !== '') { - addedFull = ` -

    The following themes have been added:

    -
      - ${addedHTML} -
    - ` - } - - new AMEModal({ - content: ` -
    - ${changedFull} - ${addedFull} -
    `, - Style: { - width: "auto", - minWidth: "386px", - maxWidth: "100%", - minHeight: "300px", - maxHeight: "100%", - height: "auto", - padding: "46px", - } - }); - }, - - themes: { - updateThemesListing: (listing) => { - let themesListingHTML = `\n`; - for (const [fileName, theme] of Object.entries(listing)) { - themesListingHTML = themesListingHTML + `\n`; - } - document.getElementById('theme').innerHTML = themesListingHTML; - console.warn('[Custom][updateThemes] Themes Listing Updated!'); - }, - updateThemes: () => { - document.getElementById('updateThemes').innerText = 'Updating...'; - ipcRenderer.invoke('updateThemes').then(listing => { - setTimeout(async () => { - AM.themesListing = await ipcRenderer.invoke('updateThemesListing'); - AMSettings.themes.updateThemesListing(AM.themesListing); - document.querySelector('#updateThemes').innerHTML = (AM.themesListing ? 'Themes Updated' : 'Error'); - document.querySelector('#updateThemes').classList.add(AM.themesListing ? 'success' : 'failure'); - AMSettings.createNotification(listing); - }, 2000) - }) - } - }, - - copyLogFile: () => { - const returnValue = ipcRenderer.sendSync('copyLogFile'); - document.querySelector('#copyLogFile').innerHTML = (returnValue ? 'Copied to Clipboard' : 'Copy Failed'); - document.querySelector('#copyLogFile').classList.add(returnValue ? 'success' : 'failure'); - }, - - hasParentClass: (child, classname) => { - if (child.className.split(' ').indexOf(classname) >= 0) return true; - try { - return child.parentNode && AMSettings.hasParentClass(child.parentNode, classname); - } catch (TypeError) { - return false; - } - }, - - HandleField: (element) => { - const field = document.getElementById(element); - if (!field) { - console.error('[HandleField] Element Not Found'); - return; - } - - let category; - if (AMSettings.hasParentClass(field, 'general')) { - category = 'general'; - } else if (AMSettings.hasParentClass(field, 'visual')) { - category = 'visual'; - } else if (AMSettings.hasParentClass(field, 'audio')) { - category = 'audio'; - } else if (AMSettings.hasParentClass(field, 'window')) { - category = 'window'; - } else if (AMSettings.hasParentClass(field, 'advanced')) { - category = 'advanced'; - } else { - console.error('[HandleField] No Parent Category Found.'); - return; - } - - /* Toggles */ - if (AMSettings.hasParentClass(field, 'toggle-element')) { - field.checked = preferences[category][element]; - field.addEventListener('change', (event) => { - ipcRenderer.invoke('setStoreValue', `${category}.${element}`, event.target.checked).catch((err) => console.error(err)); - }); - console.warn(`[HandleField] Event listener created for ${category}.${element}`) - } - /* Dropdowns */ - else if (field.classList.contains('form-dropdown-select')) { - field.value = preferences[category][element]; - field.addEventListener('change', (event) => { - ipcRenderer.invoke('setStoreValue', `${category}.${element}`, event.target.value).catch((err) => console.error(err)); - }); - console.warn(`[HandleField] Event listener created for ${category}.${element}`) - } - /* LastFM Connect Button */ - else if (field.id === "lfmConnect") { - ipcRenderer.invoke('getStoreValue', 'tokens.lastfm').then((token) => { - if (token) { - field.innerHTML = `Disconnect\n

    (Authed: ${token})

    `; - field.onclick = AMSettings.lastfm.LastFMDeauthorize; - } - }) - } - }, - - CreateMenu: (parent) => { - preferences = ipcRenderer.sendSync('getStore'); - - AMJavaScript.getRequest("ameres://html/preferences-main.html", (content) => { - document.getElementsByClassName(parent)[0].innerHTML = content; - - if (document.querySelector('footer')) { - document.querySelector('.dt-footer').style.display = "block"; - document.querySelector('.dt-footer').classList.add('app-prefs-credits'); - AMJavaScript.getRequest("ameres://html/preferences-footer.html", (content) => { - document.querySelector('.dt-footer').innerHTML = content; - }) - } - - AMSettings.themes.updateThemesListing(AM.themesListing); - - /* Adjust Preferences Menu if Acrylic is not Supported */ - if (AM.acrylicSupported) { - document.getElementById('transparencyEffect').innerHTML = document.getElementById('transparencyEffect').innerHTML + "\n"; - document.getElementById('transparencyEffect').innerHTML = document.getElementById('transparencyEffect').innerHTML + "\n"; - } else { - document.getElementById('transparencyDisableBlurToggleLI').remove(); - } - - /* Remove System Accent Toggle if its not win32/darwin */ - ipcRenderer.invoke('fetchOperatingSystem').then((platform) => { - if (platform !== "win32" && platform !== "darwin") { - document.getElementById('useOperatingSystemAccentToggleLI').remove(); - } - }); - - /* General Settings */ - AMSettings.HandleField('incognitoMode'); - AMSettings.HandleField('playbackNotifications'); - AMSettings.HandleField('trayTooltipSongName'); - AMSettings.HandleField('startupPage'); - AMSettings.HandleField('analyticsEnabled'); - AMSettings.HandleField('discordRPC'); - AMSettings.HandleField('discordClearActivityOnPause'); - AMSettings.HandleField('lfmConnect'); - AMSettings.HandleField('lastfmRemoveFeaturingArtists'); - AMSettings.HandleField('lastfmNowPlaying'); - AMSettings.HandleField('lastfmScrobbleDelay'); - - /* Visual Settings */ - AMSettings.HandleField('theme'); - AMSettings.HandleField('frameType'); - AMSettings.HandleField('transparencyEffect'); - AMSettings.HandleField('transparencyTheme'); - AMSettings.HandleField('transparencyDisableBlur'); - AMSettings.HandleField('transparencyMaximumRefreshRate'); - AMSettings.HandleField('yton'); - AMSettings.HandleField('mxmon'); - AMSettings.HandleField('mxmlanguage'); - AMSettings.HandleField('streamerMode'); - AMSettings.HandleField('removeUpsell'); - AMSettings.HandleField('removeAppleLogo'); - AMSettings.HandleField('removeFooter'); - AMSettings.HandleField('removeScrollbars'); - AMSettings.HandleField('useOperatingSystemAccent'); - AMSettings.HandleField('scaling'); - - /* Audio Settings */ - AMSettings.HandleField('audioQuality'); - AMSettings.HandleField('seamlessAudioTransitions'); - AMSettings.HandleField('castingBitDepth'); - AMSettings.HandleField('enableDLNA'); - AMSettings.HandleField('volume'); - - - /* Window Settings */ - AMSettings.HandleField('appStartupBehavior'); - AMSettings.HandleField('closeButtonMinimize'); - - /* Advanced Settings */ - AMSettings.HandleField('forceApplicationMode'); - AMSettings.HandleField('hardwareAcceleration'); - AMSettings.HandleField('verboseLogging'); - AMSettings.HandleField('alwaysOnTop'); - AMSettings.HandleField('autoUpdaterBetaBuilds'); - AMSettings.HandleField('useBetaSite'); - AMSettings.HandleField('preventMediaKeyHijacking'); - AMSettings.HandleField('devToolsOnStartup'); - AMSettings.HandleField('allowMultipleInstances'); - }) - } - } - } - -} catch (e) { - console.error("[JS] Error while trying to apply custom.js", e); -} \ No newline at end of file diff --git a/oldshit/resources/js/encoderWorker.umd.js b/oldshit/resources/js/encoderWorker.umd.js deleted file mode 100644 index 52b73acc..00000000 --- a/oldshit/resources/js/encoderWorker.umd.js +++ /dev/null @@ -1,1747 +0,0 @@ -(function OpusMediaWorkerUMD(root, factory) { - if (typeof WorkerGlobalScope !== 'undefined' && - self instanceof WorkerGlobalScope) { - var initWorker = factory(); - initWorker(); - } else if (typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if (typeof define === 'function' && define.amd) - define([], factory); - else if (typeof exports === 'object') - exports["encoderWorker"] = factory(); - else - root["encoderWorker"] = factory(); -})(typeof OpusMediaRecorder !== 'undefined' ? OpusMediaRecorder : typeof self !== 'undefined' ? self : this, function() { - return function() { - ! function(e) { - var t = {}; - - function n(r) { - if (t[r]) return t[r].exports; - var o = t[r] = { - i: r, - l: !1, - exports: {} - }; - return e[r].call(o.exports, o, o.exports, n), o.l = !0, o.exports - } - n.m = e, n.c = t, n.d = function(e, t, r) { - n.o(e, t) || Object.defineProperty(e, t, { - enumerable: !0, - get: r - }) - }, n.r = function(e) { - "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { - value: "Module" - }), Object.defineProperty(e, "__esModule", { - value: !0 - }) - }, n.t = function(e, t) { - if (1 & t && (e = n(e)), 8 & t) return e; - if (4 & t && "object" == typeof e && e && e.__esModule) return e; - var r = Object.create(null); - if (n.r(r), Object.defineProperty(r, "default", { - enumerable: !0, - value: e - }), 2 & t && "string" != typeof e) - for (var o in e) n.d(r, o, function(t) { - return e[t] - }.bind(null, o)); - return r - }, n.n = function(e) { - var t = e && e.__esModule ? function() { - return e.default - } : function() { - return e - }; - return n.d(t, "a", t), t - }, n.o = function(e, t) { - return Object.prototype.hasOwnProperty.call(e, t) - }, n.p = "", n(n.s = 5) - }([function(e, t, n) { - (function(e) { - function n(e, t) { - for (var n = 0, r = e.length - 1; r >= 0; r--) { - var o = e[r]; - "." === o ? e.splice(r, 1) : ".." === o ? (e.splice(r, 1), n++) : n && (e.splice(r, 1), n--) - } - if (t) - for (; n--; n) e.unshift(".."); - return e - } - - function r(e, t) { - if (e.filter) return e.filter(t); - for (var n = [], r = 0; r < e.length; r++) t(e[r], r, e) && n.push(e[r]); - return n - } - t.resolve = function() { - for (var t = "", o = !1, i = arguments.length - 1; i >= -1 && !o; i--) { - var u = i >= 0 ? arguments[i] : e.cwd(); - if ("string" != typeof u) throw new TypeError("Arguments to path.resolve must be strings"); - u && (t = u + "/" + t, o = "/" === u.charAt(0)) - } - return (o ? "/" : "") + (t = n(r(t.split("/"), (function(e) { - return !!e - })), !o).join("/")) || "." - }, t.normalize = function(e) { - var i = t.isAbsolute(e), - u = "/" === o(e, -1); - return (e = n(r(e.split("/"), (function(e) { - return !!e - })), !i).join("/")) || i || (e = "."), e && u && (e += "/"), (i ? "/" : "") + e - }, t.isAbsolute = function(e) { - return "/" === e.charAt(0) - }, t.join = function() { - var e = Array.prototype.slice.call(arguments, 0); - return t.normalize(r(e, (function(e, t) { - if ("string" != typeof e) throw new TypeError("Arguments to path.join must be strings"); - return e - })).join("/")) - }, t.relative = function(e, n) { - function r(e) { - for (var t = 0; t < e.length && "" === e[t]; t++); - for (var n = e.length - 1; n >= 0 && "" === e[n]; n--); - return t > n ? [] : e.slice(t, n - t + 1) - } - e = t.resolve(e).substr(1), n = t.resolve(n).substr(1); - for (var o = r(e.split("/")), i = r(n.split("/")), u = Math.min(o.length, i.length), a = u, s = 0; s < u; s++) - if (o[s] !== i[s]) { - a = s; - break - } var c = []; - for (s = a; s < o.length; s++) c.push(".."); - return (c = c.concat(i.slice(a))).join("/") - }, t.sep = "/", t.delimiter = ":", t.dirname = function(e) { - if ("string" != typeof e && (e += ""), 0 === e.length) return "."; - for (var t = e.charCodeAt(0), n = 47 === t, r = -1, o = !0, i = e.length - 1; i >= 1; --i) - if (47 === (t = e.charCodeAt(i))) { - if (!o) { - r = i; - break - } - } else o = !1; - return -1 === r ? n ? "/" : "." : n && 1 === r ? "/" : e.slice(0, r) - }, t.basename = function(e, t) { - var n = function(e) { - "string" != typeof e && (e += ""); - var t, n = 0, - r = -1, - o = !0; - for (t = e.length - 1; t >= 0; --t) - if (47 === e.charCodeAt(t)) { - if (!o) { - n = t + 1; - break - } - } else -1 === r && (o = !1, r = t + 1); - return -1 === r ? "" : e.slice(n, r) - }(e); - return t && n.substr(-1 * t.length) === t && (n = n.substr(0, n.length - t.length)), n - }, t.extname = function(e) { - "string" != typeof e && (e += ""); - for (var t = -1, n = 0, r = -1, o = !0, i = 0, u = e.length - 1; u >= 0; --u) { - var a = e.charCodeAt(u); - if (47 !== a) - 1 === r && (o = !1, r = u + 1), 46 === a ? -1 === t ? t = u : 1 !== i && (i = 1) : -1 !== t && (i = -1); - else if (!o) { - n = u + 1; - break - } - } - return -1 === t || -1 === r || 0 === i || 1 === i && t === r - 1 && t === n + 1 ? "" : e.slice(t, r) - }; - var o = "b" === "ab".substr(-1) ? function(e, t, n) { - return e.substr(t, n) - } : function(e, t, n) { - return t < 0 && (t = e.length + t), e.substr(t, n) - } - }).call(this, n(2)) - }, function(e, t) { - function n(e) { - return (n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { - return typeof e - } : function(e) { - return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e - })(e) - } - - function r(e, t) { - if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function"); - e.prototype = Object.create(t && t.prototype, { - constructor: { - value: e, - writable: !0, - configurable: !0 - } - }), t && o(e, t) - } - - function o(e, t) { - return (o = Object.setPrototypeOf || function(e, t) { - return e.__proto__ = t, e - })(e, t) - } - - function i(e) { - var t = function() { - if ("undefined" == typeof Reflect || !Reflect.construct) return !1; - if (Reflect.construct.sham) return !1; - if ("function" == typeof Proxy) return !0; - try { - return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}))), !0 - } catch (e) { - return !1 - } - }(); - return function() { - var n, r = a(e); - if (t) { - var o = a(this).constructor; - n = Reflect.construct(r, arguments, o) - } else n = r.apply(this, arguments); - return u(this, n) - } - } - - function u(e, t) { - return !t || "object" !== n(t) && "function" != typeof t ? function(e) { - if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - return e - }(e) : t - } - - function a(e) { - return (a = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) { - return e.__proto__ || Object.getPrototypeOf(e) - })(e) - } - - function s(e, t) { - if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") - } - - function c(e, t) { - for (var n = 0; n < t.length; n++) { - var r = t[n]; - r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r) - } - } - - function f(e, t, n) { - return t && c(e.prototype, t), n && c(e, n), e - } - var l = function() { - function e(t, n, r, o) { - switch (s(this, e), this._size = n, this._module = t, this._size) { - case 1: - this._heapArray = r ? this._module.HEAP8 : this._module.HEAPU8; - break; - case 2: - this._heapArray = r ? this._module.HEAP16 : this._module.HEAPU16; - break; - case 4: - this._heapArray = r ? this._module.HEAP32 : this._module.HEAPU32; - break; - default: - this._heapArray = this._module.HEAPU8 - } - o && (this._size = 4, this._heapArray = this._module.HEAPF32), this._pointer = this._module._malloc(n) - } - return f(e, [{ - key: "free", - value: function() { - this._module._free(this.pointer) - } - }, { - key: "pointer", - get: function() { - return this._pointer - } - }, { - key: "value", - get: function() { - var e = 0; - switch (this._size) { - case 2: - e = 1; - break; - case 4: - e = 2; - break; - default: - throw new Error("Pointer can be only deferenced as integer-sized") - } - return this._heapArray[this.pointer >> e] - }, - set: function(e) { - var t = 0; - switch (this._size) { - case 2: - t = 1; - break; - case 4: - t = 2; - break; - default: - throw new Error("Pointer can be only deferenced as integer-sized") - } - this._heapArray[this.pointer >> t] = e - } - }]), e - }(), - p = function(e) { - r(n, e); - var t = i(n); - - function n(e, r) { - var o; - return s(this, n), o = t.call(this, e, 4, !0, !1), void 0 !== r && (o.value = r), o - } - return n - }(l), - _ = function(e) { - r(n, e); - var t = i(n); - - function n(e, r) { - var o; - return s(this, n), o = t.call(this, e, 4, !1, !1), void 0 !== r && (o.value = r), o - } - return n - }(l), - d = function(e) { - r(n, e); - var t = i(n); - - function n(e, r, o, i, u) { - var a; - s(this, n), a = t.call(this, e, r * o, i, u); - var c = 0; - switch (o) { - case 1: - a._heapArray = i ? a._module.HEAP8 : a._module.HEAPU8, c = 0; - break; - case 2: - a._heapArray = i ? a._module.HEAP16 : a._module.HEAPU16, c = 1; - break; - case 4: - a._heapArray = i ? a._module.HEAP32 : a._module.HEAPU32, c = 2; - break; - default: - throw new Error("Unit size must be an integer-size") - } - u && (a._heapArray = a._module.HEAPF32, c = 2); - var f = a._pointer >> c; - return a._buffer = a._heapArray.subarray(f, f + r), a._length = r, a - } - return f(n, [{ - key: "set", - value: function(e, t) { - this._buffer.set(e, t) - } - }, { - key: "subarray", - value: function(e, t) { - return this._buffer.subarray(e, t) - } - }, { - key: "length", - get: function() { - return this._length - } - }]), n - }(l), - h = function(e) { - r(n, e); - var t = i(n); - - function n(e, r) { - return s(this, n), t.call(this, e, r, 4, !0, !0) - } - return n - }(d), - m = function(e) { - r(n, e); - var t = i(n); - - function n(e, r) { - return s(this, n), t.call(this, e, r, 1, !1, !1) - } - return n - }(d), - y = function() { - function e(t) { - s(this, e), this._module = t - } - return f(e, [{ - key: "mallocInt32", - value: function(e) { - return new p(this._module, e) - } - }, { - key: "mallocUint32", - value: function(e) { - return new _(this._module, e) - } - }, { - key: "mallocUint8Buffer", - value: function(e) { - return new m(this._module, e) - } - }, { - key: "mallocFloat32Buffer", - value: function(e) { - return new h(this._module, e) - } - }]), e - }(); - e.exports = { - writeString: function(e, t, n) { - for (var r = 0; r < n.length; r++) e.setUint8(t + r, n.charCodeAt(r)) - }, - EmscriptenMemoryAllocator: y - } - }, function(e, t) { - var n, r, o = e.exports = {}; - - function i() { - throw new Error("setTimeout has not been defined") - } - - function u() { - throw new Error("clearTimeout has not been defined") - } - - function a(e) { - if (n === setTimeout) return setTimeout(e, 0); - if ((n === i || !n) && setTimeout) return n = setTimeout, setTimeout(e, 0); - try { - return n(e, 0) - } catch (t) { - try { - return n.call(null, e, 0) - } catch (t) { - return n.call(this, e, 0) - } - } - }! function() { - try { - n = "function" == typeof setTimeout ? setTimeout : i - } catch (e) { - n = i - } - try { - r = "function" == typeof clearTimeout ? clearTimeout : u - } catch (e) { - r = u - } - }(); - var s, c = [], - f = !1, - l = -1; - - function p() { - f && s && (f = !1, s.length ? c = s.concat(c) : l = -1, c.length && _()) - } - - function _() { - if (!f) { - var e = a(p); - f = !0; - for (var t = c.length; t;) { - for (s = c, c = []; ++l < t;) s && s[l].run(); - l = -1, t = c.length - } - s = null, f = !1, - function(e) { - if (r === clearTimeout) return clearTimeout(e); - if ((r === u || !r) && clearTimeout) return r = clearTimeout, clearTimeout(e); - try { - r(e) - } catch (t) { - try { - return r.call(null, e) - } catch (t) { - return r.call(this, e) - } - } - }(e) - } - } - - function d(e, t) { - this.fun = e, this.array = t - } - - function h() {} - o.nextTick = function(e) { - var t = new Array(arguments.length - 1); - if (arguments.length > 1) - for (var n = 1; n < arguments.length; n++) t[n - 1] = arguments[n]; - c.push(new d(e, t)), 1 !== c.length || f || a(_) - }, d.prototype.run = function() { - this.fun.apply(null, this.array) - }, o.title = "browser", o.browser = !0, o.env = {}, o.argv = [], o.version = "", o.versions = {}, o.on = h, o.addListener = h, o.once = h, o.off = h, o.removeListener = h, o.removeAllListeners = h, o.emit = h, o.prependListener = h, o.prependOnceListener = h, o.listeners = function(e) { - return [] - }, o.binding = function(e) { - throw new Error("process.binding is not supported") - }, o.cwd = function() { - return "/" - }, o.chdir = function(e) { - throw new Error("process.chdir is not supported") - }, o.umask = function() { - return 0 - } - }, function(e, t) { - e.exports = function(e) { - return e.webpackPolyfill || (e.deprecate = function() {}, e.paths = [], e.children || (e.children = []), Object.defineProperty(e, "loaded", { - enumerable: !0, - get: function() { - return e.l - } - }), Object.defineProperty(e, "id", { - enumerable: !0, - get: function() { - return e.i - } - }), e.webpackPolyfill = 1), e - } - }, function(e, t) {}, function(e, t, n) { - function r(e) { - var t, r = n(6), - o = n(7), - i = n(8); - e.onmessage = function(e) { - var n = e.data.command; - switch (n) { - case "loadEncoder": - var u, a = e.data, - s = a.mimeType, - c = a.wasmPath; - switch (s) { - case "audio/wav": - case "audio/wave": - u = r; - break; - case "audio/webm": - u = o; - break; - case "audio/ogg": - u = i - } - var f = {}; - c && (f.locateFile = function(e, t) { - return e.match(/.wasm/) ? c : t + e - }), u(f).then((function(e) { - t = e, self.postMessage({ - command: "readyToInit" - }) - })); - break; - case "init": - var l = e.data, - p = l.sampleRate, - _ = l.channelCount, - d = l.bitsPerSecond; - t.init(p, _, d); - break; - case "pushInputData": - for (var h = e.data, m = h.channelBuffers, y = (h.length, h.duration, 0); y < m.length; y++) m[y] = new Float32Array(m[y].buffer); - t.encode(m); - break; - case "getEncodedData": - case "done": - "done" === n && t.close(); - var v = t.flush(); - self.postMessage({ - command: "done" === n ? "lastEncodedData" : "encodedData", - buffers: v - }, v), "done" === n && self.close() - } - } - } - "undefined" != typeof WorkerGlobalScope && self instanceof WorkerGlobalScope && r(self), e.exports = r - }, function(e, t, n) { - function r(e) { - return function(e) { - if (Array.isArray(e)) return o(e) - }(e) || function(e) { - if ("undefined" != typeof Symbol && Symbol.iterator in Object(e)) return Array.from(e) - }(e) || function(e, t) { - if (!e) return; - if ("string" == typeof e) return o(e, t); - var n = Object.prototype.toString.call(e).slice(8, -1); - "Object" === n && e.constructor && (n = e.constructor.name); - if ("Map" === n || "Set" === n) return Array.from(e); - if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return o(e, t) - }(e) || function() { - throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") - }() - } - - function o(e, t) { - (null == t || t > e.length) && (t = e.length); - for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n]; - return r - } - - function i(e, t) { - for (var n = 0; n < t.length; n++) { - var r = t[n]; - r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r) - } - } - var u = n(1).writeString, - a = 3, - s = function() { - function e(t, n, r) { - ! function(e, t) { - if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") - }(this, e), this.config = { - inputSampleRate: t, - channelCount: n - }, this.encodedBuffers = [] - } - var t, n, r; - return t = e, (n = [{ - key: "encode", - value: function(e) { - for (var t = e[0].length, n = new ArrayBuffer(t * a * this.config.channelCount), r = new DataView(n), o = 0; o < this.config.channelCount; o++) - for (var i = e[o], u = 0; u < t; u++) { - var s = 8388607 * i[u] | 0; - s > 8388607 ? s = 8388607 : s < -8388608 && (s = -8388608 ); - var c = (u * this.config.channelCount + o) * a; - var valz = 0 | s; - var uinx = valz & 0xff; - r.setUint8(c, uinx); - var uiny =(valz & 0xff00) >> 8; - r.setUint8(c+1, uiny); - var uinz =(valz & 0xff0000) >> 16; - r.setUint8(c+2, uinz); - } - this.encodedBuffers.push(n) - } - }, { - key: "getHeader", - value: function() { - var e = this.encodedBuffers.reduce((function(e, t) { - return e + t.byteLength - }), 0), - t = new ArrayBuffer(44), - n = new DataView(t); - return u(n, 0, "RIFF"), n.setUint32(4, 36 + e, !0), u(n, 8, "WAVE"), u(n, 12, "fmt "), n.setUint32(16, 16, !0), n.setUint16(20, 1, !0), n.setUint16(22, this.config.channelCount, !0), n.setUint32(24, this.config.inputSampleRate, !0), n.setUint32(28, this.config.inputSampleRate * a * this.config.channelCount, !0), n.setUint16(32, a * this.config.channelCount, !0), n.setUint16(34, 8 * a, !0), u(n, 36, "data"), n.setUint32(40, e, !0), t - } - }]) && i(t.prototype, n), r && i(t, r), e - }(); - e.exports = function(e) { - return new Promise((function(t, n) { - (e = void 0 !== e && e || {}).init = function(t, n, r) { - e.encoder = new s(t, n, r) - }, e.encode = function(t) { - e.encoder.encode(t) - }, e.flush = function() { - var t = e.encoder.getHeader(), - n = e.encoder.encodedBuffers.splice(0, e.encoder.encodedBuffers.length); - return [t].concat(r(n)) - }, e.close = function() {}, t(e) - })) - } - }, function(e, t, n) { - (function(e, r, o, i) { - var u; - - function a(e) { - return (a = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { - return typeof e - } : function(e) { - return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e - })(e) - } - - function s(e, t) { - if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") - } - - function c(e, t) { - for (var n = 0; n < t.length; n++) { - var r = t[n]; - r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r) - } - } - - function f(e, t, n) { - return t && c(e.prototype, t), n && c(e, n), e - } - var l, p = (l = (l = "undefined" != typeof document && document.currentScript ? document.currentScript.src : void 0) || e, function(e) { - e = void 0 !== (e = e || {}) ? e : {}; - var t = n(1), - i = t.EmscriptenMemoryAllocator, - u = 2049, - c = 48e3, - p = 4e3, - _ = 20, - d = 6, - h = 4096, - m = 0, - y = 4002, - v = 0, - b = function() { - function t(n, r) { - var o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : void 0; - s(this, t), this.config = { - inputSampleRate: n, - channelCount: r - }, this.memory = new i(e), this._opus_encoder_create = e._opus_encoder_create, this._opus_encoder_ctl = e._opus_encoder_ctl, this._opus_encode_float = e._opus_encode_float, this._opus_encoder_destroy = e._opus_encoder_destroy, this._speex_resampler_init = e._speex_resampler_init, this._speex_resampler_process_interleaved_float = e._speex_resampler_process_interleaved_float, this._speex_resampler_destroy = e._speex_resampler_destroy, this._container = new e.Container, this._container.init(c, r, Math.floor(4294967295 * Math.random())), this.OpusInitCodec(c, r, o), this.SpeexInitResampler(n, c, r), this.inputSamplesPerChannel = n * _ / 1e3, this.outputSamplePerChannel = c * _ / 1e3, this.inputBufferIndex = 0, this.mInputBuffer = this.memory.mallocFloat32Buffer(this.inputSamplesPerChannel * r), this.mResampledBuffer = this.memory.mallocFloat32Buffer(this.outputSamplePerChannel * r), this.mOutputBuffer = this.memory.mallocUint8Buffer(p), this.interleavedBuffers = 1 !== r ? new Float32Array(h * r) : void 0 - } - return f(t, [{ - key: "encode", - value: function(e) { - for (var t = this.interleave(e), n = 0; n < t.length;) { - var r = Math.min(this.mInputBuffer.length - this.inputBufferIndex, t.length - n); - if (this.mInputBuffer.set(t.subarray(n, n + r), this.inputBufferIndex), this.inputBufferIndex += r, this.inputBufferIndex >= this.mInputBuffer.length) { - var o = this.memory.mallocUint32(this.inputSamplesPerChannel), - i = this.memory.mallocUint32(this.outputSamplePerChannel), - u = this._speex_resampler_process_interleaved_float(this.resampler, this.mInputBuffer.pointer, o.pointer, this.mResampledBuffer.pointer, i.pointer); - if (o.free(), i.free(), u !== v) throw new Error("Resampling error."); - var a = this._opus_encode_float(this.encoder, this.mResampledBuffer.pointer, this.outputSamplePerChannel, this.mOutputBuffer.pointer, this.mOutputBuffer.length); - if (a < 0) throw new Error("Opus encoding error."); - this._container.writeFrame(this.mOutputBuffer.pointer, a, this.outputSamplePerChannel), this.inputBufferIndex = 0 - } - n += r - } - } - }, { - key: "close", - value: function() { - for (var t = this.config.channelCount, n = [], r = 0; r < t; ++r) n.push(new Float32Array(h - this.inputBufferIndex / t)); - this.encode(n), e.destroy(this._container), this.mInputBuffer.free(), this.mResampledBuffer.free(), this.mOutputBuffer.free(), this._opus_encoder_destroy(this.encoder), this._speex_resampler_destroy(this.resampler) - } - }, { - key: "interleave", - value: function(e) { - var t = e.length; - if (1 === t) return e[0]; - for (var n = 0; n < t; n++) - for (var r = e[n], o = 0; o < r.length; o++) this.interleavedBuffers[o * t + n] = r[o]; - return this.interleavedBuffers - } - }, { - key: "OpusInitCodec", - value: function(e, t) { - var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : void 0, - r = this.memory.mallocUint32(void 0); - this.encoder = this._opus_encoder_create(e, t, u, r.pointer); - var o = r.value; - if (r.free(), o !== m) throw new Error("Opus encodor initialization failed."); - n && this.OpusSetOpusControl(y, n) - } - }, { - key: "OpusSetOpusControl", - value: function(e, t) { - var n = this.memory.mallocInt32(t); - this._opus_encoder_ctl(this.encoder, e, n.pointer), n.free() - } - }, { - key: "SpeexInitResampler", - value: function(e, t, n) { - var r = this.memory.mallocUint32(void 0); - this.resampler = this._speex_resampler_init(n, e, t, d, r.pointer); - var o = r.value; - if (r.free(), o !== v) throw new Error("Initializing resampler failed.") - } - }]), t - }(); - e.init = function(t, n, r) { - e.encodedBuffers = [], e.encoder = new b(t, n, r) - }, e.encode = function(t) { - e.encoder.encode(t) - }, e.flush = function() { - return e.encodedBuffers.splice(0, e.encodedBuffers.length) - }, e.close = function() { - e.encoder.close() - }; - var g, w = {}; - for (g in e) e.hasOwnProperty(g) && (w[g] = e[g]); - var A = [], - C = !1, - S = !1, - x = !1, - P = !1; - C = "object" === ("undefined" == typeof window ? "undefined" : a(window)), S = "function" == typeof importScripts, x = "object" === (void 0 === r ? "undefined" : a(r)) && "object" === a(r.versions) && "string" == typeof r.versions.node, P = !C && !x && !S; - var E, B, I, R, O = ""; - - function j(t) { - return e.locateFile ? e.locateFile(t, O) : O + t - } - x ? (O = S ? n(0).dirname(O) + "/" : o + "/", E = function(e, t) { - return I || (I = n(4)), R || (R = n(0)), e = R.normalize(e), I.readFileSync(e, t ? null : "utf8") - }, B = function(e) { - var t = E(e, !0); - return t.buffer || (t = new Uint8Array(t)), W(t.buffer), t - }, r.argv.length > 1 && r.argv[1].replace(/\\/g, "/"), A = r.argv.slice(2), r.on("uncaughtException", (function(e) { - if (!(e instanceof qe)) throw e - })), r.on("unhandledRejection", _e), e.inspect = function() { - return "[Emscripten Module object]" - }) : P ? ("undefined" != typeof read && (E = function(e) { - return read(e) - }), B = function(e) { - var t; - return "function" == typeof readbuffer ? new Uint8Array(readbuffer(e)) : (W("object" === a(t = read(e, "binary"))), t) - }, "undefined" != typeof scriptArgs ? A = scriptArgs : void 0 !== arguments && (A = arguments), "undefined" != typeof print && ("undefined" == typeof console && (console = {}), console.log = print, console.warn = console.error = "undefined" != typeof printErr ? printErr : print)) : (C || S) && (S ? O = self.location.href : document.currentScript && (O = document.currentScript.src), l && (O = l), O = 0 !== O.indexOf("blob:") ? O.substr(0, O.lastIndexOf("/") + 1) : "", E = function(e) { - var t = new XMLHttpRequest; - return t.open("GET", e, !1), t.send(null), t.responseText - }, S && (B = function(e) { - var t = new XMLHttpRequest; - return t.open("GET", e, !1), t.responseType = "arraybuffer", t.send(null), new Uint8Array(t.response) - })); - var k, U, T = e.print || console.log.bind(console), - F = e.printErr || console.warn.bind(console); - for (g in w) w.hasOwnProperty(g) && (e[g] = w[g]); - w = null, e.arguments && (A = e.arguments), e.thisProgram && e.thisProgram, e.quit && e.quit, e.wasmBinary && (k = e.wasmBinary), e.noExitRuntime && e.noExitRuntime, "object" !== ("undefined" == typeof WebAssembly ? "undefined" : a(WebAssembly)) && F("no native wasm support detected"); - var H = new WebAssembly.Table({ - initial: 60, - maximum: 60, - element: "anyfunc" - }), - M = !1; - - function W(e, t) { - e || _e("Assertion failed: " + t) - } - var D = "undefined" != typeof TextDecoder ? new TextDecoder("utf8") : void 0; - - function z(e, t, n) { - for (var r = t + n, o = t; e[o] && !(o >= r);) ++o; - if (o - t > 16 && e.subarray && D) return D.decode(e.subarray(t, o)); - for (var i = ""; t < o;) { - var u = e[t++]; - if (128 & u) { - var a = 63 & e[t++]; - if (192 != (224 & u)) { - var s = 63 & e[t++]; - if ((u = 224 == (240 & u) ? (15 & u) << 12 | a << 6 | s : (7 & u) << 18 | a << 12 | s << 6 | 63 & e[t++]) < 65536) i += String.fromCharCode(u); - else { - var c = u - 65536; - i += String.fromCharCode(55296 | c >> 10, 56320 | 1023 & c) - } - } else i += String.fromCharCode((31 & u) << 6 | a) - } else i += String.fromCharCode(u) - } - return i - } - - function L(e, t) { - return e ? z(q, e, t) : "" - } - "undefined" != typeof TextDecoder && new TextDecoder("utf-16le"); - var V, q, N, G = 65536; - - function X(t) { - V = t, e.HEAP8 = new Int8Array(t), e.HEAP16 = new Int16Array(t), e.HEAP32 = N = new Int32Array(t), e.HEAPU8 = q = new Uint8Array(t), e.HEAPU16 = new Uint16Array(t), e.HEAPU32 = new Uint32Array(t), e.HEAPF32 = new Float32Array(t), e.HEAPF64 = new Float64Array(t) - } - var Y = 5289024, - $ = 45984, - J = e.INITIAL_MEMORY || 16777216; - - function K(t) { - for (; t.length > 0;) { - var n = t.shift(); - if ("function" != typeof n) { - var r = n.func; - "number" == typeof r ? void 0 === n.arg ? e.dynCall_v(r) : e.dynCall_vi(r, n.arg) : r(void 0 === n.arg ? null : n.arg) - } else n() - } - }(U = e.wasmMemory ? e.wasmMemory : new WebAssembly.Memory({ - initial: J / G, - maximum: J / G - })) && (V = U.buffer), J = V.byteLength, X(V), N[$ >> 2] = Y; - var Q = [], - Z = [], - ee = [], - te = []; - - function ne() { - if (e.preRun) - for ("function" == typeof e.preRun && (e.preRun = [e.preRun]); e.preRun.length;) ue(e.preRun.shift()); - K(Q) - } - - function re() { - K(Z) - } - - function oe() { - K(ee) - } - - function ie() { - if (e.postRun) - for ("function" == typeof e.postRun && (e.postRun = [e.postRun]); e.postRun.length;) ae(e.postRun.shift()); - K(te) - } - - function ue(e) { - Q.unshift(e) - } - - function ae(e) { - te.unshift(e) - } - var se = 0, - ce = null, - fe = null; - - function le(t) { - se++, e.monitorRunDependencies && e.monitorRunDependencies(se) - } - - function pe(t) { - if (se--, e.monitorRunDependencies && e.monitorRunDependencies(se), 0 == se && (null !== ce && (clearInterval(ce), ce = null), fe)) { - var n = fe; - fe = null, n() - } - } - - function _e(t) { - throw e.onAbort && e.onAbort(t), T(t += ""), F(t), M = !0, t = "abort(" + t + "). Build with -s ASSERTIONS=1 for more info.", new WebAssembly.RuntimeError(t) - } - e.preloadedImages = {}, e.preloadedAudios = {}; - var de = "data:application/octet-stream;base64,"; - - function he(e) { - return String.prototype.startsWith ? e.startsWith(de) : 0 === e.indexOf(de) - } - var me = "WebMOpusEncoder.wasm"; - - function ye() { - try { - if (k) return new Uint8Array(k); - if (B) return B(me); - throw "both async and sync fetching of the wasm failed" - } catch (e) { - _e(e) - } - } - - function ve() { - return k || !C && !S || "function" != typeof fetch ? new Promise((function(e, t) { - e(ye()) - })) : fetch(me, { - credentials: "same-origin" - }).then((function(e) { - if (!e.ok) throw "failed to load wasm binary file at '" + me + "'"; - return e.arrayBuffer() - })).catch((function() { - return ye() - })) - } - - function be() { - var t = { - a: Te - }; - - function n(t, n) { - var r = t.exports; - e.asm = r, pe() - } - - function r(e) { - n(e.instance) - } - - function o(e) { - return ve().then((function(e) { - return WebAssembly.instantiate(e, t) - })).then(e, (function(e) { - F("failed to asynchronously prepare wasm: " + e), _e(e) - })) - } - if (le(), e.instantiateWasm) try { - return e.instantiateWasm(t, n) - } catch (e) { - return F("Module.instantiateWasm callback failed with error: " + e), !1 - } - return function() { - if (k || "function" != typeof WebAssembly.instantiateStreaming || he(me) || "function" != typeof fetch) return o(r); - fetch(me, { - credentials: "same-origin" - }).then((function(e) { - return WebAssembly.instantiateStreaming(e, t).then(r, (function(e) { - F("wasm streaming compile failed: " + e), F("falling back to ArrayBuffer instantiation"), o(r) - })) - })) - }(), {} - } - - function ge(t, n) { - var r = new Uint8Array(e.HEAPU8.buffer, t, n); - e.encodedBuffers.push(new Uint8Array(r).buffer) - } - - function we(e, t, n, r) { - _e("Assertion failed: " + L(e) + ", at: " + [t ? L(t) : "unknown filename", n, r ? L(r) : "unknown function"]) - } - he(me) || (me = j(me)), Z.push({ - func: function() { - Me() - } - }); - var Ae = { - mappings: {}, - buffers: [null, [], - [] - ], - printChar: function(e, t) { - var n = Ae.buffers[e]; - 0 === t || 10 === t ? ((1 === e ? T : F)(z(n, 0)), n.length = 0) : n.push(t) - }, - varargs: void 0, - get: function() { - return Ae.varargs += 4, N[Ae.varargs - 4 >> 2] - }, - getStr: function(e) { - return L(e) - }, - get64: function(e, t) { - return e - } - }; - - function Ce(e, t, n) { - return Ae.varargs = n, 0 - } - - function Se(e, t, n) { - Ae.varargs = n - } - - function xe(e, t, n) { - return Ae.varargs = n, 0 - } - - function Pe() { - _e() - } - - function Ee(e, t, n) { - q.copyWithin(e, t, t + n) - } - - function Be(e) { - _e("OOM") - } - - function Ie(e) { - Be() - } - - function Re(e) { - return 0 - } - - function Oe(e, t, n, r) { - var o = Ae.getStreamFromFD(e), - i = Ae.doReadv(o, t, n); - return N[r >> 2] = i, 0 - } - - function je(e, t, n, r, o) {} - - function ke(e, t, n, r) { - for (var o = 0, i = 0; i < n; i++) { - for (var u = N[t + 8 * i >> 2], a = N[t + (8 * i + 4) >> 2], s = 0; s < a; s++) Ae.printChar(e, q[u + s]); - o += a - } - return N[r >> 2] = o, 0 - } - - function Ue(e) { - var t = Date.now() / 1e3 | 0; - return e && (N[e >> 2] = t), t - } - var Te = { - a: we, - e: Ce, - h: Se, - g: xe, - b: Pe, - m: ge, - k: Ee, - l: Ie, - c: Re, - f: Oe, - j: je, - d: ke, - memory: U, - table: H, - i: Ue - }, - Fe = be(); - e.asm = Fe; - var He, Me = e.___wasm_call_ctors = function() { - return (Me = e.___wasm_call_ctors = e.asm.n).apply(null, arguments) - }, - We = (e.___em_js__emscriptenPushBuffer = function() { - return (e.___em_js__emscriptenPushBuffer = e.asm.o).apply(null, arguments) - }, e._emscripten_bind_VoidPtr___destroy___0 = function() { - return (We = e._emscripten_bind_VoidPtr___destroy___0 = e.asm.p).apply(null, arguments) - }), - De = e._emscripten_bind_Container_Container_0 = function() { - return (De = e._emscripten_bind_Container_Container_0 = e.asm.q).apply(null, arguments) - }, - ze = e._emscripten_bind_Container_init_3 = function() { - return (ze = e._emscripten_bind_Container_init_3 = e.asm.r).apply(null, arguments) - }, - Le = e._emscripten_bind_Container_writeFrame_3 = function() { - return (Le = e._emscripten_bind_Container_writeFrame_3 = e.asm.s).apply(null, arguments) - }, - Ve = e._emscripten_bind_Container___destroy___0 = function() { - return (Ve = e._emscripten_bind_Container___destroy___0 = e.asm.t).apply(null, arguments) - }; - - function qe(e) { - this.name = "ExitStatus", this.message = "Program terminated with exit(" + e + ")", this.status = e - } - - function Ne(t) { - function n() { - He || (He = !0, e.calledRun = !0, M || (re(), oe(), e.onRuntimeInitialized && e.onRuntimeInitialized(), ie())) - } - t = t || A, se > 0 || (ne(), se > 0 || (e.setStatus ? (e.setStatus("Running..."), setTimeout((function() { - setTimeout((function() { - e.setStatus("") - }), 1), n() - }), 1)) : n())) - } - if (e._opus_encoder_create = function() { - return (e._opus_encoder_create = e.asm.u).apply(null, arguments) - }, e._opus_encode_float = function() { - return (e._opus_encode_float = e.asm.v).apply(null, arguments) - }, e._opus_encoder_ctl = function() { - return (e._opus_encoder_ctl = e.asm.w).apply(null, arguments) - }, e._opus_encoder_destroy = function() { - return (e._opus_encoder_destroy = e.asm.x).apply(null, arguments) - }, e._speex_resampler_init = function() { - return (e._speex_resampler_init = e.asm.y).apply(null, arguments) - }, e._speex_resampler_destroy = function() { - return (e._speex_resampler_destroy = e.asm.z).apply(null, arguments) - }, e._speex_resampler_process_interleaved_float = function() { - return (e._speex_resampler_process_interleaved_float = e.asm.A).apply(null, arguments) - }, e._free = function() { - return (e._free = e.asm.B).apply(null, arguments) - }, e._malloc = function() { - return (e._malloc = e.asm.C).apply(null, arguments) - }, e.dynCall_vi = function() { - return (e.dynCall_vi = e.asm.D).apply(null, arguments) - }, e.dynCall_v = function() { - return (e.dynCall_v = e.asm.E).apply(null, arguments) - }, e.asm = Fe, e.then = function(t) { - if (He) t(e); - else { - var n = e.onRuntimeInitialized; - e.onRuntimeInitialized = function() { - n && n(), t(e) - } - } - return e - }, fe = function e() { - He || Ne(), He || (fe = e) - }, e.run = Ne, e.preInit) - for ("function" == typeof e.preInit && (e.preInit = [e.preInit]); e.preInit.length > 0;) e.preInit.pop()(); - - function Ge() {} - - function Xe(e) { - return (e || Ge).__cache__ - } - - function Ye(e, t) { - var n = Xe(t), - r = n[e]; - return r || ((r = Object.create((t || Ge).prototype)).ptr = e, n[e] = r) - } - - function $e(e, t) { - return Ye(e.ptr, t) - } - - function Je(e) { - if (!e.__destroy__) throw "Error: Cannot destroy object. (Did you create it yourself?)"; - e.__destroy__(), delete Xe(e.__class__)[e.ptr] - } - - function Ke(e, t) { - return e.ptr === t.ptr - } - - function Qe(e) { - return e.ptr - } - - function Ze(e) { - return e.__class__ - } - - function et() { - throw "cannot construct a VoidPtr, no constructor in IDL" - } - - function tt() { - this.ptr = De(), Xe(tt)[this.ptr] = this - } - return Ne(), Ge.prototype = Object.create(Ge.prototype), Ge.prototype.constructor = Ge, Ge.prototype.__class__ = Ge, Ge.__cache__ = {}, e.WrapperObject = Ge, e.getCache = Xe, e.wrapPointer = Ye, e.castObject = $e, e.NULL = Ye(0), e.destroy = Je, e.compare = Ke, e.getPointer = Qe, e.getClass = Ze, et.prototype = Object.create(Ge.prototype), et.prototype.constructor = et, et.prototype.__class__ = et, et.__cache__ = {}, e.VoidPtr = et, et.prototype.__destroy__ = et.prototype.__destroy__ = function() { - var e = this.ptr; - We(e) - }, tt.prototype = Object.create(Ge.prototype), tt.prototype.constructor = tt, tt.prototype.__class__ = tt, tt.__cache__ = {}, e.Container = tt, tt.prototype.init = tt.prototype.init = function(e, t, n) { - var r = this.ptr; - e && "object" === a(e) && (e = e.ptr), t && "object" === a(t) && (t = t.ptr), n && "object" === a(n) && (n = n.ptr), ze(r, e, t, n) - }, tt.prototype.writeFrame = tt.prototype.writeFrame = function(e, t, n) { - var r = this.ptr; - e && "object" === a(e) && (e = e.ptr), t && "object" === a(t) && (t = t.ptr), n && "object" === a(n) && (n = n.ptr), Le(r, e, t, n) - }, tt.prototype.__destroy__ = tt.prototype.__destroy__ = function() { - var e = this.ptr; - Ve(e) - }, e - }); - "object" === a(t) && "object" === a(i) ? i.exports = p : void 0 === (u = function() { - return p - }.apply(t, [])) || (i.exports = u) - }).call(this, "/index.js", n(2), "/", n(3)(e)) - }, function(e, t, n) { - (function(e, r, o, i) { - var u; - - function a(e) { - return (a = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { - return typeof e - } : function(e) { - return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e - })(e) - } - - function s(e, t) { - if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") - } - - function c(e, t) { - for (var n = 0; n < t.length; n++) { - var r = t[n]; - r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r) - } - } - - function f(e, t, n) { - return t && c(e.prototype, t), n && c(e, n), e - } - var l, p = (l = (l = "undefined" != typeof document && document.currentScript ? document.currentScript.src : void 0) || e, function(e) { - e = void 0 !== (e = e || {}) ? e : {}; - var t = n(1), - i = t.EmscriptenMemoryAllocator, - u = 2049, - c = 48e3, - p = 4e3, - _ = 20, - d = 6, - h = 4096, - m = 0, - y = 4002, - v = 0, - b = function() { - function t(n, r) { - var o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : void 0; - s(this, t), this.config = { - inputSampleRate: n, - channelCount: r - }, this.memory = new i(e), this._opus_encoder_create = e._opus_encoder_create, this._opus_encoder_ctl = e._opus_encoder_ctl, this._opus_encode_float = e._opus_encode_float, this._opus_encoder_destroy = e._opus_encoder_destroy, this._speex_resampler_init = e._speex_resampler_init, this._speex_resampler_process_interleaved_float = e._speex_resampler_process_interleaved_float, this._speex_resampler_destroy = e._speex_resampler_destroy, this._container = new e.Container, this._container.init(c, r, Math.floor(4294967295 * Math.random())), this.OpusInitCodec(c, r, o), this.SpeexInitResampler(n, c, r), this.inputSamplesPerChannel = n * _ / 1e3, this.outputSamplePerChannel = c * _ / 1e3, this.inputBufferIndex = 0, this.mInputBuffer = this.memory.mallocFloat32Buffer(this.inputSamplesPerChannel * r), this.mResampledBuffer = this.memory.mallocFloat32Buffer(this.outputSamplePerChannel * r), this.mOutputBuffer = this.memory.mallocUint8Buffer(p), this.interleavedBuffers = 1 !== r ? new Float32Array(h * r) : void 0 - } - return f(t, [{ - key: "encode", - value: function(e) { - for (var t = this.interleave(e), n = 0; n < t.length;) { - var r = Math.min(this.mInputBuffer.length - this.inputBufferIndex, t.length - n); - if (this.mInputBuffer.set(t.subarray(n, n + r), this.inputBufferIndex), this.inputBufferIndex += r, this.inputBufferIndex >= this.mInputBuffer.length) { - var o = this.memory.mallocUint32(this.inputSamplesPerChannel), - i = this.memory.mallocUint32(this.outputSamplePerChannel), - u = this._speex_resampler_process_interleaved_float(this.resampler, this.mInputBuffer.pointer, o.pointer, this.mResampledBuffer.pointer, i.pointer); - if (o.free(), i.free(), u !== v) throw new Error("Resampling error."); - var a = this._opus_encode_float(this.encoder, this.mResampledBuffer.pointer, this.outputSamplePerChannel, this.mOutputBuffer.pointer, this.mOutputBuffer.length); - if (a < 0) throw new Error("Opus encoding error."); - this._container.writeFrame(this.mOutputBuffer.pointer, a, this.outputSamplePerChannel), this.inputBufferIndex = 0 - } - n += r - } - } - }, { - key: "close", - value: function() { - for (var t = this.config.channelCount, n = [], r = 0; r < t; ++r) n.push(new Float32Array(h - this.inputBufferIndex / t)); - this.encode(n), e.destroy(this._container), this.mInputBuffer.free(), this.mResampledBuffer.free(), this.mOutputBuffer.free(), this._opus_encoder_destroy(this.encoder), this._speex_resampler_destroy(this.resampler) - } - }, { - key: "interleave", - value: function(e) { - var t = e.length; - if (1 === t) return e[0]; - for (var n = 0; n < t; n++) - for (var r = e[n], o = 0; o < r.length; o++) this.interleavedBuffers[o * t + n] = r[o]; - return this.interleavedBuffers - } - }, { - key: "OpusInitCodec", - value: function(e, t) { - var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : void 0, - r = this.memory.mallocUint32(void 0); - this.encoder = this._opus_encoder_create(e, t, u, r.pointer); - var o = r.value; - if (r.free(), o !== m) throw new Error("Opus encodor initialization failed."); - n && this.OpusSetOpusControl(y, n) - } - }, { - key: "OpusSetOpusControl", - value: function(e, t) { - var n = this.memory.mallocInt32(t); - this._opus_encoder_ctl(this.encoder, e, n.pointer), n.free() - } - }, { - key: "SpeexInitResampler", - value: function(e, t, n) { - var r = this.memory.mallocUint32(void 0); - this.resampler = this._speex_resampler_init(n, e, t, d, r.pointer); - var o = r.value; - if (r.free(), o !== v) throw new Error("Initializing resampler failed.") - } - }]), t - }(); - e.init = function(t, n, r) { - e.encodedBuffers = [], e.encoder = new b(t, n, r) - }, e.encode = function(t) { - e.encoder.encode(t) - }, e.flush = function() { - return e.encodedBuffers.splice(0, e.encodedBuffers.length) - }, e.close = function() { - e.encoder.close() - }; - var g, w = {}; - for (g in e) e.hasOwnProperty(g) && (w[g] = e[g]); - var A = [], - C = !1, - S = !1, - x = !1, - P = !1; - C = "object" === ("undefined" == typeof window ? "undefined" : a(window)), S = "function" == typeof importScripts, x = "object" === (void 0 === r ? "undefined" : a(r)) && "object" === a(r.versions) && "string" == typeof r.versions.node, P = !C && !x && !S; - var E, B, I, R, O = ""; - - function j(t) { - return e.locateFile ? e.locateFile(t, O) : O + t - } - x ? (O = S ? n(0).dirname(O) + "/" : o + "/", E = function(e, t) { - return I || (I = n(4)), R || (R = n(0)), e = R.normalize(e), I.readFileSync(e, t ? null : "utf8") - }, B = function(e) { - var t = E(e, !0); - return t.buffer || (t = new Uint8Array(t)), W(t.buffer), t - }, r.argv.length > 1 && r.argv[1].replace(/\\/g, "/"), A = r.argv.slice(2), r.on("uncaughtException", (function(e) { - if (!(e instanceof We)) throw e - })), r.on("unhandledRejection", _e), e.inspect = function() { - return "[Emscripten Module object]" - }) : P ? ("undefined" != typeof read && (E = function(e) { - return read(e) - }), B = function(e) { - var t; - return "function" == typeof readbuffer ? new Uint8Array(readbuffer(e)) : (W("object" === a(t = read(e, "binary"))), t) - }, "undefined" != typeof scriptArgs ? A = scriptArgs : void 0 !== arguments && (A = arguments), "undefined" != typeof print && ("undefined" == typeof console && (console = {}), console.log = print, console.warn = console.error = "undefined" != typeof printErr ? printErr : print)) : (C || S) && (S ? O = self.location.href : document.currentScript && (O = document.currentScript.src), l && (O = l), O = 0 !== O.indexOf("blob:") ? O.substr(0, O.lastIndexOf("/") + 1) : "", E = function(e) { - var t = new XMLHttpRequest; - return t.open("GET", e, !1), t.send(null), t.responseText - }, S && (B = function(e) { - var t = new XMLHttpRequest; - return t.open("GET", e, !1), t.responseType = "arraybuffer", t.send(null), new Uint8Array(t.response) - })); - var k, U, T = e.print || console.log.bind(console), - F = e.printErr || console.warn.bind(console); - for (g in w) w.hasOwnProperty(g) && (e[g] = w[g]); - w = null, e.arguments && (A = e.arguments), e.thisProgram && e.thisProgram, e.quit && e.quit, e.wasmBinary && (k = e.wasmBinary), e.noExitRuntime && e.noExitRuntime, "object" !== ("undefined" == typeof WebAssembly ? "undefined" : a(WebAssembly)) && F("no native wasm support detected"); - var H = new WebAssembly.Table({ - initial: 36, - maximum: 36, - element: "anyfunc" - }), - M = !1; - - function W(e, t) { - e || _e("Assertion failed: " + t) - } - var D = "undefined" != typeof TextDecoder ? new TextDecoder("utf8") : void 0; - - function z(e, t, n) { - for (var r = t + n, o = t; e[o] && !(o >= r);) ++o; - if (o - t > 16 && e.subarray && D) return D.decode(e.subarray(t, o)); - for (var i = ""; t < o;) { - var u = e[t++]; - if (128 & u) { - var a = 63 & e[t++]; - if (192 != (224 & u)) { - var s = 63 & e[t++]; - if ((u = 224 == (240 & u) ? (15 & u) << 12 | a << 6 | s : (7 & u) << 18 | a << 12 | s << 6 | 63 & e[t++]) < 65536) i += String.fromCharCode(u); - else { - var c = u - 65536; - i += String.fromCharCode(55296 | c >> 10, 56320 | 1023 & c) - } - } else i += String.fromCharCode((31 & u) << 6 | a) - } else i += String.fromCharCode(u) - } - return i - } - - function L(e, t) { - return e ? z(q, e, t) : "" - } - "undefined" != typeof TextDecoder && new TextDecoder("utf-16le"); - var V, q, N, G = 65536; - - function X(t) { - V = t, e.HEAP8 = new Int8Array(t), e.HEAP16 = new Int16Array(t), e.HEAP32 = N = new Int32Array(t), e.HEAPU8 = q = new Uint8Array(t), e.HEAPU16 = new Uint16Array(t), e.HEAPU32 = new Uint32Array(t), e.HEAPF32 = new Float32Array(t), e.HEAPF64 = new Float64Array(t) - } - var Y = 5289728, - $ = 46688, - J = e.INITIAL_MEMORY || 16777216; - - function K(t) { - for (; t.length > 0;) { - var n = t.shift(); - if ("function" != typeof n) { - var r = n.func; - "number" == typeof r ? void 0 === n.arg ? e.dynCall_v(r) : e.dynCall_vi(r, n.arg) : r(void 0 === n.arg ? null : n.arg) - } else n() - } - }(U = e.wasmMemory ? e.wasmMemory : new WebAssembly.Memory({ - initial: J / G, - maximum: J / G - })) && (V = U.buffer), J = V.byteLength, X(V), N[$ >> 2] = Y; - var Q = [], - Z = [], - ee = [], - te = []; - - function ne() { - if (e.preRun) - for ("function" == typeof e.preRun && (e.preRun = [e.preRun]); e.preRun.length;) ue(e.preRun.shift()); - K(Q) - } - - function re() { - K(Z) - } - - function oe() { - K(ee) - } - - function ie() { - if (e.postRun) - for ("function" == typeof e.postRun && (e.postRun = [e.postRun]); e.postRun.length;) ae(e.postRun.shift()); - K(te) - } - - function ue(e) { - Q.unshift(e) - } - - function ae(e) { - te.unshift(e) - } - var se = 0, - ce = null, - fe = null; - - function le(t) { - se++, e.monitorRunDependencies && e.monitorRunDependencies(se) - } - - function pe(t) { - if (se--, e.monitorRunDependencies && e.monitorRunDependencies(se), 0 == se && (null !== ce && (clearInterval(ce), ce = null), fe)) { - var n = fe; - fe = null, n() - } - } - - function _e(t) { - throw e.onAbort && e.onAbort(t), T(t += ""), F(t), M = !0, t = "abort(" + t + "). Build with -s ASSERTIONS=1 for more info.", new WebAssembly.RuntimeError(t) - } - e.preloadedImages = {}, e.preloadedAudios = {}; - var de = "data:application/octet-stream;base64,"; - - function he(e) { - return String.prototype.startsWith ? e.startsWith(de) : 0 === e.indexOf(de) - } - var me = "OggOpusEncoder.wasm"; - - function ye() { - try { - if (k) return new Uint8Array(k); - if (B) return B(me); - throw "both async and sync fetching of the wasm failed" - } catch (e) { - _e(e) - } - } - - function ve() { - return k || !C && !S || "function" != typeof fetch ? new Promise((function(e, t) { - e(ye()) - })) : fetch(me, { - credentials: "same-origin" - }).then((function(e) { - if (!e.ok) throw "failed to load wasm binary file at '" + me + "'"; - return e.arrayBuffer() - })).catch((function() { - return ye() - })) - } - - function be() { - var t = { - a: Re - }; - - function n(t, n) { - var r = t.exports; - e.asm = r, pe() - } - - function r(e) { - n(e.instance) - } - - function o(e) { - return ve().then((function(e) { - return WebAssembly.instantiate(e, t) - })).then(e, (function(e) { - F("failed to asynchronously prepare wasm: " + e), _e(e) - })) - } - if (le(), e.instantiateWasm) try { - return e.instantiateWasm(t, n) - } catch (e) { - return F("Module.instantiateWasm callback failed with error: " + e), !1 - } - return function() { - if (k || "function" != typeof WebAssembly.instantiateStreaming || he(me) || "function" != typeof fetch) return o(r); - fetch(me, { - credentials: "same-origin" - }).then((function(e) { - return WebAssembly.instantiateStreaming(e, t).then(r, (function(e) { - F("wasm streaming compile failed: " + e), F("falling back to ArrayBuffer instantiation"), o(r) - })) - })) - }(), {} - } - - function ge(t, n) { - var r = new Uint8Array(e.HEAPU8.buffer, t, n); - e.encodedBuffers.push(new Uint8Array(r).buffer) - } - - function we(e, t, n, r) { - _e("Assertion failed: " + L(e) + ", at: " + [t ? L(t) : "unknown filename", n, r ? L(r) : "unknown function"]) - } - - function Ae() { - _e() - } - - function Ce(e, t, n) { - q.copyWithin(e, t, t + n) - } - - function Se(e) { - _e("OOM") - } - - function xe(e) { - Se() - } - he(me) || (me = j(me)), Z.push({ - func: function() { - ke() - } - }); - var Pe = { - mappings: {}, - buffers: [null, [], - [] - ], - printChar: function(e, t) { - var n = Pe.buffers[e]; - 0 === t || 10 === t ? ((1 === e ? T : F)(z(n, 0)), n.length = 0) : n.push(t) - }, - varargs: void 0, - get: function() { - return Pe.varargs += 4, N[Pe.varargs - 4 >> 2] - }, - getStr: function(e) { - return L(e) - }, - get64: function(e, t) { - return e - } - }; - - function Ee(e) { - return 0 - } - - function Be(e, t, n, r, o) {} - - function Ie(e, t, n, r) { - for (var o = 0, i = 0; i < n; i++) { - for (var u = N[t + 8 * i >> 2], a = N[t + (8 * i + 4) >> 2], s = 0; s < a; s++) Pe.printChar(e, q[u + s]); - o += a - } - return N[r >> 2] = o, 0 - } - var Re = { - a: we, - c: Ae, - d: ge, - f: Ce, - g: xe, - h: Ee, - e: Be, - b: Ie, - memory: U, - table: H - }, - Oe = be(); - e.asm = Oe; - var je, ke = e.___wasm_call_ctors = function() { - return (ke = e.___wasm_call_ctors = e.asm.i).apply(null, arguments) - }, - Ue = (e.___em_js__emscriptenPushBuffer = function() { - return (e.___em_js__emscriptenPushBuffer = e.asm.j).apply(null, arguments) - }, e._emscripten_bind_VoidPtr___destroy___0 = function() { - return (Ue = e._emscripten_bind_VoidPtr___destroy___0 = e.asm.k).apply(null, arguments) - }), - Te = e._emscripten_bind_Container_Container_0 = function() { - return (Te = e._emscripten_bind_Container_Container_0 = e.asm.l).apply(null, arguments) - }, - Fe = e._emscripten_bind_Container_init_3 = function() { - return (Fe = e._emscripten_bind_Container_init_3 = e.asm.m).apply(null, arguments) - }, - He = e._emscripten_bind_Container_writeFrame_3 = function() { - return (He = e._emscripten_bind_Container_writeFrame_3 = e.asm.n).apply(null, arguments) - }, - Me = e._emscripten_bind_Container___destroy___0 = function() { - return (Me = e._emscripten_bind_Container___destroy___0 = e.asm.o).apply(null, arguments) - }; - - function We(e) { - this.name = "ExitStatus", this.message = "Program terminated with exit(" + e + ")", this.status = e - } - - function De(t) { - function n() { - je || (je = !0, e.calledRun = !0, M || (re(), oe(), e.onRuntimeInitialized && e.onRuntimeInitialized(), ie())) - } - t = t || A, se > 0 || (ne(), se > 0 || (e.setStatus ? (e.setStatus("Running..."), setTimeout((function() { - setTimeout((function() { - e.setStatus("") - }), 1), n() - }), 1)) : n())) - } - if (e._opus_encoder_create = function() { - return (e._opus_encoder_create = e.asm.p).apply(null, arguments) - }, e._opus_encode_float = function() { - return (e._opus_encode_float = e.asm.q).apply(null, arguments) - }, e._opus_encoder_ctl = function() { - return (e._opus_encoder_ctl = e.asm.r).apply(null, arguments) - }, e._opus_encoder_destroy = function() { - return (e._opus_encoder_destroy = e.asm.s).apply(null, arguments) - }, e._malloc = function() { - return (e._malloc = e.asm.t).apply(null, arguments) - }, e._free = function() { - return (e._free = e.asm.u).apply(null, arguments) - }, e._speex_resampler_init = function() { - return (e._speex_resampler_init = e.asm.v).apply(null, arguments) - }, e._speex_resampler_destroy = function() { - return (e._speex_resampler_destroy = e.asm.w).apply(null, arguments) - }, e._speex_resampler_process_interleaved_float = function() { - return (e._speex_resampler_process_interleaved_float = e.asm.x).apply(null, arguments) - }, e.dynCall_vi = function() { - return (e.dynCall_vi = e.asm.y).apply(null, arguments) - }, e.dynCall_v = function() { - return (e.dynCall_v = e.asm.z).apply(null, arguments) - }, e.asm = Oe, e.then = function(t) { - if (je) t(e); - else { - var n = e.onRuntimeInitialized; - e.onRuntimeInitialized = function() { - n && n(), t(e) - } - } - return e - }, fe = function e() { - je || De(), je || (fe = e) - }, e.run = De, e.preInit) - for ("function" == typeof e.preInit && (e.preInit = [e.preInit]); e.preInit.length > 0;) e.preInit.pop()(); - - function ze() {} - - function Le(e) { - return (e || ze).__cache__ - } - - function Ve(e, t) { - var n = Le(t), - r = n[e]; - return r || ((r = Object.create((t || ze).prototype)).ptr = e, n[e] = r) - } - - function qe(e, t) { - return Ve(e.ptr, t) - } - - function Ne(e) { - if (!e.__destroy__) throw "Error: Cannot destroy object. (Did you create it yourself?)"; - e.__destroy__(), delete Le(e.__class__)[e.ptr] - } - - function Ge(e, t) { - return e.ptr === t.ptr - } - - function Xe(e) { - return e.ptr - } - - function Ye(e) { - return e.__class__ - } - - function $e() { - throw "cannot construct a VoidPtr, no constructor in IDL" - } - - function Je() { - this.ptr = Te(), Le(Je)[this.ptr] = this - } - return De(), ze.prototype = Object.create(ze.prototype), ze.prototype.constructor = ze, ze.prototype.__class__ = ze, ze.__cache__ = {}, e.WrapperObject = ze, e.getCache = Le, e.wrapPointer = Ve, e.castObject = qe, e.NULL = Ve(0), e.destroy = Ne, e.compare = Ge, e.getPointer = Xe, e.getClass = Ye, $e.prototype = Object.create(ze.prototype), $e.prototype.constructor = $e, $e.prototype.__class__ = $e, $e.__cache__ = {}, e.VoidPtr = $e, $e.prototype.__destroy__ = $e.prototype.__destroy__ = function() { - var e = this.ptr; - Ue(e) - }, Je.prototype = Object.create(ze.prototype), Je.prototype.constructor = Je, Je.prototype.__class__ = Je, Je.__cache__ = {}, e.Container = Je, Je.prototype.init = Je.prototype.init = function(e, t, n) { - var r = this.ptr; - e && "object" === a(e) && (e = e.ptr), t && "object" === a(t) && (t = t.ptr), n && "object" === a(n) && (n = n.ptr), Fe(r, e, t, n) - }, Je.prototype.writeFrame = Je.prototype.writeFrame = function(e, t, n) { - var r = this.ptr; - e && "object" === a(e) && (e = e.ptr), t && "object" === a(t) && (t = t.ptr), n && "object" === a(n) && (n = n.ptr), He(r, e, t, n) - }, Je.prototype.__destroy__ = Je.prototype.__destroy__ = function() { - var e = this.ptr; - Me(e) - }, e - }); - "object" === a(t) && "object" === a(i) ? i.exports = p : void 0 === (u = function() { - return p - }.apply(t, [])) || (i.exports = u) - }).call(this, "/index.js", n(2), "/", n(3)(e)) - }]); - } -}); \ No newline at end of file diff --git a/oldshit/resources/js/eq.js b/oldshit/resources/js/eq.js deleted file mode 100644 index ce17071d..00000000 --- a/oldshit/resources/js/eq.js +++ /dev/null @@ -1,591 +0,0 @@ -var EAOverride = true; -var AErecorderNode; -var GCOverride = true; -var outputID = -1; -var EAoutputID = -1; -var queueExclusive = false; -var queueChromecast = false; -var selectedGC ; -var MVsource; -var windowAudioNode; -const workerOptions = { - OggOpusEncoderWasmPath: 'https://cdn.jsdelivr.net/npm/opus-media-recorder@latest/OggOpusEncoder.wasm', - WebMOpusEncoderWasmPath: 'https://cdn.jsdelivr.net/npm/opus-media-recorder@latest/WebMOpusEncoder.wasm' -}; -var recorder; - -window.MediaRecorder = OpusMediaRecorder; - -var audioWorklet = `class RecorderWorkletProcessor extends AudioWorkletProcessor { - static get parameterDescriptors() { - return [{ - name: 'isRecording', - defaultValue: 0 - }, - { - name: 'numberOfChannels', - defaultValue: 2 - } - ]; - } - - constructor() { - super(); - this._bufferSize = 32768; - this._buffers = null; - this._initBuffer(); - } - - _initBuffers(numberOfChannels) { - this._buffers = []; - for (let channel=0; channel < numberOfChannels; channel++) { - this._buffers.push(new Float32Array(this._bufferSize)); - } - } - - _initBuffer() { - this._bytesWritten = 0; - } - - _isBufferEmpty() { - return this._bytesWritten === 0; - } - - _isBufferFull() { - return this._bytesWritten === this._bufferSize; - } - - - _pushToBuffers(audioRawData, numberOfChannels) { - if (this._isBufferFull()) { - this._flush(); - } - - let dataLength = audioRawData[0].length; - - for (let idx=0; idx { - if (this._bytesWritten < this._bufferSize) { - buffer = buffer.slice(0, this._bytesWritten); - } - buffers[channel] = buffer; - }); - this.port.postMessage({ - eventType: 'data', - audioBuffer: buffers, - bufferSize: this._bufferSize - }); - this._initBuffer(); - } - - _recordingStopped() { - this.port.postMessage({ - eventType: 'stop' - }); - } - - process(inputs, outputs, parameters) { - const isRecordingValues = parameters.isRecording; - const numberOfChannels = parameters.numberOfChannels[0]; - if (this._buffers === null) { - this._initBuffers(numberOfChannels); - } - - for (let dataIndex = 0; dataIndex < isRecordingValues.length; dataIndex++) - { - const shouldRecord = isRecordingValues[dataIndex] === 1; - if (!shouldRecord && !this._isBufferEmpty()) { - this._flush(); - this._recordingStopped(); - } - - if (shouldRecord) { - let audioRawData = inputs[0]; - this._pushToBuffers(audioRawData, numberOfChannels); - } - } - return true; - } - - } - - registerProcessor('recorder-worklet', RecorderWorkletProcessor);`; -var GCstream; -var searchInt; -var AMEx = { - context: new AudioContext(), - result: {}, - filter: [], - EQRanges: [{ - f: 32, - type: 'lowshelf' - }, { - f: 64, - type: 'peaking' - }, { - f: 125, - type: 'peaking' - }, { - f: 250, - type: 'peaking' - }, { - f: 500, - type: 'peaking' - }, { - f: 1000, - type: 'peaking' - }, { - f: 2000, - type: 'peaking' - }, { - f: 4000, - type: 'peaking' - }, { - f: 8000, - type: 'peaking' - }, { - f: 16000, - type: 'highshelf' - }] -}; -var bassFilter; -var trebleFilter; - -var AudioOutputs = { - fInit: false, - eqReady: false, - activeCasts: [], - castUI() { - AMJavaScript.getRequest("ameres://html/cast_device.html", (content) => { - var vm = new Vue({ - data: { - devices: { - cast: [], - airplay: [] - }, - scanning: false, - activeCasts: AudioOutputs.activeCasts - }, - methods: { - scan() { - let self = this; - this.scanning = true; - AudioOutputs.getGCDevices(); - setTimeout(()=>{ - self.devices.cast = ipcRenderer.sendSync("getKnownCastDevices"); - self.scanning = false; - }, 2000); - console.log(this.devices); - vm.$forceUpdate(); - }, - setCast(device) { - console.log(`requesting: ${device}`); - AudioOutputs.playGC(device); - }, - stopCasting() { - AudioOutputs.stopGC(); - this.activeCasts = AudioOutputs.activeCasts; - vm.$forceUpdate(); - }, - close() { - modal.close(); - } - } - }); - var modal = new AMEModal({ - content: content, - CloseButton: false, - Style: { - maxWidth: "600px" - }, - OnCreate() { - vm.$mount("#castdevices-vue"); - vm.scan(); - }, - OnClose() { - _vues.destroy(vm); - } - }); - }) - }, - init: function (cb = function () {}) { - AudioOutputs.fInit = true; - searchInt = setInterval(function () { - if (document.getElementById("apple-music-player")) { - AudioOutputs.eqReady = true; - document.getElementById("apple-music-player").crossOrigin = "anonymous"; - AudioOutputs.amplifyMedia(document.getElementById("apple-music-player"), 0); - var context = AMEx.context; - var source = AMEx.result.source; - bassFilter = context.createBiquadFilter(); - bassFilter.type = "lowshelf"; - bassFilter.frequency.value = 200; - bassFilter.gain.value = 0; - - trebleFilter = context.createBiquadFilter(); - trebleFilter.type = "highshelf"; - trebleFilter.frequency.value = 2000; - trebleFilter.gain.value = 0; - - source.connect(bassFilter); - bassFilter.connect(trebleFilter); - trebleFilter.connect(context.destination); - console.log("Attached EQ"); - - if (queueExclusive){ - console.log('we good'); - AudioOutputs.startExclusiveAudio(outputID); } - - cb(); - clearInterval(searchInt); - } - }, 1000); - waitFor(()=>{return queueChromecast && - ((document.getElementById("apple-music-player") != null&& - document.getElementById("apple-music-player").readyState == 4) || ( - document.querySelector('apple-music-video-player') && - document.querySelector('apple-music-video-player').shadowRoot && - document.querySelector('apple-music-video-player').shadowRoot.querySelector('amp-video-player-internal') && - document.querySelector('apple-music-video-player').shadowRoot.querySelector('amp-video-player-internal').shadowRoot && - document.querySelector('apple-music-video-player').shadowRoot.querySelector('amp-video-player-internal').shadowRoot.querySelector('amp-video-player') && - document.querySelector('apple-music-video-player').shadowRoot.querySelector('amp-video-player-internal').shadowRoot.querySelector('amp-video-player').shadowRoot && - document.querySelector('apple-music-video-player').shadowRoot.querySelector('amp-video-player-internal').shadowRoot.querySelector('amp-video-player').shadowRoot.getElementById('apple-music-video-player') && - document.querySelector('apple-music-video-player').shadowRoot.querySelector('amp-video-player-internal').shadowRoot.querySelector('amp-video-player').shadowRoot.getElementById('apple-music-video-player').readyState == 4)) ;},() => AudioOutputs.playGC(selectedGC)) - - }, - amplifyMedia: function (mediaElem, multiplier) { - AMEx.context = new(window.AudioContext || window.webkitAudioContext), - AMEx.result = { - context: AMEx.context, - source: AMEx.context.createMediaElementSource(mediaElem), - gain: AMEx.context.createGain(), - media: mediaElem, - amplify: function (multiplier) { - AMEx.result.gain.gain.value = multiplier; - }, - getAmpLevel: function () { - return AMEx.result.gain.gain.value; - } - }; - AMEx.result.source.connect(AMEx.result.gain); - AMEx.result.gain.connect(AMEx.context.destination); - AMEx.result.amplify(multiplier); - return AMEx.result; - }, - popup_generic: function ({ - title = "", - content = document.createElement("div"), - closefn = function () {}, - transparentBg = false, - windowStyle = {}, - backdropStyle = {} - }) { - let backdrop = document.createElement("div"); - backdrop.style.width = "100%"; - backdrop.style.height = "100%"; - backdrop.style.position = "fixed"; - backdrop.style.top = 0; - backdrop.style.left = 0; - if (!transparentBg) { - backdrop.style.background = "rgba(0,0,0,0.5)"; - } else { - backdrop.style.background = "rgba(0,0,0,0.0)"; - }; - backdrop.style.zIndex = 10000; - backdrop.style.display = "flex"; - backdrop.style.alignItems = "center"; - backdrop.style.justifyContent = "center"; - let win = document.createElement("div"); - win.style.width = "300px"; - win.style.background = "var(--modalBGColor)"; - win.style.zIndex = 10000; - win.style.padding = "16px"; - win.style.borderRadius = "10px"; - Object.assign(backdrop.style, backdropStyle); - Object.assign(win.style, windowStyle); - let closeBtn = document.createElement("button"); - closeBtn.style.background = "var(--primaryColor)"; - closeBtn.style.borderRadius = "4px"; - closeBtn.style.padding = "8px 0px 8px 0px"; - closeBtn.style.width = "100%"; - closeBtn.style.fontWeight = "bold"; - closeBtn.style.margin = "12px 0px 0px 0px"; - closeBtn.innerHTML = "Close"; - closeBtn.id = "eq-close"; - closeBtn.addEventListener("click", function () { - backdrop.remove(); - closefn(); - }); - let titleText = document.createElement("div"); - titleText.innerHTML = (title); - titleText.style.fontWeight = "bold"; - - - win.appendChild(titleText); - win.appendChild(content); - win.appendChild(closeBtn); - - backdrop.appendChild(win); - document.body.appendChild(backdrop); - }, - ShowEQ: function () { - if (!AudioOutputs.eqReady) { - alert("Audio is not ready, Play a song to use this function."); - }; - let backdrop = document.createElement("div"); - backdrop.style.width = "100%"; - backdrop.style.height = "100%"; - backdrop.style.position = "fixed"; - backdrop.style.top = 0; - backdrop.style.left = 0; - backdrop.style.background = "rgba(0,0,0,0.5)"; - backdrop.style.zIndex = 9999; - backdrop.style.display = "flex"; - backdrop.style.alignItems = "center"; - backdrop.style.justifyContent = "center"; - backdrop.style.backdropFilter = "blur(12px) saturate(180%)"; - - let win = document.createElement("div"); - win.style.width = "300px"; - win.style.background = "var(--modalBGColor)"; - win.style.zIndex = 10000; - win.style.padding = "16px"; - win.style.borderRadius = "10px"; - - - let closeBtn = document.createElement("button"); - closeBtn.style.background = "var(--primaryColor)"; - closeBtn.style.borderRadius = "4px"; - closeBtn.style.padding = "8px 0px 8px 0px"; - closeBtn.style.width = "100%"; - closeBtn.style.fontWeight = "bold"; - closeBtn.style.margin = "12px 0px 0px 0px"; - - closeBtn.innerHTML = "Close"; - closeBtn.addEventListener("click", function () { - backdrop.remove() - }); - - let titleText = document.createElement("div"); - let bassText = document.createElement("div"); - let trebleText = document.createElement("div"); - let gainText = document.createElement("div"); - titleText.id = 'eq-menu'; - titleText.innerHTML = (`Equalizer`); - titleText.style.fontWeight = "bold"; - bassText.innerHTML = (`Bass (${bassFilter.gain.value})`); - trebleText.innerHTML = (`Treble (${trebleFilter.gain.value})`); - gainText.innerHTML = (`Gain (${AMEx.result.gain.gain.value})`); - - - let bassAdjust = document.createElement("input"); - bassAdjust.style.width = "100%"; - bassAdjust.type = "range"; - bassAdjust.min = -10; - bassAdjust.max = 10; - bassAdjust.value = bassFilter.gain.value; - bassAdjust.addEventListener("input", function () { - bassFilter.gain.value = this.value; - bassText.innerHTML = `Bass (${bassFilter.gain.value})`; - }); - - let trebleAdjust = document.createElement("input"); - trebleAdjust.style.width = "100%"; - trebleAdjust.min = -10; - trebleAdjust.max = 10; - trebleAdjust.type = "range"; - trebleAdjust.value = trebleFilter.gain.value; - trebleAdjust.addEventListener("input", function () { - trebleFilter.gain.value = this.value; - trebleText.innerHTML = `Treble (${trebleFilter.gain.value})`; - }); - - let gainAdjust = document.createElement("input"); - gainAdjust.style.width = "100%"; - gainAdjust.min = -1; - gainAdjust.max = 1; - gainAdjust.type = "range"; - gainAdjust.value = AMEx.result.gain.gain.value; - gainAdjust.addEventListener("input", function () { - AMEx.result.gain.gain.value = this.value; - gainText.innerHTML = `Gain (${AMEx.result.gain.gain.value})`; - }); - - let bassLabel = document.createElement("label"); - let trebleLabel = document.createElement("label"); - let gainLabel = document.createElement("label"); - - bassLabel.appendChild(bassText); - trebleLabel.appendChild(trebleText); - gainLabel.appendChild(gainText); - - bassLabel.appendChild(bassAdjust); - bassLabel.appendChild(document.createElement("br")); - trebleLabel.appendChild(trebleAdjust); - trebleLabel.appendChild(document.createElement("br")); - gainLabel.appendChild(gainAdjust); - - win.appendChild(titleText); - win.appendChild(bassLabel); - win.appendChild(trebleLabel); - win.appendChild(gainLabel); - win.appendChild(closeBtn); - - backdrop.appendChild(win); - document.body.appendChild(backdrop); - }, - getAudioDevices: function(){ - ipcRenderer.send('getAudioDevices',''); - }, - startExclusiveAudio: async function(id){ - - if(AMEx.result.source != null || MVsource != null){ - if(EAoutputID!= id){ - EAoutputID = id; - EAOverride = false; - ipcRenderer.send('muteAudio',true); - ipcRenderer.send('enableExclusiveAudio',id); - windowAudioNode = AMEx.context.createGain(); - try{ - AMEx.result.source.connect(windowAudioNode);} - catch(e){} - - var options = { - mimeType : 'audio/wav' - }; - var destnode = AMEx.context.createMediaStreamDestination(); - windowAudioNode.connect(destnode); - if(!recorder){ - recorder = new MediaRecorder(destnode.stream,options,workerOptions); - recorder.start(1); - - recorder.ondataavailable = function(e) { - e.data.arrayBuffer().then(buffer => { - if(!GCOverride) {ipcRenderer.send('writeWAV',buffer,preferences.audio.castingBitDepth);} - if(!EAOverride) {ipcRenderer.send('writePCM',buffer);} - } - ); - }} - - } else {console.log('device already in exclusive mode');} - } else { - outputID = id; - queueExclusive = true; - } - }, - stopExclusiveAudio: function(){ - try{ - recorder.stop(); - recorder = null; - } catch(e){} - EAOverride = true; - EAoutputID = -1; - outputID = -1; - queueExclusive = false; - ipcRenderer.send('muteAudio',false); - ipcRenderer.send('disableExclusiveAudio',''); - - }, - getGCDevices: function(){ - ipcRenderer.send('getChromeCastDevices',''); - }, - playGC : async function(device){ - console.log('wot'); - AudioOutputs.activeCasts.push(device); - GCOverride = false; - if(AMEx.result.source != null || MVsource != null ){ - queueChromecast = false; - const musicType = (MusicKit.getInstance().nowPlayingItem != null) ? MusicKit.getInstance().nowPlayingItem["type"] ?? '' : ''; - const trackName = ((MusicKit.getInstance().nowPlayingItem != null) ? MusicKit.getInstance().nowPlayingItem.title ?? '' : ''); - const artistName = ((MusicKit.getInstance().nowPlayingItem != null) ? MusicKit.getInstance().nowPlayingItem.artistName ?? '' : ''); - const albumName = ((MusicKit.getInstance().nowPlayingItem != null) ? MusicKit.getInstance().nowPlayingItem.albumName ?? '' : ''); - ipcRenderer.send('performGCCast',device, "Apple Music Electron","Playing ...","3.0.0 beta",''); - windowAudioNode = AMEx.context.createGain(); - try{ - AMEx.result.source.connect(windowAudioNode);} - catch(e){} - - var options = { - mimeType : 'audio/wav' - }; - var destnode = AMEx.context.createMediaStreamDestination(); - windowAudioNode.connect(destnode); - if(!recorder){ - recorder = new MediaRecorder(destnode.stream,options,workerOptions); - recorder.start(1); - - recorder.ondataavailable = function(e) { - e.data.arrayBuffer().then(buffer => { - if(!GCOverride) { - ipcRenderer.send('writeWAV',buffer,preferences.audio.castingBitDepth); - } - if(!EAOverride) {ipcRenderer.send('writePCM',buffer);} - } - ); - }} - - } else {queueChromecast = true; selectedGC = device} - - - }, - stopGC : function(){ - queueChromecast = false; - try{ - recorder.stop(); - recorder = null; - } catch(e){} - GCOverride = true; - this.activeCasts = []; - ipcRenderer.send('stopGCast',''); - } -}; - - - -document.addEventListener('keydown', function (event) { - if (event.ctrlKey || event.metaKey) { - switch (String.fromCharCode(event.which).toLowerCase()) { - case "2": - if (document.getElementById('eq-menu')){ - document.getElementById('eq-menu').parentNode.getElementsByTagName('button')[0].click(); - } - else{AudioOutputs.ShowEQ();} - break; - case "3": - (EAOverride) ? (EAOverride = false) : (EAOverride = true); - break; - } - } -}); - -function waitFor(condition, callback) { - if(condition() == null || !condition() ) { - window.setTimeout(waitFor.bind(null, condition, callback), 1000); - } else { - callback(); - } -} - -function setIntervalX(callback, delay, repetitions) { - var x = 0; - var intervalID = window.setInterval(function () { - - callback(); - - if (++x === repetitions) { - window.clearInterval(intervalID); - } - }, delay); -} - -AudioOutputs.init() \ No newline at end of file diff --git a/oldshit/resources/js/frame_Windows.js b/oldshit/resources/js/frame_Windows.js deleted file mode 100644 index 940887f2..00000000 --- a/oldshit/resources/js/frame_Windows.js +++ /dev/null @@ -1,91 +0,0 @@ -try { - if (document.querySelector('.web-nav-window-controls') === null && document.getElementsByClassName('web-nav-window-controls').length === 0) { - - class ClassWatcher { - - constructor(targetNode, classToWatch, classAddedCallback, classRemovedCallback) { - this.targetNode = targetNode; - this.classToWatch = classToWatch; - this.classAddedCallback = classAddedCallback; - this.classRemovedCallback = classRemovedCallback; - this.observer = null; - this.lastClassState = targetNode.classList.contains(this.classToWatch); - - this.init(); - }; - - init() { - this.observer = new MutationObserver(this.mutationCallback); - this.observe(); - } - - observe() { - this.observer.observe(this.targetNode, { attributes: true }) - }; - - disconnect() { - this.observer.disconnect() - }; - - mutationCallback = mutationsList => { - for(let mutation of mutationsList) { - if (mutation.type === 'attributes' && mutation.attributeName === 'class') { - let currentClassState = mutation.target.classList.contains(this.classToWatch); - if(this.lastClassState !== currentClassState) { - this.lastClassState = currentClassState; - if(currentClassState) { - this.classAddedCallback(); - } - else { - this.classRemovedCallback(); - } - } - } - } - } - } - - function UserAuthorized() { /* When user is authenticated (Signed In) and web-chrome appears */ - document.getElementsByClassName('web-nav-window-controls')[0].classList.add('web-chrome-window-controls'); - document.getElementsByClassName('web-main-drag')[0].style.zIndex = '1'; /* Hide the drag bar */ - } - - function UserUnauthorized() { /* When user is unauthenticated (Signed Out) and web-chrome display: none */ - if (document.getElementsByClassName('web-chrome-window-controls').length !== 0) { - console.log(`Length: ${document.getElementsByClassName('web-chrome-window-controls').length}`); - document.getElementsByClassName('web-chrome-window-controls')[0].classList.remove('web-chrome-window-controls'); - } - document.getElementsByClassName('web-main-drag')[0].style.zIndex = '2'; /* Show the drag bar */ - document.getElementsByClassName('header-nav')[0].style.margin = '5px var(--bodyGutter) 0' - } - - new ClassWatcher(document.body, 'not-authenticated', UserUnauthorized, UserAuthorized); - - document.getElementsByClassName('web-navigation')[0].insertAdjacentHTML('afterbegin', ` -
    -
    -
    - - - -
    - `); - - if ((document.getElementsByClassName('web-chrome')[0].style.display === 'none' || document.body.classList.contains('not-authenticated')) && document.getElementsByClassName('web-nav-window-controls').length > 0) { - UserUnauthorized(); - } else { - UserAuthorized(); - } - - /* Clean Up Search bar */ - if (document.getElementsByClassName('search-box dt-search-box web-navigation__search-box').length > 0) { - document.getElementsByClassName('search-box dt-search-box web-navigation__search-box')[0].style.marginTop = '15px'; - } - - if (document.getElementById('web-navigation-container')) { - document.getElementById('web-navigation-container').style.gridTemplateRows = 'auto auto 1fr auto' - } - } -} catch (e) { - console.error("[CSS] Error while trying to apply frame_Windows.js", e); -} \ No newline at end of file diff --git a/oldshit/resources/js/frame_macOS.js b/oldshit/resources/js/frame_macOS.js deleted file mode 100644 index 691325be..00000000 --- a/oldshit/resources/js/frame_macOS.js +++ /dev/null @@ -1,30 +0,0 @@ -try { - if (document.getElementById('web-navigation-search-box') && !document.querySelector('.web-nav-window-controls')) { - - document.getElementById('web-navigation-search-box').insertAdjacentHTML('beforebegin', ` -
    -
    - - - -
    -
    - `); - - if (document.getElementById('web-navigation-search-box')) { - document.getElementById('web-navigation-search-box').style.gridArea = "auto !important"; - document.getElementById('web-navigation-search-box').style.marginTop = '0px !important'; - } - - if (document.getElementById('web-navigation-container')) { - document.getElementById('web-navigation-container').style.gridTemplateRows = '55px auto 1fr auto !important'; - } - - if (document.querySelector('.web-chrome')) { - document.querySelector('.web-chrome').style.width = "calc(100vw - var(--web-navigation-width))"; - } - - } -} catch (e) { - console.error("[JS] Error while trying to apply frame_macOS.js", e); -} \ No newline at end of file diff --git a/oldshit/resources/js/lyrics.js b/oldshit/resources/js/lyrics.js deleted file mode 100644 index dce4fcfc..00000000 --- a/oldshit/resources/js/lyrics.js +++ /dev/null @@ -1,213 +0,0 @@ -(function () { - const lineClicked = function (self, id) { - return function () { - const detail = {"time": self.rangeLrc[id].startTime}; - const e = new CustomEvent(self.clickEventName, { - 'detail': detail, - "bubbles": true - }); - const elem = document.getElementById(self.lineidPrefix + id); - elem.dispatchEvent(e); - }; - }; - const setHtml = function (self) { - let i; - self.currentLine = 0; - - const container = document.getElementById(self.divID); - if(!container) { - return; - } - container.innerHTML = ""; - const ul = document.createElement("ul"); - container.appendChild(ul); - for (i = 0; i < self.totalLines; i++) { - const li = document.createElement("li"); - if (self.rangeLrc[i].line === 'lrcInstrumental'){ - li.innerHTML = `
    `; - } else { - li.innerHTML = self.rangeLrc[i].line; - if (!li.innerHTML) { - li.innerHTML = " " - }} - li.setAttribute("id", self.lineidPrefix + i); - if (self.clickable) { - li.onclick = lineClicked(self, i); - li.style.cursor = 'pointer'; - } - ul.appendChild(li); - } - - /* hide the later ones*/ - for (i = self.totalLines; i < self.totalLines; i++) { - document.getElementById(self.lineidPrefix + i).style.display = "block"; - } - }; - const moveToLine = function (self, line) { - const startShow = line - self.showLines; - const endShow = line + self.showLines; - for (let i = 0; i < self.totalLines; i++) { - const li = document.getElementById(self.lineidPrefix + i); - if (i >= startShow && i <= endShow) { - try{ - li.style.display = "block";} - catch(e){} - } else { - li.style.display = "block"; - } - if (i === line) { - li.classList.add(self.currentcss); - if(this.focus == 'start'){ - li.scrollIntoView({behavior: 'smooth', block: 'start'}); - }else{ - li.scrollIntoView({behavior: 'smooth', block: 'center'})}; - try{ - if (li.innerText == ' '){ - document.querySelector(`#MVLyricsBox`).style.display = 'none'; - } else if (MusicKit.getInstance().nowPlayingItem["type"] === "musicVideo"){ - document.querySelector(`#MVLyricsBox`).style.display = 'block'; - } - var u = ''; - if (li.getElementsByClassName('lyrics-translation').length > 0 ){ - try{ - if(!li.innerText.includes('Instrumental. / Lyrics not found.')){ - u = li.getElementsByClassName('lyrics-translation')[0].innerText; - document.querySelector(`#MVLyricsBox`).childNodes[1].innerHTML= li.getElementsByClassName('lyrics-translation')[0].innerText; - document.querySelector(`#MVLyricsBox`).childNodes[0].innerHTML= (li.innerText).replace(u,'');} - } catch(e){} - } else { - if(!li.innerText.includes('Instrumental. / Lyrics not found.')){ - document.querySelector(`#MVLyricsBox`).childNodes[0].innerHTML= li.innerText; - document.querySelector(`#MVLyricsBox`).childNodes[1].innerHTML= ''; } - } - - - - } catch(e){console.log('mverr',e);} - } else { - try{ - li.classList.remove(self.currentcss); - } catch(e){} - } - } - }; - /* The constructor can be empty or passed in the lrc string*/ - const Lyricer = function (options) { - this.divID = "lyricer"; /* the default html container id */ - this.currentcss = "lyricer-current-line"; /* this css for the line current playing*/ - this.lineidPrefix = "lyricer-line"; /* the id prefix for each line*/ - this.showLines = 8; /*lines showing before and after;*/ - this.clickable = true; - this.clickEventName = "lyricerclick"; - this.focus = 'center'; - if (options) { - for (const prop in options) { - if (typeof this[prop] != "undefined" && options.hasOwnProperty(prop)) { - this[prop] = options[prop]; - } - } - } - }; - Lyricer.prototype.setFocus = function(focus2){ - this.focus = focus2; - }; - - Lyricer.prototype.setLrc = function (rawLrc) { - let i; - this.tags = {}; - this.lrc = []; - this.rangeLrc = []; - - const tagRegex = /\[([a-z]+):(.*)].*/; - const lrcAllRegex = /(\[[0-9.:\[\]]*])+(.*)/; - const timeRegex = /\[([0-9]+):([0-9.]+)]/; - const rawLrcArray = rawLrc.split(/[\r\n]/); - for (i = 0; i < rawLrcArray.length; i++) { - /* handle tags first*/ - const tag = tagRegex.exec(rawLrcArray[i]); - if (tag && tag[0]) { - this.tags[tag[1]] = tag[2]; - continue; - } - /* handle lrc*/ - const lrc = lrcAllRegex.exec(rawLrcArray[i]); - if (lrc && lrc[0]) { - const times = lrc[1].replace(/]\[/g, "],[").split(","); - for (let j = 0; j < times.length; j++) { - const time = timeRegex.exec(times[j]); - if (time && time[0]) { - this.lrc.push({"startTime": parseInt(time[1], 10) * 60 + parseFloat(time[2]), "line": lrc[2]}); - } - } - } - } - - /*sort lrc array*/ - this.lrc.sort(function (a, b) { - return a.startTime - b.startTime; - }); - - /* crate the range lrc array*/ - /* dummy lines*/ - /* for (var i = 0; i < rawLrcArray.length; i++) { - /* this.rangeLrc.push( { "startTime": -1, "endTime": 0, "line": " " } ); - /* }; - /* real data*/ - let startTime = 0; - let line = ""; - for (i = 0; i < this.lrc.length; i++) { - endTime = parseFloat(this.lrc[i].startTime); - if (startTime == 10 && line == 'lrcInstrumental') startTime=0; - if (!this.rangeLrc.includes({"startTime": startTime, "endTime": endTime, "line": line})){ - this.rangeLrc.push({"startTime": startTime, "endTime": endTime, "line": line});} else {console.log('blocked');} - startTime = endTime; - line = this.lrc[i].line; - } - this.rangeLrc.push({"startTime": startTime, "endTime": 999.99, "line": line}); - /* dummy lines - /* for (var i = 0; i < this.showLines; i++) { - /* this.rangeLrc.push( { "startTime": -1, "endTime": 0, "line": " " } ); - /* };*/ - this.totalLines = this.rangeLrc.length; - console.log(this.rangeLrc); - - /* set html and move to start*/ - setHtml(this); - this.move(0); - if(typeof _lyrics !== "undefined") { - _lyrics.setLyrics(this.rangeLrc); - } - }; - - Lyricer.prototype.move = function (time) { - for (let i = 0; i < this.totalLines; i++) { - if (time >= this.rangeLrc[i].startTime && time < this.rangeLrc[i].endTime) { - if (this.currentLine !== i) { - this.currentLine = i; - moveToLine(this, this.currentLine); - } - return; - } - } - }; - - Lyricer.prototype.setMXMTranslation = function (translation_list) { - const container = document.getElementById(this.divID); - const lines = container.getElementsByTagName('li'); - for (var line of lines){ - for (var trans_line of translation_list){ - if (line.textContent == " "+trans_line["translation"]["matched_line"]){ - const trans = document.createElement("div"); - trans.className = "lyrics-translation"; - trans.textContent = trans_line["translation"]["description"]; - line.appendChild(trans); - break; - } - } - } - - }; - - window.Lyricer = Lyricer; /*exposed to global*/ - -})(); diff --git a/oldshit/resources/js/pluginSystem.js b/oldshit/resources/js/pluginSystem.js deleted file mode 100644 index 716e647a..00000000 --- a/oldshit/resources/js/pluginSystem.js +++ /dev/null @@ -1,118 +0,0 @@ -var _plugins = { - events: { - Start: [], - OnNavigation: [], - OnPlaybackStateChanged: [], - OnExit: [], - OnHide: [], - OnShow: [] - }, - plugins: [], - menuitems: [], - chromeitems: [], - loadPlugin(plugin = "") { - if (plugin == "") { - return - } - ipcRenderer.send("load-plugin", plugin) - }, - execute(type = "Start", args = {}) { - let self = this - if (!this.events[type]) { - console.warn(`[Plugins] Event type: ${type} not found!`) - return - } else { - console.info(`[Plugins] Event type: ${type} called`) //info makes it more distingishable in the console (more Beginner friendly) - } - this.events[type].forEach(element => { - element(args) - }); - } -}; - -class AMEPlugin_Menuitem { - constructor() { - this.Text = "" - this.Icon = "" - this.OnClick = () => {} - } - get() { - JSON.stringify(this) - } -} - -class AMEPluginHelper { - constructor() { - /** - * Adds all events to the _plugins event queue - */ - _plugins.events.Start.push(this.Start) - _plugins.events.OnNavigation.push(this.OnNavigation) - _plugins.events.OnPlaybackStateChanged.push(this.OnPlaybackStateChanged) - _plugins.events.OnExit.push(this.OnExit) - _plugins.events.OnHide.push(this.OnHide) - _plugins.events.OnShow.push(this.OnShow) - this.name = "Plugin Name" - this.Start() - this.Announce() - } - /** - * Announces that the plugin has loaded in console - */ - Announce() { - console.info(`[Plugins] Plugin: ${this.name} loaded.`) - } - /** - * Excutes when the web player has fully loaded - */ - Start() {} - /** - * Executes when playback state is changed (WIP) - */ - OnPlaybackStateChanged() {} - /** - * Executes when the user changes pages on the site or opens a context menu - * ex: Songs to Playlist screen - */ - OnNavigation() {} - /** - * Executes when the application exits (WIP) - */ - OnExit() {} - /** - * Executes when the application is hidden to the taskbar - */ - OnHide() {} - /** - * Executes when the application is unhidden (WIP) - */ - OnShow() {} - /** - * Adds a menu item to the profile menu (WIP) - */ - AddMenuItem({ - Text = "", - Icon = "", - OnClick = () => {} - }) { - var menuitem = new AMEPlugin_Menuitem() - menuitem.Text = Text - menuitem.Icon = Icon - menuitem.OnClick = OnClick - _plugins.menuitems.push(menuitem) - } - /** - * Adds a button to the web chrome after the volume meter (WIP) - */ - AddChromeButton({ - text = "", - style = {}, - onclick = () => {} - }) { - var btn = document.createElement("button") - btn.classList.add("button-reset") - var btnStyle = { - width: 38 - } - } -} \ No newline at end of file diff --git a/oldshit/resources/js/settingsPage.js b/oldshit/resources/js/settingsPage.js deleted file mode 100644 index b4b06cc2..00000000 --- a/oldshit/resources/js/settingsPage.js +++ /dev/null @@ -1,19 +0,0 @@ -try { - function matchRuleShort(str, rule) { - var escapeRegex = (str) => str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); - return new RegExp("^" + rule.split("*").map(escapeRegex).join(".*") + "$").test(str); - } - if(AMJavaScript.getQuery("amesettings")) { - if (!storedInnerHTML && document.getElementsByTagName('footer').length !== 0) { - var storedInnerHTML = document.getElementsByTagName('footer')[0].innerHTML; - } - - if (matchRuleShort(window.location.href, '*settings*') && document.getElementsByClassName('application-preferences').length === 0) { - AMSettings.CreateMenu('commerce-full-content'); - } else if (document.getElementsByTagName('footer').length === 1) { - document.getElementsByTagName('footer')[0].innerHTML = storedInnerHTML; /* Revert the footer */ - } - } -} catch (e) { - console.error("[JS] Error while trying to apply settingsPage.js", e); -} \ No newline at end of file diff --git a/oldshit/resources/js/tests.js b/oldshit/resources/js/tests.js deleted file mode 100644 index c219e271..00000000 --- a/oldshit/resources/js/tests.js +++ /dev/null @@ -1,542 +0,0 @@ -var _tests = { - remoteUI() { - AMJavaScript.getRequest("ameres://html/itunes_remote.html", (content)=>{ - var vm = new Vue({ - data: { - passcode: { - 0: "", - 1: "", - 2: "", - 3: "" - }, - state: "pin" - }, - methods: { - close() { - modal.close() - }, - jumpToNum(num) { - document.querySelector(`#passcode-num-${num}`).focus() - document.querySelector(`#passcode-num-${num}`).select() - }, - retry() { - this.passcode = {0:"",1:"",2:"",3:""} - this.state = "pin" - }, - connect() { - let self = this - this.state = "connecting" - setTimeout(()=>{ - self.state = "success" - }, 2000) - } - } - - }) - var modal = new AMEModal({ - content: content, - CloseButton: false, - Dismissible: false, - Style: { - maxWidth: "700px", - maxHeight: "400px" - }, - OnCreate() { - vm.$mount("#itunes-remote-vue") - vm.jumpToNum(0) - }, - OnClose() { - _vues.destroy(vm) - } - }) - }) - }, - usermenuinit() { - // MOVE ME ONCE IMPLEMENTED! - - // Clone the user menu - var umClone = document.querySelector(".web-chrome-controls-container>.web-navigation__auth").cloneNode(true) - // Hide the existing menu - document.querySelector(".web-chrome-controls-container>.web-navigation__auth").style.display = "none" - // Append cloned menu - document.querySelector(".web-chrome-controls-container").append(umClone) - // Set cloned menu events - - umClone.addEventListener("click", (e)=>{ - _tests.usermenu(e) - }) - }, - usermenu(e) { - - // MOVE ME ONCE IMPLEMENTED! - AMJavaScript.getRequest("ameres://html/usermenu.html", (content) => { - var vm = new Vue({ - data: { - menuitems: [ - { - label: "Help", - visible: true, - icon: "", - svg: ``, - - onclick: () => { - window.open(`https://support.apple.com/guide/music-web`) - } - - }, - { - label: "Discord", - visible: true, - icon: "", - svg: ` - - `, - - onclick: () => { - window.open(`https://discord.gg/CezHYdXHEM`) - } - - }, - { - label: "Account Settings", - visible: true, - icon: "", - svg: ` - - - `, - - onclick: () => { - - history.pushState("settings", "Settings", "/account/settings/") - window.location.href = "#" - } - }, - { - label: "Preferences", - visible: true, - icon: "", - svg: ``, - - onclick: () => { - - history.pushState("settings", "Settings", "/account/settings/?amesettings=1") - window.location.href = "#" - } - }, - { - label: "Equalizer", - - visible: AudioOutputs.eqReady, - - svg: ` - - - - - - - - - - - -`, - - onclick: () => { - - _tests.eq() - } - }, - { - label: "Sign Out", - visible: true, - icon: "", - style: { - color: "var(--systemRed)" - }, - - onclick: () => { - MusicKit.getInstance().unauthorize() - } - - } - ] - }, - methods: { - close() { - modal.close() - } - } - }) - var calc = { - width: 185, - left: e.clientX - (185 / 2) - } - - // calculate the position of the menu based on the mouse position and the width of the menu itself - if (calc.left + calc.width > window.innerWidth) { - calc.left = (window.innerWidth - calc.width) - } - if (calc.left < 0) { - calc.left = 0 - } - - var modal = new AMEModal({ - content: content, - CloseButton: false, - ModalClasses: ["ameUserMenu"], - BackdropStyle: { - background: "transparent" - }, - Style: { - height: "auto", - - width: `${calc["width"]}px`, - position: "absolute", - // top: "46px", - // right: "142px" - top: `46px`, - left: `${calc.left}px` - }, - OnCreate() { - vm.$mount("#usermenu-vue") - if(typeof _plugins != "undefined") { - _plugins.menuitems.forEach((menuitem)=>{ - vm.menuitems.unshift({ - label: menuitem["Text"], - onclick: menuitem["OnClick"], - icon: "", - visible: true - }) - }) - } - - }, - OnClose() { - _vues.destroy(vm) - } - }) - }) - }, - eq() { - AMJavaScript.getRequest("ameres://html/eq.html", (content) => { - var vm = new Vue({ - data: { - manualEntry: false, - bass: bassFilter.gain.value.toFixed(2), - treble: trebleFilter.gain.value.toFixed(2), - gain: AMEx.result.gain.gain.value.toFixed(2) - }, - methods: { - reset() { - this.bass = 0 - bassFilter.gain.value = 0 - this.treble = 0 - trebleFilter.gain.value = 0 - this.gain = 0 - AMEx.result.gain.gain.value = 0 - }, - close() { - modal.close() - } - } - }) - var modal = new AMEModal({ - content: content, - CloseButton: false, - ModalClasses: ["ameUserMenu"], - BackdropStyle: { - background: "transparent" - }, - - Style: { - - animation: "ameEQIn .10s var(--appleEase)", - width: "306px", - height: "254px", - position: "absolute", - top: "46px", - right: "42px" - }, - OnCreate() { - vm.$mount("#eq-vm") - } - }) - }) - }, - zoo() { - AMJavaScript.getRequest("ameres://html/zoo.html", (content) => { - var modal = new AMEModal({ - content: content - }) - }) - }, - outputDevice() { - AMJavaScript.getRequest("ameres://html/outputdevice.html", (content) => { - var vm = new Vue({ - data: { - selected: "", - audio: document.querySelector("#apple-music-player"), - devices: [] - }, - methods: { - setOutputDevice(id) { - if (this.audio) { - selected = id - sessionStorage.setItem("outputDevice", id) - this.audio.setSinkId(id) - } - } - } - }) - var modal = new AMEModal({ - content: content, - Style: { - width: "30%", - minWidth: "500px" - }, - OnCreate() { - vm.$mount("#outputdevices-vue") - if (vm.audio) { - vm.selected = audio.sinkId - } else { - vm.selected = "default" - } - navigator.mediaDevices.enumerateDevices() - .then(function (devices) { - vm.devices = devices.filter((device) => { - if (device.kind == "audiooutput") { - return device - } - }) - }) - .catch(function (err) { - console.log(err.name + ": " + err.message) - }) - }, - OnClose() { - _vues.destroy(vm) - } - }) - }) - }, - stats() { - var container = document.createElement("div") - var frameRate = document.createElement("div") - var listeners = document.createElement("div") - Object.assign(container.style, - { - textAlign: "center", - position: "absolute", - fontSize: "18px", - bottom: "16px", - right: "16px", - pointerEvents: "none", - zIndex: 99991, - color: "white", - webkitTextStroke: "0.2px black" - }) - document.body.appendChild(container) - container.appendChild(frameRate) - container.appendChild(listeners) - - const times = []; - let fps; - - function refreshLoop() { - window.requestAnimationFrame(() => { - const now = performance.now(); - while (times.length > 0 && times[0] <= now - 1000) { - times.shift(); - } - times.push(now); - fps = times.length; - frameRate.innerText = `${fps} FPS` - refreshLoop(); - }); - } - - refreshLoop(); - }, - oobe(skipIntro = false, closeBtn = false) { - // MOVE ME ONCE IMPLEMENTED! - - AMJavaScript.getRequest("ameres://html/oobe.html", (content) => { - var vm = new Vue({ - data: { - prefs: { - general: { - storefront: "us", - discordRPC: "", - analyticsEnabled: true - }, - visual: { - theme: "", - transparencyEffect: "", - useOperatingSystemAccent: false, - scaling: 1, - mxmon: false, - yton: false, - mxmlanguage: "en", - removeScrollbars: true - }, - audio: { - audioQuality: "auto", - seamlessAudioTransitions: true, - castingBitDepth: '16', - enableDLNA: false, - }, - window: { - closeButtonMinimize: true - } - }, - page: "intro", - }, - methods: { - btn() { - console.info("Button clicked") - }, - getPrefs() { - let self = this - ipcRenderer.invoke("getStoreValue", "audio.audioQuality").then((result) => { - self.prefs.audio.audioQuality = result - }) - - ipcRenderer.invoke("getStoreValue", "audio.seamlessAudioTransitions").then((result) => { - self.prefs.audio.seamlessAudioTransitions = result - }) - - ipcRenderer.invoke("getStoreValue", "audio.castingBitDepth").then((result) => { - self.prefs.audio.castingBitDepth = result - }) - - ipcRenderer.invoke("getStoreValue", "audio.enableDLNA").then((result) => { - self.prefs.audio.enableDLNA = result - }) - - ipcRenderer.invoke("getStoreValue", "general.storefront").then((result) => { - self.prefs.general.storefront = result - }) - - ipcRenderer.invoke("getStoreValue", "general.discordRPC").then((result) => { - self.prefs.general.discordRPC = result - }) - - ipcRenderer.invoke("getStoreValue", "general.analyticsEnabled").then((result) => { - self.prefs.general.analyticsEnabled = result - }) - - ipcRenderer.invoke("getStoreValue", "window.closeButtonMinimize").then((result) => { - self.prefs.window.closeButtonMinimize = result - }) - - ipcRenderer.invoke("getStoreValue", "visual.theme").then((result) => { - self.prefs.visual.theme = result - }) - - ipcRenderer.invoke("getStoreValue", "visual.transparencyEffect").then((result) => { - self.prefs.visual.transparencyEffect = result - }) - - ipcRenderer.invoke("getStoreValue", "visual.useOperatingSystemAccent").then((result) => { - self.prefs.visual.useOperatingSystemAccent = result - }) - - ipcRenderer.invoke("getStoreValue", "visual.mxmon").then((result) => { - self.prefs.visual.mxmon = result - }) - - - ipcRenderer.invoke("getStoreValue", "visual.yton").then((result) => { - self.prefs.visual.yton = result - }) - - ipcRenderer.invoke("getStoreValue", "visual.mxmlanguage").then((result) => { - self.prefs.visual.mxmlanguage = result - }) - - ipcRenderer.invoke("getStoreValue", "visual.removeScrollbars").then((result) => { - self.prefs.visual.removeScrollbars = result - }) - }, - setPrefs() { - let self = this - ipcRenderer.invoke("setStoreValue", "audio.audioQuality", self.prefs.audio.audioQuality) - ipcRenderer.invoke("setStoreValue", "audio.seamlessAudioTransitions", self.prefs.audio.seamlessAudioTransitions) - ipcRenderer.invoke("setStoreValue", "audio.castingBitDepth", self.prefs.audio.castingBitDepth) - ipcRenderer.invoke("setStoreValue", "audio.enableDLNA", self.prefs.audio.enableDLNA) - ipcRenderer.invoke("setStoreValue", "general.storefront", self.prefs.general.storefront) - ipcRenderer.invoke("setStoreValue", "general.discordRPC", self.prefs.general.discordRPC) - ipcRenderer.invoke("setStoreValue", "general.analyticsEnabled", self.prefs.general.analyticsEnabled) - ipcRenderer.invoke("setStoreValue", "window.closeButtonMinimize", self.prefs.window.closeButtonMinimize) - ipcRenderer.invoke("setStoreValue", "visual.theme", self.prefs.visual.theme) - ipcRenderer.invoke("setStoreValue", "visual.transparencyEffect", self.prefs.visual.transparencyEffect) - ipcRenderer.invoke("setStoreValue", "visual.useOperatingSystemAccent", self.prefs.visual.useOperatingSystemAccent) - ipcRenderer.invoke("setStoreValue", "visual.mxmon", self.prefs.visual.mxmon) - - ipcRenderer.invoke("setStoreValue", "visual.yton", self.prefs.visual.yton) - - ipcRenderer.invoke("setStoreValue", "visual.mxmlanguage", self.prefs.visual.mxmlanguage) - ipcRenderer.invoke("setStoreValue", "visual.removeScrollbars", self.prefs.visual.removeScrollbars) - }, - promptRelaunch() { - var relaunch = confirm( - "Relaunch Required\nA relaunch is required in order for the settings you have changed to apply." - ) - if (relaunch) { - ipcRenderer.send("relaunchApp") - } - }, - close() { - this.setPrefs() - // this.promptRelaunch() - modal.close() - }, - init() { - let self = this - document.getElementById('introVideo').addEventListener('ended', () => { - self.page = "welcome" - }, false); - this.getPrefs() - }, - enableBlur() { - modal.setStyle("backdrop", { - backdropFilter: "blur(16px) saturate(180%)" - }) - }, - disableBlur() { - modal.setStyle("backdrop", { - backdropFilter: "blur(0px)" - }) - } - } - }) - var modal = new AMEModal({ - content: content, - CloseButton: closeBtn, - Dismissible: closeBtn, - OnCreate() { - vm.$mount("#oobe-vue") - if (skipIntro) { - vm.page = "welcome" - } else { - vm.init() - } - }, - OnClose() { - _vues.destroy(vm); - if (!MusicKit.getInstance().isAuthorized) { - MusicKit.getInstance().authorize(); - } - } - }) - }) - } -}; - -if (ipcRenderer.sendSync('showOOBE')) { - setTimeout(() => { - _tests.oobe(); - }, 200) -} diff --git a/oldshit/resources/js/utils.js b/oldshit/resources/js/utils.js deleted file mode 100644 index 17b81e0c..00000000 --- a/oldshit/resources/js/utils.js +++ /dev/null @@ -1,147 +0,0 @@ -var _vues = { - instances: [], - killVue(id) { - let self = this - this.instances = this.instances.filter((instance) => { - console.warn(`Requested destroy: ${id}`) - if (instance["_amID"] != id) { - console.warn("Found vue") - console.warn("Destroying Vue") - instance.$destroy() - } else { - return instance - } - }) - }, - gc() { - var needsGC = this.instances.every((val, i, arr) => val == undefined) - if (needsGC) { - this.instances = [] - } - }, - destroy(vue) { - vue.$destroy() - vue = undefined - console.info("Destroyed Vue instance") - }, - killAll() { - // Kill all Vue instances - this.instances.forEach((instance) => { - instance.$destroy() - instance = null - }) - this.instances = [] - } -}; - -class AMEModal { - constructor({ - content = "", - OnCreate = () => { - }, - OnClose = () => { - }, - CloseButton = true, - Style = {}, - ModalClasses = [], - BackdropStyle = {}, - Dismissible = true - }) { - this.Style = Style - this.BackdropStyle = BackdropStyle - this.ModalClasses = ModalClasses - this.closeButton = CloseButton - this.content = content - this.OnClose = OnClose - this.OnCreate = OnCreate - this.Dismissible = Dismissible - this.modal = {} - this.create() - } - - create() { - let self = this - var backdrop = document.createElement("div") - var dismissArea = document.createElement("div") - var modalWin = document.createElement("div") - var modalCloseBtn = document.createElement("button") - var modalContent = document.createElement("div") - backdrop.classList.add("ameModal-Backdrop") - modalWin.classList.add("ameModal") - modalCloseBtn.classList.add("ameModal-Close") - modalCloseBtn.innerHTML = ("Close") - modalCloseBtn.addEventListener("click", () => { - self.close() - }, {once: true}) - Object.assign(dismissArea.style, { - width: "100%", - height: "100%", - position: "absolute", - top: "0px", - left: "0px", - cursor: "pointer" - }) - modalContent.style.height = "100%" - setInnerHTML(modalContent, this.content) - if(this.closeButton) { - modalWin.appendChild(modalCloseBtn) - } - if(this.Dismissible) { - dismissArea.addEventListener("click",()=>{ - self.close() - }, {once: true}) - document.addEventListener("keyup", (e)=>{ - if(e.key == "Escape") { - self.close() - } - }, {once: true}) - backdrop.appendChild(dismissArea) - } - modalWin.appendChild(modalContent) - Object.assign(backdrop.style, this.BackdropStyle) - this.ModalClasses.forEach((cssClass)=>{ - modalWin.classList.add(cssClass) - }) - if(document.querySelectorAll(".ameModal").length == 0) { - document.body.classList.add("no-acrylic") - } - Object.assign(modalWin.style, this.Style) - backdrop.appendChild(modalWin) - document.body.appendChild(backdrop) - this.modal = { - backdrop: backdrop, - window: modalWin, - content: modalContent, - closeBtn: modalCloseBtn - } - this.OnCreate() - } - - close() { - this.OnClose() - this.modal.backdrop.style.background = "transparent" - this.modal.window.classList.add("ameModal-closing") - setTimeout(()=>{ - this.modal.backdrop.remove() - if(document.querySelectorAll(".ameModal").length == 0) { - document.body.classList.remove("no-acrylic") - } - }, 100) - } - - setStyle (element, style = {}) { - if(this.modal[element]) { - Object.assign(this.modal[element].style, style) - }else{ - console.warn(`Undefined modal element "${element}", available modals are: "backdrop", "window", "closeBtn"`) - } - } - - OnCreate() { - - } - - OnClose() { - - } -}; \ No newline at end of file diff --git a/oldshit/resources/lfmApiCredentials.json b/oldshit/resources/lfmApiCredentials.json deleted file mode 100644 index 18a973d7..00000000 --- a/oldshit/resources/lfmApiCredentials.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "key": "174905d201451602407b428a86e8344d", - "secret": "be61d4081f6adec150f0130939f854bb" -} diff --git a/oldshit/resources/lyrics/Vibrant.js b/oldshit/resources/lyrics/Vibrant.js deleted file mode 100644 index 94f2c5ee..00000000 --- a/oldshit/resources/lyrics/Vibrant.js +++ /dev/null @@ -1,872 +0,0 @@ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o b) ? 1 : 0); - }, - sum: function(array, f) { - var o = {}; - return array.reduce(f ? function(p, d, i) { - o.index = i; - return p + f.call(o, d); - } : function(p, d) { - return p + d; - }, 0); - }, - max: function(array, f) { - return Math.max.apply(null, f ? pv.map(array, f) : array); - } - } -} - -/** - * Basic Javascript port of the MMCQ (modified median cut quantization) - * algorithm from the Leptonica library (http://www.leptonica.com/). - * Returns a color map you can use to map original pixels to the reduced - * palette. Still a work in progress. - * - * @author Nick Rabinowitz - * @example - -// array of pixels as [R,G,B] arrays -var myPixels = [[190,197,190], [202,204,200], [207,214,210], [211,214,211], [205,207,207] - // etc - ]; -var maxColors = 4; - -var cmap = MMCQ.quantize(myPixels, maxColors); -var newPalette = cmap.palette(); -var newPixels = myPixels.map(function(p) { - return cmap.map(p); -}); - - */ -var MMCQ = (function() { - // private constants - var sigbits = 5, - rshift = 8 - sigbits, - maxIterations = 1000, - fractByPopulations = 0.75; - - // get reduced-space color index for a pixel - - function getColorIndex(r, g, b) { - return (r << (2 * sigbits)) + (g << sigbits) + b; - } - - // Simple priority queue - - function PQueue(comparator) { - var contents = [], - sorted = false; - - function sort() { - contents.sort(comparator); - sorted = true; - } - - return { - push: function(o) { - contents.push(o); - sorted = false; - }, - peek: function(index) { - if (!sorted) sort(); - if (index === undefined) index = contents.length - 1; - return contents[index]; - }, - pop: function() { - if (!sorted) sort(); - return contents.pop(); - }, - size: function() { - return contents.length; - }, - map: function(f) { - return contents.map(f); - }, - debug: function() { - if (!sorted) sort(); - return contents; - } - }; - } - - // 3d color space box - - function VBox(r1, r2, g1, g2, b1, b2, histo) { - var vbox = this; - vbox.r1 = r1; - vbox.r2 = r2; - vbox.g1 = g1; - vbox.g2 = g2; - vbox.b1 = b1; - vbox.b2 = b2; - vbox.histo = histo; - } - VBox.prototype = { - volume: function(force) { - var vbox = this; - if (!vbox._volume || force) { - vbox._volume = ((vbox.r2 - vbox.r1 + 1) * (vbox.g2 - vbox.g1 + 1) * (vbox.b2 - vbox.b1 + 1)); - } - return vbox._volume; - }, - count: function(force) { - var vbox = this, - histo = vbox.histo; - if (!vbox._count_set || force) { - var npix = 0, - i, j, k; - for (i = vbox.r1; i <= vbox.r2; i++) { - for (j = vbox.g1; j <= vbox.g2; j++) { - for (k = vbox.b1; k <= vbox.b2; k++) { - index = getColorIndex(i, j, k); - npix += (histo[index] || 0); - } - } - } - vbox._count = npix; - vbox._count_set = true; - } - return vbox._count; - }, - copy: function() { - var vbox = this; - return new VBox(vbox.r1, vbox.r2, vbox.g1, vbox.g2, vbox.b1, vbox.b2, vbox.histo); - }, - avg: function(force) { - var vbox = this, - histo = vbox.histo; - if (!vbox._avg || force) { - var ntot = 0, - mult = 1 << (8 - sigbits), - rsum = 0, - gsum = 0, - bsum = 0, - hval, - i, j, k, histoindex; - for (i = vbox.r1; i <= vbox.r2; i++) { - for (j = vbox.g1; j <= vbox.g2; j++) { - for (k = vbox.b1; k <= vbox.b2; k++) { - histoindex = getColorIndex(i, j, k); - hval = histo[histoindex] || 0; - ntot += hval; - rsum += (hval * (i + 0.5) * mult); - gsum += (hval * (j + 0.5) * mult); - bsum += (hval * (k + 0.5) * mult); - } - } - } - if (ntot) { - vbox._avg = [~~(rsum / ntot), ~~ (gsum / ntot), ~~ (bsum / ntot)]; - } else { - //console.log('empty box'); - vbox._avg = [~~(mult * (vbox.r1 + vbox.r2 + 1) / 2), ~~ (mult * (vbox.g1 + vbox.g2 + 1) / 2), ~~ (mult * (vbox.b1 + vbox.b2 + 1) / 2)]; - } - } - return vbox._avg; - }, - contains: function(pixel) { - var vbox = this, - rval = pixel[0] >> rshift; - gval = pixel[1] >> rshift; - bval = pixel[2] >> rshift; - return (rval >= vbox.r1 && rval <= vbox.r2 && - gval >= vbox.g1 && gval <= vbox.g2 && - bval >= vbox.b1 && bval <= vbox.b2); - } - }; - - // Color map - - function CMap() { - this.vboxes = new PQueue(function(a, b) { - return pv.naturalOrder( - a.vbox.count() * a.vbox.volume(), - b.vbox.count() * b.vbox.volume() - ) - });; - } - CMap.prototype = { - push: function(vbox) { - this.vboxes.push({ - vbox: vbox, - color: vbox.avg() - }); - }, - palette: function() { - return this.vboxes.map(function(vb) { - return vb.color - }); - }, - size: function() { - return this.vboxes.size(); - }, - map: function(color) { - var vboxes = this.vboxes; - for (var i = 0; i < vboxes.size(); i++) { - if (vboxes.peek(i).vbox.contains(color)) { - return vboxes.peek(i).color; - } - } - return this.nearest(color); - }, - nearest: function(color) { - var vboxes = this.vboxes, - d1, d2, pColor; - for (var i = 0; i < vboxes.size(); i++) { - d2 = Math.sqrt( - Math.pow(color[0] - vboxes.peek(i).color[0], 2) + - Math.pow(color[1] - vboxes.peek(i).color[1], 2) + - Math.pow(color[2] - vboxes.peek(i).color[2], 2) - ); - if (d2 < d1 || d1 === undefined) { - d1 = d2; - pColor = vboxes.peek(i).color; - } - } - return pColor; - }, - forcebw: function() { - // XXX: won't work yet - var vboxes = this.vboxes; - vboxes.sort(function(a, b) { - return pv.naturalOrder(pv.sum(a.color), pv.sum(b.color)) - }); - - // force darkest color to black if everything < 5 - var lowest = vboxes[0].color; - if (lowest[0] < 5 && lowest[1] < 5 && lowest[2] < 5) - vboxes[0].color = [0, 0, 0]; - - // force lightest color to white if everything > 251 - var idx = vboxes.length - 1, - highest = vboxes[idx].color; - if (highest[0] > 251 && highest[1] > 251 && highest[2] > 251) - vboxes[idx].color = [255, 255, 255]; - } - }; - - // histo (1-d array, giving the number of pixels in - // each quantized region of color space), or null on error - - function getHisto(pixels) { - var histosize = 1 << (3 * sigbits), - histo = new Array(histosize), - index, rval, gval, bval; - pixels.forEach(function(pixel) { - rval = pixel[0] >> rshift; - gval = pixel[1] >> rshift; - bval = pixel[2] >> rshift; - index = getColorIndex(rval, gval, bval); - histo[index] = (histo[index] || 0) + 1; - }); - return histo; - } - - function vboxFromPixels(pixels, histo) { - var rmin = 1000000, - rmax = 0, - gmin = 1000000, - gmax = 0, - bmin = 1000000, - bmax = 0, - rval, gval, bval; - // find min/max - pixels.forEach(function(pixel) { - rval = pixel[0] >> rshift; - gval = pixel[1] >> rshift; - bval = pixel[2] >> rshift; - if (rval < rmin) rmin = rval; - else if (rval > rmax) rmax = rval; - if (gval < gmin) gmin = gval; - else if (gval > gmax) gmax = gval; - if (bval < bmin) bmin = bval; - else if (bval > bmax) bmax = bval; - }); - return new VBox(rmin, rmax, gmin, gmax, bmin, bmax, histo); - } - - function medianCutApply(histo, vbox) { - if (!vbox.count()) return; - - var rw = vbox.r2 - vbox.r1 + 1, - gw = vbox.g2 - vbox.g1 + 1, - bw = vbox.b2 - vbox.b1 + 1, - maxw = pv.max([rw, gw, bw]); - // only one pixel, no split - if (vbox.count() == 1) { - return [vbox.copy()] - } - /* Find the partial sum arrays along the selected axis. */ - var total = 0, - partialsum = [], - lookaheadsum = [], - i, j, k, sum, index; - if (maxw == rw) { - for (i = vbox.r1; i <= vbox.r2; i++) { - sum = 0; - for (j = vbox.g1; j <= vbox.g2; j++) { - for (k = vbox.b1; k <= vbox.b2; k++) { - index = getColorIndex(i, j, k); - sum += (histo[index] || 0); - } - } - total += sum; - partialsum[i] = total; - } - } else if (maxw == gw) { - for (i = vbox.g1; i <= vbox.g2; i++) { - sum = 0; - for (j = vbox.r1; j <= vbox.r2; j++) { - for (k = vbox.b1; k <= vbox.b2; k++) { - index = getColorIndex(j, i, k); - sum += (histo[index] || 0); - } - } - total += sum; - partialsum[i] = total; - } - } else { /* maxw == bw */ - for (i = vbox.b1; i <= vbox.b2; i++) { - sum = 0; - for (j = vbox.r1; j <= vbox.r2; j++) { - for (k = vbox.g1; k <= vbox.g2; k++) { - index = getColorIndex(j, k, i); - sum += (histo[index] || 0); - } - } - total += sum; - partialsum[i] = total; - } - } - partialsum.forEach(function(d, i) { - lookaheadsum[i] = total - d - }); - - function doCut(color) { - var dim1 = color + '1', - dim2 = color + '2', - left, right, vbox1, vbox2, d2, count2 = 0; - for (i = vbox[dim1]; i <= vbox[dim2]; i++) { - if (partialsum[i] > total / 2) { - vbox1 = vbox.copy(); - vbox2 = vbox.copy(); - left = i - vbox[dim1]; - right = vbox[dim2] - i; - if (left <= right) - d2 = Math.min(vbox[dim2] - 1, ~~ (i + right / 2)); - else d2 = Math.max(vbox[dim1], ~~ (i - 1 - left / 2)); - // avoid 0-count boxes - while (!partialsum[d2]) d2++; - count2 = lookaheadsum[d2]; - while (!count2 && partialsum[d2 - 1]) count2 = lookaheadsum[--d2]; - // set dimensions - vbox1[dim2] = d2; - vbox2[dim1] = vbox1[dim2] + 1; - // console.log('vbox counts:', vbox.count(), vbox1.count(), vbox2.count()); - return [vbox1, vbox2]; - } - } - - } - // determine the cut planes - return maxw == rw ? doCut('r') : - maxw == gw ? doCut('g') : - doCut('b'); - } - - function quantize(pixels, maxcolors) { - // short-circuit - if (!pixels.length || maxcolors < 2 || maxcolors > 256) { - // console.log('wrong number of maxcolors'); - return false; - } - - // XXX: check color content and convert to grayscale if insufficient - - var histo = getHisto(pixels), - histosize = 1 << (3 * sigbits); - - // check that we aren't below maxcolors already - var nColors = 0; - histo.forEach(function() { - nColors++ - }); - if (nColors <= maxcolors) { - // XXX: generate the new colors from the histo and return - } - - // get the beginning vbox from the colors - var vbox = vboxFromPixels(pixels, histo), - pq = new PQueue(function(a, b) { - return pv.naturalOrder(a.count(), b.count()) - }); - pq.push(vbox); - - // inner function to do the iteration - - function iter(lh, target) { - var ncolors = 1, - niters = 0, - vbox; - while (niters < maxIterations) { - vbox = lh.pop(); - if (!vbox.count()) { /* just put it back */ - lh.push(vbox); - niters++; - continue; - } - // do the cut - var vboxes = medianCutApply(histo, vbox), - vbox1 = vboxes[0], - vbox2 = vboxes[1]; - - if (!vbox1) { - // console.log("vbox1 not defined; shouldn't happen!"); - return; - } - lh.push(vbox1); - if (vbox2) { /* vbox2 can be null */ - lh.push(vbox2); - ncolors++; - } - if (ncolors >= target) return; - if (niters++ > maxIterations) { - // console.log("infinite loop; perhaps too few pixels!"); - return; - } - } - } - - // first set of colors, sorted by population - iter(pq, fractByPopulations * maxcolors); - // console.log(pq.size(), pq.debug().length, pq.debug().slice()); - - // Re-sort by the product of pixel occupancy times the size in color space. - var pq2 = new PQueue(function(a, b) { - return pv.naturalOrder(a.count() * a.volume(), b.count() * b.volume()) - }); - while (pq.size()) { - pq2.push(pq.pop()); - } - - // next set - generate the median cuts using the (npix * vol) sorting. - iter(pq2, maxcolors - pq2.size()); - - // calculate the actual colors - var cmap = new CMap(); - while (pq2.size()) { - cmap.push(pq2.pop()); - } - - return cmap; - } - - return { - quantize: quantize - } -})(); - -module.exports = MMCQ.quantize - -},{}],2:[function(require,module,exports){ - -/* - Vibrant.js - by Jari Zwarts - - Color algorithm class that finds variations on colors in an image. - - Credits - -------- - Lokesh Dhakar (http://www.lokeshdhakar.com) - Created ColorThief - Google - Palette support library in Android - */ - -(function() { - var CanvasImage, Swatch, Vibrant, - bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - slice = [].slice; - - window.Swatch = Swatch = (function() { - Swatch.prototype.hsl = void 0; - - Swatch.prototype.rgb = void 0; - - Swatch.prototype.population = 1; - - Swatch.yiq = 0; - - function Swatch(rgb, population) { - this.rgb = rgb; - this.population = population; - } - - Swatch.prototype.getHsl = function() { - if (!this.hsl) { - return this.hsl = Vibrant.rgbToHsl(this.rgb[0], this.rgb[1], this.rgb[2]); - } else { - return this.hsl; - } - }; - - Swatch.prototype.getPopulation = function() { - return this.population; - }; - - Swatch.prototype.getRgb = function() { - return this.rgb; - }; - - Swatch.prototype.getHex = function() { - return "#" + ((1 << 24) + (this.rgb[0] << 16) + (this.rgb[1] << 8) + this.rgb[2]).toString(16).slice(1, 7); - }; - - Swatch.prototype.getTitleTextColor = function() { - this._ensureTextColors(); - if (this.yiq < 200) { - return "#fff"; - } else { - return "#000"; - } - }; - - Swatch.prototype.getBodyTextColor = function() { - this._ensureTextColors(); - if (this.yiq < 150) { - return "#fff"; - } else { - return "#000"; - } - }; - - Swatch.prototype._ensureTextColors = function() { - if (!this.yiq) { - return this.yiq = (this.rgb[0] * 299 + this.rgb[1] * 587 + this.rgb[2] * 114) / 1000; - } - }; - - return Swatch; - - })(); - - window.Vibrant = Vibrant = (function() { - Vibrant.prototype.quantize = require('quantize'); - - Vibrant.prototype._swatches = []; - - Vibrant.prototype.TARGET_DARK_LUMA = 0.26; - - Vibrant.prototype.MAX_DARK_LUMA = 0.45; - - Vibrant.prototype.MIN_LIGHT_LUMA = 0.55; - - Vibrant.prototype.TARGET_LIGHT_LUMA = 0.74; - - Vibrant.prototype.MIN_NORMAL_LUMA = 0.3; - - Vibrant.prototype.TARGET_NORMAL_LUMA = 0.5; - - Vibrant.prototype.MAX_NORMAL_LUMA = 0.7; - - Vibrant.prototype.TARGET_MUTED_SATURATION = 0.3; - - Vibrant.prototype.MAX_MUTED_SATURATION = 0.4; - - Vibrant.prototype.TARGET_VIBRANT_SATURATION = 1; - - Vibrant.prototype.MIN_VIBRANT_SATURATION = 0.35; - - Vibrant.prototype.WEIGHT_SATURATION = 3; - - Vibrant.prototype.WEIGHT_LUMA = 6; - - Vibrant.prototype.WEIGHT_POPULATION = 1; - - Vibrant.prototype.VibrantSwatch = void 0; - - Vibrant.prototype.MutedSwatch = void 0; - - Vibrant.prototype.DarkVibrantSwatch = void 0; - - Vibrant.prototype.DarkMutedSwatch = void 0; - - Vibrant.prototype.LightVibrantSwatch = void 0; - - Vibrant.prototype.LightMutedSwatch = void 0; - - Vibrant.prototype.HighestPopulation = 0; - - function Vibrant(sourceImage, colorCount, quality) { - this.swatches = bind(this.swatches, this); - var a, allPixels, b, cmap, g, i, image, imageData, offset, pixelCount, pixels, r; - if (typeof colorCount === 'undefined') { - colorCount = 64; - } - if (typeof quality === 'undefined') { - quality = 5; - } - image = new CanvasImage(sourceImage); - imageData = image.getImageData(); - pixels = imageData.data; - pixelCount = image.getPixelCount(); - allPixels = []; - i = 0; - while (i < pixelCount) { - offset = i * 4; - r = pixels[offset + 0]; - g = pixels[offset + 1]; - b = pixels[offset + 2]; - a = pixels[offset + 3]; - if (a >= 125) { - if (!(r > 250 && g > 250 && b > 250)) { - allPixels.push([r, g, b]); - } - } - i = i + quality; - } - cmap = this.quantize(allPixels, colorCount); - this._swatches = cmap.vboxes.map((function(_this) { - return function(vbox) { - return new Swatch(vbox.color, vbox.vbox.count()); - }; - })(this)); - this.maxPopulation = this.findMaxPopulation; - this.generateVarationColors(); - this.generateEmptySwatches(); - image.removeCanvas(); - } - - Vibrant.prototype.generateVarationColors = function() { - this.VibrantSwatch = this.findColorVariation(this.TARGET_NORMAL_LUMA, this.MIN_NORMAL_LUMA, this.MAX_NORMAL_LUMA, this.TARGET_VIBRANT_SATURATION, this.MIN_VIBRANT_SATURATION, 1); - this.LightVibrantSwatch = this.findColorVariation(this.TARGET_LIGHT_LUMA, this.MIN_LIGHT_LUMA, 1, this.TARGET_VIBRANT_SATURATION, this.MIN_VIBRANT_SATURATION, 1); - this.DarkVibrantSwatch = this.findColorVariation(this.TARGET_DARK_LUMA, 0, this.MAX_DARK_LUMA, this.TARGET_VIBRANT_SATURATION, this.MIN_VIBRANT_SATURATION, 1); - this.MutedSwatch = this.findColorVariation(this.TARGET_NORMAL_LUMA, this.MIN_NORMAL_LUMA, this.MAX_NORMAL_LUMA, this.TARGET_MUTED_SATURATION, 0, this.MAX_MUTED_SATURATION); - this.LightMutedSwatch = this.findColorVariation(this.TARGET_LIGHT_LUMA, this.MIN_LIGHT_LUMA, 1, this.TARGET_MUTED_SATURATION, 0, this.MAX_MUTED_SATURATION); - return this.DarkMutedSwatch = this.findColorVariation(this.TARGET_DARK_LUMA, 0, this.MAX_DARK_LUMA, this.TARGET_MUTED_SATURATION, 0, this.MAX_MUTED_SATURATION); - }; - - Vibrant.prototype.generateEmptySwatches = function() { - var hsl; - if (this.VibrantSwatch === void 0) { - if (this.DarkVibrantSwatch !== void 0) { - hsl = this.DarkVibrantSwatch.getHsl(); - hsl[2] = this.TARGET_NORMAL_LUMA; - this.VibrantSwatch = new Swatch(Vibrant.hslToRgb(hsl[0], hsl[1], hsl[2]), 0); - } - } - if (this.DarkVibrantSwatch === void 0) { - if (this.VibrantSwatch !== void 0) { - hsl = this.VibrantSwatch.getHsl(); - hsl[2] = this.TARGET_DARK_LUMA; - return this.DarkVibrantSwatch = new Swatch(Vibrant.hslToRgb(hsl[0], hsl[1], hsl[2]), 0); - } - } - }; - - Vibrant.prototype.findMaxPopulation = function() { - var j, len, population, ref, swatch; - population = 0; - ref = this._swatches; - for (j = 0, len = ref.length; j < len; j++) { - swatch = ref[j]; - population = Math.max(population, swatch.getPopulation()); - } - return population; - }; - - Vibrant.prototype.findColorVariation = function(targetLuma, minLuma, maxLuma, targetSaturation, minSaturation, maxSaturation) { - var j, len, luma, max, maxValue, ref, sat, swatch, value; - max = void 0; - maxValue = 0; - ref = this._swatches; - for (j = 0, len = ref.length; j < len; j++) { - swatch = ref[j]; - sat = swatch.getHsl()[1]; - luma = swatch.getHsl()[2]; - if (sat >= minSaturation && sat <= maxSaturation && luma >= minLuma && luma <= maxLuma && !this.isAlreadySelected(swatch)) { - value = this.createComparisonValue(sat, targetSaturation, luma, targetLuma, swatch.getPopulation(), this.HighestPopulation); - if (max === void 0 || value > maxValue) { - max = swatch; - maxValue = value; - } - } - } - return max; - }; - - Vibrant.prototype.createComparisonValue = function(saturation, targetSaturation, luma, targetLuma, population, maxPopulation) { - return this.weightedMean(this.invertDiff(saturation, targetSaturation), this.WEIGHT_SATURATION, this.invertDiff(luma, targetLuma), this.WEIGHT_LUMA, population / maxPopulation, this.WEIGHT_POPULATION); - }; - - Vibrant.prototype.invertDiff = function(value, targetValue) { - return 1 - Math.abs(value - targetValue); - }; - - Vibrant.prototype.weightedMean = function() { - var i, sum, sumWeight, value, values, weight; - values = 1 <= arguments.length ? slice.call(arguments, 0) : []; - sum = 0; - sumWeight = 0; - i = 0; - while (i < values.length) { - value = values[i]; - weight = values[i + 1]; - sum += value * weight; - sumWeight += weight; - i += 2; - } - return sum / sumWeight; - }; - - Vibrant.prototype.swatches = function() { - return { - Vibrant: this.VibrantSwatch, - Muted: this.MutedSwatch, - DarkVibrant: this.DarkVibrantSwatch, - DarkMuted: this.DarkMutedSwatch, - LightVibrant: this.LightVibrantSwatch, - LightMuted: this.LightMuted - }; - }; - - Vibrant.prototype.isAlreadySelected = function(swatch) { - return this.VibrantSwatch === swatch || this.DarkVibrantSwatch === swatch || this.LightVibrantSwatch === swatch || this.MutedSwatch === swatch || this.DarkMutedSwatch === swatch || this.LightMutedSwatch === swatch; - }; - - Vibrant.rgbToHsl = function(r, g, b) { - var d, h, l, max, min, s; - r /= 255; - g /= 255; - b /= 255; - max = Math.max(r, g, b); - min = Math.min(r, g, b); - h = void 0; - s = void 0; - l = (max + min) / 2; - if (max === min) { - h = s = 0; - } else { - d = max - min; - s = l > 0.5 ? d / (2 - max - min) : d / (max + min); - switch (max) { - case r: - h = (g - b) / d + (g < b ? 6 : 0); - break; - case g: - h = (b - r) / d + 2; - break; - case b: - h = (r - g) / d + 4; - } - h /= 6; - } - return [h, s, l]; - }; - - Vibrant.hslToRgb = function(h, s, l) { - var b, g, hue2rgb, p, q, r; - r = void 0; - g = void 0; - b = void 0; - hue2rgb = function(p, q, t) { - if (t < 0) { - t += 1; - } - if (t > 1) { - t -= 1; - } - if (t < 1 / 6) { - return p + (q - p) * 6 * t; - } - if (t < 1 / 2) { - return q; - } - if (t < 2 / 3) { - return p + (q - p) * (2 / 3 - t) * 6; - } - return p; - }; - if (s === 0) { - r = g = b = l; - } else { - q = l < 0.5 ? l * (1 + s) : l + s - (l * s); - p = 2 * l - q; - r = hue2rgb(p, q, h + 1 / 3); - g = hue2rgb(p, q, h); - b = hue2rgb(p, q, h - (1 / 3)); - } - return [r * 255, g * 255, b * 255]; - }; - - return Vibrant; - - })(); - - - /* - CanvasImage Class - Class that wraps the html image element and canvas. - It also simplifies some of the canvas context manipulation - with a set of helper functions. - Stolen from https://github.com/lokesh/color-thief - */ - - window.CanvasImage = CanvasImage = (function() { - function CanvasImage(image) { - this.canvas = document.createElement('canvas'); - this.context = this.canvas.getContext('2d'); - document.body.appendChild(this.canvas); - this.width = this.canvas.width = image.width; - this.height = this.canvas.height = image.height; - this.context.drawImage(image, 0, 0, this.width, this.height); - } - - CanvasImage.prototype.clear = function() { - return this.context.clearRect(0, 0, this.width, this.height); - }; - - CanvasImage.prototype.update = function(imageData) { - return this.context.putImageData(imageData, 0, 0); - }; - - CanvasImage.prototype.getPixelCount = function() { - return this.width * this.height; - }; - - CanvasImage.prototype.getImageData = function() { - return this.context.getImageData(0, 0, this.width, this.height); - }; - - CanvasImage.prototype.removeCanvas = function() { - return this.canvas.parentNode.removeChild(this.canvas); - }; - - return CanvasImage; - - })(); - -}).call(this); - -},{"quantize":1}]},{},[2]); diff --git a/oldshit/resources/lyrics/index.html b/oldshit/resources/lyrics/index.html deleted file mode 100644 index b50bc95d..00000000 --- a/oldshit/resources/lyrics/index.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - Lyrics - - - - - - - - -
    -
    - -
    -
    -
    - -
    -
    - - - \ No newline at end of file diff --git a/oldshit/resources/lyrics/musixmatch.html b/oldshit/resources/lyrics/musixmatch.html deleted file mode 100644 index dd5d4a8a..00000000 --- a/oldshit/resources/lyrics/musixmatch.html +++ /dev/null @@ -1,190 +0,0 @@ - - - - - Lyrics - - - - - - Background Image -
    -
    -
    - - - \ No newline at end of file diff --git a/oldshit/resources/lyrics/netease.html b/oldshit/resources/lyrics/netease.html deleted file mode 100644 index b248fad5..00000000 --- a/oldshit/resources/lyrics/netease.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - Lyrics - - - - - - Background Image -
    -
    -
    - - - \ No newline at end of file diff --git a/oldshit/resources/lyrics/youtube.html b/oldshit/resources/lyrics/youtube.html deleted file mode 100644 index a54101bf..00000000 --- a/oldshit/resources/lyrics/youtube.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - Lyrics - - - - - - Background Image -
    -
    -
    - - - \ No newline at end of file diff --git a/oldshit/resources/splash/index.html b/oldshit/resources/splash/index.html deleted file mode 100644 index 22bc0be3..00000000 --- a/oldshit/resources/splash/index.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - Splash Screen - - - - - \ No newline at end of file diff --git a/oldshit/resources/themes/README.md b/oldshit/resources/themes/README.md deleted file mode 100644 index 03abfddf..00000000 --- a/oldshit/resources/themes/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Apple-Music-Electron-Themes -Simple theme repository for use with https://github.com/Apple-Music-Electron/Apple-Music-Electron - -## [Instructions](https://github.com/Apple-Music-Electron/Apple-Music-Electron/wiki/Theme-Creation#instructions) - -## [Theme Preview Images](https://github.com/Apple-Music-Electron/Apple-Music-Electron/wiki/Theme-Preview-Images) \ No newline at end of file diff --git a/oldshit/resources/themes/Template.css b/oldshit/resources/themes/Template.css deleted file mode 100644 index 80886cc0..00000000 --- a/oldshit/resources/themes/Template.css +++ /dev/null @@ -1,508 +0,0 @@ -:root { - --bodyGutter:25px; - color-scheme:light dark; - --systemRed:#ff3b30; - --systemRed-vibrant:#f53126; - --systemRed-default_IC:#d70015; - --systemRed-vibrant_IC:#c20618; - --systemOrange:#ff9500; - --systemOrange-vibrant:#f58b00; - --systemOrange-default_IC:#c93400; - --systemOrange-vibrant_IC:#ad3a00; - --systemYellow:#ffcc00; - --systemYellow-vibrant:#f5c200; - --systemYellow-default_IC:#a05a00; - --systemYellow-vibrant_IC:#925100; - --systemGreen:#28cd41; - --systemGreen-vibrant:#1ec337; - --systemGreen-default_IC:#007d1b; - --systemGreen-vibrant_IC:#007018; - --systemMint:#00c7be; - --systemMint-vibrant:#00bdb4; - --systemMint-default_IC:#0c817b; - --systemMint-vibrant_IC:#0b7570; - --systemTeal:#59adc4; - --systemTeal-vibrant:#2ea7bd; - --systemTeal-default_IC:#008299; - --systemTeal-vibrant_IC:#00778c; - --systemCyan:#55bef0; - --systemCyan-vibrant:#41afdc; - --systemCyan-default_IC:#0071a4; - --systemCyan-vibrant_IC:#006796; - --systemBlue:#007aff; - --systemBlue-vibrant:#0070f5; - --systemBlue-default_IC:#0040dd; - --systemBlue-vibrant_IC:#0040dd; - --systemBlue-rollover:#0045b7; - --systemBlue-pressed:#005cd7; - --systemBlue-deepPressed:#0045b7; - --systemBlue-disabled:rgba(0, 122, 255, 0.35); - --systemIndigo:#5856d6; - --systemIndigo-vibrant:#5452cc; - --systemIndigo-default_IC:#3634a3; - --systemIndigo-vibrant_IC:#3634a3; - --systemPurple:#af52de; - --systemPurple-vibrant:#9f4bc9; - --systemPurple-default_IC:#ad44ab; - --systemPurple-vibrant_IC:#ad44ab; - --systemPink:#ff2d55; - --systemPink-vibrant:#f5234b; - --systemPink-default_IC:#d30f45; - --systemPink-vibrant_IC:#c11032; - --systemBrown:#a2845e; - --systemBrown-vibrant:#987a54; - --systemBrown-default_IC:#7f6545; - --systemBrown-vibrant_IC:#775d3b; - --systemGray:#8e8e93; - --systemGray-vibrant:#848489; - --systemGray-default_IC:#69696e; - --systemGray-vibrant_IC:#616165; - --systemPrimary:rgba(0, 0, 0, 0.85); - --systemPrimary-vibrant:#4c4c4c; - --systemPrimary-vibrant-rgb:76,76,76; - --systemPrimary-default_IC:black; - --systemPrimary-default_IC-rgb:0,0,0; - --systemPrimary-vibrant_IC:black; - --systemPrimary-vibrant_IC-rgb:0,0,0; - --systemSecondary:rgba(0, 0, 0, 0.5); - --systemSecondary-vibrant:gray; - --systemSecondary-default_IC:rgba(0, 0, 0, 0.76); - --systemSecondary-vibrant_IC:rgba(0, 0, 0, 0.76); - --systemTertiary:rgba(0, 0, 0, 0.25); - --systemTertiary-vibrant:#bfbfbf; - --systemTertiary-default_IC:rgba(0, 0, 0, 0.56); - --systemTertiary-vibrant_IC:rgba(0, 0, 0, 0.56); - --systemQuaternary:rgba(0, 0, 0, 0.1); - --systemQuaternary-vibrant:#e6e6e6; - --systemQuaternary-default_IC:rgba(0, 0, 0, 0.35); - --systemQuaternary-vibrant_IC:rgba(0, 0, 0, 0.35); - --systemQuinary:rgba(0, 0, 0, 0.05); - --systemQuinary-vibrant:#f2f2f2; - --systemQuinary-default_IC:rgba(0, 0, 0, 0.1); - --systemQuinary-vibrant_IC:rgba(0, 0, 0, 0.1); - --keyColor:#fa233b; - --keyColor-rgb:250,35,59; - --keyColor-rollover:#c60007; - --keyColor-rollover-rgb:198,0,7; - --keyColor-pressed:#e00921; - --keyColor-pressed-rgb:224,9,33; - --keyColor-deepPressed:#c60007; - --keyColor-deepPressed-rgb:198,0,7; - --keyColor-disabled:rgba(250, 35, 59, 0.35); - --keyColor-default_IC:#d60017; - --keyColor-default_IC-rgb:214,0,23; - --keyColor-rollover_IC:#a20000; - --keyColor-rollover_IC-rgb:162,0,0; - --keyColor-pressed_IC:#bb0000; - --keyColor-pressed_IC-rgb:187,0,0; - --keyColor-deepPressed_IC:#a20000; - --keyColor-deepPressed_IC-rgb:162,0,0; - --keyColor-disabled_IC:rgba(214, 0, 23, 0.25); - --systemStandardUltrathinMaterialSover:rgba(246, 246, 246, 0.36); - --systemStandardUltrathinMaterialSover-inactive:#f0f0f0; - --systemStandardUltrathinMaterialSover-default_IC:#d2d2d2; - --systemStandardUltrathinMaterialSover-inactive_IC:#ececec; - --systemStandardThinMaterialSover:rgba(246, 246, 246, 0.48); - --systemStandardThinMaterialSover-inactive:#f0f0f0; - --systemStandardThinMaterialSover-default_IC:gainsboro; - --systemStandardThinMaterialSover-inactive_IC:#ececec; - --systemStandardMediumMaterialSover:rgba(246, 246, 246, 0.6); - --systemStandardMediumMaterialSover-inactive:#f0f0f0; - --systemStandardMediumMaterialSover-default_IC:#e6e6e6; - --systemStandardMediumMaterialSover-inactive_IC:#ececec; - --systemStandardThickMaterialSover:rgba(246, 246, 246, 0.72); - --systemStandardThickMaterialSover-inactive:#f0f0f0; - --systemStandardThickMaterialSover-default_IC:#f0f0f0; - --systemStandardThickMaterialSover-inactive_IC:#ececec; - --systemStandardUltrathickMaterialSover:rgba(246, 246, 246, 0.84); - --systemStandardUltrathickMaterialSover-inactive:#f0f0f0; - --systemStandardUltrathickMaterialSover-default_IC:#fafafa; - --systemStandardUltrathickMaterialSover-inactive_IC:#ececec; - --systemHeaderMaterialSover:rgba(255, 255, 255, 0.8); - --systemHeaderMaterialSover-default_IC:white; - --systemToolbarTitlebarMaterialSover:rgba(253, 253, 253, 0.8); - --systemToolbarTitlebarMaterialSover-inactive:#f0f0f0; - --systemToolbarTitlebarMaterialSover-default_IC:white; - --systemToolbarTitlebarMaterialSover-inactive_IC:#ececec; - --labelDivider:rgba(0, 0, 0, 0.15); - --vibrantDivider:rgba(60, 60, 67, 0.29); - --pageBG:white; - --shelfBG:rgba(0, 0, 0, 0.05); - --genericJoeColor:#ebebeb; - --fallbackMaterialBG:rgba(255, 255, 255, 0.97); - --musicKeyColor:#fa233b; - --musicKeyColor-rollover:#c60007; - --musicKeyColor-pressed:#e00921; - --musicKeyColor-deepPressed:#c60007; - --musicKeyColor-disabled:rgba(250, 35, 59, 0.35); - --musicKeyColor-default_IC:#d60017; - --musicKeyColor-rollover_IC:#a20000; - --musicKeyColor-pressed_IC:#bb0000; - --musicKeyColor-deepPressed_IC:#a20000; - --musicKeyColor-disabled_IC:rgba(214, 0, 23, 0.25); - --systemAccentBG:#fa233b; - --systemAccentBG-rollover:#c60007; - --systemAccentBG-pressed:#e00921; - --systemAccentBG-deepPressed:#c60007; - --systemAccentBG-disabled:rgba(250, 35, 59, 0.35); - --systemAccentBG-default_IC:#d60017; - --systemAccentBG-rollover_IC:#a20000; - --systemAccentBG-pressed_IC:#bb0000; - --systemAccentBG-deepPressed_IC:#a20000; - --systemAccentBG-disabled_IC:rgba(214, 0, 23, 0.25); - --musicBrandBG:#fa233b; - --musicBrandBG-default_IC:#d60017; - --modalBGColor:white; - --modalBGColor-rgb:255,255,255; - --modalBGHeaderColor:rgba(255, 255, 255, 0.97); - --modalScrimColor:rgba(0, 0, 0, 0.45); - --opaqueShelfBG:#f2f2f2; - --profileBadgeJoeColor:#e2e4e7; - --selectionColor:#dd1f34; - --selectionColor-default_IC:#d60017; - --selectionColorRollover:#af0007; - --selectionColorRollover-default_IC:#a20000; - --selectionColorPressed:#c6081d; - --selectionColorPressed-default_IC:#bb0000; - --selectionColorDeepPressed:#af0007; - --selectionColorDeepPressed-default_IC:#a20000; - --selectionColorDisabled:rgba(250, 35, 59, 0.35); - --selectionColorDisabled-default_IC:rgba(214, 0, 23, 0.25); - --topResultsBGColor:rgba(0, 0, 0, 0.1); - --lockupHoverBGColor:rgba(51, 51, 51, 0.3); - --opaquePageBGColor:white; - --replayCardBG:#f7f3eb; - --replayComponentBG:#fbf9f5; - --barButtonDeselectedGradientTop:#fefefe; - --barButtonDeselectedGradientBottom:#fafafa; - --barButtonSelectedBGFill:#7f7f7f; - --barButtonSelectedTextColor:white; - --lockupSuperlabelPrimary:rgba(255, 255, 255, 0.95); - --lockupChinScrim:rgba(0, 0, 0, 0.2); - --lovedBGColor:#fa233b; - --playerDropShadow2:rgba(0, 0, 0, 0.07); - --playerInnerShadow:rgba(255, 255, 255, 0.45); - --powerSwooshAlgoRadioLockupChinScrim:rgba(44, 44, 46, 0.4); - --socialSearchBG:rgba(0, 0, 0, 0.15); - --socialModalFooter:rgba(255, 255, 255, 0.7); - --tracklistAltRowColor:rgba(0, 0, 0, 0.015); - --tracklistAltRowColor-default_IC:rgba(0, 0, 0, 0.05); - --tracklistHoverColor:rgba(0, 0, 0, 0.06); - --tracklistHoverColor-default_IC:rgba(0, 0, 0, 0.1); - --tracklistWorksTrackHoverColor:rgba(0, 0, 0, 0.12); - --tracklistWorksTrackHoverColor-default_IC:rgba(0, 0, 0, 0.18); - --viewLoading:white; - --circularArtistHeaderGradientBottom:rgba(0, 0, 0, 0.05); - --dialogScrimColor:rgba(255, 255, 255, 0.8); - --monogramPlaceholderColor:#9a9aa2; - --listItemAddDownloadBG:rgba(0, 0, 0, 0.5); - --listItemProgressBG:rgba(0, 0, 0, 0.25); - --radiosityShadowColor:rgba(0, 0, 0, 0.1); - --dialogShadowColor:rgba(0, 0, 0, 0.25); - --contextMenuBorderColor:rgba(0, 0, 0, 0.15); - --contextMenuTextColor:rgba(0, 0, 0, 0.85); - --footerBG:#fbfbfb; - --frostedFallbackHover:rgba(142, 142, 147, 0.8); - --iPhoneNowPlayingBackdropBG:#dbccc4; - --searchBorder:rgba(0, 0, 0, 0.15); - --searchIconDropShadow:rgba(0, 0, 0, 0.15); - --searchHintsBG:rgba(232, 232, 232, 0.9); - --searchHintsBGHover:rgba(201, 204, 203, 0.9); - --sidebar:rgba(60, 60, 67, 0.03); - --sidebar-default_IC:#fafafa; - --sidebarBorderRule:rgba(0, 0, 0, 0.1); - --sidebarSelectedState:rgba(60, 60, 67, 0.1); - --sidebarNativeUpsellBackgroundFallback:rgba(255, 255, 255, 0.97); - --webNavigationMobileBg:white; - --playerScrubberPlayhead:gray; - --playerScrubberFill:rgba(0, 0, 0, 0.5); - --playerScrubberTrack:rgba(0, 0, 0, 0.1); - --playerBackgroundFallback:rgba(255, 255, 255, 0.97); - --playerBackgroundFallback-default_IC:#fafafa; - --playerBackground:rgba(255, 255, 255, 0.88); - --playerBackground-default_IC:#fafafa; - --playerGradientTop:rgba(255, 255, 255, 0.25); - --playerGradientBottom:rgba(255, 255, 255, 0); - --playerLCDLogo:rgba(0, 0, 0, 0.5); - --playerLCDBGFill:white; - --playerLCDBGFill-rgb:255,255,255; - --playerLCDBGOuterStroke:rgba(0, 0, 0, 0.2); - --playerArtworkKeyline:rgba(0, 0, 0, 0.1); - --playerVolumePlayhead:white; - --playerVolumePlayheadActive:#e5e5e5; - --playerVolumeFill:rgba(0, 0, 0, 0.5); - --playerVolumeTrack:rgba(0, 0, 0, 0.15); - --playerVolumeIconFill:rgba(0, 0, 0, 0.4); - --trackBackgroundEven:rgba(0, 0, 0, 0.02); - --trackHoverColor:rgba(255, 255, 255, 0.97); - --playerPlatterButtonBGFill:#6c6c6c; - --playerPlatterButtonIconFill:white; - --librarySongsTrackInactiveBG:rgba(0, 0, 0, 0.14); - --searchScopeDeselectedGradientTop:#fefefe; - --searchScopeDeselectedGradientBottom:#fafafa; - --searchScopeSelectedBGFill:#7f7f7f; - --searchScopeSelectedTextColor:white; - --searchBoxIconFill:rgba(0, 0, 0, 0.65); - --segmentedControlBG:rgba(118, 118, 128, 0.12); - --segmentedControlSelectedBG:white; - --segmentedControlSelectedShadow1:rgba(0, 0, 0, 0.12); - --segmentedControlSelectedShadow2:rgba(0, 0, 0, 0.04); - --segmentedControlSelectedBorder:rgba(0, 0, 0, 0.04); - --searchBarBorderColor:rgba(0, 0, 0, 0.15); - --viewport-default:"xsmall"; - --viewport-grid-layout:"grid-layout:xs-1"; - --viewport-sidebar:"sidebar:hidden"; - --viewport-search-landing-grid:"search-landing-grid:1"; - --web-navigation-width:164px -} - -@media (prefers-color-scheme:dark) { - :root { - --systemRed:#ff453a; - --systemRed-vibrant:#ff4f44; - --systemRed-default_IC:#ff6961; - --systemRed-vibrant_IC:#ff4136; - --systemOrange:#ff9f0a; - --systemOrange-vibrant:#ffa914; - --systemOrange-default_IC:#ffb340; - --systemOrange-vibrant_IC:#ffb340; - --systemYellow:#ffd60a; - --systemYellow-vibrant:#ffe014; - --systemYellow-default_IC:#ffd426; - --systemYellow-vibrant_IC:#ffd426; - --systemGreen:#32d74b; - --systemGreen-vibrant:#3ce155; - --systemGreen-default_IC:#31de4b; - --systemGreen-vibrant_IC:#31de4b; - --systemMint:#63e6e2; - --systemMint-vibrant:#6ce0db; - --systemMint-default_IC:#63e6e2; - --systemMint-vibrant_IC:#63e6e2; - --systemTeal:#6ac4dc; - --systemTeal-vibrant:#44d4ed; - --systemTeal-default_IC:#5de6ff; - --systemTeal-vibrant_IC:#5de6ff; - --systemCyan:#5ac8f5; - --systemCyan-vibrant:#5acdfa; - --systemCyan-default_IC:#70d7ff; - --systemCyan-vibrant_IC:#70d7ff; - --systemBlue:#0a84ff; - --systemBlue-vibrant:#148eff; - --systemBlue-default_IC:#409cff; - --systemBlue-vibrant_IC:#409cff; - --systemBlue-rollover:#47c1ff; - --systemBlue-pressed:#38b2ff; - --systemBlue-deepPressed:#47c1ff; - --systemBlue-disabled:rgba(10, 132, 255, 0.5); - --systemIndigo:#5e5ce6; - --systemIndigo-vibrant:#6361f2; - --systemIndigo-default_IC:#7d7aff; - --systemIndigo-vibrant_IC:#7d7aff; - --systemPurple:#bf5af2; - --systemPurple-vibrant:#cc65ff; - --systemPurple-default_IC:#da8fff; - --systemPurple-vibrant_IC:#da8fff; - --systemPink:#ff375f; - --systemPink-vibrant:#ff4169; - --systemPink-default_IC:#ff6482; - --systemPink-vibrant_IC:#ff3a5f; - --systemBrown:#ac8e68; - --systemBrown-vibrant:#b69872; - --systemBrown-default_IC:#b59469; - --systemBrown-vibrant_IC:#b59469; - --systemGray:#98989d; - --systemGray-vibrant:#a2a2a7; - --systemGray-default_IC:#98989d; - --systemGray-vibrant_IC:#98989d; - --systemPrimary:rgba(255, 255, 255, 0.85); - --systemPrimary-vibrant:#e5e5e5; - --systemPrimary-vibrant-rgb:229,229,229; - --systemPrimary-default_IC:white; - --systemPrimary-default_IC-rgb:255,255,255; - --systemPrimary-vibrant_IC:white; - --systemPrimary-vibrant_IC-rgb:255,255,255; - --systemSecondary:rgba(255, 255, 255, 0.55); - --systemSecondary-vibrant:#7c7c7c; - --systemSecondary-default_IC:rgba(255, 255, 255, 0.7); - --systemSecondary-vibrant_IC:rgba(255, 255, 255, 0.7); - --systemTertiary:rgba(255, 255, 255, 0.25); - --systemTertiary-vibrant:#414141; - --systemTertiary-default_IC:rgba(255, 255, 255, 0.5); - --systemTertiary-vibrant_IC:rgba(255, 255, 255, 0.5); - --systemQuaternary:rgba(255, 255, 255, 0.1); - --systemQuaternary-vibrant:#232323; - --systemQuaternary-default_IC:rgba(255, 255, 255, 0.3); - --systemQuaternary-vibrant_IC:rgba(255, 255, 255, 0.3); - --systemQuinary:rgba(255, 255, 255, 0.05); - --systemQuinary-vibrant:#080808; - --systemQuinary-default_IC:rgba(255, 255, 255, 0.1); - --systemQuinary-vibrant_IC:rgba(255, 255, 255, 0.1); - --keyColor:#fa2d48; - --keyColor-rgb:250,45,72; - --keyColor-rollover:#ff5f7a; - --keyColor-rollover-rgb:255,95,122; - --keyColor-pressed:#ff4661; - --keyColor-pressed-rgb:255,70,97; - --keyColor-deepPressed:#ff5f7a; - --keyColor-deepPressed-rgb:255,95,122; - --keyColor-disabled:rgba(250, 45, 72, 0.35); - --keyColor-default_IC:#fa586a; - --keyColor-default_IC-rgb:250,88,106; - --keyColor-rollover_IC:#ff8a9c; - --keyColor-rollover_IC-rgb:255,138,156; - --keyColor-pressed_IC:#ff7183; - --keyColor-pressed_IC-rgb:255,113,131; - --keyColor-deepPressed_IC:#ff8a9c; - --keyColor-deepPressed_IC-rgb:255,138,156; - --keyColor-disabled_IC:rgba(250, 88, 106, 0.35); - --systemStandardUltrathinMaterialSover:rgba(40, 40, 40, 0.4); - --systemStandardUltrathinMaterialSover-inactive:#282828; - --systemStandardUltrathinMaterialSover-default_IC:black; - --systemStandardUltrathinMaterialSover-inactive_IC:#141414; - --systemStandardThinMaterialSover:rgba(40, 40, 40, 0.5); - --systemStandardThinMaterialSover-inactive:#282828; - --systemStandardThinMaterialSover-default_IC:#0a0a0a; - --systemStandardThinMaterialSover-inactive_IC:#141414; - --systemStandardMediumMaterialSover:rgba(40, 40, 40, 0.6); - --systemStandardMediumMaterialSover-inactive:#282828; - --systemStandardMediumMaterialSover-default_IC:#141414; - --systemStandardMediumMaterialSover-inactive_IC:#141414; - --systemStandardThickMaterialSover:rgba(40, 40, 40, 0.7); - --systemStandardThickMaterialSover-inactive:#282828; - --systemStandardThickMaterialSover-default_IC:#1e1e1e; - --systemStandardThickMaterialSover-inactive_IC:#141414; - --systemStandardUltrathickMaterialSover:rgba(40, 40, 40, 0.8); - --systemStandardUltrathickMaterialSover-inactive:#282828; - --systemStandardUltrathickMaterialSover-default_IC:#282828; - --systemStandardUltrathickMaterialSover-inactive_IC:#141414; - --systemHeaderMaterialSover:rgba(30, 30, 30, 0.8); - --systemHeaderMaterialSover-default_IC:#1e1e1e; - --systemToolbarTitlebarMaterialSover:rgba(60, 60, 60, 0.8); - --systemToolbarTitlebarMaterialSover-inactive:#282828; - --systemToolbarTitlebarMaterialSover-default_IC:#262626; - --systemToolbarTitlebarMaterialSover-inactive_IC:#141414; - --labelDivider:rgba(255, 255, 255, 0.1); - --vibrantDivider:rgba(235, 235, 245, 0.19); - --pageBG:#1f1f1f; - --shelfBG:rgba(255, 255, 255, 0.05); - --genericJoeColor:#323232; - --fallbackMaterialBG:rgba(31, 31, 31, 0.97); - --musicKeyColor:#fa2d48; - --musicKeyColor-rollover:#ff5f7a; - --musicKeyColor-pressed:#ff4661; - --musicKeyColor-deepPressed:#ff5f7a; - --musicKeyColor-disabled:rgba(250, 45, 72, 0.35); - --musicKeyColor-default_IC:#fa586a; - --musicKeyColor-rollover_IC:#ff8a9c; - --musicKeyColor-pressed_IC:#ff7183; - --musicKeyColor-deepPressed_IC:#ff8a9c; - --musicKeyColor-disabled_IC:rgba(250, 88, 106, 0.35); - --systemAccentBG:#fa233b; - --systemAccentBG-rollover:#c60007; - --systemAccentBG-pressed:#e00921; - --systemAccentBG-deepPressed:#c60007; - --systemAccentBG-disabled:rgba(250, 35, 59, 0.35); - --systemAccentBG-default_IC:#d60017; - --systemAccentBG-rollover_IC:#a20000; - --systemAccentBG-pressed_IC:#bb0000; - --systemAccentBG-deepPressed_IC:#a20000; - --systemAccentBG-disabled_IC:rgba(214, 0, 23, 0.25); - --musicBrandBG:#fa233b; - --musicBrandBG-default_IC:#d60017; - --modalBGColor:#1f1f1f; - --modalBGColor-rgb:31,31,31; - --modalBGHeaderColor:rgba(31, 31, 31, 0.97); - --modalScrimColor:rgba(0, 0, 0, 0.55); - --opaqueShelfBG:#2b2b2b; - --profileBadgeJoeColor:#e2e4e7; - --selectionColor:#c11b2e; - --selectionColor-default_IC:#a60012; - --selectionColorRollover:#990006; - --selectionColorRollover-default_IC:#7d0000; - --selectionColorPressed:#ad0719; - --selectionColorPressed-default_IC:#900000; - --selectionColorDeepPressed:#990006; - --selectionColorDeepPressed-default_IC:#7d0000; - --selectionColorDisabled:rgba(250, 45, 72, 0.35); - --selectionColorDisabled-default_IC:rgba(66, 0, 7, 0.421075); - --topResultsBGColor:rgba(255, 255, 255, 0.1); - --lockupHoverBGColor:rgba(51, 51, 51, 0.3); - --opaquePageBGColor:#2d2d2d; - --replayCardBG:#1a1a1a; - --replayComponentBG:#2e2e2e; - --barButtonDeselectedGradientTop:#595a5c; - --barButtonDeselectedGradientBottom:#565759; - --barButtonSelectedBGFill:#aeaeb2; - --barButtonSelectedTextColor:#4c4c4c; - --lockupSuperlabelPrimary:rgba(0, 0, 0, 0.95); - --lockupChinScrim:rgba(0, 0, 0, 0.2); - --lovedBGColor:#fa2d48; - --playerDropShadow2:rgba(0, 0, 0, 0.1); - --playerInnerShadow:rgba(255, 255, 255, 0.1); - --powerSwooshAlgoRadioLockupChinScrim:rgba(44, 44, 46, 0.4); - --socialSearchBG:rgba(255, 255, 255, 0.15); - --socialModalFooter:rgba(0, 0, 0, 0.7); - --tracklistAltRowColor:rgba(255, 255, 255, 0.015); - --tracklistAltRowColor-default_IC:rgba(255, 255, 255, 0.05); - --tracklistHoverColor:rgba(255, 255, 255, 0.06); - --tracklistHoverColor-default_IC:rgba(255, 255, 255, 0.1); - --tracklistWorksTrackHoverColor:rgba(255, 255, 255, 0.12); - --tracklistWorksTrackHoverColor-default_IC:rgba(255, 255, 255, 0.18); - --viewLoading:transparent; - --circularArtistHeaderGradientBottom:rgba(255, 255, 255, 0.03); - --dialogScrimColor:rgba(38, 38, 38, 0.8); - --monogramPlaceholderColor:#5a5a5a; - --listItemAddDownloadBG:rgba(255, 255, 255, 0.55); - --listItemProgressBG:rgba(255, 255, 255, 0.25); - --radiosityShadowColor:rgba(0, 0, 0, 0.3); - --dialogShadowColor:rgba(0, 0, 0, 0.55); - --contextMenuBorderColor:rgba(255, 255, 255, 0.1); - --contextMenuTextColor:rgba(255, 255, 255, 0.85); - --footerBG:#323232; - --frostedFallbackHover:rgba(152, 152, 157, 0.8); - --iPhoneNowPlayingBackdropBG:#dbccc4; - --searchBorder:rgba(255, 255, 255, 0.15); - --searchIconDropShadow:rgba(0, 0, 0, 0.25); - --searchHintsBG:rgba(44, 46, 48, 0.9); - --searchHintsBGHover:rgba(45, 47, 50, 0.9); - --sidebar:rgba(235, 235, 245, 0.03); - --sidebar-default_IC:#282828; - --sidebarBorderRule:rgba(255, 255, 255, 0.1); - --sidebarSelectedState:rgba(235, 235, 245, 0.1); - --sidebarNativeUpsellBackgroundFallback:rgba(60, 60, 67, 0.95); - --webNavigationMobileBg:#2e2e2e; - --playerScrubberPlayhead:#7c7c7c; - --playerScrubberFill:rgba(255, 255, 255, 0.6); - --playerScrubberTrack:rgba(255, 255, 255, 0.1); - --playerBackgroundFallback:rgba(45, 45, 45, 0.97); - --playerBackgroundFallback-default_IC:#282828; - --playerBackground:rgba(45, 45, 45, 0.88); - --playerBackground-default_IC:#282828; - --playerGradientTop:transparent; - --playerGradientBottom:transparent; - --playerLCDLogo:rgba(255, 255, 255, 0.55); - --playerLCDBGFill:#4d4d4d; - --playerLCDBGFill-rgb:77,77,77; - --playerLCDBGOuterStroke:rgba(0, 0, 0, 0.2); - --playerArtworkKeyline:rgba(255, 255, 255, 0.1); - --playerVolumePlayhead:#2c2c2c; - --playerVolumePlayheadActive:#413e40; - --playerVolumeFill:rgba(255, 255, 255, 0.6); - --playerVolumeTrack:rgba(255, 255, 255, 0.15); - --playerVolumeIconFill:rgba(255, 255, 255, 0.4); - --trackBackgroundEven:rgba(255, 255, 255, 0.05); - --trackHoverColor:rgba(0, 0, 0, 0.37); - --playerPlatterButtonBGFill:white; - --playerPlatterButtonIconFill:rgba(0, 0, 0, 0.7); - --librarySongsTrackInactiveBG:rgba(255, 255, 240, 0.12); - --searchScopeDeselectedGradientTop:#595a5c; - --searchScopeDeselectedGradientBottom:#565759; - --searchScopeSelectedBGFill:#aeaeb2; - --searchScopeSelectedTextColor:#4c4c4c; - --searchBoxIconFill:rgba(255, 255, 255, 0.9); - --segmentedControlBG:rgba(118, 118, 128, 0.24); - --segmentedControlSelectedBG:#636366; - --segmentedControlSelectedShadow1:transparent; - --segmentedControlSelectedShadow2:transparent; - --searchBarBorderColor:rgba(0, 0, 0, 0.15) - } diff --git a/oldshit/resources/themes/acrylic.css b/oldshit/resources/themes/acrylic.css deleted file mode 100644 index 9745c8d2..00000000 --- a/oldshit/resources/themes/acrylic.css +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @name Acrylic - * @author cryptofyre - * @description Transparent theme for use with Acrylic themesets. -*/ - -@media (prefers-color-scheme: dark) { - :root { - --transparency: #0f0f0f00 !important; - --sidebar: #0f0f0f00 !important; - --pageBG: #0f0f0f00 !important; - --playerBackground: #0f0f0f00 !important; - --systemHeaderMaterialSover-default_IC: #0f0f0f00 !important; - --systemHeaderMaterialSover: #0f0f0f00 !important; - --playerLCDBGFill: transparent!important; - --playerLCDBGOuterStroke: transparent!important; - - } - - .dt-search-box__input { - background-color: #0f0f0f00 !important; - } -} diff --git a/oldshit/resources/themes/blurple.css b/oldshit/resources/themes/blurple.css deleted file mode 100644 index 0ad65c32..00000000 --- a/oldshit/resources/themes/blurple.css +++ /dev/null @@ -1,34 +0,0 @@ -/* - * @name Blurple - * @author Core#1034 - * @description Cool blurple theme, uses similar colors to discord but a bit darker. -*/ - -@media (prefers-color-scheme:dark) { - :root { - /* accent colors */ - --keyColor: #5865f2 !important; - --keyColor-rgb: 88, 101, 242 !important; - --systemAccentBG: #5865f2 !important; - --systemAccentBG-pressed: #404eed !important; - --selectionColor: #5865f2 !important; - - /* main colors */ - --transparency: #13151957 !important; - --sidebar: #131519 !important; - --footerBG: #131519 !important; - --pageBG: #171a1f !important; - - /* search bar */ - --systemHeaderMaterialSover-default_IC: #131519 !important; - --systemHeaderMaterialSover: #131519 !important; - - /* web-chrome */ - --playerBackground: #131519 !important; - --playerLCDBGFill: #131519 !important; - - /* up-next */ - --systemToolbarTitlebarMaterialSover-inactive: #131519 !important; - --systemToolbarTitlebarMaterialSover: rgba(19, 21, 25, 0.8) !important; - } -} \ No newline at end of file diff --git a/oldshit/resources/themes/dracula.css b/oldshit/resources/themes/dracula.css deleted file mode 100644 index 812cf02f..00000000 --- a/oldshit/resources/themes/dracula.css +++ /dev/null @@ -1,48 +0,0 @@ -/* Dracula theme by zenorocha - * converted by floookay - * fixed up a bit by cryptofyre - * - * Background #282a36 - * Current Line #44475a - * Foreground #f8f8f2 - * Comment #6272a4 - * Cyan #8be9fd - * Green #50fa7b - * Orange #ffb86c - * Pink #ff79c6 - * Purple #bd93f9 - * Red #ff5555 - * Yellow #f1fa8c -*/ - -@media (prefers-color-scheme:dark) { - :root { - --primaryColor: #bd93f9 !important; - --sidebar: #21222c !important; - --transparency: #21222c18 !important; - --footerBG: #44475a !important; - --pageBG: #282a36 !important; - --playerBackground: #21222c !important; - --playerLCDBGFill: #44475a !important; - --playerVolumeIconFill: #6272a4 !important; - --systemGreen: #50fa7b !important; - --systemRed: #ff5555 !important; - --lovedBGColor: #ff79c6 !important; - - --modalBGColor: #282a36 !important; - --systemHeaderMaterialSover: #282a36 !important; - --systemPrimary: #f8f8f2 !important; - --systemSecondary: #6272a4 !important; - --systemQuaternary: #44475a !important; - --selectionColor: #bd93f9 !important; - - --systemHeaderMaterialSoverIncreaseContrast: #282a36 !important; - --segmentedControlSelectedBG: #44475a !important; - --modalBGHeaderColor: #21222c !important; - --tracklistHoverColor: #44475a !important; - --sidebarSelectedState: #44475a !important; - - --playerPlatterButtonBGFill: #bd93f9 !important; - --playerPlatterButtonIconFill: #f8f8f2 !important; - } -} diff --git a/oldshit/resources/themes/jungle.css b/oldshit/resources/themes/jungle.css deleted file mode 100644 index 6232f3ff..00000000 --- a/oldshit/resources/themes/jungle.css +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @name Jungle - * @author devilAPI#0361 - * @description Jungle Theme -*/ - -@media (prefers-color-scheme:dark) { - :root { - --primaryColor: #D8E4FF !important; - --primaryColor-rgb: 216, 228, 255 !important; - --sidebar: #00120 !important; - --transparency: #00120b18 !important; - --footerBG: #24423E !important; - --pageBG: #00120B !important; - --pageBG-rgb: rgba(0, 18, 11, 0.1) !important; - --playerBackground: #24423E !important; - --playerLCDBGFill: #24423E !important; - - --modalBGColor: var(--pageBG) !important; - --systemHeaderMaterialSover: var(--pageBG) !important; - --systemQuaternary: var(--pageBG-rgb) !important; - --selectionColor: var(--primaryColor) !important; - } -} \ No newline at end of file diff --git a/oldshit/resources/themes/nord.css b/oldshit/resources/themes/nord.css deleted file mode 100644 index be9d993b..00000000 --- a/oldshit/resources/themes/nord.css +++ /dev/null @@ -1,84 +0,0 @@ -/* Nord theme: https://www.nordtheme.com - * Base CSS from: floookay's Dracular theme - */ - -@media (prefers-color-scheme:dark) { - :root { - - /* accent colors */ - --keyColor: #88c0d0 !important; - --keyColor-rgb: 136, 192, 208 !important; - --systemAccentBG: #88c0d0 !important; - --systemAccentBG-pressed: #81a1c1 !important; - --selectionColor: #81a1c1 !important; - - /*everything else*/ - --primaryColor: #88C0D0 !important; - --sidebar: #3B4252 !important; - --transparency: #3b425202 !important; - --footerBG: #434C5E !important; - --pageBG: #2E3440 !important; - --playerBackground: #3B4252 !important; - --playerLCDBGFill: #434C5E !important; - --playerVolumeIconFill: #88C0D0 !important; - --systemGreen: #A3BE8C !important; - --systemRed: #BF616A !important; - --lovedBGColor: #B48EAD !important; - --systemVibrantTextPrimary: #ECEFF4 !important; - --systemVibrantTextTertiary: #ECEFF4 !important; - --modalBGColor: #2E3440 !important; - --systemHeaderMaterialSover: #2E3440 !important; - --systemPrimary: #ECEFF4 !important; - --systemSecondary: #ECEFF4 !important; - --systemQuaternary: #434C5E !important; - --selectionColor: #88C0D0 !important; - --systemHeaderMaterialSoverIncreaseContrast: #2E3440 !important; - --segmentedControlSelectedBG: #434C5E !important; - --modalBGHeaderColor: #3B4252 !important; - --tracklistHoverColor: #434C5E !important; - --sidebarSelectedState: #434C5E !important; - --playerPlatterButtonBGFill: #88C0D0 !important; - --playerPlatterButtonIconFill: #ECEFF4 !important; - --primaryColor-rgb: transparent !important; - --playerVolumeFill: #88C0D0 !important; - --systemStandardThickMaterialSover: #3B4252 !important; - --systemSecondary-vibrantText: #D8DEE9 !important; - --systemPrimary-vibrantText: #ECEFF4 !important; - --contextMenuBorderColor: #2E3440 !important; - --systemTertiary-vibrant: #2E3440 !important; - } - - body > div { - color: #ECEFF4 !important; - } - - .dt-search-box__input { - border-color: #88C0D0 !important; - } - - .web-navigation__header-button:hover, - .web-navigation__header-text { - color: #ECEFF4 !important; - opacity: 1.0 !important; - } - - .songs-list__col--heart-and-star { - background-color: transparent !important; - } - - .media-artwork-v2--error, - .media-artwork-v2--error, - .media-artwork-v2__image, - .media-artwork-v2--feature-recommended, - .media-artwork-v2--feature-recommended - .media-artwork-v2__image, - .media-artwork-v2:not(.media-artwork-v2--downloaded), - .media-artwork-v2:not(.media-artwork-v2--downloaded) - .media-artwork-v2__image { - background-color: transparent !important; - } - - ::placeholder { - color: #ECEFF4 !important; - } -} diff --git a/oldshit/resources/themes/oled.css b/oldshit/resources/themes/oled.css deleted file mode 100644 index 51fff644..00000000 --- a/oldshit/resources/themes/oled.css +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @name Oled Black - * @author cryptofyre - * @description Sexy oled black theme -*/ - -@media (prefers-color-scheme: dark) { - :root { - --transparency: #0f0f0f10 !important; - --sidebar: #0c0c0c !important; - --pageBG: rgb(0, 0, 0) !important; - --playerBackground: #131313 !important; - } - - .dt-search-box__input { - background-color: #00000013 !important; - } -} \ No newline at end of file diff --git a/oldshit/resources/themes/spotify.css b/oldshit/resources/themes/spotify.css deleted file mode 100644 index 2a3158af..00000000 --- a/oldshit/resources/themes/spotify.css +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @name Spotify - * @author devilAPI#0361 (Upgraded by Core#1034) - * @description Spotify Theme -*/ - -@media (prefers-color-scheme:dark) { - :root { - /* accent colors */ - --keyColor: #1DB954 !important; - --keyColor-rgb: 30, 215, 96 !important; - --systemAccentBG: #1DB954 !important; - --systemAccentBG-pressed: #15853c !important; - --selectionColor: #1DB954 !important; - - /* main colors */ - --transparency: #0c0c0c57 !important; - --sidebar: #000000 !important; - --footerBG: #121212 !important; - --pageBG: #121212 !important; - - /* search bar */ - --systemHeaderMaterialSover-default_IC: #121212 !important; - --systemHeaderMaterialSover: #121212 !important; - - /* web-chrome */ - --playerBackground: #121212 !important; - --playerLCDBGFill: #121212 !important; - - /* up-next */ - --systemToolbarTitlebarMaterialSover-inactive: #121212 !important; - --systemToolbarTitlebarMaterialSover: rgba(25, 20, 20, 0.8) !important; - } -} \ No newline at end of file diff --git a/oldshit/resources/web-remote/ameframework.css b/oldshit/resources/web-remote/ameframework.css deleted file mode 100644 index a7b524a3..00000000 --- a/oldshit/resources/web-remote/ameframework.css +++ /dev/null @@ -1,1039 +0,0 @@ -/* Simple CSS framework for Apple Music Electron */ - -.md-labeltext { - font-size: 14px; - text-transform: uppercase; - opacity: 0.75; - font-weight: 500; -} - -.md-option-container { - border-radius: 10px; - overflow: hidden; -} - -.md-option-line { - display: flex; - width: 100%; - padding: 14px; - background: var(--opaquePageBGColor); - font-size: 0.85em; -} - -.md-option-segment.md-option-segment_auto { - width: auto; -} - -.md-option-container .md-option-line:not(:last-child) { - border-bottom: 1px solid rgb(0 0 0 / 15%); -} - -input[type="range"].md-slider { - -webkit-appearance: none; - height: 7px; - background: rgba(255, 255, 255, 0.6); - border-radius: 5px; - background-size: 70% 100%; - background-repeat: no-repeat; -} - -input[type="range"].md-slider::-webkit-slider-thumb { - -webkit-appearance: none; - height: 20px; - width: 20px; - border-radius: 50%; - background: rgb(255 255 255); - cursor: ew-resize; - box-shadow: 0 0 2px 0 #555; -} - -input[type=range].md-slider::-webkit-slider-runnable-track { - -webkit-appearance: none; - box-shadow: none; - border: none; - background: transparent; -} - -.md-option-segment { - width: 100%; - display: flex; - justify-content: center; - flex-direction: column; -} - -.md-h1 { - font-size: 3em; - text-align: center; -} - -.md-header { - padding: 16px; -} - -.md-header-title { - padding: 18px; - font-weight: 600; - font-size: 16px; - height: 55px; - background: var(--opaquePageBGColor); - border-bottom: 1px solid rgb(0 0 0 / 15%); -} - -.md-footer { - padding: 16px; - text-align: center; -} - - -.md-close-btn { - -webkit-mask-image: url("ameres://icons/webui/close.svg"); - -webkit-mask-repeat: no-repeat; - -webkit-mask-position: center; - background-color: white; - opacity: 0.75; - -webkit-mask-size: contain; - height: 18px; - width: 18px; -} - -.md-btn { - background: rgba(100, 100, 100, 0.5); - padding: 8px 16px; - border-radius: 4px; - font-size: 15px; - border: 1px solid rgb(100 100 100 / 35%); - box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.3), 0px 1px 1px rgba(0, 0, 0, 0.4); -} - -.md-btn.md-btn-block { - display: block; -} - -.md-btn:active { - filter: brightness(75%); -} - -.md-select { - padding: 5px 10px; - font-size: 1em; - font-family: inherit; - border-radius: 4px; - border: 1px solid rgb(100 100 100 / 35%); - box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.3), 0px 1px 1px rgba(0, 0, 0, 0.4); -} - -.md-select:focus { - outline: none; -} - -.md-select > option { - font-size: 1em; - font-family: inherit; - padding: 8px 16px; -} - -.md-btn.md-btn-primary { - background: var(--keyColor); - color: white; -} - -.md-transparent { - background: transparent; -} - -.md-container { - display: flex; - flex-direction: column; - height: 100%; - position: absolute; - top: 0px; - left: 0px; - width: 100%; - padding: 32px; -} - -.md-container_panel { - padding: 0px; -} - -.md-body { - height: 100%; - padding: 16px; - font-size: 1.25em; -} - -@media (prefers-color-scheme: light) { - .md-btn { - background: rgb(255 255 255); - box-shadow: rgb(0 0 0 / 10%) 0px 0px 1px, rgb(0 0 0 / 20%) 0px 1px 1px; - border: 1px solid rgb(0 0 0 / 15%); - } - - .md-close-btn { - background-color: #000; - } -} - -/* Vue transitions */ -.fade_simple-enter-active, .fade_simple-leave-active { - transition: all .5s; -} - -.fade_simple-enter, .fade_simple-leave-to { - opacity: 0; -} - -.fade-enter-active, .fade-leave-active { - transition: all .5s; -} - -.fade-enter, .fade-leave-to { - opacity: 0; - transform: scale(0.95); -} - -/* CSS Grids */ - -.container, -.container-fluid, -.container-xxl, -.container-xl, -.container-lg, -.container-md, -.container-sm { - width: 100%; - padding-right: var(--bs-gutter-x, 0.75rem); - padding-left: var(--bs-gutter-x, 0.75rem); - margin-right: auto; - margin-left: auto; -} - -.row { - --bs-gutter-x: 1.5rem; - --bs-gutter-y: 0; - display: flex; - flex-wrap: wrap; - margin-top: calc(-1 * var(--bs-gutter-y)); - margin-right: calc(-0.5 * var(--bs-gutter-x)); - margin-left: calc(-0.5 * var(--bs-gutter-x)); -} - -.row > * { - box-sizing: border-box; - flex-shrink: 0; - width: 100%; - max-width: 100%; - padding-right: calc(var(--bs-gutter-x) * 0.5); - padding-left: calc(var(--bs-gutter-x) * 0.5); - margin-top: var(--bs-gutter-y); -} - -.col { - flex: 1 0 0%; -} - -.row-cols-auto > * { - flex: 0 0 auto; - width: auto; -} - -.row-cols-1 > * { - flex: 0 0 auto; - width: 100%; -} - -.row-cols-2 > * { - flex: 0 0 auto; - width: 50%; -} - -.row-cols-3 > * { - flex: 0 0 auto; - width: 33.3333333333%; -} - -.row-cols-4 > * { - flex: 0 0 auto; - width: 25%; -} - -.row-cols-5 > * { - flex: 0 0 auto; - width: 20%; -} - -.row-cols-6 > * { - flex: 0 0 auto; - width: 16.6666666667%; -} - -.col-auto { - flex: 0 0 auto; - width: auto; -} - -.col-1 { - flex: 0 0 auto; - width: 8.33333333%; -} - -.col-2 { - flex: 0 0 auto; - width: 16.66666667%; -} - -.col-3 { - flex: 0 0 auto; - width: 25%; -} - -.col-4 { - flex: 0 0 auto; - width: 33.33333333%; -} - -.col-5 { - flex: 0 0 auto; - width: 41.66666667%; -} - -.col-6 { - flex: 0 0 auto; - width: 50%; -} - -.col-7 { - flex: 0 0 auto; - width: 58.33333333%; -} - -.col-8 { - flex: 0 0 auto; - width: 66.66666667%; -} - -.col-9 { - flex: 0 0 auto; - width: 75%; -} - -.col-10 { - flex: 0 0 auto; - width: 83.33333333%; -} - -.col-11 { - flex: 0 0 auto; - width: 91.66666667%; -} - -.col-12 { - flex: 0 0 auto; - width: 100%; -} - -.offset-1 { - margin-left: 8.33333333%; -} - -.offset-2 { - margin-left: 16.66666667%; -} - -.offset-3 { - margin-left: 25%; -} - -.offset-4 { - margin-left: 33.33333333%; -} - -.offset-5 { - margin-left: 41.66666667%; -} - -.offset-6 { - margin-left: 50%; -} - -.offset-7 { - margin-left: 58.33333333%; -} - -.offset-8 { - margin-left: 66.66666667%; -} - -.offset-9 { - margin-left: 75%; -} - -.offset-10 { - margin-left: 83.33333333%; -} - -.offset-11 { - margin-left: 91.66666667%; -} - -.g-0, -.gx-0 { - --bs-gutter-x: 0; -} - -.g-0, -.gy-0 { - --bs-gutter-y: 0; -} - -.g-1, -.gx-1 { - --bs-gutter-x: 0.25rem; -} - -.g-1, -.gy-1 { - --bs-gutter-y: 0.25rem; -} - -.g-2, -.gx-2 { - --bs-gutter-x: 0.5rem; -} - -.g-2, -.gy-2 { - --bs-gutter-y: 0.5rem; -} - -.g-3, -.gx-3 { - --bs-gutter-x: 1rem; -} - -.g-3, -.gy-3 { - --bs-gutter-y: 1rem; -} - -.g-4, -.gx-4 { - --bs-gutter-x: 1.5rem; -} - -.g-4, -.gy-4 { - --bs-gutter-y: 1.5rem; -} - -.g-5, -.gx-5 { - --bs-gutter-x: 3rem; -} - -.g-5, -.gy-5 { - --bs-gutter-y: 3rem; -} - -.d-inline { - display: inline !important; -} - -.d-inline-block { - display: inline-block !important; -} - -.d-block { - display: block !important; -} - -.d-grid { - display: grid !important; -} - -.d-table { - display: table !important; -} - -.d-table-row { - display: table-row !important; -} - -.d-table-cell { - display: table-cell !important; -} - -.d-flex { - display: flex !important; -} - -.d-inline-flex { - display: inline-flex !important; -} - -.d-none { - display: none !important; -} - -.flex-fill { - flex: 1 1 auto !important; -} - -.flex-row { - flex-direction: row !important; -} - -.flex-column { - flex-direction: column !important; -} - -.flex-row-reverse { - flex-direction: row-reverse !important; -} - -.flex-column-reverse { - flex-direction: column-reverse !important; -} - -.flex-grow-0 { - flex-grow: 0 !important; -} - -.flex-grow-1 { - flex-grow: 1 !important; -} - -.flex-shrink-0 { - flex-shrink: 0 !important; -} - -.flex-shrink-1 { - flex-shrink: 1 !important; -} - -.flex-wrap { - flex-wrap: wrap !important; -} - -.flex-nowrap { - flex-wrap: nowrap !important; -} - -.flex-wrap-reverse { - flex-wrap: wrap-reverse !important; -} - -.justify-content-start { - justify-content: flex-start !important; -} - -.justify-content-end { - justify-content: flex-end !important; -} - -.justify-content-center { - justify-content: center !important; -} - -.justify-content-between { - justify-content: space-between !important; -} - -.justify-content-around { - justify-content: space-around !important; -} - -.justify-content-evenly { - justify-content: space-evenly !important; -} - -.align-items-start { - align-items: flex-start !important; -} - -.align-items-end { - align-items: flex-end !important; -} - -.align-items-center { - align-items: center !important; -} - -.align-items-baseline { - align-items: baseline !important; -} - -.align-items-stretch { - align-items: stretch !important; -} - -.align-content-start { - align-content: flex-start !important; -} - -.align-content-end { - align-content: flex-end !important; -} - -.align-content-center { - align-content: center !important; -} - -.align-content-between { - align-content: space-between !important; -} - -.align-content-around { - align-content: space-around !important; -} - -.align-content-stretch { - align-content: stretch !important; -} - -.align-self-auto { - align-self: auto !important; -} - -.align-self-start { - align-self: flex-start !important; -} - -.align-self-end { - align-self: flex-end !important; -} - -.align-self-center { - align-self: center !important; -} - -.align-self-baseline { - align-self: baseline !important; -} - -.align-self-stretch { - align-self: stretch !important; -} - -.order-first { - order: -1 !important; -} - -.order-0 { - order: 0 !important; -} - -.order-1 { - order: 1 !important; -} - -.order-2 { - order: 2 !important; -} - -.order-3 { - order: 3 !important; -} - -.order-4 { - order: 4 !important; -} - -.order-5 { - order: 5 !important; -} - -.order-last { - order: 6 !important; -} - -.m-0 { - margin: 0 !important; -} - -.m-1 { - margin: 0.25rem !important; -} - -.m-2 { - margin: 0.5rem !important; -} - -.m-3 { - margin: 1rem !important; -} - -.m-4 { - margin: 1.5rem !important; -} - -.m-5 { - margin: 3rem !important; -} - -.m-auto { - margin: auto !important; -} - -.mx-0 { - margin-right: 0 !important; - margin-left: 0 !important; -} - -.mx-1 { - margin-right: 0.25rem !important; - margin-left: 0.25rem !important; -} - -.mx-2 { - margin-right: 0.5rem !important; - margin-left: 0.5rem !important; -} - -.mx-3 { - margin-right: 1rem !important; - margin-left: 1rem !important; -} - -.mx-4 { - margin-right: 1.5rem !important; - margin-left: 1.5rem !important; -} - -.mx-5 { - margin-right: 3rem !important; - margin-left: 3rem !important; -} - -.mx-auto { - margin-right: auto !important; - margin-left: auto !important; -} - -.my-0 { - margin-top: 0 !important; - margin-bottom: 0 !important; -} - -.my-1 { - margin-top: 0.25rem !important; - margin-bottom: 0.25rem !important; -} - -.my-2 { - margin-top: 0.5rem !important; - margin-bottom: 0.5rem !important; -} - -.my-3 { - margin-top: 1rem !important; - margin-bottom: 1rem !important; -} - -.my-4 { - margin-top: 1.5rem !important; - margin-bottom: 1.5rem !important; -} - -.my-5 { - margin-top: 3rem !important; - margin-bottom: 3rem !important; -} - -.my-auto { - margin-top: auto !important; - margin-bottom: auto !important; -} - -.mt-0 { - margin-top: 0 !important; -} - -.mt-1 { - margin-top: 0.25rem !important; -} - -.mt-2 { - margin-top: 0.5rem !important; -} - -.mt-3 { - margin-top: 1rem !important; -} - -.mt-4 { - margin-top: 1.5rem !important; -} - -.mt-5 { - margin-top: 3rem !important; -} - -.mt-auto { - margin-top: auto !important; -} - -.me-0 { - margin-right: 0 !important; -} - -.me-1 { - margin-right: 0.25rem !important; -} - -.me-2 { - margin-right: 0.5rem !important; -} - -.me-3 { - margin-right: 1rem !important; -} - -.me-4 { - margin-right: 1.5rem !important; -} - -.me-5 { - margin-right: 3rem !important; -} - -.me-auto { - margin-right: auto !important; -} - -.mb-0 { - margin-bottom: 0 !important; -} - -.mb-1 { - margin-bottom: 0.25rem !important; -} - -.mb-2 { - margin-bottom: 0.5rem !important; -} - -.mb-3 { - margin-bottom: 1rem !important; -} - -.mb-4 { - margin-bottom: 1.5rem !important; -} - -.mb-5 { - margin-bottom: 3rem !important; -} - -.mb-auto { - margin-bottom: auto !important; -} - -.ms-0 { - margin-left: 0 !important; -} - -.ms-1 { - margin-left: 0.25rem !important; -} - -.ms-2 { - margin-left: 0.5rem !important; -} - -.ms-3 { - margin-left: 1rem !important; -} - -.ms-4 { - margin-left: 1.5rem !important; -} - -.ms-5 { - margin-left: 3rem !important; -} - -.ms-auto { - margin-left: auto !important; -} - -.p-0 { - padding: 0 !important; -} - -.p-1 { - padding: 0.25rem !important; -} - -.p-2 { - padding: 0.5rem !important; -} - -.p-3 { - padding: 1rem !important; -} - -.p-4 { - padding: 1.5rem !important; -} - -.p-5 { - padding: 3rem !important; -} - -.px-0 { - padding-right: 0 !important; - padding-left: 0 !important; -} - -.px-1 { - padding-right: 0.25rem !important; - padding-left: 0.25rem !important; -} - -.px-2 { - padding-right: 0.5rem !important; - padding-left: 0.5rem !important; -} - -.px-3 { - padding-right: 1rem !important; - padding-left: 1rem !important; -} - -.px-4 { - padding-right: 1.5rem !important; - padding-left: 1.5rem !important; -} - -.px-5 { - padding-right: 3rem !important; - padding-left: 3rem !important; -} - -.py-0 { - padding-top: 0 !important; - padding-bottom: 0 !important; -} - -.py-1 { - padding-top: 0.25rem !important; - padding-bottom: 0.25rem !important; -} - -.py-2 { - padding-top: 0.5rem !important; - padding-bottom: 0.5rem !important; -} - -.py-3 { - padding-top: 1rem !important; - padding-bottom: 1rem !important; -} - -.py-4 { - padding-top: 1.5rem !important; - padding-bottom: 1.5rem !important; -} - -.py-5 { - padding-top: 3rem !important; - padding-bottom: 3rem !important; -} - -.pt-0 { - padding-top: 0 !important; -} - -.pt-1 { - padding-top: 0.25rem !important; -} - -.pt-2 { - padding-top: 0.5rem !important; -} - -.pt-3 { - padding-top: 1rem !important; -} - -.pt-4 { - padding-top: 1.5rem !important; -} - -.pt-5 { - padding-top: 3rem !important; -} - -.pe-0 { - padding-right: 0 !important; -} - -.pe-1 { - padding-right: 0.25rem !important; -} - -.pe-2 { - padding-right: 0.5rem !important; -} - -.pe-3 { - padding-right: 1rem !important; -} - -.pe-4 { - padding-right: 1.5rem !important; -} - -.pe-5 { - padding-right: 3rem !important; -} - -.pb-0 { - padding-bottom: 0 !important; -} - -.pb-1 { - padding-bottom: 0.25rem !important; -} - -.pb-2 { - padding-bottom: 0.5rem !important; -} - -.pb-3 { - padding-bottom: 1rem !important; -} - -.pb-4 { - padding-bottom: 1.5rem !important; -} - -.pb-5 { - padding-bottom: 3rem !important; -} - -.ps-0 { - padding-left: 0 !important; -} - -.ps-1 { - padding-left: 0.25rem !important; -} - -.ps-2 { - padding-left: 0.5rem !important; -} - -.ps-3 { - padding-left: 1rem !important; -} - -.ps-4 { - padding-left: 1.5rem !important; -} - -.ps-5 { - padding-left: 3rem !important; -} \ No newline at end of file diff --git a/oldshit/resources/web-remote/assets/Grabber.svg b/oldshit/resources/web-remote/assets/Grabber.svg deleted file mode 100644 index 287eb001..00000000 --- a/oldshit/resources/web-remote/assets/Grabber.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/oldshit/resources/web-remote/assets/infinity.svg b/oldshit/resources/web-remote/assets/infinity.svg deleted file mode 100644 index 4d06c7b8..00000000 --- a/oldshit/resources/web-remote/assets/infinity.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/oldshit/resources/web-remote/icon-192x192.png b/oldshit/resources/web-remote/icon-192x192.png deleted file mode 100644 index 05834da2..00000000 Binary files a/oldshit/resources/web-remote/icon-192x192.png and /dev/null differ diff --git a/oldshit/resources/web-remote/icon-256x256.png b/oldshit/resources/web-remote/icon-256x256.png deleted file mode 100644 index cb75e71b..00000000 Binary files a/oldshit/resources/web-remote/icon-256x256.png and /dev/null differ diff --git a/oldshit/resources/web-remote/icon-384x384.png b/oldshit/resources/web-remote/icon-384x384.png deleted file mode 100644 index 46293e22..00000000 Binary files a/oldshit/resources/web-remote/icon-384x384.png and /dev/null differ diff --git a/oldshit/resources/web-remote/icon-512x512.png b/oldshit/resources/web-remote/icon-512x512.png deleted file mode 100644 index f4a96312..00000000 Binary files a/oldshit/resources/web-remote/icon-512x512.png and /dev/null differ diff --git a/oldshit/resources/web-remote/index.html b/oldshit/resources/web-remote/index.html deleted file mode 100644 index c66c2839..00000000 --- a/oldshit/resources/web-remote/index.html +++ /dev/null @@ -1,862 +0,0 @@ - - - - - - - - Web Remote - - - - - - - - -
    - - - - -
    -
    - -
    -
    -
    - Loading... -
    -
    -

    Connection Interrupted

    - -
    -
    - -
    -
    - - -
    -
    - -
    -
    - -
    - -
    -
    -
    - - - - - - - - \ No newline at end of file diff --git a/oldshit/resources/web-remote/index.js b/oldshit/resources/web-remote/index.js deleted file mode 100644 index 902ba770..00000000 --- a/oldshit/resources/web-remote/index.js +++ /dev/null @@ -1,619 +0,0 @@ -var socket; - -Vue.component('footer-player', { - template: '#footer-player' -}); - -// vue instance -var app = new Vue({ - el: '#app', - data: { - screen: "player", - player: { - currentMediaItem: {}, - songActions: false, - lyrics: {}, - lyricsMediaItem: {}, - lyricsDebug: { - current: 0, - start: 0, - end: 0 - }, - queue: {}, - lowerPanelState: "controls", - userInteraction: false - }, - queue: { - temp: [] - }, - artistPage: { - data: {}, - editorsNotes: false - }, - albumPage: { - data: {}, - editorsNotes: false - }, - search: { - query: "", - results: [], - state: 0, - tab: "all", - searchType: "applemusic", - trackSelect: false, - selected: {}, - queue: {}, - lastPage: "search", - lastY: 0 - }, - lastPage: "player", - connectedState: 0, - url: window.location.hostname, - mode: "default", - // url: "localhost", - }, - methods: { - searchScroll(e) { - this.search.lastY = e.target.scrollTop; - }, - musicKitAPI(method, id, params) { - socket.send( - JSON.stringify({ - action: "musickit-api", - method: method, - id: id, - params: params - }) - ) - }, - resetPlayerUI() { - this.player.lowerPanelState = "controls"; - }, - musicAppVariant() { - if (navigator.userAgent.match(/Android/i)) { - return "Apple Music"; - } else if (navigator.userAgent.match(/iPhone|iPad|iPod/i)) { - return "Music"; - } else { - if (navigator.userAgent.indexOf('Mac') > 0) { - return 'Music'; - } else if (navigator.userAgent.indexOf('Win') > 0) { - return 'Apple Music Electron'; - } else { - return 'Apple Music Electron'; - } - } - }, - checkOrientation() { - // check orientation of device - if (window.innerHeight > window.innerWidth) { - return 'portrait' - } else { - return 'landscape'; - } - }, - checkPlatformMD() { - // check if platfom is desktop or mobile - if (navigator.userAgent.match(/Android/i)) { - return "mobile"; - } else if (navigator.userAgent.match(/iPhone|iPad|iPod/i)) { - return "mobile"; - } else { - if (navigator.userAgent.indexOf('Mac') > 0) { - return 'desktop'; - } else if (navigator.userAgent.indexOf('Win') > 0) { - return 'desktop'; - } else { - return 'desktop'; - } - } - }, - checkPlatform() { - if (navigator.userAgent.match(/Android/i)) { - return "android"; - } else if (navigator.userAgent.match(/iPhone|iPad|iPod/i)) { - return "ios"; - } else { - if (navigator.userAgent.indexOf('Mac') > 0) { - return 'mac'; - } else if (navigator.userAgent.indexOf('Win') > 0) { - return 'win'; - } else { - return 'linux'; - } - } - }, - artworkPlaying() { - if (this.player.currentMediaItem.status) { - return - } else { - return ["paused"] - } - }, - setAutoplay(value) { - socket.send(JSON.stringify({ - "action": "set-autoplay", - "autoplay": value - })); - this.getCurrentMediaItem() - if (value) { - setTimeout(() => { - this.getQueue() - }, 1000) - } else { - this.getQueue() - } - }, - seekTo(time, adjust = true) { - if (adjust) { - time = parseInt(time / 1000) - } - socket.send(JSON.stringify({ - action: "seek", - time: time - })); - }, - setVolume(volume) { - socket.send(JSON.stringify({ - action: "volume", - volume: volume - })); - }, - getQueue() { - socket.send(JSON.stringify({ - action: "get-queue" - })) - }, - play() { - socket.send(JSON.stringify({ - action: "play" - })) - }, - pause() { - socket.send(JSON.stringify({ - action: "pause" - })) - }, - next() { - socket.send(JSON.stringify({ - action: "next" - })) - }, - previous() { - socket.send(JSON.stringify({ - action: "previous" - })) - }, - searchArtist() { - this.search.query = this.player.currentMediaItem.artistName; - this.screen = "search"; - this.searchQuery(); - }, - trackSelect(song) { - this.search.selected = song; - this.search.trackSelect = true - }, - clearSelectedTrack() { - this.search.selected = {} - this.search.trackSelect = false - }, - getArtworkColor(hex) { - return `#${hex}` - }, - playMediaItemById(id, kind = "song") { - socket.send(JSON.stringify({ - action: "play-mediaitem", - id: id, - kind: kind - })) - this.screen = "player"; - }, - playNext(type, id) { - socket.send(JSON.stringify({ - action: "play-next", - type: type, - id: id - })) - }, - playLater(type, id) { - socket.send(JSON.stringify({ - action: "play-later", - type: type, - id: id - })) - }, - searchQuery() { - if (this.search.query.length == 0) { - this.search.state = 0; - return; - } - this.search.state = 1; - var actionType = "search" - if (this.search.searchType == "library") { - actionType = "library-search" - } - socket.send(JSON.stringify({ - "action": actionType, - "term": this.search.query, - "limit": 20 - })) - }, - quickSearch() { - var search = prompt("Search for a song", "") - if (search == null || search == "") { - return - } - - socket.send(JSON.stringify({ - action: "quick-play", - term: search - })) - }, - parseTime(value) { - var minutes = Math.floor(value / 60000); - var seconds = ((value % 60000) / 1000).toFixed(0); - return minutes + ":" + (seconds < 10 ? '0' : '') + seconds; - }, - parseTimeDecimal(value) { - var minutes = Math.floor(value / 60000); - var seconds = ((value % 60000) / 1000).toFixed(0); - return minutes + "." + (seconds < 10 ? '0' : '') + seconds; - }, - hmsToSecondsOnly(str) { - var p = str.split(':'), - s = 0, - m = 1; - - while (p.length > 0) { - s += m * parseInt(p.pop(), 10); - m *= 60; - } - - return s; - }, - getCurrentTime() { - return parseFloat(this.hmsToSecondsOnly(this.parseTime(this.player.currentMediaItem.durationInMillis - this.player.currentMediaItem.remainingTime))); - }, - percentage(partial, full) { - return (100 * partial) / full - }, - getLyricBGStyle(start, end) { - var currentTime = this.getCurrentTime(); - var duration = this.player.currentMediaItem.durationInMillis - var start2 = this.hmsToSecondsOnly(start) - var end2 = this.hmsToSecondsOnly(end) - var currentProgress = ((100 * (currentTime)) / (end2)) - // check if currenttime is between start and end - this.player.lyricsDebug.start = start2 - this.player.lyricsDebug.end = end2 - this.player.lyricsDebug.current = currentTime - if (currentTime >= start2 && currentTime <= end2) { - return { - "--bgSpeed": `${(end2 - start2)}s` - } - } else { - return {} - } - }, - getLyricClass(start, end) { - var currentTime = this.getCurrentTime(); - // check if currenttime is between start and end - if (currentTime >= start && currentTime <= end) { - setTimeout(() => { - if (document.querySelector(".lyric-line.active")) { - document.querySelector(".lyric-line.active").scrollIntoView({ - behavior: "smooth", - block: "center" - }) - } - }, 200) - return "active" - } else { - return "" - } - }, - getAlbumArtUrl(size = 600) { - if (this.player.currentMediaItem.artwork) { - return `url("${this.player.currentMediaItem.artwork.url.replace('{w}', size).replace('{h}', size)}")`; - } else { - return ""; - } - }, - getAlbumArtUrlList(url, size = 64) { - return `url("${url.replace('{w}', size).replace('{h}', size)}")`; - }, - searchTabClass(tab) { - if (tab == this.search.tab) { - return "active"; - } - }, - searchTypeClass(type) { - if (type == this.search.searchType) { - return "active"; - } - }, - getQueuePositionClass(position) { - if (this.player.queue["_position"] == position) { - return ["playing", "passed"] - } else if (this.player.queue["_position"] > position) { - return ["passed"] - } - }, - showSearch(reset = false) { - if(reset) { - this.search.lastPage = "search" - } - switch(this.search.lastPage) { - case "search": - this.screen = "search" - break; - case "album": - this.screen = "album-page" - break; - case "artist": - this.screen = "artist-page" - break; - case "playlist": - this.screen = "playlist-page" - break; - } - }, - showArtistByName(name) { - this.musicKitAPI("search", name, {types: "artists"}) - }, - showAlbum(id) { - this.search.lastPage = "album" - this.screen = "album-page" - this.musicKitAPI("album", id, {}) - }, - showArtist(id) { - this.search.lastPage = "artist" - this.screen = "artist-page" - this.musicKitAPI("artist", id, {include: "songs,playlists,albums"}) - }, - showQueue() { - this.queue.temp = this.player["queue"]["_queueItems"] - this.screen = "queue" - this.getQueue() - }, - queueMove(evt) { - console.log(evt) - console.log(`new: ${evt.moved.newIndex} old: ${evt.moved.oldIndex}`) - this.queue.temp.splice(evt.moved.newIndex, 0, this.queue.temp.splice(evt.moved.oldIndex, 1)[0]) - socket.send(JSON.stringify({ - action: "queue-move", - from: evt.moved.oldIndex, - to: evt.moved.newIndex - })) - this.getQueue() - return true - }, - repeat() { - socket.send(JSON.stringify({ - action: "repeat" - })) - this.getCurrentMediaItem() - }, - shuffle() { - socket.send(JSON.stringify({ - action: "shuffle" - })) - this.getCurrentMediaItem() - }, - setShuffle(val) { - socket.send(JSON.stringify({ - action: "set-shuffle", - shuffle: val - })) - this.getCurrentMediaItem() - }, - getMediaPalette(data) { - var palette = { - '--bgColor': `#${data['artwork']['bgColor']}`, - '--textColor1': `#${data['artwork']['textColor1']}`, - '--textColor2': `#${data['artwork']['textColor2']}`, - '--textColor3': `#${data['artwork']['textColor3']}`, - '--textColor4': `#${data['artwork']['textColor4']}` - } - return palette - }, - playAlbum(id, shuffle = false) { - if(shuffle) { - this.setShuffle(true) - }else{ - this.setShuffle(false) - } - this.playMediaItemById(id, 'album'); - }, - getLyrics() { - socket.send(JSON.stringify({ - action: "get-lyrics", - })) - }, - showLyrics() { - this.getLyrics() - this.screen = "lyrics" - }, - showLyricsInline() { - this.getLyrics() - this.player.lowerPanelState = "lyrics" - }, - parseLyrics() { - var xml = this.stringToXml(this.player.lyricsMediaItem.ttml) - var json = xmlToJson(xml); - this.player.lyrics = json - }, - stringToXml(st) { - // string to xml - var xml = (new DOMParser()).parseFromString(st, "text/xml"); - return xml; - }, - canShowSearchTab(tab) { - if (tab == this.search.tab || this.search.tab == "all") { - return true; - } else { - return false; - } - }, - getCurrentMediaItem() { - socket.send(JSON.stringify({ - action: "get-currentmediaitem" - })) - }, - setStreamerOverlay() { - document.body.classList.add("streamer-overlay") - }, - setMode(mode) { - switch(mode) { - default: - this.screen = "player" - break; - case "miniplayer": - this.screen = "miniplayer" - break; - } - }, - connect() { - let self = this; - this.connectedState = 0; - if (this.url === "") { - this.url = prompt("Host IP", "localhost") - } - socket = new WebSocket(`ws://${this.url}:26369`); - socket.onopen = (e) => { - console.log(e); - console.log('connected'); - app.connectedState = 1; - if(getParameterByName("mode")) { - self.setMode(getParameterByName("mode")) - }else{ - self.setMode("default") - } - self.clearSelectedTrack() - } - - socket.onclose = (e) => { - console.log(e); - console.log('disconnected'); - app.connectedState = 2; - } - - socket.onerror = (e) => { - console.log(e); - console.log('error'); - app.connectedState = 2; - } - - socket.onmessage = (e) => { - const response = JSON.parse(e.data); - switch (response.type) { - default: - console.log(response); - break; - case "musickitapi.search": - self.showArtist(response.data["artists"][0]["id"]); - break; - case "musickitapi.album": - if(self.screen == "album-page") { - self.albumPage.data = response.data - } - break; - case "musickitapi.artist": - if(self.screen == "artist-page") { - self.artistPage.data = response.data - } - break; - case "queue": - self.player.queue = response.data; - self.queue.temp = response.data["_queueItems"]; - self.$forceUpdate() - break; - case "lyrics": - self.player.lyrics = response.data; - self.$forceUpdate() - break; - case "searchResultsLibrary": - self.search.results = response.data; - self.search.state = 2; - break; - case "searchResults": - self.search.results = response.data; - self.search.state = 2; - break; - case "playbackStateUpdate": - if (!self.player.userInteraction) { - self.updatePlaybackState(response.data) - } - break; - } - // console.log(e.data); - } - }, - updatePlaybackState(mediaitem) { - var lyricsDisplayed = this.screen == "lyrics" || this.player.lowerPanelState == "lyrics" - if (this.player.currentMediaItem["isrc"] != mediaitem["isrc"]) { - if (lyricsDisplayed) { - this.getLyrics() - } - if (this.screen == "queue") { - this.getQueue() - } - } - this.player.currentMediaItem = mediaitem - } - }, -}); - -function getParameterByName(name, url) { - if (!url) url = window.location.href; - name = name.replace(/[\[\]]/g, '\\$&'); - var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), - results = regex.exec(url); - if (!results) return null; - if (!results[2]) return ''; - return decodeURIComponent(results[2].replace(/\+/g, ' ')); -} - -function xmlToJson(xml) { - - // Create the return object - var obj = {}; - - if (xml.nodeType == 1) { // element - // do attributes - if (xml.attributes.length > 0) { - obj["@attributes"] = {}; - for (var j = 0; j < xml.attributes.length; j++) { - var attribute = xml.attributes.item(j); - obj["@attributes"][attribute.nodeName] = attribute.nodeValue; - } - } - } else if (xml.nodeType == 3) { // text - obj = xml.nodeValue; - } - - // do children - if (xml.hasChildNodes()) { - for (var i = 0; i < xml.childNodes.length; i++) { - var item = xml.childNodes.item(i); - var nodeName = item.nodeName; - if (typeof (obj[nodeName]) == "undefined") { - obj[nodeName] = xmlToJson(item); - } else { - if (typeof (obj[nodeName].push) == "undefined") { - var old = obj[nodeName]; - obj[nodeName] = []; - obj[nodeName].push(old); - } - obj[nodeName].push(xmlToJson(item)); - } - } - } - return obj; -}; - -window.onresize = function () { - app.resetPlayerUI() -} - -app.connect() \ No newline at end of file diff --git a/oldshit/resources/web-remote/manifest.json b/oldshit/resources/web-remote/manifest.json deleted file mode 100644 index 3e68fce5..00000000 --- a/oldshit/resources/web-remote/manifest.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "theme_color": "#000000", - "background_color": "#000000", - "display": "standalone", - "scope": "/", - "start_url": "/", - "name": "AME Remote", - "short_name": "AME Remote", - "description": "Apple Music Electron Remote", - "icons": [ - { - "src": "/icon-192x192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "/icon-256x256.png", - "sizes": "256x256", - "type": "image/png" - }, - { - "src": "/icon-384x384.png", - "sizes": "384x384", - "type": "image/png" - }, - { - "src": "/icon-512x512.png", - "sizes": "512x512", - "type": "image/png" - } - ] -} \ No newline at end of file diff --git a/oldshit/resources/web-remote/sortable.min.js b/oldshit/resources/web-remote/sortable.min.js deleted file mode 100644 index 7ba6b590..00000000 --- a/oldshit/resources/web-remote/sortable.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! Sortable 1.14.0 - MIT | git://github.com/SortableJS/Sortable.git */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Sortable=e()}(this,function(){"use strict";function e(e,t){var n,o=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)),o}function A(o){for(var t=1;tt.length)&&(e=t.length);for(var n=0,o=new Array(e);n"===e[0]&&(e=e.substring(1)),t))try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return}}function N(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"!==e[0]||t.parentNode===n)&&p(t,e)||o&&t===n)return t}while(t!==n&&(t=(i=t).host&&i!==document&&i.host.nodeType?i.host:i.parentNode))}var i;return null}var g,m=/\s+/g;function I(t,e,n){var o;t&&e&&(t.classList?t.classList[n?"add":"remove"](e):(o=(" "+t.className+" ").replace(m," ").replace(" "+e+" "," "),t.className=(o+(n?" "+e:"")).replace(m," ")))}function P(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];o[e=!(e in o||-1!==e.indexOf("webkit"))?"-webkit-"+e:e]=n+("string"==typeof n?"":"px")}}function v(t,e){var n="";if("string"==typeof t)n=t;else do{var o=P(t,"transform")}while(o&&"none"!==o&&(n=o+" "+n),!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function b(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i=n.left-e&&i<=n.right+e,e=r>=n.top-e&&r<=n.bottom+e;return o&&e?a=t:void 0}}),a);if(e){var n,o={};for(n in t)t.hasOwnProperty(n)&&(o[n]=t[n]);o.target=o.rootEl=e,o.preventDefault=void 0,o.stopPropagation=void 0,e[j]._onDragOver(o)}}var i,r,a}function Yt(t){q&&q.parentNode[j]._isOutsideThisEl(t.target)}function Bt(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=a({},e),t[j]=this;var n,o,i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return It(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Bt.supportPointer&&"PointerEvent"in window&&!u,emptyInsertThreshold:5};for(n in K.initializePlugins(this,t,i),i)n in e||(e[n]=i[n]);for(o in Pt(e),this)"_"===o.charAt(0)&&"function"==typeof this[o]&&(this[o]=this[o].bind(this));this.nativeDraggable=!e.forceFallback&&At,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?h(t,"pointerdown",this._onTapStart):(h(t,"mousedown",this._onTapStart),h(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(h(t,"dragover",this),h(t,"dragenter",this)),Et.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),a(this,x())}function Ft(t,e,n,o,i,r,a,l){var s,c,u=t[j],d=u.options.onMove;return!window.CustomEvent||y||w?(s=document.createEvent("Event")).initEvent("move",!0,!0):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=e,s.from=t,s.dragged=n,s.draggedRect=o,s.related=i||e,s.relatedRect=r||k(e),s.willInsertAfter=l,s.originalEvent=a,t.dispatchEvent(s),c=d?d.call(u,s,a):c}function jt(t){t.draggable=!1}function Ht(){Ct=!1}function Lt(t){return setTimeout(t,0)}function Kt(t){return clearTimeout(t)}Bt.prototype={constructor:Bt,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(gt=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,q):this.options.direction},_onTapStart:function(e){if(e.cancelable){var n=this,o=this.el,t=this.options,i=t.preventOnFilter,r=e.type,a=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,l=(a||e).target,s=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,c=t.filter;if(!function(t){Tt.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&Tt.push(o)}}(o),!q&&!(/mousedown|pointerdown/.test(r)&&0!==e.button||t.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!u||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=N(l,t.draggable,o,!1))&&l.animated||J===l)){if(nt=B(l),it=B(l,t.draggable),"function"==typeof c){if(c.call(this,e,l,this))return U({sortable:n,rootEl:s,name:"filter",targetEl:l,toEl:o,fromEl:o}),z("filter",n,{evt:e}),void(i&&e.cancelable&&e.preventDefault())}else if(c=c&&c.split(",").some(function(t){if(t=N(s,t.trim(),o,!1))return U({sortable:n,rootEl:t,name:"filter",targetEl:l,fromEl:o,toEl:o}),z("filter",n,{evt:e}),!0}))return void(i&&e.cancelable&&e.preventDefault());t.handle&&!N(s,t.handle,o,!1)||this._prepareDragStart(e,a,l)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,a=i.options,l=r.ownerDocument;n&&!q&&n.parentNode===r&&(o=k(n),$=r,V=(q=n).parentNode,Q=q.nextSibling,J=n,at=a.group,st={target:Bt.dragged=q,clientX:(e||t).clientX,clientY:(e||t).clientY},ht=st.clientX-o.left,ft=st.clientY-o.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,q.style["will-change"]="all",o=function(){z("delayEnded",i,{evt:t}),Bt.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!s&&i.nativeDraggable&&(q.draggable=!0),i._triggerDragStart(t,e),U({sortable:i,name:"choose",originalEvent:t}),I(q,a.chosenClass,!0))},a.ignore.split(",").forEach(function(t){b(q,t.trim(),jt)}),h(l,"dragover",Xt),h(l,"mousemove",Xt),h(l,"touchmove",Xt),h(l,"mouseup",i._onDrop),h(l,"touchend",i._onDrop),h(l,"touchcancel",i._onDrop),s&&this.nativeDraggable&&(this.options.touchStartThreshold=4,q.draggable=!0),z("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(w||y)?o():Bt.eventCanceled?this._onDrop():(h(l,"mouseup",i._disableDelayedDrag),h(l,"touchend",i._disableDelayedDrag),h(l,"touchcancel",i._disableDelayedDrag),h(l,"mousemove",i._delayedDragTouchMoveHandler),h(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&h(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,a.delay)))},_delayedDragTouchMoveHandler:function(t){t=t.touches?t.touches[0]:t;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){q&&jt(q),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;f(t,"mouseup",this._disableDelayedDrag),f(t,"touchend",this._disableDelayedDrag),f(t,"touchcancel",this._disableDelayedDrag),f(t,"mousemove",this._delayedDragTouchMoveHandler),f(t,"touchmove",this._delayedDragTouchMoveHandler),f(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?h(document,"pointermove",this._onTouchMove):h(document,e?"touchmove":"mousemove",this._onTouchMove):(h(q,"dragend",this),h($,"dragstart",this._onDragStart));try{document.selection?Lt(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){var n;yt=!1,$&&q?(z("dragStarted",this,{evt:e}),this.nativeDraggable&&h(document,"dragover",Yt),n=this.options,t||I(q,n.dragClass,!1),I(q,n.ghostClass,!0),Bt.active=this,t&&this._appendGhost(),U({sortable:this,name:"start",originalEvent:e})):this._nulling()},_emulateDragOver:function(){if(ct){this._lastX=ct.clientX,this._lastY=ct.clientY,kt();for(var t=document.elementFromPoint(ct.clientX,ct.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(ct.clientX,ct.clientY))!==e;)e=t;if(q.parentNode[j]._isOutsideThisEl(t),e)do{if(e[j])if(e[j]._onDragOver({clientX:ct.clientX,clientY:ct.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}while(e=(t=e).parentNode);Rt()}},_onTouchMove:function(t){if(st){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=Z&&v(Z,!0),a=Z&&r&&r.a,l=Z&&r&&r.d,e=Ot&&bt&&E(bt),a=(i.clientX-st.clientX+o.x)/(a||1)+(e?e[0]-_t[0]:0)/(a||1),l=(i.clientY-st.clientY+o.y)/(l||1)+(e?e[1]-_t[1]:0)/(l||1);if(!Bt.active&&!yt){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))n.right+10||t.clientX<=n.right&&t.clientY>n.bottom&&t.clientX>=n.left:t.clientX>n.right&&t.clientY>n.top||t.clientX<=n.right&&t.clientY>n.bottom+10}(n,r,this)&&!g.animated){if(g===q)return O(!1);if((l=g&&a===n.target?g:l)&&(w=k(l)),!1!==Ft($,a,q,o,l,w,n,!!l))return x(),a.appendChild(q),V=a,M(),O(!0)}else if(g&&function(t,e,n){n=k(X(n.el,0,n.options,!0));return e?t.clientX.notes-preview { - height: 60px; - overflow: hidden; - -webkit-mask-image: -webkit-gradient(linear, left 95%, left bottom, from(rgba(0, 0, 0, 1)), to(rgba(0, 0, 0, 0))); -} - -.albumpage-album-notes>.notes-more { - position: absolute; - bottom:0px; - right:0px; - appearance: none; - background: transparent; - color: var(--keyColor); - font-weight: bold; - font-family: inherit; - text-transform: uppercase; - height: 100%; - width: 100%; - padding: 0px; - border:0px; - display:flex; - justify-content: flex-end; - align-items: flex-end; -} - -.album-page-fullnotes-body { - padding: 22px; - font-size: 17px; - overflow-y: scroll; - overflow-y: overlay; -} - -.albumpage-album-name { - margin: 0 auto; - font-size: 17px; - width: 100%; - text-align: center; - font-weight: 600; -} - -.albumpage-artist-name { - margin: 0 auto; - width: 100%; - text-align: center; - font-size: 18px; - color: var(--keyColor); -} - -.albumpage-artist-name:hover { - text-decoration: underline; - cursor: pointer; -} - -.artist-header { - height: 400px; - width: 100%; - margin: 12px auto; - display: flex; - justify-content: center; - align-items: center; - padding: 12px; - flex-direction: column; - background: rgb(0 0 0 / 40%); -} - -.artist-header .artist-header-portrait { - height: 200px; - width: 200px; - background: var(--artwork); - background-size: contain; - background-repeat: no-repeat; - border-radius: 100%; - box-shadow: var(--mediaItemShadow); -} - -.search-body { - position: absolute; - width: 100%; - height: 100%; - padding-top: 220px; -} - -.artist-body { - position: absolute; - width: 100%; - height: 100%; -} - -.search-tab { - background: rgb(20 20 20 / 0.85); - border-radius: 50px; - color: white; - border: 0px; - box-shadow: unset; - font-family: inherit; - padding: 8px 16px; - font-size: 14px; - font-weight: 500; -} - -.search-tab.active { - background: var(--keyColor); -} - -.context-menu { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: rgba(0, 0, 0, 0.5); - z-index: 100; -} - -.context-menu .context-menu-item { - --borderRadius: 10px; - appearance: none; - width: 100%; - display: block; - font-size: 1.10em; - padding: 18px 20px; - font-family: inherit; - border: 0px; - font-weight: 600; - border-radius: 0px; - border-bottom: 1px solid rgb(200 200 200 / 15%); - margin: 0px; - background: rgb(60 60 60 / 80%); - backdrop-filter: blur(16px) saturate(180%); - -webkit-backdrop-filter: blur(16px) saturate(180%); - color: #ccc; -} - -.context-menu .context-menu-item:hover { - cursor: pointer; -} - -.context-menu .context-menu-item:active { - filter: brightness(75%); -} - -.context-menu .context-menu-item:first-child { - border-radius: 0px; - border-top-left-radius: var(--borderRadius); - border-top-right-radius: var(--borderRadius); -} - -.context-menu .context-menu-item:last-child { - border-radius: 0px; - border-bottom-left-radius: var(--borderRadius); - border-bottom-right-radius: var(--borderRadius); - border-bottom: 0px; -} - -.context-menu .context-menu-item:only-child { - border-radius: var(--borderRadius); -} - -.context-menu .context-menu-item.context-menu-item--left { - text-align: left; -} - -.context-menu .context-menu-body { - display: flex; - align-items: flex-end; - justify-content: flex-end; - flex-direction: column; -} - -.lyric-body { - -webkit-mask-image: -webkit-gradient(linear, left 95%, left bottom, from(rgba(0, 0, 0, 1)), to(rgba(0, 0, 0, 0))); - overflow-y: scroll; - overflow-x: hidden; - display:flex; - flex-flow: column; -} - -.lyric-line { - --bgSpeed: 1s; - appearance: none; - color: white; - font-size: 2rem; - transform: scale(0.8); - transform-origin: left center; - transition: transform 0.2s var(--appleEase); - opacity: 0.75; - width: auto; - display: inline-block; - margin: 10px; - margin-left: 5%; - margin-right: 0px; -} - -.lyric-line:hover { - cursor: pointer; -} - -.lyric-line:hover::after { - content: ' '; - width: 100%; - height: 100%; - position: absolute; - top: 0; - left: 0; - transform: scale(1.06); - background: rgba(200, 200, 200, 0.1); - pointer-events: none; - border-radius: 10px; - -webkit-backface-visibility: hidden; -} - -.lyric-line.active { - --bgSpeed: 1s; - opacity: 1; - transform: scale(1); - /*background: var(--keyColor);*/ - transition: transform 0.2s var(--appleEase); -} - -.lyric-line:not(.active) { - filter: blur(1px) -} - -.lyricWaiting { - margin-top: 8px; - display: none; -} - -.lyric-line.active .lyricWaiting { - display: inline-flex; - animation: lyricWaitingLine 6s cubic-bezier(0.42, 0, 0.58, 1) infinite; -} - - -.lyric-line.active .lyricWaiting > div { - width: 10px; - height: 10px; - background: white; - border-radius: 50%; - margin: 3px; -} - -@keyframes lyricWaitingLine { - 0% { - opacity: 0; - transform: scale(0.85); - } - 50% { - opacity: 1; - transform: scale(1); - } - 100% { - opacity: 0; - transform: scale(0.85); - } -} - - -.lyric-line2:before { - background: var(--keyColor); - content: ''; - width: 0%; - height: 6px; - position: absolute; - bottom: -8px; - left: 0; - border-radius: 10px; - z-index: -1; - transition: width var(--bgSpeed); -} - -.lyric-line2.active:before { - width: 100%; - transition: width var(--bgSpeed); -} - -.player_top { - height: 100%; -} - -.miniplayer-main { - width: 100%; - height: 100%; - position: relative; -} - -.miniplayer-main .miniplayer-controls { - position: absolute; - bottom: 0px; - left: 0px; - background:rgb(0 0 0 / 50%); - height: 80px; - z-index: 2; - width:100%; - display:flex; - justify-content: center; - align-items: center; - backdrop-filter: blur(16px) saturate(180%); -} - -.miniplayer-main .miniplayer-draggable { - position: absolute; - top: 0; - left: 0; - height: calc(100% - 80px); - width: 100%; -} - -.miniplayer-main .miniplayer-controls .md-btn { - width: 40px; - background-size: 16px; -} - -.media-artwork--miniplayer { - width: 100%; - height: 100%; - background: var(--artwork); - background-size: cover; - background-position: center; - background-repeat: no-repeat; -} - -/* Small Screen */ -@media only screen and (max-height: 668px) { - #app { - zoom: 0.8; - } -} - -/* Big Screen */ - - -@media only screen and (orientation: landscape) { - #app { - max-width: 100%; - } - - .album-body-container { - display: flex; - flex-wrap: wrap; - } - - .album-body-container>.md-header { - min-width: 300px; - flex: 0 0 auto; - /*! max-width: 300px; */ - margin: 0 auto; - } - - .artist-body { - position: relative; - /*! flex: 0 0 auto; */ - } - - .player-panel { - display: flex; - flex-direction: row; - } - - .player_top { - width: 100%; - } - - .player_bottom { - display: flex; - justify-content: center; - align-items: center; - flex-direction: column; - width: 100%; - margin: 0 auto; - } - - .media-artwork { - width: 45vw; - height: 45vw; - margin: 60px; - } - - .player-song-title { - font-size: 2em; - } - - .player-song-artist { - font-size: 1.25em; - } - - .search-panel { - } - - .md-footer { - width: 100%; - } -} - - -/* Transitions */ -.wpfade-enter-active, -.wpfade-leave-active { - transition: opacity .1s var(--appleEase); -} - -.wpfade-enter, -.wpfade-leave-to { - opacity: 0; -} \ No newline at end of file diff --git a/oldshit/resources/web-remote/vue.js b/oldshit/resources/web-remote/vue.js deleted file mode 100644 index d998ff72..00000000 --- a/oldshit/resources/web-remote/vue.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! - * Vue.js v2.6.14 - * (c) 2014-2021 Evan You - * Released under the MIT License. - */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Vue=t()}(this,function(){"use strict";var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function r(e){return!0===e}function i(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function o(e){return null!==e&&"object"==typeof e}var a=Object.prototype.toString;function s(e){return"[object Object]"===a.call(e)}function c(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function u(e){return n(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function l(e){return null==e?"":Array.isArray(e)||s(e)&&e.toString===a?JSON.stringify(e,null,2):String(e)}function f(e){var t=parseFloat(e);return isNaN(t)?e:t}function p(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}var m=Object.prototype.hasOwnProperty;function y(e,t){return m.call(e,t)}function g(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var _=/-(\w)/g,b=g(function(e){return e.replace(_,function(e,t){return t?t.toUpperCase():""})}),$=g(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),w=/\B([A-Z])/g,C=g(function(e){return e.replace(w,"-$1").toLowerCase()});var x=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function k(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function A(e,t){for(var n in t)e[n]=t[n];return e}function O(e){for(var t={},n=0;n0,Z=J&&J.indexOf("edge/")>0,G=(J&&J.indexOf("android"),J&&/iphone|ipad|ipod|ios/.test(J)||"ios"===K),X=(J&&/chrome\/\d+/.test(J),J&&/phantomjs/.test(J),J&&J.match(/firefox\/(\d+)/)),Y={}.watch,Q=!1;if(V)try{var ee={};Object.defineProperty(ee,"passive",{get:function(){Q=!0}}),window.addEventListener("test-passive",null,ee)}catch(e){}var te=function(){return void 0===B&&(B=!V&&!z&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),B},ne=V&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function re(e){return"function"==typeof e&&/native code/.test(e.toString())}var ie,oe="undefined"!=typeof Symbol&&re(Symbol)&&"undefined"!=typeof Reflect&&re(Reflect.ownKeys);ie="undefined"!=typeof Set&&re(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ae=S,se=0,ce=function(){this.id=se++,this.subs=[]};ce.prototype.addSub=function(e){this.subs.push(e)},ce.prototype.removeSub=function(e){h(this.subs,e)},ce.prototype.depend=function(){ce.target&&ce.target.addDep(this)},ce.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t-1)if(o&&!y(i,"default"))a=!1;else if(""===a||a===C(e)){var c=Re(String,i.type);(c<0||s0&&(ct((u=e(u,(a||"")+"_"+c))[0])&&ct(f)&&(s[l]=he(f.text+u[0].text),u.shift()),s.push.apply(s,u)):i(u)?ct(f)?s[l]=he(f.text+u):""!==u&&s.push(he(u)):ct(u)&&ct(f)?s[l]=he(f.text+u.text):(r(o._isVList)&&n(u.tag)&&t(u.key)&&n(a)&&(u.key="__vlist"+a+"_"+c+"__"),s.push(u)));return s}(e):void 0}function ct(e){return n(e)&&n(e.text)&&!1===e.isComment}function ut(e,t){if(e){for(var n=Object.create(null),r=oe?Reflect.ownKeys(e):Object.keys(e),i=0;i0,a=t?!!t.$stable:!o,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&r&&r!==e&&s===r.$key&&!o&&!r.$hasNormal)return r;for(var c in i={},t)t[c]&&"$"!==c[0]&&(i[c]=vt(n,c,t[c]))}else i={};for(var u in n)u in i||(i[u]=ht(n,u));return t&&Object.isExtensible(t)&&(t._normalized=i),R(i,"$stable",a),R(i,"$key",s),R(i,"$hasNormal",o),i}function vt(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({}),t=(e=e&&"object"==typeof e&&!Array.isArray(e)?[e]:st(e))&&e[0];return e&&(!t||1===e.length&&t.isComment&&!pt(t))?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function ht(e,t){return function(){return e[t]}}function mt(e,t){var r,i,a,s,c;if(Array.isArray(e)||"string"==typeof e)for(r=new Array(e.length),i=0,a=e.length;idocument.createEvent("Event").timeStamp&&(cn=function(){return un.now()})}function ln(){var e,t;for(sn=cn(),on=!0,en.sort(function(e,t){return e.id-t.id}),an=0;anan&&en[n].id>e.id;)n--;en.splice(n+1,0,e)}else en.push(e);rn||(rn=!0,Qe(ln))}}(this)},pn.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user){var n='callback for watcher "'+this.expression+'"';Be(this.cb,this.vm,[e,t],this.vm,n)}else this.cb.call(this.vm,e,t)}}},pn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},pn.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},pn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||h(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var dn={enumerable:!0,configurable:!0,get:S,set:S};function vn(e,t,n){dn.get=function(){return this[t][n]},dn.set=function(e){this[t][n]=e},Object.defineProperty(e,n,dn)}function hn(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&$e(!1);var o=function(o){i.push(o);var a=Ie(o,t,n,e);xe(r,o,a),o in e||vn(e,"_props",o)};for(var a in t)o(a);$e(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]="function"!=typeof t[n]?S:x(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;s(t=e._data="function"==typeof t?function(e,t){le();try{return e.call(t,t)}catch(e){return He(e,t,"data()"),{}}finally{fe()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&y(r,o)||(a=void 0,36!==(a=(o+"").charCodeAt(0))&&95!==a&&vn(e,"_data",o))}var a;Ce(t,!0)}(e):Ce(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=te();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;r||(n[i]=new pn(e,a||S,S,mn)),i in e||yn(e,i,o)}}(e,t.computed),t.watch&&t.watch!==Y&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,"[object RegExp]"===a.call(n)&&e.test(t));var n}function On(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=a.name;s&&!t(s)&&Sn(n,o,r,i)}}}function Sn(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,h(n,t)}!function(t){t.prototype._init=function(t){var n=this;n._uid=$n++,n._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(n,t):n.$options=De(wn(n.constructor),t||{},n),n._renderProxy=n,n._self=n,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(n),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&Wt(e,t)}(n),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,i=r&&r.context;t.$slots=lt(n._renderChildren,i),t.$scopedSlots=e,t._c=function(e,n,r,i){return Ht(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return Ht(t,e,n,r,i,!0)};var o=r&&r.data;xe(t,"$attrs",o&&o.attrs||e,null,!0),xe(t,"$listeners",n._parentListeners||e,null,!0)}(n),Qt(n,"beforeCreate"),function(e){var t=ut(e.$options.inject,e);t&&($e(!1),Object.keys(t).forEach(function(n){xe(e,n,t[n])}),$e(!0))}(n),hn(n),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(n),Qt(n,"created"),n.$options.el&&n.$mount(n.$options.el)}}(Cn),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=ke,e.prototype.$delete=Ae,e.prototype.$watch=function(e,t,n){if(s(t))return bn(this,e,t,n);(n=n||{}).user=!0;var r=new pn(this,e,t,n);if(n.immediate){var i='callback for immediate watcher "'+r.expression+'"';le(),Be(t,this,[r.value],this,i),fe()}return function(){r.teardown()}}}(Cn),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i1?k(t):t;for(var n=k(arguments,1),r='event handler for "'+e+'"',i=0,o=t.length;iparseInt(this.max)&&Sn(e,t[0],t,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)Sn(this.cache,e,this.keys)},mounted:function(){var e=this;this.cacheVNode(),this.$watch("include",function(t){On(e,function(e){return An(t,e)})}),this.$watch("exclude",function(t){On(e,function(e){return!An(t,e)})})},updated:function(){this.cacheVNode()},render:function(){var e=this.$slots.default,t=zt(e),n=t&&t.componentOptions;if(n){var r=kn(n),i=this.include,o=this.exclude;if(i&&(!r||!An(i,r))||o&&r&&An(o,r))return t;var a=this.cache,s=this.keys,c=null==t.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):t.key;a[c]?(t.componentInstance=a[c].componentInstance,h(s,c),s.push(c)):(this.vnodeToCache=t,this.keyToCache=c),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return F}};Object.defineProperty(e,"config",t),e.util={warn:ae,extend:A,mergeOptions:De,defineReactive:xe},e.set=ke,e.delete=Ae,e.nextTick=Qe,e.observable=function(e){return Ce(e),e},e.options=Object.create(null),I.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,A(e.options.components,Nn),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=k(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=De(this.options,e),this}}(e),xn(e),function(e){I.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&s(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}(e)}(Cn),Object.defineProperty(Cn.prototype,"$isServer",{get:te}),Object.defineProperty(Cn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Cn,"FunctionalRenderContext",{value:Et}),Cn.version="2.6.14";var En=p("style,class"),jn=p("input,textarea,option,select,progress"),Dn=function(e,t,n){return"value"===n&&jn(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},Ln=p("contenteditable,draggable,spellcheck"),In=p("events,caret,typing,plaintext-only"),Mn=function(e,t){return Bn(t)||"false"===t?"false":"contenteditable"===e&&In(t)?t:"true"},Fn=p("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),Pn="http://www.w3.org/1999/xlink",Rn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Hn=function(e){return Rn(e)?e.slice(6,e.length):""},Bn=function(e){return null==e||!1===e};function Un(e){for(var t=e.data,r=e,i=e;n(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=Vn(i.data,t));for(;n(r=r.parent);)r&&r.data&&(t=Vn(t,r.data));return function(e,t){if(n(e)||n(t))return zn(e,Kn(t));return""}(t.staticClass,t.class)}function Vn(e,t){return{staticClass:zn(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function zn(e,t){return e?t?e+" "+t:e:t||""}function Kn(e){return Array.isArray(e)?function(e){for(var t,r="",i=0,o=e.length;i-1?mr(e,t,n):Fn(t)?Bn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):Ln(t)?e.setAttribute(t,Mn(t,n)):Rn(t)?Bn(n)?e.removeAttributeNS(Pn,Hn(t)):e.setAttributeNS(Pn,t,n):mr(e,t,n)}function mr(e,t,n){if(Bn(n))e.removeAttribute(t);else{if(q&&!W&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var yr={create:vr,update:vr};function gr(e,r){var i=r.elm,o=r.data,a=e.data;if(!(t(o.staticClass)&&t(o.class)&&(t(a)||t(a.staticClass)&&t(a.class)))){var s=Un(r),c=i._transitionClasses;n(c)&&(s=zn(s,Kn(c))),s!==i._prevClass&&(i.setAttribute("class",s),i._prevClass=s)}}var _r,br,$r,wr,Cr,xr,kr={create:gr,update:gr},Ar=/[\w).+\-_$\]]/;function Or(e){var t,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r=0&&" "===(h=e.charAt(v));v--);h&&Ar.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r-1?{exp:e.slice(0,wr),key:'"'+e.slice(wr+1)+'"'}:{exp:e,key:null};br=e,wr=Cr=xr=0;for(;!zr();)Kr($r=Vr())?qr($r):91===$r&&Jr($r);return{exp:e.slice(0,Cr),key:e.slice(Cr+1,xr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function Vr(){return br.charCodeAt(++wr)}function zr(){return wr>=_r}function Kr(e){return 34===e||39===e}function Jr(e){var t=1;for(Cr=wr;!zr();)if(Kr(e=Vr()))qr(e);else if(91===e&&t++,93===e&&t--,0===t){xr=wr;break}}function qr(e){for(var t=e;!zr()&&(e=Vr())!==t;);}var Wr,Zr="__r",Gr="__c";function Xr(e,t,n){var r=Wr;return function i(){null!==t.apply(null,arguments)&&ei(e,i,n,r)}}var Yr=Ke&&!(X&&Number(X[1])<=53);function Qr(e,t,n,r){if(Yr){var i=sn,o=t;t=o._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=i||e.timeStamp<=0||e.target.ownerDocument!==document)return o.apply(this,arguments)}}Wr.addEventListener(e,t,Q?{capture:n,passive:r}:n)}function ei(e,t,n,r){(r||Wr).removeEventListener(e,t._wrapper||t,n)}function ti(e,r){if(!t(e.data.on)||!t(r.data.on)){var i=r.data.on||{},o=e.data.on||{};Wr=r.elm,function(e){if(n(e[Zr])){var t=q?"change":"input";e[t]=[].concat(e[Zr],e[t]||[]),delete e[Zr]}n(e[Gr])&&(e.change=[].concat(e[Gr],e.change||[]),delete e[Gr])}(i),it(i,o,Qr,ei,Xr,r.context),Wr=void 0}}var ni,ri={create:ti,update:ti};function ii(e,r){if(!t(e.data.domProps)||!t(r.data.domProps)){var i,o,a=r.elm,s=e.data.domProps||{},c=r.data.domProps||{};for(i in n(c.__ob__)&&(c=r.data.domProps=A({},c)),s)i in c||(a[i]="");for(i in c){if(o=c[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i&&"PROGRESS"!==a.tagName){a._value=o;var u=t(o)?"":String(o);oi(a,u)&&(a.value=u)}else if("innerHTML"===i&&Wn(a.tagName)&&t(a.innerHTML)){(ni=ni||document.createElement("div")).innerHTML=""+o+"";for(var l=ni.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}else if(o!==s[i])try{a[i]=o}catch(e){}}}}function oi(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var r=e.value,i=e._vModifiers;if(n(i)){if(i.number)return f(r)!==f(t);if(i.trim)return r.trim()!==t.trim()}return r!==t}(e,t))}var ai={create:ii,update:ii},si=g(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function ci(e){var t=ui(e.style);return e.staticStyle?A(e.staticStyle,t):t}function ui(e){return Array.isArray(e)?O(e):"string"==typeof e?si(e):e}var li,fi=/^--/,pi=/\s*!important$/,di=function(e,t,n){if(fi.test(t))e.style.setProperty(t,n);else if(pi.test(n))e.style.setProperty(C(t),n.replace(pi,""),"important");else{var r=hi(t);if(Array.isArray(n))for(var i=0,o=n.length;i-1?t.split(gi).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function bi(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(gi).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function $i(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&A(t,wi(e.name||"v")),A(t,e),t}return"string"==typeof e?wi(e):void 0}}var wi=g(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),Ci=V&&!W,xi="transition",ki="animation",Ai="transition",Oi="transitionend",Si="animation",Ti="animationend";Ci&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Ai="WebkitTransition",Oi="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Si="WebkitAnimation",Ti="webkitAnimationEnd"));var Ni=V?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Ei(e){Ni(function(){Ni(e)})}function ji(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),_i(e,t))}function Di(e,t){e._transitionClasses&&h(e._transitionClasses,t),bi(e,t)}function Li(e,t,n){var r=Mi(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===xi?Oi:Ti,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c0&&(n=xi,l=a,f=o.length):t===ki?u>0&&(n=ki,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?xi:ki:null)?n===xi?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===xi&&Ii.test(r[Ai+"Property"])}}function Fi(e,t){for(;e.length1}function Vi(e,t){!0!==t.data.show&&Ri(t)}var zi=function(e){var o,a,s={},c=e.modules,u=e.nodeOps;for(o=0;ov?_(e,t(i[y+1])?null:i[y+1].elm,i,d,y,o):d>y&&$(r,p,v)}(p,h,y,o,l):n(y)?(n(e.text)&&u.setTextContent(p,""),_(p,null,y,0,y.length-1,o)):n(h)?$(h,0,h.length-1):n(e.text)&&u.setTextContent(p,""):e.text!==i.text&&u.setTextContent(p,i.text),n(v)&&n(d=v.hook)&&n(d=d.postpatch)&&d(e,i)}}}function k(e,t,i){if(r(i)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o-1,a.selected!==o&&(a.selected=o);else if(E(Zi(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function Wi(e,t){return t.every(function(t){return!E(t,e)})}function Zi(e){return"_value"in e?e._value:e.value}function Gi(e){e.target.composing=!0}function Xi(e){e.target.composing&&(e.target.composing=!1,Yi(e.target,"input"))}function Yi(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Qi(e){return!e.componentInstance||e.data&&e.data.transition?e:Qi(e.componentInstance._vnode)}var eo={model:Ki,show:{bind:function(e,t,n){var r=t.value,i=(n=Qi(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,Ri(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Qi(n)).data&&n.data.transition?(n.data.show=!0,r?Ri(n,function(){e.style.display=e.__vOriginalDisplay}):Hi(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},to={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function no(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?no(zt(t.children)):e}function ro(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[b(o)]=i[o];return t}function io(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var oo=function(e){return e.tag||pt(e)},ao=function(e){return"show"===e.name},so={name:"transition",props:to,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(oo)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var a=no(o);if(!a)return o;if(this._leaving)return io(e,o);var s="__transition-"+this._uid+"-";a.key=null==a.key?a.isComment?s+"comment":s+a.tag:i(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var c=(a.data||(a.data={})).transition=ro(this),u=this._vnode,l=no(u);if(a.data.directives&&a.data.directives.some(ao)&&(a.data.show=!0),l&&l.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(a,l)&&!pt(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=A({},c);if("out-in"===r)return this._leaving=!0,ot(f,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),io(e,o);if("in-out"===r){if(pt(a))return u;var p,d=function(){p()};ot(c,"afterEnter",d),ot(c,"enterCancelled",d),ot(f,"delayLeave",function(e){p=e})}}return o}}},co=A({tag:String,moveClass:String},to);function uo(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function lo(e){e.data.newPos=e.elm.getBoundingClientRect()}function fo(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}delete co.mode;var po={Transition:so,TransitionGroup:{props:co,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=Gt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=ro(this),s=0;s-1?Xn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Xn[e]=/HTMLUnknownElement/.test(t.toString())},A(Cn.options.directives,eo),A(Cn.options.components,po),Cn.prototype.__patch__=V?zi:S,Cn.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=ve),Qt(e,"beforeMount"),r=function(){e._update(e._render(),n)},new pn(e,r,S,{before:function(){e._isMounted&&!e._isDestroyed&&Qt(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,Qt(e,"mounted")),e}(this,e=e&&V?Qn(e):void 0,t)},V&&setTimeout(function(){F.devtools&&ne&&ne.emit("init",Cn)},0);var vo=/\{\{((?:.|\r?\n)+?)\}\}/g,ho=/[-.*+?^${}()|[\]\/\\]/g,mo=g(function(e){var t=e[0].replace(ho,"\\$&"),n=e[1].replace(ho,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")});var yo={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=Pr(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=Fr(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}};var go,_o={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=Pr(e,"style");n&&(e.staticStyle=JSON.stringify(si(n)));var r=Fr(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},bo=function(e){return(go=go||document.createElement("div")).innerHTML=e,go.textContent},$o=p("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),wo=p("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),Co=p("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),xo=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ko=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Ao="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+P.source+"]*",Oo="((?:"+Ao+"\\:)?"+Ao+")",So=new RegExp("^<"+Oo),To=/^\s*(\/?)>/,No=new RegExp("^<\\/"+Oo+"[^>]*>"),Eo=/^]+>/i,jo=/^",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},Fo=/&(?:lt|gt|quot|amp|#39);/g,Po=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,Ro=p("pre,textarea",!0),Ho=function(e,t){return e&&Ro(e)&&"\n"===t[0]};function Bo(e,t){var n=t?Po:Fo;return e.replace(n,function(e){return Mo[e]})}var Uo,Vo,zo,Ko,Jo,qo,Wo,Zo,Go=/^@|^v-on:/,Xo=/^v-|^@|^:|^#/,Yo=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Qo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,ea=/^\(|\)$/g,ta=/^\[.*\]$/,na=/:(.*)$/,ra=/^:|^\.|^v-bind:/,ia=/\.[^.\]]+(?=[^\]]*$)/g,oa=/^v-slot(:|$)|^#/,aa=/[\r\n]/,sa=/[ \f\t\r\n]+/g,ca=g(bo),ua="_empty_";function la(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:ya(t),rawAttrsMap:{},parent:n,children:[]}}function fa(e,t){Uo=t.warn||Tr,qo=t.isPreTag||T,Wo=t.mustUseProp||T,Zo=t.getTagNamespace||T;t.isReservedTag;zo=Nr(t.modules,"transformNode"),Ko=Nr(t.modules,"preTransformNode"),Jo=Nr(t.modules,"postTransformNode"),Vo=t.delimiters;var n,r,i=[],o=!1!==t.preserveWhitespace,a=t.whitespace,s=!1,c=!1;function u(e){if(l(e),s||e.processed||(e=pa(e,t)),i.length||e===n||n.if&&(e.elseif||e.else)&&va(n,{exp:e.elseif,block:e}),r&&!e.forbidden)if(e.elseif||e.else)a=e,(u=function(e){var t=e.length;for(;t--;){if(1===e[t].type)return e[t];e.pop()}}(r.children))&&u.if&&va(u,{exp:a.elseif,block:a});else{if(e.slotScope){var o=e.slotTarget||'"default"';(r.scopedSlots||(r.scopedSlots={}))[o]=e}r.children.push(e),e.parent=r}var a,u;e.children=e.children.filter(function(e){return!e.slotScope}),l(e),e.pre&&(s=!1),qo(e.tag)&&(c=!1);for(var f=0;f]*>)","i")),p=e.replace(f,function(e,n,r){return u=r.length,Lo(l)||"noscript"===l||(n=n.replace(//g,"$1").replace(//g,"$1")),Ho(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});c+=e.length-p.length,e=p,A(l,c-u,c)}else{var d=e.indexOf("<");if(0===d){if(jo.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v),c,c+v+3),C(v+3);continue}}if(Do.test(e)){var h=e.indexOf("]>");if(h>=0){C(h+2);continue}}var m=e.match(Eo);if(m){C(m[0].length);continue}var y=e.match(No);if(y){var g=c;C(y[0].length),A(y[1],g,c);continue}var _=x();if(_){k(_),Ho(_.tagName,e)&&C(1);continue}}var b=void 0,$=void 0,w=void 0;if(d>=0){for($=e.slice(d);!(No.test($)||So.test($)||jo.test($)||Do.test($)||(w=$.indexOf("<",1))<0);)d+=w,$=e.slice(d);b=e.substring(0,d)}d<0&&(b=e),b&&C(b.length),t.chars&&b&&t.chars(b,c-b.length,c)}if(e===n){t.chars&&t.chars(e);break}}function C(t){c+=t,e=e.substring(t)}function x(){var t=e.match(So);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};for(C(t[0].length);!(n=e.match(To))&&(r=e.match(ko)||e.match(xo));)r.start=c,C(r[0].length),r.end=c,i.attrs.push(r);if(n)return i.unarySlash=n[1],C(n[0].length),i.end=c,i}}function k(e){var n=e.tagName,c=e.unarySlash;o&&("p"===r&&Co(n)&&A(r),s(n)&&r===n&&A(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)t.end&&t.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,o):"p"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}A()}(e,{warn:Uo,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,o,a,l,f){var p=r&&r.ns||Zo(e);q&&"svg"===p&&(o=function(e){for(var t=[],n=0;nc&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var u=Or(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),Mr(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Ur(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Ur(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Ur(t,"$$c")+"}",null,!0)}(e,r,i);else if("input"===o&&"radio"===a)!function(e,t,n){var r=n&&n.number,i=Fr(e,"value")||"null";Er(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),Mr(e,"change",Ur(t,i),null,!0)}(e,r,i);else if("input"===o||"textarea"===o)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?Zr:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=Ur(t,l);c&&(f="if($event.target.composing)return;"+f),Er(e,"value","("+t+")"),Mr(e,u,f,null,!0),(s||a)&&Mr(e,"blur","$forceUpdate()")}(e,r,i);else if(!F.isReservedTag(o))return Br(e,r,i),!1;return!0},text:function(e,t){t.value&&Er(e,"textContent","_s("+t.value+")",t)},html:function(e,t){t.value&&Er(e,"innerHTML","_s("+t.value+")",t)}},isPreTag:function(e){return"pre"===e},isUnaryTag:$o,mustUseProp:Dn,canBeLeftOpenTag:wo,isReservedTag:Zn,getTagNamespace:Gn,staticKeys:function(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}($a)},ka=g(function(e){return p("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(e?","+e:""))});function Aa(e,t){e&&(wa=ka(t.staticKeys||""),Ca=t.isReservedTag||T,function e(t){t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||d(e.tag)||!Ca(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(wa)))}(t);if(1===t.type){if(!Ca(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n|^function(?:\s+[\w$]+)?\s*\(/,Sa=/\([^)]*?\);*$/,Ta=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Na={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Ea={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},ja=function(e){return"if("+e+")return null;"},Da={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:ja("$event.target !== $event.currentTarget"),ctrl:ja("!$event.ctrlKey"),shift:ja("!$event.shiftKey"),alt:ja("!$event.altKey"),meta:ja("!$event.metaKey"),left:ja("'button' in $event && $event.button !== 0"),middle:ja("'button' in $event && $event.button !== 1"),right:ja("'button' in $event && $event.button !== 2")};function La(e,t){var n=t?"nativeOn:":"on:",r="",i="";for(var o in e){var a=Ia(e[o]);e[o]&&e[o].dynamic?i+=o+","+a+",":r+='"'+o+'":'+a+","}return r="{"+r.slice(0,-1)+"}",i?n+"_d("+r+",["+i.slice(0,-1)+"])":n+r}function Ia(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map(function(e){return Ia(e)}).join(",")+"]";var t=Ta.test(e.value),n=Oa.test(e.value),r=Ta.test(e.value.replace(Sa,""));if(e.modifiers){var i="",o="",a=[];for(var s in e.modifiers)if(Da[s])o+=Da[s],Na[s]&&a.push(s);else if("exact"===s){var c=e.modifiers;o+=ja(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+=function(e){return"if(!$event.type.indexOf('key')&&"+e.map(Ma).join("&&")+")return null;"}(a)),o&&(i+=o),"function($event){"+i+(t?"return "+e.value+".apply(null, arguments)":n?"return ("+e.value+").apply(null, arguments)":r?"return "+e.value:e.value)+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function Ma(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=Na[e],r=Ea[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var Fa={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:S},Pa=function(e){this.options=e,this.warn=e.warn||Tr,this.transforms=Nr(e.modules,"transformCode"),this.dataGenFns=Nr(e.modules,"genData"),this.directives=A(A({},Fa),e.directives);var t=e.isReservedTag||T;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function Ra(e,t){var n=new Pa(t);return{render:"with(this){return "+(e?"script"===e.tag?"null":Ha(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function Ha(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return Ba(e,t);if(e.once&&!e.onceProcessed)return Ua(e,t);if(e.for&&!e.forProcessed)return za(e,t);if(e.if&&!e.ifProcessed)return Va(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=Wa(e,t),i="_t("+n+(r?",function(){return "+r+"}":""),o=e.attrs||e.dynamicAttrs?Xa((e.attrs||[]).concat(e.dynamicAttrs||[]).map(function(e){return{name:b(e.name),value:e.value,dynamic:e.dynamic}})):null,a=e.attrsMap["v-bind"];!o&&!a||r||(i+=",null");o&&(i+=","+o);a&&(i+=(o?"":",null")+","+a);return i+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:Wa(t,n,!0);return"_c("+e+","+Ka(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=Ka(e,t));var i=e.inlineTemplate?null:Wa(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o>>0}(a):"")+")"}(e,e.scopedSlots,t)+","),e.model&&(n+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var o=function(e,t){var n=e.children[0];if(n&&1===n.type){var r=Ra(n,t.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map(function(e){return"function(){"+e+"}"}).join(",")+"]}"}}(e,t);o&&(n+=o+",")}return n=n.replace(/,$/,"")+"}",e.dynamicAttrs&&(n="_b("+n+',"'+e.tag+'",'+Xa(e.dynamicAttrs)+")"),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function Ja(e){return 1===e.type&&("slot"===e.tag||e.children.some(Ja))}function qa(e,t){var n=e.attrsMap["slot-scope"];if(e.if&&!e.ifProcessed&&!n)return Va(e,t,qa,"null");if(e.for&&!e.forProcessed)return za(e,t,qa);var r=e.slotScope===ua?"":String(e.slotScope),i="function("+r+"){return "+("template"===e.tag?e.if&&n?"("+e.if+")?"+(Wa(e,t)||"undefined")+":undefined":Wa(e,t)||"undefined":Ha(e,t))+"}",o=r?"":",proxy:true";return"{key:"+(e.slotTarget||'"default"')+",fn:"+i+o+"}"}function Wa(e,t,n,r,i){var o=e.children;if(o.length){var a=o[0];if(1===o.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag){var s=n?t.maybeComponent(a)?",1":",0":"";return""+(r||Ha)(a,t)+s}var c=n?function(e,t){for(var n=0,r=0;r':'
    ',ns.innerHTML.indexOf(" ")>0}var as=!!V&&os(!1),ss=!!V&&os(!0),cs=g(function(e){var t=Qn(e);return t&&t.innerHTML}),us=Cn.prototype.$mount;return Cn.prototype.$mount=function(e,t){if((e=e&&Qn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=cs(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=is(r,{outputSourceRange:!1,shouldDecodeNewlines:as,shouldDecodeNewlinesForHref:ss,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return us.call(this,e,t)},Cn.compile=is,Cn}); \ No newline at end of file diff --git a/package.json b/package.json index 90fec338..83bc6845 100644 --- a/package.json +++ b/package.json @@ -5,45 +5,47 @@ "version": "1.0.0", "description": "A new look into listening and enjoying music in style and performance.", "license": "MIT", - "author": "Cider Development Team (https://cider.sh)", - "repository": "https://github.com/Apple-Music-Electron/Cider.git", + "author": "Cider Collective (https://cider.sh)", + "repository": "https://github.com/ciderapp/Cider.git", "bugs": { - "url": "https://github.com/Apple-Music-Electron/Cider/issues?q=is%3Aopen+is%3Aissue+label%3Abug" + "url": "https://github.com/ciderapp/Cider/issues?q=is%3Aopen+is%3Aissue+label%3Abug" }, "homepage": "https://cider.sh/", "buildResources": "resources", "scripts": { "init": "yarn install --force", - "start": "electron --enable-accelerated-mjpeg-decode --enable-accelerated-video --disable-gpu-driver-bug-workarounds --ignore-gpu-blacklist --enable-native-gpu-memory-buffers .", + "start": "electron . --enable-accelerated-mjpeg-decode --enable-accelerated-video --disable-gpu-driver-bug-workarounds --ignore-gpu-blacklist --enable-native-gpu-memory-buffers", "pack": "electron-builder --dir", "dist": "electron-builder", + "msft": "electron-builder -c msft-package.json", "postinstall": "electron-builder install-app-deps" }, "dependencies": { "@sentry/electron": "^2.5.4", "discord-rpc": "^4.0.1", "ejs": "^3.1.6", - "electron-acrylic-window": "^0.5.9", - "electron-log": "^4.4.1", + "electron-acrylic-window": "^0.5.11", + "electron-log": "^4.4.3", "electron-store": "^8.0.1", - "electron-updater": "^4.3.9", + "electron-updater": "^4.6.1", "electron-window-state": "^5.0.3", - "express": "^4.17.1", + "express": "^4.17.2", "get-port": "^5.1.1", + "mpris-service": "^2.1.2", "react": "^17.0.2", "react-dom": "^17.0.2", - "source-map-support": "^0.5.20", + "source-map-support": "^0.5.21", "v8-compile-cache": "^2.3.0", - "ws": "^8.2.3", + "ws": "^8.3.0", "xml2js": "^0.4.23" }, "devDependencies": { "electron": "https://github.com/castlabs/electron-releases.git", - "electron-builder": "^22.13.1", + "electron-builder": "^22.14.5", "electron-webpack": "^2.8.2", "musickit-typescript": "^1.2.4", "vue-devtools": "^5.1.4", - "webpack": "~5.64.0" + "webpack": "~5.65.0" }, "fileAssociations": [ { @@ -51,6 +53,7 @@ "mimeType": "x-scheme-handler/ame;x-scheme-handler/itms;x-scheme-handler/itmss;x-scheme-handler/musics;x-scheme-handler/music;", "schemes": [ "ame", + "cider", "itms", "itmss", "musics", @@ -58,6 +61,7 @@ ], "protocols": [ "ame", + "cider", "itms", "itmss", "musics", @@ -66,9 +70,9 @@ } ], "build": { - "electronVersion": "15.3.3", + "electronVersion": "15.3.4", "electronDownload": { - "version": "15.3.3-wvvmp", + "version": "15.3.4-wvvmp", "mirror": "https://github.com/castlabs/electron-releases/releases/download/v" }, "appId": "cider", @@ -77,6 +81,7 @@ "name": "Cider", "schemes": [ "ame", + "cider", "itms", "itmss", "musics", @@ -87,6 +92,7 @@ "extends": null, "files": [ "**/*", + "./src/**/*", "./resources/icons/icon.*" ], "linux": { @@ -101,34 +107,28 @@ "icon": "cider", "executableName": "cider" }, + "appx": { + "applicationId": "Cider", + "displayName": "Cider", + "identityName": "Cider", + "publisherDisplayName": "Cider Collective", + "backgroundColor": "transparent", + "setBuildNumber": true + }, "win": { "target": [ "nsis" ], - "icon": "./resources/icons/icon.ico" + "icon": "resources/icons/icon.ico" }, - "appx": { - "applicationId": "cider", - "publisher": "CN=cryptofyre", - "displayName": "Cider", - "identityName": "Cider", - "backgroundColor": "#CD001A", - "setBuildNumber": true + "directories": { + "buildResources": "." }, "mac": { "icon": "./resources/icons/icon.icns", "category": "public.app-category.music", "entitlements": "resources/entitlements.mac.plist", "darkModeSupport": true - }, - "extraResources": [ - { - "from": "node_modules/regedit/vbs", - "to": "regedit/vbs", - "filter": [ - "**/*" - ] - } - ] + } } } diff --git a/logobannercider.png b/resources/banner.png similarity index 100% rename from logobannercider.png rename to resources/banner.png diff --git a/resources/cider-ui/assets/arrow-left.svg b/resources/cider-ui/assets/arrow-left.svg deleted file mode 100644 index 41098a56..00000000 --- a/resources/cider-ui/assets/arrow-left.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/resources/cider-ui/assets/backward.svg b/resources/cider-ui/assets/backward.svg deleted file mode 100644 index 4c445c05..00000000 --- a/resources/cider-ui/assets/backward.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/resources/cider-ui/assets/forward.svg b/resources/cider-ui/assets/forward.svg deleted file mode 100644 index 37b509f1..00000000 --- a/resources/cider-ui/assets/forward.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/resources/cider-ui/assets/list.svg b/resources/cider-ui/assets/list.svg deleted file mode 100644 index 5a8ca2c3..00000000 --- a/resources/cider-ui/assets/list.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/resources/cider-ui/assets/pause.svg b/resources/cider-ui/assets/pause.svg deleted file mode 100644 index 2e9ab6fd..00000000 --- a/resources/cider-ui/assets/pause.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/resources/cider-ui/assets/play.svg b/resources/cider-ui/assets/play.svg deleted file mode 100644 index f6296da5..00000000 --- a/resources/cider-ui/assets/play.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/resources/cider-ui/assets/quote-right.svg b/resources/cider-ui/assets/quote-right.svg deleted file mode 100644 index 629ab4ee..00000000 --- a/resources/cider-ui/assets/quote-right.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/resources/cider-ui/assets/repeat.svg b/resources/cider-ui/assets/repeat.svg deleted file mode 100644 index 0c283cf4..00000000 --- a/resources/cider-ui/assets/repeat.svg +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/cider-ui/assets/search.svg b/resources/cider-ui/assets/search.svg deleted file mode 100644 index 62953986..00000000 --- a/resources/cider-ui/assets/search.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/resources/cider-ui/assets/shuffle.svg b/resources/cider-ui/assets/shuffle.svg deleted file mode 100644 index 5ac0b6ae..00000000 --- a/resources/cider-ui/assets/shuffle.svg +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/cider-ui/assets/volume-down.svg b/resources/cider-ui/assets/volume-down.svg deleted file mode 100644 index 87c9f9fc..00000000 --- a/resources/cider-ui/assets/volume-down.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/resources/cider-ui/assets/volume-up.svg b/resources/cider-ui/assets/volume-up.svg deleted file mode 100644 index 05db44e8..00000000 --- a/resources/cider-ui/assets/volume-up.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/resources/cider-ui/sw.js.map b/resources/cider-ui/sw.js.map deleted file mode 100644 index 6355c494..00000000 --- a/resources/cider-ui/sw.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sw.js","sources":["C:/Users/vieta/AppData/Local/Temp/b97cb0fb56dd447f95668d4898340903/sw.js"],"sourcesContent":["import {registerRoute as workbox_routing_registerRoute} from 'C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-routing/registerRoute.mjs';\nimport {CacheFirst as workbox_strategies_CacheFirst} from 'C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-strategies/CacheFirst.mjs';\nimport {precacheAndRoute as workbox_precaching_precacheAndRoute} from 'C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-precaching/precacheAndRoute.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.addEventListener('message', (event) => {\n if (event.data && event.data.type === 'SKIP_WAITING') {\n self.skipWaiting();\n }\n});\n\n\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"ameframework.css\",\n \"revision\": \"4bcc8646bb5742638fad52b94e231601\"\n },\n {\n \"url\": \"apple-hls.js\",\n \"revision\": \"2b74055662676b0fcc2d4a4bf994a9dc\"\n },\n {\n \"url\": \"hlscider.js\",\n \"revision\": \"cf7f512e83e32694f2c94f904714fe4c\"\n },\n {\n \"url\": \"index_old.html\",\n \"revision\": \"c21f3e9c5b015599d3ab07639f64a7a8\"\n },\n {\n \"url\": \"index.js\",\n \"revision\": \"8591a69fc9c975a063eb264b7447f173\"\n },\n {\n \"url\": \"less.js\",\n \"revision\": \"b6e574e4d680686786a28e7e71a17bbc\"\n },\n {\n \"url\": \"musickit.js\",\n \"revision\": \"211d80891c3336c1795cb83df58d4b63\"\n },\n {\n \"url\": \"sortable.min.js\",\n \"revision\": \"5cbc31ebec32adf60e27b76418e79d93\"\n },\n {\n \"url\": \"style-old.css\",\n \"revision\": \"aea9ea49df13f2deee42b68654aeea06\"\n },\n {\n \"url\": \"todo.js\",\n \"revision\": \"18d49fabcb96de8bd11455877d8eacb6\"\n },\n {\n \"url\": \"vue-observe-visibility.min.js\",\n \"revision\": \"5a52e761f6aa71b4f65a7b458f698b95\"\n },\n {\n \"url\": \"vue.js\",\n \"revision\": \"0a9a4681294d8c5f476687eea6e74842\"\n },\n {\n \"url\": \"vuedraggable.umd.min.js\",\n \"revision\": \"9a84fec5263bb510cee88e1c3b9583cc\"\n }\n], {\n \"ignoreURLParametersMatching\": [/^utm_/, /^fbclid$/, /^X-Amz-Algorithm/, /^X-Amz-Date/, /^X-Amz-SignedHeaders/, /^X-Amz-Expires/, /^X-Amz-Credential/, /^X-Amz-Signature/]\n});\n\n\n\n\nworkbox_routing_registerRoute(/\\.(?:png|jpg|jpeg|svg|webp)$/, new workbox_strategies_CacheFirst({ \"cacheName\":\"imageinternet\", plugins: [] }), 'GET');\nworkbox_routing_registerRoute(/https:\\/\\/is[0-9]-ssl\\.mzstatic\\.com\\/image+/, new workbox_strategies_CacheFirst(), 'GET');\nworkbox_routing_registerRoute(/^https:\\/\\/store-\\d{3}\\.blobstore\\.apple\\.com\\/.{65}\\/image+/, new workbox_strategies_CacheFirst(), 'GET');\n\n\n\n\n"],"names":["self","addEventListener","event","data","type","skipWaiting","workbox_strategies_CacheFirst","plugins"],"mappings":"0nBAqBAA,KAAKC,iBAAiB,WAAYC,IAC5BA,EAAMC,MAA4B,iBAApBD,EAAMC,KAAKC,MAC3BJ,KAAKK,oCAY2B,CAClC,KACS,4BACK,oCAEd,KACS,wBACK,oCAEd,KACS,uBACK,oCAEd,KACS,0BACK,oCAEd,KACS,oBACK,oCAEd,KACS,mBACK,oCAEd,KACS,uBACK,oCAEd,KACS,2BACK,oCAEd,KACS,yBACK,oCAEd,KACS,mBACK,oCAEd,KACS,yCACK,oCAEd,KACS,kBACK,oCAEd,KACS,mCACK,qCAEb,6BAC8B,CAAC,QAAS,WAAY,mBAAoB,cAAe,uBAAwB,iBAAkB,oBAAqB,sCAM3H,+BAAgC,IAAIC,aAA8B,WAAc,gBAAiBC,QAAS,KAAO,uBACjH,+CAAgD,IAAID,aAAiC,uBACrF,+DAAgE,IAAIA,aAAiC"} \ No newline at end of file diff --git a/resources/cider-ui/views/components/mediaitem-square-large.ejs b/resources/cider-ui/views/components/mediaitem-square-large.ejs deleted file mode 100644 index 76f235ff..00000000 --- a/resources/cider-ui/views/components/mediaitem-square-large.ejs +++ /dev/null @@ -1,57 +0,0 @@ - - - \ No newline at end of file diff --git a/resources/cider-ui/views/components/mediaitem-square-sp.ejs b/resources/cider-ui/views/components/mediaitem-square-sp.ejs deleted file mode 100644 index f070e9cd..00000000 --- a/resources/cider-ui/views/components/mediaitem-square-sp.ejs +++ /dev/null @@ -1,63 +0,0 @@ - - - \ No newline at end of file diff --git a/resources/cider-ui/views/pages/library-recentlyadded.ejs b/resources/cider-ui/views/pages/library-recentlyadded.ejs deleted file mode 100644 index e69de29b..00000000 diff --git a/resources/cider-ui/vue.js b/resources/cider-ui/vue.js deleted file mode 100644 index d998ff72..00000000 --- a/resources/cider-ui/vue.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! - * Vue.js v2.6.14 - * (c) 2014-2021 Evan You - * Released under the MIT License. - */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Vue=t()}(this,function(){"use strict";var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function r(e){return!0===e}function i(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function o(e){return null!==e&&"object"==typeof e}var a=Object.prototype.toString;function s(e){return"[object Object]"===a.call(e)}function c(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function u(e){return n(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function l(e){return null==e?"":Array.isArray(e)||s(e)&&e.toString===a?JSON.stringify(e,null,2):String(e)}function f(e){var t=parseFloat(e);return isNaN(t)?e:t}function p(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}var m=Object.prototype.hasOwnProperty;function y(e,t){return m.call(e,t)}function g(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var _=/-(\w)/g,b=g(function(e){return e.replace(_,function(e,t){return t?t.toUpperCase():""})}),$=g(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),w=/\B([A-Z])/g,C=g(function(e){return e.replace(w,"-$1").toLowerCase()});var x=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function k(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function A(e,t){for(var n in t)e[n]=t[n];return e}function O(e){for(var t={},n=0;n0,Z=J&&J.indexOf("edge/")>0,G=(J&&J.indexOf("android"),J&&/iphone|ipad|ipod|ios/.test(J)||"ios"===K),X=(J&&/chrome\/\d+/.test(J),J&&/phantomjs/.test(J),J&&J.match(/firefox\/(\d+)/)),Y={}.watch,Q=!1;if(V)try{var ee={};Object.defineProperty(ee,"passive",{get:function(){Q=!0}}),window.addEventListener("test-passive",null,ee)}catch(e){}var te=function(){return void 0===B&&(B=!V&&!z&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),B},ne=V&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function re(e){return"function"==typeof e&&/native code/.test(e.toString())}var ie,oe="undefined"!=typeof Symbol&&re(Symbol)&&"undefined"!=typeof Reflect&&re(Reflect.ownKeys);ie="undefined"!=typeof Set&&re(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ae=S,se=0,ce=function(){this.id=se++,this.subs=[]};ce.prototype.addSub=function(e){this.subs.push(e)},ce.prototype.removeSub=function(e){h(this.subs,e)},ce.prototype.depend=function(){ce.target&&ce.target.addDep(this)},ce.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t-1)if(o&&!y(i,"default"))a=!1;else if(""===a||a===C(e)){var c=Re(String,i.type);(c<0||s0&&(ct((u=e(u,(a||"")+"_"+c))[0])&&ct(f)&&(s[l]=he(f.text+u[0].text),u.shift()),s.push.apply(s,u)):i(u)?ct(f)?s[l]=he(f.text+u):""!==u&&s.push(he(u)):ct(u)&&ct(f)?s[l]=he(f.text+u.text):(r(o._isVList)&&n(u.tag)&&t(u.key)&&n(a)&&(u.key="__vlist"+a+"_"+c+"__"),s.push(u)));return s}(e):void 0}function ct(e){return n(e)&&n(e.text)&&!1===e.isComment}function ut(e,t){if(e){for(var n=Object.create(null),r=oe?Reflect.ownKeys(e):Object.keys(e),i=0;i0,a=t?!!t.$stable:!o,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&r&&r!==e&&s===r.$key&&!o&&!r.$hasNormal)return r;for(var c in i={},t)t[c]&&"$"!==c[0]&&(i[c]=vt(n,c,t[c]))}else i={};for(var u in n)u in i||(i[u]=ht(n,u));return t&&Object.isExtensible(t)&&(t._normalized=i),R(i,"$stable",a),R(i,"$key",s),R(i,"$hasNormal",o),i}function vt(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({}),t=(e=e&&"object"==typeof e&&!Array.isArray(e)?[e]:st(e))&&e[0];return e&&(!t||1===e.length&&t.isComment&&!pt(t))?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function ht(e,t){return function(){return e[t]}}function mt(e,t){var r,i,a,s,c;if(Array.isArray(e)||"string"==typeof e)for(r=new Array(e.length),i=0,a=e.length;idocument.createEvent("Event").timeStamp&&(cn=function(){return un.now()})}function ln(){var e,t;for(sn=cn(),on=!0,en.sort(function(e,t){return e.id-t.id}),an=0;anan&&en[n].id>e.id;)n--;en.splice(n+1,0,e)}else en.push(e);rn||(rn=!0,Qe(ln))}}(this)},pn.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user){var n='callback for watcher "'+this.expression+'"';Be(this.cb,this.vm,[e,t],this.vm,n)}else this.cb.call(this.vm,e,t)}}},pn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},pn.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},pn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||h(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var dn={enumerable:!0,configurable:!0,get:S,set:S};function vn(e,t,n){dn.get=function(){return this[t][n]},dn.set=function(e){this[t][n]=e},Object.defineProperty(e,n,dn)}function hn(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&$e(!1);var o=function(o){i.push(o);var a=Ie(o,t,n,e);xe(r,o,a),o in e||vn(e,"_props",o)};for(var a in t)o(a);$e(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]="function"!=typeof t[n]?S:x(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;s(t=e._data="function"==typeof t?function(e,t){le();try{return e.call(t,t)}catch(e){return He(e,t,"data()"),{}}finally{fe()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&y(r,o)||(a=void 0,36!==(a=(o+"").charCodeAt(0))&&95!==a&&vn(e,"_data",o))}var a;Ce(t,!0)}(e):Ce(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=te();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;r||(n[i]=new pn(e,a||S,S,mn)),i in e||yn(e,i,o)}}(e,t.computed),t.watch&&t.watch!==Y&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,"[object RegExp]"===a.call(n)&&e.test(t));var n}function On(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=a.name;s&&!t(s)&&Sn(n,o,r,i)}}}function Sn(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,h(n,t)}!function(t){t.prototype._init=function(t){var n=this;n._uid=$n++,n._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(n,t):n.$options=De(wn(n.constructor),t||{},n),n._renderProxy=n,n._self=n,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(n),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&Wt(e,t)}(n),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,i=r&&r.context;t.$slots=lt(n._renderChildren,i),t.$scopedSlots=e,t._c=function(e,n,r,i){return Ht(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return Ht(t,e,n,r,i,!0)};var o=r&&r.data;xe(t,"$attrs",o&&o.attrs||e,null,!0),xe(t,"$listeners",n._parentListeners||e,null,!0)}(n),Qt(n,"beforeCreate"),function(e){var t=ut(e.$options.inject,e);t&&($e(!1),Object.keys(t).forEach(function(n){xe(e,n,t[n])}),$e(!0))}(n),hn(n),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(n),Qt(n,"created"),n.$options.el&&n.$mount(n.$options.el)}}(Cn),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=ke,e.prototype.$delete=Ae,e.prototype.$watch=function(e,t,n){if(s(t))return bn(this,e,t,n);(n=n||{}).user=!0;var r=new pn(this,e,t,n);if(n.immediate){var i='callback for immediate watcher "'+r.expression+'"';le(),Be(t,this,[r.value],this,i),fe()}return function(){r.teardown()}}}(Cn),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i1?k(t):t;for(var n=k(arguments,1),r='event handler for "'+e+'"',i=0,o=t.length;iparseInt(this.max)&&Sn(e,t[0],t,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)Sn(this.cache,e,this.keys)},mounted:function(){var e=this;this.cacheVNode(),this.$watch("include",function(t){On(e,function(e){return An(t,e)})}),this.$watch("exclude",function(t){On(e,function(e){return!An(t,e)})})},updated:function(){this.cacheVNode()},render:function(){var e=this.$slots.default,t=zt(e),n=t&&t.componentOptions;if(n){var r=kn(n),i=this.include,o=this.exclude;if(i&&(!r||!An(i,r))||o&&r&&An(o,r))return t;var a=this.cache,s=this.keys,c=null==t.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):t.key;a[c]?(t.componentInstance=a[c].componentInstance,h(s,c),s.push(c)):(this.vnodeToCache=t,this.keyToCache=c),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return F}};Object.defineProperty(e,"config",t),e.util={warn:ae,extend:A,mergeOptions:De,defineReactive:xe},e.set=ke,e.delete=Ae,e.nextTick=Qe,e.observable=function(e){return Ce(e),e},e.options=Object.create(null),I.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,A(e.options.components,Nn),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=k(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=De(this.options,e),this}}(e),xn(e),function(e){I.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&s(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}(e)}(Cn),Object.defineProperty(Cn.prototype,"$isServer",{get:te}),Object.defineProperty(Cn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Cn,"FunctionalRenderContext",{value:Et}),Cn.version="2.6.14";var En=p("style,class"),jn=p("input,textarea,option,select,progress"),Dn=function(e,t,n){return"value"===n&&jn(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},Ln=p("contenteditable,draggable,spellcheck"),In=p("events,caret,typing,plaintext-only"),Mn=function(e,t){return Bn(t)||"false"===t?"false":"contenteditable"===e&&In(t)?t:"true"},Fn=p("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),Pn="http://www.w3.org/1999/xlink",Rn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Hn=function(e){return Rn(e)?e.slice(6,e.length):""},Bn=function(e){return null==e||!1===e};function Un(e){for(var t=e.data,r=e,i=e;n(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=Vn(i.data,t));for(;n(r=r.parent);)r&&r.data&&(t=Vn(t,r.data));return function(e,t){if(n(e)||n(t))return zn(e,Kn(t));return""}(t.staticClass,t.class)}function Vn(e,t){return{staticClass:zn(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function zn(e,t){return e?t?e+" "+t:e:t||""}function Kn(e){return Array.isArray(e)?function(e){for(var t,r="",i=0,o=e.length;i-1?mr(e,t,n):Fn(t)?Bn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):Ln(t)?e.setAttribute(t,Mn(t,n)):Rn(t)?Bn(n)?e.removeAttributeNS(Pn,Hn(t)):e.setAttributeNS(Pn,t,n):mr(e,t,n)}function mr(e,t,n){if(Bn(n))e.removeAttribute(t);else{if(q&&!W&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var yr={create:vr,update:vr};function gr(e,r){var i=r.elm,o=r.data,a=e.data;if(!(t(o.staticClass)&&t(o.class)&&(t(a)||t(a.staticClass)&&t(a.class)))){var s=Un(r),c=i._transitionClasses;n(c)&&(s=zn(s,Kn(c))),s!==i._prevClass&&(i.setAttribute("class",s),i._prevClass=s)}}var _r,br,$r,wr,Cr,xr,kr={create:gr,update:gr},Ar=/[\w).+\-_$\]]/;function Or(e){var t,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r=0&&" "===(h=e.charAt(v));v--);h&&Ar.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r-1?{exp:e.slice(0,wr),key:'"'+e.slice(wr+1)+'"'}:{exp:e,key:null};br=e,wr=Cr=xr=0;for(;!zr();)Kr($r=Vr())?qr($r):91===$r&&Jr($r);return{exp:e.slice(0,Cr),key:e.slice(Cr+1,xr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function Vr(){return br.charCodeAt(++wr)}function zr(){return wr>=_r}function Kr(e){return 34===e||39===e}function Jr(e){var t=1;for(Cr=wr;!zr();)if(Kr(e=Vr()))qr(e);else if(91===e&&t++,93===e&&t--,0===t){xr=wr;break}}function qr(e){for(var t=e;!zr()&&(e=Vr())!==t;);}var Wr,Zr="__r",Gr="__c";function Xr(e,t,n){var r=Wr;return function i(){null!==t.apply(null,arguments)&&ei(e,i,n,r)}}var Yr=Ke&&!(X&&Number(X[1])<=53);function Qr(e,t,n,r){if(Yr){var i=sn,o=t;t=o._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=i||e.timeStamp<=0||e.target.ownerDocument!==document)return o.apply(this,arguments)}}Wr.addEventListener(e,t,Q?{capture:n,passive:r}:n)}function ei(e,t,n,r){(r||Wr).removeEventListener(e,t._wrapper||t,n)}function ti(e,r){if(!t(e.data.on)||!t(r.data.on)){var i=r.data.on||{},o=e.data.on||{};Wr=r.elm,function(e){if(n(e[Zr])){var t=q?"change":"input";e[t]=[].concat(e[Zr],e[t]||[]),delete e[Zr]}n(e[Gr])&&(e.change=[].concat(e[Gr],e.change||[]),delete e[Gr])}(i),it(i,o,Qr,ei,Xr,r.context),Wr=void 0}}var ni,ri={create:ti,update:ti};function ii(e,r){if(!t(e.data.domProps)||!t(r.data.domProps)){var i,o,a=r.elm,s=e.data.domProps||{},c=r.data.domProps||{};for(i in n(c.__ob__)&&(c=r.data.domProps=A({},c)),s)i in c||(a[i]="");for(i in c){if(o=c[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i&&"PROGRESS"!==a.tagName){a._value=o;var u=t(o)?"":String(o);oi(a,u)&&(a.value=u)}else if("innerHTML"===i&&Wn(a.tagName)&&t(a.innerHTML)){(ni=ni||document.createElement("div")).innerHTML=""+o+"";for(var l=ni.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}else if(o!==s[i])try{a[i]=o}catch(e){}}}}function oi(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var r=e.value,i=e._vModifiers;if(n(i)){if(i.number)return f(r)!==f(t);if(i.trim)return r.trim()!==t.trim()}return r!==t}(e,t))}var ai={create:ii,update:ii},si=g(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function ci(e){var t=ui(e.style);return e.staticStyle?A(e.staticStyle,t):t}function ui(e){return Array.isArray(e)?O(e):"string"==typeof e?si(e):e}var li,fi=/^--/,pi=/\s*!important$/,di=function(e,t,n){if(fi.test(t))e.style.setProperty(t,n);else if(pi.test(n))e.style.setProperty(C(t),n.replace(pi,""),"important");else{var r=hi(t);if(Array.isArray(n))for(var i=0,o=n.length;i-1?t.split(gi).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function bi(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(gi).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function $i(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&A(t,wi(e.name||"v")),A(t,e),t}return"string"==typeof e?wi(e):void 0}}var wi=g(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),Ci=V&&!W,xi="transition",ki="animation",Ai="transition",Oi="transitionend",Si="animation",Ti="animationend";Ci&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Ai="WebkitTransition",Oi="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Si="WebkitAnimation",Ti="webkitAnimationEnd"));var Ni=V?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Ei(e){Ni(function(){Ni(e)})}function ji(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),_i(e,t))}function Di(e,t){e._transitionClasses&&h(e._transitionClasses,t),bi(e,t)}function Li(e,t,n){var r=Mi(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===xi?Oi:Ti,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c0&&(n=xi,l=a,f=o.length):t===ki?u>0&&(n=ki,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?xi:ki:null)?n===xi?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===xi&&Ii.test(r[Ai+"Property"])}}function Fi(e,t){for(;e.length1}function Vi(e,t){!0!==t.data.show&&Ri(t)}var zi=function(e){var o,a,s={},c=e.modules,u=e.nodeOps;for(o=0;ov?_(e,t(i[y+1])?null:i[y+1].elm,i,d,y,o):d>y&&$(r,p,v)}(p,h,y,o,l):n(y)?(n(e.text)&&u.setTextContent(p,""),_(p,null,y,0,y.length-1,o)):n(h)?$(h,0,h.length-1):n(e.text)&&u.setTextContent(p,""):e.text!==i.text&&u.setTextContent(p,i.text),n(v)&&n(d=v.hook)&&n(d=d.postpatch)&&d(e,i)}}}function k(e,t,i){if(r(i)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o-1,a.selected!==o&&(a.selected=o);else if(E(Zi(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function Wi(e,t){return t.every(function(t){return!E(t,e)})}function Zi(e){return"_value"in e?e._value:e.value}function Gi(e){e.target.composing=!0}function Xi(e){e.target.composing&&(e.target.composing=!1,Yi(e.target,"input"))}function Yi(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Qi(e){return!e.componentInstance||e.data&&e.data.transition?e:Qi(e.componentInstance._vnode)}var eo={model:Ki,show:{bind:function(e,t,n){var r=t.value,i=(n=Qi(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,Ri(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Qi(n)).data&&n.data.transition?(n.data.show=!0,r?Ri(n,function(){e.style.display=e.__vOriginalDisplay}):Hi(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},to={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function no(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?no(zt(t.children)):e}function ro(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[b(o)]=i[o];return t}function io(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var oo=function(e){return e.tag||pt(e)},ao=function(e){return"show"===e.name},so={name:"transition",props:to,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(oo)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var a=no(o);if(!a)return o;if(this._leaving)return io(e,o);var s="__transition-"+this._uid+"-";a.key=null==a.key?a.isComment?s+"comment":s+a.tag:i(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var c=(a.data||(a.data={})).transition=ro(this),u=this._vnode,l=no(u);if(a.data.directives&&a.data.directives.some(ao)&&(a.data.show=!0),l&&l.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(a,l)&&!pt(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=A({},c);if("out-in"===r)return this._leaving=!0,ot(f,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),io(e,o);if("in-out"===r){if(pt(a))return u;var p,d=function(){p()};ot(c,"afterEnter",d),ot(c,"enterCancelled",d),ot(f,"delayLeave",function(e){p=e})}}return o}}},co=A({tag:String,moveClass:String},to);function uo(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function lo(e){e.data.newPos=e.elm.getBoundingClientRect()}function fo(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}delete co.mode;var po={Transition:so,TransitionGroup:{props:co,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=Gt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=ro(this),s=0;s-1?Xn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Xn[e]=/HTMLUnknownElement/.test(t.toString())},A(Cn.options.directives,eo),A(Cn.options.components,po),Cn.prototype.__patch__=V?zi:S,Cn.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=ve),Qt(e,"beforeMount"),r=function(){e._update(e._render(),n)},new pn(e,r,S,{before:function(){e._isMounted&&!e._isDestroyed&&Qt(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,Qt(e,"mounted")),e}(this,e=e&&V?Qn(e):void 0,t)},V&&setTimeout(function(){F.devtools&&ne&&ne.emit("init",Cn)},0);var vo=/\{\{((?:.|\r?\n)+?)\}\}/g,ho=/[-.*+?^${}()|[\]\/\\]/g,mo=g(function(e){var t=e[0].replace(ho,"\\$&"),n=e[1].replace(ho,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")});var yo={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=Pr(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=Fr(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}};var go,_o={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=Pr(e,"style");n&&(e.staticStyle=JSON.stringify(si(n)));var r=Fr(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},bo=function(e){return(go=go||document.createElement("div")).innerHTML=e,go.textContent},$o=p("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),wo=p("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),Co=p("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),xo=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ko=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Ao="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+P.source+"]*",Oo="((?:"+Ao+"\\:)?"+Ao+")",So=new RegExp("^<"+Oo),To=/^\s*(\/?)>/,No=new RegExp("^<\\/"+Oo+"[^>]*>"),Eo=/^]+>/i,jo=/^",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},Fo=/&(?:lt|gt|quot|amp|#39);/g,Po=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,Ro=p("pre,textarea",!0),Ho=function(e,t){return e&&Ro(e)&&"\n"===t[0]};function Bo(e,t){var n=t?Po:Fo;return e.replace(n,function(e){return Mo[e]})}var Uo,Vo,zo,Ko,Jo,qo,Wo,Zo,Go=/^@|^v-on:/,Xo=/^v-|^@|^:|^#/,Yo=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Qo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,ea=/^\(|\)$/g,ta=/^\[.*\]$/,na=/:(.*)$/,ra=/^:|^\.|^v-bind:/,ia=/\.[^.\]]+(?=[^\]]*$)/g,oa=/^v-slot(:|$)|^#/,aa=/[\r\n]/,sa=/[ \f\t\r\n]+/g,ca=g(bo),ua="_empty_";function la(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:ya(t),rawAttrsMap:{},parent:n,children:[]}}function fa(e,t){Uo=t.warn||Tr,qo=t.isPreTag||T,Wo=t.mustUseProp||T,Zo=t.getTagNamespace||T;t.isReservedTag;zo=Nr(t.modules,"transformNode"),Ko=Nr(t.modules,"preTransformNode"),Jo=Nr(t.modules,"postTransformNode"),Vo=t.delimiters;var n,r,i=[],o=!1!==t.preserveWhitespace,a=t.whitespace,s=!1,c=!1;function u(e){if(l(e),s||e.processed||(e=pa(e,t)),i.length||e===n||n.if&&(e.elseif||e.else)&&va(n,{exp:e.elseif,block:e}),r&&!e.forbidden)if(e.elseif||e.else)a=e,(u=function(e){var t=e.length;for(;t--;){if(1===e[t].type)return e[t];e.pop()}}(r.children))&&u.if&&va(u,{exp:a.elseif,block:a});else{if(e.slotScope){var o=e.slotTarget||'"default"';(r.scopedSlots||(r.scopedSlots={}))[o]=e}r.children.push(e),e.parent=r}var a,u;e.children=e.children.filter(function(e){return!e.slotScope}),l(e),e.pre&&(s=!1),qo(e.tag)&&(c=!1);for(var f=0;f]*>)","i")),p=e.replace(f,function(e,n,r){return u=r.length,Lo(l)||"noscript"===l||(n=n.replace(//g,"$1").replace(//g,"$1")),Ho(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});c+=e.length-p.length,e=p,A(l,c-u,c)}else{var d=e.indexOf("<");if(0===d){if(jo.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v),c,c+v+3),C(v+3);continue}}if(Do.test(e)){var h=e.indexOf("]>");if(h>=0){C(h+2);continue}}var m=e.match(Eo);if(m){C(m[0].length);continue}var y=e.match(No);if(y){var g=c;C(y[0].length),A(y[1],g,c);continue}var _=x();if(_){k(_),Ho(_.tagName,e)&&C(1);continue}}var b=void 0,$=void 0,w=void 0;if(d>=0){for($=e.slice(d);!(No.test($)||So.test($)||jo.test($)||Do.test($)||(w=$.indexOf("<",1))<0);)d+=w,$=e.slice(d);b=e.substring(0,d)}d<0&&(b=e),b&&C(b.length),t.chars&&b&&t.chars(b,c-b.length,c)}if(e===n){t.chars&&t.chars(e);break}}function C(t){c+=t,e=e.substring(t)}function x(){var t=e.match(So);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};for(C(t[0].length);!(n=e.match(To))&&(r=e.match(ko)||e.match(xo));)r.start=c,C(r[0].length),r.end=c,i.attrs.push(r);if(n)return i.unarySlash=n[1],C(n[0].length),i.end=c,i}}function k(e){var n=e.tagName,c=e.unarySlash;o&&("p"===r&&Co(n)&&A(r),s(n)&&r===n&&A(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)t.end&&t.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,o):"p"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}A()}(e,{warn:Uo,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,o,a,l,f){var p=r&&r.ns||Zo(e);q&&"svg"===p&&(o=function(e){for(var t=[],n=0;nc&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var u=Or(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),Mr(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Ur(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Ur(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Ur(t,"$$c")+"}",null,!0)}(e,r,i);else if("input"===o&&"radio"===a)!function(e,t,n){var r=n&&n.number,i=Fr(e,"value")||"null";Er(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),Mr(e,"change",Ur(t,i),null,!0)}(e,r,i);else if("input"===o||"textarea"===o)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?Zr:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=Ur(t,l);c&&(f="if($event.target.composing)return;"+f),Er(e,"value","("+t+")"),Mr(e,u,f,null,!0),(s||a)&&Mr(e,"blur","$forceUpdate()")}(e,r,i);else if(!F.isReservedTag(o))return Br(e,r,i),!1;return!0},text:function(e,t){t.value&&Er(e,"textContent","_s("+t.value+")",t)},html:function(e,t){t.value&&Er(e,"innerHTML","_s("+t.value+")",t)}},isPreTag:function(e){return"pre"===e},isUnaryTag:$o,mustUseProp:Dn,canBeLeftOpenTag:wo,isReservedTag:Zn,getTagNamespace:Gn,staticKeys:function(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}($a)},ka=g(function(e){return p("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(e?","+e:""))});function Aa(e,t){e&&(wa=ka(t.staticKeys||""),Ca=t.isReservedTag||T,function e(t){t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||d(e.tag)||!Ca(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(wa)))}(t);if(1===t.type){if(!Ca(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n|^function(?:\s+[\w$]+)?\s*\(/,Sa=/\([^)]*?\);*$/,Ta=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Na={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Ea={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},ja=function(e){return"if("+e+")return null;"},Da={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:ja("$event.target !== $event.currentTarget"),ctrl:ja("!$event.ctrlKey"),shift:ja("!$event.shiftKey"),alt:ja("!$event.altKey"),meta:ja("!$event.metaKey"),left:ja("'button' in $event && $event.button !== 0"),middle:ja("'button' in $event && $event.button !== 1"),right:ja("'button' in $event && $event.button !== 2")};function La(e,t){var n=t?"nativeOn:":"on:",r="",i="";for(var o in e){var a=Ia(e[o]);e[o]&&e[o].dynamic?i+=o+","+a+",":r+='"'+o+'":'+a+","}return r="{"+r.slice(0,-1)+"}",i?n+"_d("+r+",["+i.slice(0,-1)+"])":n+r}function Ia(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map(function(e){return Ia(e)}).join(",")+"]";var t=Ta.test(e.value),n=Oa.test(e.value),r=Ta.test(e.value.replace(Sa,""));if(e.modifiers){var i="",o="",a=[];for(var s in e.modifiers)if(Da[s])o+=Da[s],Na[s]&&a.push(s);else if("exact"===s){var c=e.modifiers;o+=ja(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+=function(e){return"if(!$event.type.indexOf('key')&&"+e.map(Ma).join("&&")+")return null;"}(a)),o&&(i+=o),"function($event){"+i+(t?"return "+e.value+".apply(null, arguments)":n?"return ("+e.value+").apply(null, arguments)":r?"return "+e.value:e.value)+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function Ma(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=Na[e],r=Ea[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var Fa={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:S},Pa=function(e){this.options=e,this.warn=e.warn||Tr,this.transforms=Nr(e.modules,"transformCode"),this.dataGenFns=Nr(e.modules,"genData"),this.directives=A(A({},Fa),e.directives);var t=e.isReservedTag||T;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function Ra(e,t){var n=new Pa(t);return{render:"with(this){return "+(e?"script"===e.tag?"null":Ha(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function Ha(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return Ba(e,t);if(e.once&&!e.onceProcessed)return Ua(e,t);if(e.for&&!e.forProcessed)return za(e,t);if(e.if&&!e.ifProcessed)return Va(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=Wa(e,t),i="_t("+n+(r?",function(){return "+r+"}":""),o=e.attrs||e.dynamicAttrs?Xa((e.attrs||[]).concat(e.dynamicAttrs||[]).map(function(e){return{name:b(e.name),value:e.value,dynamic:e.dynamic}})):null,a=e.attrsMap["v-bind"];!o&&!a||r||(i+=",null");o&&(i+=","+o);a&&(i+=(o?"":",null")+","+a);return i+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:Wa(t,n,!0);return"_c("+e+","+Ka(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=Ka(e,t));var i=e.inlineTemplate?null:Wa(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o>>0}(a):"")+")"}(e,e.scopedSlots,t)+","),e.model&&(n+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var o=function(e,t){var n=e.children[0];if(n&&1===n.type){var r=Ra(n,t.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map(function(e){return"function(){"+e+"}"}).join(",")+"]}"}}(e,t);o&&(n+=o+",")}return n=n.replace(/,$/,"")+"}",e.dynamicAttrs&&(n="_b("+n+',"'+e.tag+'",'+Xa(e.dynamicAttrs)+")"),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function Ja(e){return 1===e.type&&("slot"===e.tag||e.children.some(Ja))}function qa(e,t){var n=e.attrsMap["slot-scope"];if(e.if&&!e.ifProcessed&&!n)return Va(e,t,qa,"null");if(e.for&&!e.forProcessed)return za(e,t,qa);var r=e.slotScope===ua?"":String(e.slotScope),i="function("+r+"){return "+("template"===e.tag?e.if&&n?"("+e.if+")?"+(Wa(e,t)||"undefined")+":undefined":Wa(e,t)||"undefined":Ha(e,t))+"}",o=r?"":",proxy:true";return"{key:"+(e.slotTarget||'"default"')+",fn:"+i+o+"}"}function Wa(e,t,n,r,i){var o=e.children;if(o.length){var a=o[0];if(1===o.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag){var s=n?t.maybeComponent(a)?",1":",0":"";return""+(r||Ha)(a,t)+s}var c=n?function(e,t){for(var n=0,r=0;r':'
    ',ns.innerHTML.indexOf(" ")>0}var as=!!V&&os(!1),ss=!!V&&os(!0),cs=g(function(e){var t=Qn(e);return t&&t.innerHTML}),us=Cn.prototype.$mount;return Cn.prototype.$mount=function(e,t){if((e=e&&Qn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=cs(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=is(r,{outputSourceRange:!1,shouldDecodeNewlines:as,shouldDecodeNewlinesForHref:ss,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return us.call(this,e,t)},Cn.compile=is,Cn}); \ No newline at end of file diff --git a/resources/cider-ui/vuedraggable.umd.min.js b/resources/cider-ui/vuedraggable.umd.min.js deleted file mode 100644 index dee16afe..00000000 --- a/resources/cider-ui/vuedraggable.umd.min.js +++ /dev/null @@ -1,2 +0,0 @@ -(function(t,n){"object"===typeof exports&&"object"===typeof module?module.exports=n(require("sortablejs")):"function"===typeof define&&define.amd?define(["sortablejs"],n):"object"===typeof exports?exports["vuedraggable"]=n(require("sortablejs")):t["vuedraggable"]=n(t["Sortable"])})("undefined"!==typeof self?self:this,function(t){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t["default"]}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s="fb15")}({"02f4":function(t,n,e){var r=e("4588"),o=e("be13");t.exports=function(t){return function(n,e){var i,u,c=String(o(n)),a=r(e),f=c.length;return a<0||a>=f?t?"":void 0:(i=c.charCodeAt(a),i<55296||i>56319||a+1===f||(u=c.charCodeAt(a+1))<56320||u>57343?t?c.charAt(a):i:t?c.slice(a,a+2):u-56320+(i-55296<<10)+65536)}}},"0390":function(t,n,e){"use strict";var r=e("02f4")(!0);t.exports=function(t,n,e){return n+(e?r(t,n).length:1)}},"07e3":function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},"0bfb":function(t,n,e){"use strict";var r=e("cb7c");t.exports=function(){var t=r(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n}},"0fc9":function(t,n,e){var r=e("3a38"),o=Math.max,i=Math.min;t.exports=function(t,n){return t=r(t),t<0?o(t+n,0):i(t,n)}},1654:function(t,n,e){"use strict";var r=e("71c1")(!0);e("30f1")(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,n=this._t,e=this._i;return e>=n.length?{value:void 0,done:!0}:(t=r(n,e),this._i+=t.length,{value:t,done:!1})})},1691:function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},"1af6":function(t,n,e){var r=e("63b6");r(r.S,"Array",{isArray:e("9003")})},"1bc3":function(t,n,e){var r=e("f772");t.exports=function(t,n){if(!r(t))return t;var e,o;if(n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;if("function"==typeof(e=t.valueOf)&&!r(o=e.call(t)))return o;if(!n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},"1ec9":function(t,n,e){var r=e("f772"),o=e("e53d").document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},"20fd":function(t,n,e){"use strict";var r=e("d9f6"),o=e("aebd");t.exports=function(t,n,e){n in t?r.f(t,n,o(0,e)):t[n]=e}},"214f":function(t,n,e){"use strict";e("b0c5");var r=e("2aba"),o=e("32e9"),i=e("79e5"),u=e("be13"),c=e("2b4c"),a=e("520a"),f=c("species"),s=!i(function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")}),l=function(){var t=/(?:)/,n=t.exec;t.exec=function(){return n.apply(this,arguments)};var e="ab".split(t);return 2===e.length&&"a"===e[0]&&"b"===e[1]}();t.exports=function(t,n,e){var p=c(t),d=!i(function(){var n={};return n[p]=function(){return 7},7!=""[t](n)}),v=d?!i(function(){var n=!1,e=/a/;return e.exec=function(){return n=!0,null},"split"===t&&(e.constructor={},e.constructor[f]=function(){return e}),e[p](""),!n}):void 0;if(!d||!v||"replace"===t&&!s||"split"===t&&!l){var h=/./[p],b=e(u,p,""[t],function(t,n,e,r,o){return n.exec===a?d&&!o?{done:!0,value:h.call(n,e,r)}:{done:!0,value:t.call(e,n,r)}:{done:!1}}),g=b[0],y=b[1];r(String.prototype,t,g),o(RegExp.prototype,p,2==n?function(t,n){return y.call(t,this,n)}:function(t){return y.call(t,this)})}}},"230e":function(t,n,e){var r=e("d3f4"),o=e("7726").document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},"23c6":function(t,n,e){var r=e("2d95"),o=e("2b4c")("toStringTag"),i="Arguments"==r(function(){return arguments}()),u=function(t,n){try{return t[n]}catch(e){}};t.exports=function(t){var n,e,c;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=u(n=Object(t),o))?e:i?r(n):"Object"==(c=r(n))&&"function"==typeof n.callee?"Arguments":c}},"241e":function(t,n,e){var r=e("25eb");t.exports=function(t){return Object(r(t))}},"25eb":function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},"294c":function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},"2aba":function(t,n,e){var r=e("7726"),o=e("32e9"),i=e("69a8"),u=e("ca5a")("src"),c=e("fa5b"),a="toString",f=(""+c).split(a);e("8378").inspectSource=function(t){return c.call(t)},(t.exports=function(t,n,e,c){var a="function"==typeof e;a&&(i(e,"name")||o(e,"name",n)),t[n]!==e&&(a&&(i(e,u)||o(e,u,t[n]?""+t[n]:f.join(String(n)))),t===r?t[n]=e:c?t[n]?t[n]=e:o(t,n,e):(delete t[n],o(t,n,e)))})(Function.prototype,a,function(){return"function"==typeof this&&this[u]||c.call(this)})},"2b4c":function(t,n,e){var r=e("5537")("wks"),o=e("ca5a"),i=e("7726").Symbol,u="function"==typeof i,c=t.exports=function(t){return r[t]||(r[t]=u&&i[t]||(u?i:o)("Symbol."+t))};c.store=r},"2d00":function(t,n){t.exports=!1},"2d95":function(t,n){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},"2fdb":function(t,n,e){"use strict";var r=e("5ca1"),o=e("d2c8"),i="includes";r(r.P+r.F*e("5147")(i),"String",{includes:function(t){return!!~o(this,t,i).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},"30f1":function(t,n,e){"use strict";var r=e("b8e3"),o=e("63b6"),i=e("9138"),u=e("35e8"),c=e("481b"),a=e("8f60"),f=e("45f2"),s=e("53e2"),l=e("5168")("iterator"),p=!([].keys&&"next"in[].keys()),d="@@iterator",v="keys",h="values",b=function(){return this};t.exports=function(t,n,e,g,y,x,m){a(e,n,g);var w,O,S,j=function(t){if(!p&&t in C)return C[t];switch(t){case v:return function(){return new e(this,t)};case h:return function(){return new e(this,t)}}return function(){return new e(this,t)}},_=n+" Iterator",M=y==h,T=!1,C=t.prototype,E=C[l]||C[d]||y&&C[y],A=E||j(y),P=y?M?j("entries"):A:void 0,I="Array"==n&&C.entries||E;if(I&&(S=s(I.call(new t)),S!==Object.prototype&&S.next&&(f(S,_,!0),r||"function"==typeof S[l]||u(S,l,b))),M&&E&&E.name!==h&&(T=!0,A=function(){return E.call(this)}),r&&!m||!p&&!T&&C[l]||u(C,l,A),c[n]=A,c[_]=b,y)if(w={values:M?A:j(h),keys:x?A:j(v),entries:P},m)for(O in w)O in C||i(C,O,w[O]);else o(o.P+o.F*(p||T),n,w);return w}},"32a6":function(t,n,e){var r=e("241e"),o=e("c3a1");e("ce7e")("keys",function(){return function(t){return o(r(t))}})},"32e9":function(t,n,e){var r=e("86cc"),o=e("4630");t.exports=e("9e1e")?function(t,n,e){return r.f(t,n,o(1,e))}:function(t,n,e){return t[n]=e,t}},"32fc":function(t,n,e){var r=e("e53d").document;t.exports=r&&r.documentElement},"335c":function(t,n,e){var r=e("6b4c");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},"355d":function(t,n){n.f={}.propertyIsEnumerable},"35e8":function(t,n,e){var r=e("d9f6"),o=e("aebd");t.exports=e("8e60")?function(t,n,e){return r.f(t,n,o(1,e))}:function(t,n,e){return t[n]=e,t}},"36c3":function(t,n,e){var r=e("335c"),o=e("25eb");t.exports=function(t){return r(o(t))}},3702:function(t,n,e){var r=e("481b"),o=e("5168")("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||i[o]===t)}},"3a38":function(t,n){var e=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:e)(t)}},"40c3":function(t,n,e){var r=e("6b4c"),o=e("5168")("toStringTag"),i="Arguments"==r(function(){return arguments}()),u=function(t,n){try{return t[n]}catch(e){}};t.exports=function(t){var n,e,c;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=u(n=Object(t),o))?e:i?r(n):"Object"==(c=r(n))&&"function"==typeof n.callee?"Arguments":c}},4588:function(t,n){var e=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:e)(t)}},"45f2":function(t,n,e){var r=e("d9f6").f,o=e("07e3"),i=e("5168")("toStringTag");t.exports=function(t,n,e){t&&!o(t=e?t:t.prototype,i)&&r(t,i,{configurable:!0,value:n})}},4630:function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},"469f":function(t,n,e){e("6c1c"),e("1654"),t.exports=e("7d7b")},"481b":function(t,n){t.exports={}},"4aa6":function(t,n,e){t.exports=e("dc62")},"4bf8":function(t,n,e){var r=e("be13");t.exports=function(t){return Object(r(t))}},"4ee1":function(t,n,e){var r=e("5168")("iterator"),o=!1;try{var i=[7][r]();i["return"]=function(){o=!0},Array.from(i,function(){throw 2})}catch(u){}t.exports=function(t,n){if(!n&&!o)return!1;var e=!1;try{var i=[7],c=i[r]();c.next=function(){return{done:e=!0}},i[r]=function(){return c},t(i)}catch(u){}return e}},"50ed":function(t,n){t.exports=function(t,n){return{value:n,done:!!t}}},5147:function(t,n,e){var r=e("2b4c")("match");t.exports=function(t){var n=/./;try{"/./"[t](n)}catch(e){try{return n[r]=!1,!"/./"[t](n)}catch(o){}}return!0}},5168:function(t,n,e){var r=e("dbdb")("wks"),o=e("62a0"),i=e("e53d").Symbol,u="function"==typeof i,c=t.exports=function(t){return r[t]||(r[t]=u&&i[t]||(u?i:o)("Symbol."+t))};c.store=r},5176:function(t,n,e){t.exports=e("51b6")},"51b6":function(t,n,e){e("a3c3"),t.exports=e("584a").Object.assign},"520a":function(t,n,e){"use strict";var r=e("0bfb"),o=RegExp.prototype.exec,i=String.prototype.replace,u=o,c="lastIndex",a=function(){var t=/a/,n=/b*/g;return o.call(t,"a"),o.call(n,"a"),0!==t[c]||0!==n[c]}(),f=void 0!==/()??/.exec("")[1],s=a||f;s&&(u=function(t){var n,e,u,s,l=this;return f&&(e=new RegExp("^"+l.source+"$(?!\\s)",r.call(l))),a&&(n=l[c]),u=o.call(l,t),a&&u&&(l[c]=l.global?u.index+u[0].length:n),f&&u&&u.length>1&&i.call(u[0],e,function(){for(s=1;s1?arguments[1]:void 0,b=void 0!==h,g=0,y=s(p);if(b&&(h=r(h,v>2?arguments[2]:void 0,2)),void 0==y||d==Array&&c(y))for(n=a(p.length),e=new d(n);n>g;g++)f(e,g,b?h(p[g],g):p[g]);else for(l=y.call(p),e=new d;!(o=l.next()).done;g++)f(e,g,b?u(l,h,[o.value,g],!0):o.value);return e.length=g,e}})},"54a1":function(t,n,e){e("6c1c"),e("1654"),t.exports=e("95d5")},5537:function(t,n,e){var r=e("8378"),o=e("7726"),i="__core-js_shared__",u=o[i]||(o[i]={});(t.exports=function(t,n){return u[t]||(u[t]=void 0!==n?n:{})})("versions",[]).push({version:r.version,mode:e("2d00")?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},5559:function(t,n,e){var r=e("dbdb")("keys"),o=e("62a0");t.exports=function(t){return r[t]||(r[t]=o(t))}},"584a":function(t,n){var e=t.exports={version:"2.6.5"};"number"==typeof __e&&(__e=e)},"5b4e":function(t,n,e){var r=e("36c3"),o=e("b447"),i=e("0fc9");t.exports=function(t){return function(n,e,u){var c,a=r(n),f=o(a.length),s=i(u,f);if(t&&e!=e){while(f>s)if(c=a[s++],c!=c)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===e)return t||s||0;return!t&&-1}}},"5ca1":function(t,n,e){var r=e("7726"),o=e("8378"),i=e("32e9"),u=e("2aba"),c=e("9b43"),a="prototype",f=function(t,n,e){var s,l,p,d,v=t&f.F,h=t&f.G,b=t&f.S,g=t&f.P,y=t&f.B,x=h?r:b?r[n]||(r[n]={}):(r[n]||{})[a],m=h?o:o[n]||(o[n]={}),w=m[a]||(m[a]={});for(s in h&&(e=n),e)l=!v&&x&&void 0!==x[s],p=(l?x:e)[s],d=y&&l?c(p,r):g&&"function"==typeof p?c(Function.call,p):p,x&&u(x,s,p,t&f.U),m[s]!=p&&i(m,s,d),g&&w[s]!=p&&(w[s]=p)};r.core=o,f.F=1,f.G=2,f.S=4,f.P=8,f.B=16,f.W=32,f.U=64,f.R=128,t.exports=f},"5d73":function(t,n,e){t.exports=e("469f")},"5f1b":function(t,n,e){"use strict";var r=e("23c6"),o=RegExp.prototype.exec;t.exports=function(t,n){var e=t.exec;if("function"===typeof e){var i=e.call(t,n);if("object"!==typeof i)throw new TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==r(t))throw new TypeError("RegExp#exec called on incompatible receiver");return o.call(t,n)}},"626a":function(t,n,e){var r=e("2d95");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},"62a0":function(t,n){var e=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+r).toString(36))}},"63b6":function(t,n,e){var r=e("e53d"),o=e("584a"),i=e("d864"),u=e("35e8"),c=e("07e3"),a="prototype",f=function(t,n,e){var s,l,p,d=t&f.F,v=t&f.G,h=t&f.S,b=t&f.P,g=t&f.B,y=t&f.W,x=v?o:o[n]||(o[n]={}),m=x[a],w=v?r:h?r[n]:(r[n]||{})[a];for(s in v&&(e=n),e)l=!d&&w&&void 0!==w[s],l&&c(x,s)||(p=l?w[s]:e[s],x[s]=v&&"function"!=typeof w[s]?e[s]:g&&l?i(p,r):y&&w[s]==p?function(t){var n=function(n,e,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(n);case 2:return new t(n,e)}return new t(n,e,r)}return t.apply(this,arguments)};return n[a]=t[a],n}(p):b&&"function"==typeof p?i(Function.call,p):p,b&&((x.virtual||(x.virtual={}))[s]=p,t&f.R&&m&&!m[s]&&u(m,s,p)))};f.F=1,f.G=2,f.S=4,f.P=8,f.B=16,f.W=32,f.U=64,f.R=128,t.exports=f},6762:function(t,n,e){"use strict";var r=e("5ca1"),o=e("c366")(!0);r(r.P,"Array",{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),e("9c6c")("includes")},6821:function(t,n,e){var r=e("626a"),o=e("be13");t.exports=function(t){return r(o(t))}},"69a8":function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},"6a99":function(t,n,e){var r=e("d3f4");t.exports=function(t,n){if(!r(t))return t;var e,o;if(n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;if("function"==typeof(e=t.valueOf)&&!r(o=e.call(t)))return o;if(!n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},"6b4c":function(t,n){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},"6c1c":function(t,n,e){e("c367");for(var r=e("e53d"),o=e("35e8"),i=e("481b"),u=e("5168")("toStringTag"),c="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),a=0;a=f?t?"":void 0:(i=c.charCodeAt(a),i<55296||i>56319||a+1===f||(u=c.charCodeAt(a+1))<56320||u>57343?t?c.charAt(a):i:t?c.slice(a,a+2):u-56320+(i-55296<<10)+65536)}}},7726:function(t,n){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},"774e":function(t,n,e){t.exports=e("d2d5")},"77f1":function(t,n,e){var r=e("4588"),o=Math.max,i=Math.min;t.exports=function(t,n){return t=r(t),t<0?o(t+n,0):i(t,n)}},"794b":function(t,n,e){t.exports=!e("8e60")&&!e("294c")(function(){return 7!=Object.defineProperty(e("1ec9")("div"),"a",{get:function(){return 7}}).a})},"79aa":function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},"79e5":function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},"7cd6":function(t,n,e){var r=e("40c3"),o=e("5168")("iterator"),i=e("481b");t.exports=e("584a").getIteratorMethod=function(t){if(void 0!=t)return t[o]||t["@@iterator"]||i[r(t)]}},"7d7b":function(t,n,e){var r=e("e4ae"),o=e("7cd6");t.exports=e("584a").getIterator=function(t){var n=o(t);if("function"!=typeof n)throw TypeError(t+" is not iterable!");return r(n.call(t))}},"7e90":function(t,n,e){var r=e("d9f6"),o=e("e4ae"),i=e("c3a1");t.exports=e("8e60")?Object.defineProperties:function(t,n){o(t);var e,u=i(n),c=u.length,a=0;while(c>a)r.f(t,e=u[a++],n[e]);return t}},8378:function(t,n){var e=t.exports={version:"2.6.5"};"number"==typeof __e&&(__e=e)},8436:function(t,n){t.exports=function(){}},"86cc":function(t,n,e){var r=e("cb7c"),o=e("c69a"),i=e("6a99"),u=Object.defineProperty;n.f=e("9e1e")?Object.defineProperty:function(t,n,e){if(r(t),n=i(n,!0),r(e),o)try{return u(t,n,e)}catch(c){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[n]=e.value),t}},"8aae":function(t,n,e){e("32a6"),t.exports=e("584a").Object.keys},"8e60":function(t,n,e){t.exports=!e("294c")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},"8f60":function(t,n,e){"use strict";var r=e("a159"),o=e("aebd"),i=e("45f2"),u={};e("35e8")(u,e("5168")("iterator"),function(){return this}),t.exports=function(t,n,e){t.prototype=r(u,{next:o(1,e)}),i(t,n+" Iterator")}},9003:function(t,n,e){var r=e("6b4c");t.exports=Array.isArray||function(t){return"Array"==r(t)}},9138:function(t,n,e){t.exports=e("35e8")},9306:function(t,n,e){"use strict";var r=e("c3a1"),o=e("9aa9"),i=e("355d"),u=e("241e"),c=e("335c"),a=Object.assign;t.exports=!a||e("294c")(function(){var t={},n={},e=Symbol(),r="abcdefghijklmnopqrst";return t[e]=7,r.split("").forEach(function(t){n[t]=t}),7!=a({},t)[e]||Object.keys(a({},n)).join("")!=r})?function(t,n){var e=u(t),a=arguments.length,f=1,s=o.f,l=i.f;while(a>f){var p,d=c(arguments[f++]),v=s?r(d).concat(s(d)):r(d),h=v.length,b=0;while(h>b)l.call(d,p=v[b++])&&(e[p]=d[p])}return e}:a},9427:function(t,n,e){var r=e("63b6");r(r.S,"Object",{create:e("a159")})},"95d5":function(t,n,e){var r=e("40c3"),o=e("5168")("iterator"),i=e("481b");t.exports=e("584a").isIterable=function(t){var n=Object(t);return void 0!==n[o]||"@@iterator"in n||i.hasOwnProperty(r(n))}},"9aa9":function(t,n){n.f=Object.getOwnPropertySymbols},"9b43":function(t,n,e){var r=e("d8e8");t.exports=function(t,n,e){if(r(t),void 0===n)return t;switch(e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,o){return t.call(n,e,r,o)}}return function(){return t.apply(n,arguments)}}},"9c6c":function(t,n,e){var r=e("2b4c")("unscopables"),o=Array.prototype;void 0==o[r]&&e("32e9")(o,r,{}),t.exports=function(t){o[r][t]=!0}},"9def":function(t,n,e){var r=e("4588"),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},"9e1e":function(t,n,e){t.exports=!e("79e5")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},a159:function(t,n,e){var r=e("e4ae"),o=e("7e90"),i=e("1691"),u=e("5559")("IE_PROTO"),c=function(){},a="prototype",f=function(){var t,n=e("1ec9")("iframe"),r=i.length,o="<",u=">";n.style.display="none",e("32fc").appendChild(n),n.src="javascript:",t=n.contentWindow.document,t.open(),t.write(o+"script"+u+"document.F=Object"+o+"/script"+u),t.close(),f=t.F;while(r--)delete f[a][i[r]];return f()};t.exports=Object.create||function(t,n){var e;return null!==t?(c[a]=r(t),e=new c,c[a]=null,e[u]=t):e=f(),void 0===n?e:o(e,n)}},a352:function(n,e){n.exports=t},a3c3:function(t,n,e){var r=e("63b6");r(r.S+r.F,"Object",{assign:e("9306")})},a481:function(t,n,e){"use strict";var r=e("cb7c"),o=e("4bf8"),i=e("9def"),u=e("4588"),c=e("0390"),a=e("5f1b"),f=Math.max,s=Math.min,l=Math.floor,p=/\$([$&`']|\d\d?|<[^>]*>)/g,d=/\$([$&`']|\d\d?)/g,v=function(t){return void 0===t?t:String(t)};e("214f")("replace",2,function(t,n,e,h){return[function(r,o){var i=t(this),u=void 0==r?void 0:r[n];return void 0!==u?u.call(r,i,o):e.call(String(i),r,o)},function(t,n){var o=h(e,t,this,n);if(o.done)return o.value;var l=r(t),p=String(this),d="function"===typeof n;d||(n=String(n));var g=l.global;if(g){var y=l.unicode;l.lastIndex=0}var x=[];while(1){var m=a(l,p);if(null===m)break;if(x.push(m),!g)break;var w=String(m[0]);""===w&&(l.lastIndex=c(p,i(l.lastIndex),y))}for(var O="",S=0,j=0;j=S&&(O+=p.slice(S,M)+P,S=M+_.length)}return O+p.slice(S)}];function b(t,n,r,i,u,c){var a=r+t.length,f=i.length,s=d;return void 0!==u&&(u=o(u),s=p),e.call(c,s,function(e,o){var c;switch(o.charAt(0)){case"$":return"$";case"&":return t;case"`":return n.slice(0,r);case"'":return n.slice(a);case"<":c=u[o.slice(1,-1)];break;default:var s=+o;if(0===s)return e;if(s>f){var p=l(s/10);return 0===p?e:p<=f?void 0===i[p-1]?o.charAt(1):i[p-1]+o.charAt(1):e}c=i[s-1]}return void 0===c?"":c})}})},a4bb:function(t,n,e){t.exports=e("8aae")},a745:function(t,n,e){t.exports=e("f410")},aae3:function(t,n,e){var r=e("d3f4"),o=e("2d95"),i=e("2b4c")("match");t.exports=function(t){var n;return r(t)&&(void 0!==(n=t[i])?!!n:"RegExp"==o(t))}},aebd:function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},b0c5:function(t,n,e){"use strict";var r=e("520a");e("5ca1")({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},b0dc:function(t,n,e){var r=e("e4ae");t.exports=function(t,n,e,o){try{return o?n(r(e)[0],e[1]):n(e)}catch(u){var i=t["return"];throw void 0!==i&&r(i.call(t)),u}}},b447:function(t,n,e){var r=e("3a38"),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},b8e3:function(t,n){t.exports=!0},be13:function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},c366:function(t,n,e){var r=e("6821"),o=e("9def"),i=e("77f1");t.exports=function(t){return function(n,e,u){var c,a=r(n),f=o(a.length),s=i(u,f);if(t&&e!=e){while(f>s)if(c=a[s++],c!=c)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===e)return t||s||0;return!t&&-1}}},c367:function(t,n,e){"use strict";var r=e("8436"),o=e("50ed"),i=e("481b"),u=e("36c3");t.exports=e("30f1")(Array,"Array",function(t,n){this._t=u(t),this._i=0,this._k=n},function(){var t=this._t,n=this._k,e=this._i++;return!t||e>=t.length?(this._t=void 0,o(1)):o(0,"keys"==n?e:"values"==n?t[e]:[e,t[e]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},c3a1:function(t,n,e){var r=e("e6f3"),o=e("1691");t.exports=Object.keys||function(t){return r(t,o)}},c649:function(t,n,e){"use strict";(function(t){e.d(n,"c",function(){return l}),e.d(n,"a",function(){return f}),e.d(n,"b",function(){return u}),e.d(n,"d",function(){return s});e("a481");var r=e("4aa6"),o=e.n(r);function i(){return"undefined"!==typeof window?window.console:t.console}var u=i();function c(t){var n=o()(null);return function(e){var r=n[e];return r||(n[e]=t(e))}}var a=/-(\w)/g,f=c(function(t){return t.replace(a,function(t,n){return n?n.toUpperCase():""})});function s(t){null!==t.parentElement&&t.parentElement.removeChild(t)}function l(t,n,e){var r=0===e?t.children[0]:t.children[e-1].nextSibling;t.insertBefore(n,r)}}).call(this,e("c8ba"))},c69a:function(t,n,e){t.exports=!e("9e1e")&&!e("79e5")(function(){return 7!=Object.defineProperty(e("230e")("div"),"a",{get:function(){return 7}}).a})},c8ba:function(t,n){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(r){"object"===typeof window&&(e=window)}t.exports=e},c8bb:function(t,n,e){t.exports=e("54a1")},ca5a:function(t,n){var e=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+r).toString(36))}},cb7c:function(t,n,e){var r=e("d3f4");t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},ce7e:function(t,n,e){var r=e("63b6"),o=e("584a"),i=e("294c");t.exports=function(t,n){var e=(o.Object||{})[t]||Object[t],u={};u[t]=n(e),r(r.S+r.F*i(function(){e(1)}),"Object",u)}},d2c8:function(t,n,e){var r=e("aae3"),o=e("be13");t.exports=function(t,n,e){if(r(n))throw TypeError("String#"+e+" doesn't accept regex!");return String(o(t))}},d2d5:function(t,n,e){e("1654"),e("549b"),t.exports=e("584a").Array.from},d3f4:function(t,n){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},d864:function(t,n,e){var r=e("79aa");t.exports=function(t,n,e){if(r(t),void 0===n)return t;switch(e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,o){return t.call(n,e,r,o)}}return function(){return t.apply(n,arguments)}}},d8e8:function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},d9f6:function(t,n,e){var r=e("e4ae"),o=e("794b"),i=e("1bc3"),u=Object.defineProperty;n.f=e("8e60")?Object.defineProperty:function(t,n,e){if(r(t),n=i(n,!0),r(e),o)try{return u(t,n,e)}catch(c){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[n]=e.value),t}},dbdb:function(t,n,e){var r=e("584a"),o=e("e53d"),i="__core-js_shared__",u=o[i]||(o[i]={});(t.exports=function(t,n){return u[t]||(u[t]=void 0!==n?n:{})})("versions",[]).push({version:r.version,mode:e("b8e3")?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},dc62:function(t,n,e){e("9427");var r=e("584a").Object;t.exports=function(t,n){return r.create(t,n)}},e4ae:function(t,n,e){var r=e("f772");t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},e53d:function(t,n){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},e6f3:function(t,n,e){var r=e("07e3"),o=e("36c3"),i=e("5b4e")(!1),u=e("5559")("IE_PROTO");t.exports=function(t,n){var e,c=o(t),a=0,f=[];for(e in c)e!=u&&r(c,e)&&f.push(e);while(n.length>a)r(c,e=n[a++])&&(~i(f,e)||f.push(e));return f}},f410:function(t,n,e){e("1af6"),t.exports=e("584a").Array.isArray},f559:function(t,n,e){"use strict";var r=e("5ca1"),o=e("9def"),i=e("d2c8"),u="startsWith",c=""[u];r(r.P+r.F*e("5147")(u),"String",{startsWith:function(t){var n=i(this,t,u),e=o(Math.min(arguments.length>1?arguments[1]:void 0,n.length)),r=String(t);return c?c.call(n,r,e):n.slice(e,e+r.length)===r}})},f772:function(t,n){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},fa5b:function(t,n,e){t.exports=e("5537")("native-function-to-string",Function.toString)},fb15:function(t,n,e){"use strict";var r;(e.r(n),"undefined"!==typeof window)&&((r=window.document.currentScript)&&(r=r.src.match(/(.+\/)[^\/]+\.js(\?.*)?$/))&&(e.p=r[1]));var o=e("5176"),i=e.n(o),u=(e("f559"),e("a4bb")),c=e.n(u),a=(e("6762"),e("2fdb"),e("a745")),f=e.n(a);function s(t){if(f()(t))return t}var l=e("5d73"),p=e.n(l);function d(t,n){var e=[],r=!0,o=!1,i=void 0;try{for(var u,c=p()(t);!(r=(u=c.next()).done);r=!0)if(e.push(u.value),n&&e.length===n)break}catch(a){o=!0,i=a}finally{try{r||null==c["return"]||c["return"]()}finally{if(o)throw i}}return e}function v(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function h(t,n){return s(t)||d(t,n)||v()}function b(t){if(f()(t)){for(var n=0,e=new Array(t.length);n=i?o.length:o.indexOf(t)});return e?u.filter(function(t){return-1!==t}):u}function A(t,n){var e=this;this.$nextTick(function(){return e.$emit(t.toLowerCase(),n)})}function P(t){var n=this;return function(e){null!==n.realList&&n["onDrag"+t](e),A.call(n,t,e)}}function I(t){if(!t||1!==t.length)return!1;var n=h(t,1),e=n[0].componentOptions;return!!e&&["transition-group","TransitionGroup"].includes(e.tag)}function L(t,n){var e=n.header,r=n.footer,o=0,i=0;return e&&(o=e.length,t=t?[].concat(S(e),S(t)):S(e)),r&&(i=r.length,t=t?[].concat(S(t),S(r)):S(r)),{children:t,headerOffset:o,footerOffset:i}}function F(t,n){var e=null,r=function(t,n){e=T(e,t,n)},o=c()(t).filter(function(t){return"id"===t||t.startsWith("data-")}).reduce(function(n,e){return n[e]=t[e],n},{});if(r("attrs",o),!n)return e;var u=n.on,a=n.props,f=n.attrs;return r("on",u),r("props",a),i()(e.attrs,f),e}var $=["Start","Add","Remove","Update","End"],k=["Choose","Sort","Filter","Clone"],D=["Move"].concat($,k).map(function(t){return"on"+t}),R=null,V={options:Object,list:{type:Array,required:!1,default:null},value:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:function(t){return t}},element:{type:String,default:"div"},tag:{type:String,default:null},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},N={name:"draggable",inheritAttrs:!1,props:V,data:function(){return{transitionMode:!1,noneFunctionalComponentMode:!1,init:!1}},render:function(t){var n=this.$slots.default;this.transitionMode=I(n);var e=L(n,this.$slots),r=e.children,o=e.headerOffset,i=e.footerOffset;this.headerOffset=o,this.footerOffset=i;var u=F(this.$attrs,this.componentData);return t(this.getTag(),u,r)},created:function(){null!==this.list&&null!==this.value&&M["b"].error("Value and list props are mutually exclusive! Please set one or another."),"div"!==this.element&&M["b"].warn("Element props is deprecated please use tag props instead. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#element-props"),void 0!==this.options&&M["b"].warn("Options props is deprecated, add sortable options directly as vue.draggable item, or use v-bind. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#options-props")},mounted:function(){var t=this;if(this.noneFunctionalComponentMode=this.getTag().toLowerCase()!==this.$el.nodeName.toLowerCase(),this.noneFunctionalComponentMode&&this.transitionMode)throw new Error("Transition-group inside component is not supported. Please alter tag value or remove transition-group. Current tag value: ".concat(this.getTag()));var n={};$.forEach(function(e){n["on"+e]=P.call(t,e)}),k.forEach(function(e){n["on"+e]=A.bind(t,e)});var e=c()(this.$attrs).reduce(function(n,e){return n[Object(M["a"])(e)]=t.$attrs[e],n},{}),r=i()({},this.options,e,n,{onMove:function(n,e){return t.onDragMove(n,e)}});!("draggable"in r)&&(r.draggable=">*"),this._sortable=new _.a(this.rootContainer,r),this.computeIndexes()},beforeDestroy:function(){void 0!==this._sortable&&this._sortable.destroy()},computed:{rootContainer:function(){return this.transitionMode?this.$el.children[0]:this.$el},realList:function(){return this.list?this.list:this.value}},watch:{options:{handler:function(t){this.updateOptions(t)},deep:!0},$attrs:{handler:function(t){this.updateOptions(t)},deep:!0},realList:function(){this.computeIndexes()}},methods:{getTag:function(){return this.tag||this.element},updateOptions:function(t){for(var n in t){var e=Object(M["a"])(n);-1===D.indexOf(e)&&this._sortable.option(e,t[n])}},getChildrenNodes:function(){if(this.init||(this.noneFunctionalComponentMode=this.noneFunctionalComponentMode&&1===this.$children.length,this.init=!0),this.noneFunctionalComponentMode)return this.$children[0].$slots.default;var t=this.$slots.default;return this.transitionMode?t[0].child.$slots.default:t},computeIndexes:function(){var t=this;this.$nextTick(function(){t.visibleIndexes=E(t.getChildrenNodes(),t.rootContainer.children,t.transitionMode,t.footerOffset)})},getUnderlyingVm:function(t){var n=C(this.getChildrenNodes()||[],t);if(-1===n)return null;var e=this.realList[n];return{index:n,element:e}},getUnderlyingPotencialDraggableComponent:function(t){var n=t.__vue__;return n&&n.$options&&"transition-group"===n.$options._componentTag?n.$parent:n},emitChanges:function(t){var n=this;this.$nextTick(function(){n.$emit("change",t)})},alterList:function(t){if(this.list)t(this.list);else{var n=S(this.value);t(n),this.$emit("input",n)}},spliceList:function(){var t=arguments,n=function(n){return n.splice.apply(n,S(t))};this.alterList(n)},updatePosition:function(t,n){var e=function(e){return e.splice(n,0,e.splice(t,1)[0])};this.alterList(e)},getRelatedContextFromMoveEvent:function(t){var n=t.to,e=t.related,r=this.getUnderlyingPotencialDraggableComponent(n);if(!r)return{component:r};var o=r.realList,u={list:o,component:r};if(n!==e&&o&&r.getUnderlyingVm){var c=r.getUnderlyingVm(e);if(c)return i()(c,u)}return u},getVmIndex:function(t){var n=this.visibleIndexes,e=n.length;return t>e-1?e:n[t]},getComponent:function(){return this.$slots.default[0].componentInstance},resetTransitionData:function(t){if(this.noTransitionOnDrag&&this.transitionMode){var n=this.getChildrenNodes();n[t].data=null;var e=this.getComponent();e.children=[],e.kept=void 0}},onDragStart:function(t){this.context=this.getUnderlyingVm(t.item),t.item._underlying_vm_=this.clone(this.context.element),R=t.item},onDragAdd:function(t){var n=t.item._underlying_vm_;if(void 0!==n){Object(M["d"])(t.item);var e=this.getVmIndex(t.newIndex);this.spliceList(e,0,n),this.computeIndexes();var r={element:n,newIndex:e};this.emitChanges({added:r})}},onDragRemove:function(t){if(Object(M["c"])(this.rootContainer,t.item,t.oldIndex),"clone"!==t.pullMode){var n=this.context.index;this.spliceList(n,1);var e={element:this.context.element,oldIndex:n};this.resetTransitionData(n),this.emitChanges({removed:e})}else Object(M["d"])(t.clone)},onDragUpdate:function(t){Object(M["d"])(t.item),Object(M["c"])(t.from,t.item,t.oldIndex);var n=this.context.index,e=this.getVmIndex(t.newIndex);this.updatePosition(n,e);var r={element:this.context.element,oldIndex:n,newIndex:e};this.emitChanges({moved:r})},updateProperty:function(t,n){t.hasOwnProperty(n)&&(t[n]+=this.headerOffset)},computeFutureIndex:function(t,n){if(!t.element)return 0;var e=S(n.to.children).filter(function(t){return"none"!==t.style["display"]}),r=e.indexOf(n.related),o=t.component.getVmIndex(r),i=-1!==e.indexOf(R);return i||!n.willInsertAfter?o:o+1},onDragMove:function(t,n){var e=this.move;if(!e||!this.realList)return!0;var r=this.getRelatedContextFromMoveEvent(t),o=this.context,u=this.computeFutureIndex(r,t);i()(o,{futureIndex:u});var c=i()({},t,{relatedContext:r,draggedContext:o});return e(c,n)},onDragEnd:function(){this.computeIndexes(),R=null}}};"undefined"!==typeof window&&"Vue"in window&&window.Vue.component("draggable",N);var U=N;n["default"]=U}})["default"]}); -//# sourceMappingURL=vuedraggable.umd.min.js.map \ No newline at end of file diff --git a/resources/cider-ui/workbox-962786f2.js.map b/resources/cider-ui/workbox-962786f2.js.map deleted file mode 100644 index 94a0b528..00000000 --- a/resources/cider-ui/workbox-962786f2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"workbox-962786f2.js","sources":["C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-core/_version.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-core/_private/logger.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-core/models/messages/messageGenerator.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-core/_private/WorkboxError.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-routing/_version.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-routing/utils/constants.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-routing/utils/normalizeHandler.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-routing/Route.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-routing/RegExpRoute.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-routing/Router.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-routing/utils/getOrCreateDefaultRouter.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-routing/registerRoute.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-core/_private/cacheNames.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-core/_private/cacheMatchIgnoreParams.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-core/_private/Deferred.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-core/models/quotaErrorCallbacks.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-strategies/_version.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-strategies/StrategyHandler.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-core/_private/timeout.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-core/_private/getFriendlyURL.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-core/_private/executeQuotaErrorCallbacks.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-strategies/Strategy.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-core/_private/waitUntil.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-precaching/_version.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-precaching/utils/createCacheKey.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-precaching/utils/PrecacheInstallReportPlugin.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-precaching/utils/PrecacheCacheKeyPlugin.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-core/_private/canConstructResponseFromBodyStream.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-precaching/utils/getOrCreatePrecacheController.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-core/copyResponse.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-precaching/PrecacheStrategy.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-precaching/PrecacheController.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-precaching/PrecacheRoute.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-precaching/utils/generateURLVariations.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-precaching/utils/removeIgnoredSearchParams.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-strategies/CacheFirst.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-precaching/precacheAndRoute.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-precaching/precache.js","C:/Users/vieta/AppData/Roaming/nvm/v14.18.1/node_modules/workbox-cli/node_modules/workbox-precaching/addRoute.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:core:6.4.1'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2019 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst logger = (process.env.NODE_ENV === 'production'\n ? null\n : (() => {\n // Don't overwrite this value if it's already set.\n // See https://github.com/GoogleChrome/workbox/pull/2284#issuecomment-560470923\n if (!('__WB_DISABLE_DEV_LOGS' in self)) {\n self.__WB_DISABLE_DEV_LOGS = false;\n }\n let inGroup = false;\n const methodToColorMap = {\n debug: `#7f8c8d`,\n log: `#2ecc71`,\n warn: `#f39c12`,\n error: `#c0392b`,\n groupCollapsed: `#3498db`,\n groupEnd: null, // No colored prefix on groupEnd\n };\n const print = function (method, args) {\n if (self.__WB_DISABLE_DEV_LOGS) {\n return;\n }\n if (method === 'groupCollapsed') {\n // Safari doesn't print all console.groupCollapsed() arguments:\n // https://bugs.webkit.org/show_bug.cgi?id=182754\n if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {\n console[method](...args);\n return;\n }\n }\n const styles = [\n `background: ${methodToColorMap[method]}`,\n `border-radius: 0.5em`,\n `color: white`,\n `font-weight: bold`,\n `padding: 2px 0.5em`,\n ];\n // When in a group, the workbox prefix is not displayed.\n const logPrefix = inGroup ? [] : ['%cworkbox', styles.join(';')];\n console[method](...logPrefix, ...args);\n if (method === 'groupCollapsed') {\n inGroup = true;\n }\n if (method === 'groupEnd') {\n inGroup = false;\n }\n };\n // eslint-disable-next-line @typescript-eslint/ban-types\n const api = {};\n const loggerMethods = Object.keys(methodToColorMap);\n for (const key of loggerMethods) {\n const method = key;\n api[method] = (...args) => {\n print(method, args);\n };\n }\n return api;\n })());\nexport { logger };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { messages } from './messages.js';\nimport '../../_version.js';\nconst fallback = (code, ...args) => {\n let msg = code;\n if (args.length > 0) {\n msg += ` :: ${JSON.stringify(args)}`;\n }\n return msg;\n};\nconst generatorFunction = (code, details = {}) => {\n const message = messages[code];\n if (!message) {\n throw new Error(`Unable to find message for code '${code}'.`);\n }\n return message(details);\n};\nexport const messageGenerator = process.env.NODE_ENV === 'production' ? fallback : generatorFunction;\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { messageGenerator } from '../models/messages/messageGenerator.js';\nimport '../_version.js';\n/**\n * Workbox errors should be thrown with this class.\n * This allows use to ensure the type easily in tests,\n * helps developers identify errors from workbox\n * easily and allows use to optimise error\n * messages correctly.\n *\n * @private\n */\nclass WorkboxError extends Error {\n /**\n *\n * @param {string} errorCode The error code that\n * identifies this particular error.\n * @param {Object=} details Any relevant arguments\n * that will help developers identify issues should\n * be added as a key on the context object.\n */\n constructor(errorCode, details) {\n const message = messageGenerator(errorCode, details);\n super(message);\n this.name = errorCode;\n this.details = details;\n }\n}\nexport { WorkboxError };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:routing:6.4.1'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * The default HTTP method, 'GET', used when there's no specific method\n * configured for a route.\n *\n * @type {string}\n *\n * @private\n */\nexport const defaultMethod = 'GET';\n/**\n * The list of valid HTTP methods associated with requests that could be routed.\n *\n * @type {Array}\n *\n * @private\n */\nexport const validMethods = [\n 'DELETE',\n 'GET',\n 'HEAD',\n 'PATCH',\n 'POST',\n 'PUT',\n];\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport '../_version.js';\n/**\n * @param {function()|Object} handler Either a function, or an object with a\n * 'handle' method.\n * @return {Object} An object with a handle method.\n *\n * @private\n */\nexport const normalizeHandler = (handler) => {\n if (handler && typeof handler === 'object') {\n if (process.env.NODE_ENV !== 'production') {\n assert.hasMethod(handler, 'handle', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'handler',\n });\n }\n return handler;\n }\n else {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(handler, 'function', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'handler',\n });\n }\n return { handle: handler };\n }\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { defaultMethod, validMethods } from './utils/constants.js';\nimport { normalizeHandler } from './utils/normalizeHandler.js';\nimport './_version.js';\n/**\n * A `Route` consists of a pair of callback functions, \"match\" and \"handler\".\n * The \"match\" callback determine if a route should be used to \"handle\" a\n * request by returning a non-falsy value if it can. The \"handler\" callback\n * is called when there is a match and should return a Promise that resolves\n * to a `Response`.\n *\n * @memberof module:workbox-routing\n */\nclass Route {\n /**\n * Constructor for Route class.\n *\n * @param {module:workbox-routing~matchCallback} match\n * A callback function that determines whether the route matches a given\n * `fetch` event by returning a non-falsy value.\n * @param {module:workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resolving to a Response.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n */\n constructor(match, handler, method = defaultMethod) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(match, 'function', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'match',\n });\n if (method) {\n assert.isOneOf(method, validMethods, { paramName: 'method' });\n }\n }\n // These values are referenced directly by Router so cannot be\n // altered by minificaton.\n this.handler = normalizeHandler(handler);\n this.match = match;\n this.method = method;\n }\n /**\n *\n * @param {module:workbox-routing-handlerCallback} handler A callback\n * function that returns a Promise resolving to a Response\n */\n setCatchHandler(handler) {\n this.catchHandler = normalizeHandler(handler);\n }\n}\nexport { Route };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { Route } from './Route.js';\nimport './_version.js';\n/**\n * RegExpRoute makes it easy to create a regular expression based\n * [Route]{@link module:workbox-routing.Route}.\n *\n * For same-origin requests the RegExp only needs to match part of the URL. For\n * requests against third-party servers, you must define a RegExp that matches\n * the start of the URL.\n *\n * [See the module docs for info.]{@link https://developers.google.com/web/tools/workbox/modules/workbox-routing}\n *\n * @memberof module:workbox-routing\n * @extends module:workbox-routing.Route\n */\nclass RegExpRoute extends Route {\n /**\n * If the regular expression contains\n * [capture groups]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#grouping-back-references},\n * the captured values will be passed to the\n * [handler's]{@link module:workbox-routing~handlerCallback} `params`\n * argument.\n *\n * @param {RegExp} regExp The regular expression to match against URLs.\n * @param {module:workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n */\n constructor(regExp, handler, method) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(regExp, RegExp, {\n moduleName: 'workbox-routing',\n className: 'RegExpRoute',\n funcName: 'constructor',\n paramName: 'pattern',\n });\n }\n const match = ({ url }) => {\n const result = regExp.exec(url.href);\n // Return immediately if there's no match.\n if (!result) {\n return;\n }\n // Require that the match start at the first character in the URL string\n // if it's a cross-origin request.\n // See https://github.com/GoogleChrome/workbox/issues/281 for the context\n // behind this behavior.\n if (url.origin !== location.origin && result.index !== 0) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`The regular expression '${regExp.toString()}' only partially matched ` +\n `against the cross-origin URL '${url.toString()}'. RegExpRoute's will only ` +\n `handle cross-origin requests if they match the entire URL.`);\n }\n return;\n }\n // If the route matches, but there aren't any capture groups defined, then\n // this will return [], which is truthy and therefore sufficient to\n // indicate a match.\n // If there are capture groups, then it will return their values.\n return result.slice(1);\n };\n super(match, handler, method);\n }\n}\nexport { RegExpRoute };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { defaultMethod } from './utils/constants.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { normalizeHandler } from './utils/normalizeHandler.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport './_version.js';\n/**\n * The Router can be used to process a FetchEvent through one or more\n * [Routes]{@link module:workbox-routing.Route} responding with a Request if\n * a matching route exists.\n *\n * If no route matches a given a request, the Router will use a \"default\"\n * handler if one is defined.\n *\n * Should the matching Route throw an error, the Router will use a \"catch\"\n * handler if one is defined to gracefully deal with issues and respond with a\n * Request.\n *\n * If a request matches multiple routes, the **earliest** registered route will\n * be used to respond to the request.\n *\n * @memberof module:workbox-routing\n */\nclass Router {\n /**\n * Initializes a new Router.\n */\n constructor() {\n this._routes = new Map();\n this._defaultHandlerMap = new Map();\n }\n /**\n * @return {Map>} routes A `Map` of HTTP\n * method name ('GET', etc.) to an array of all the corresponding `Route`\n * instances that are registered.\n */\n get routes() {\n return this._routes;\n }\n /**\n * Adds a fetch event listener to respond to events when a route matches\n * the event's request.\n */\n addFetchListener() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('fetch', ((event) => {\n const { request } = event;\n const responsePromise = this.handleRequest({ request, event });\n if (responsePromise) {\n event.respondWith(responsePromise);\n }\n }));\n }\n /**\n * Adds a message event listener for URLs to cache from the window.\n * This is useful to cache resources loaded on the page prior to when the\n * service worker started controlling it.\n *\n * The format of the message data sent from the window should be as follows.\n * Where the `urlsToCache` array may consist of URL strings or an array of\n * URL string + `requestInit` object (the same as you'd pass to `fetch()`).\n *\n * ```\n * {\n * type: 'CACHE_URLS',\n * payload: {\n * urlsToCache: [\n * './script1.js',\n * './script2.js',\n * ['./script3.js', {mode: 'no-cors'}],\n * ],\n * },\n * }\n * ```\n */\n addCacheListener() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('message', ((event) => {\n // event.data is type 'any'\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (event.data && event.data.type === 'CACHE_URLS') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const { payload } = event.data;\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Caching URLs from the window`, payload.urlsToCache);\n }\n const requestPromises = Promise.all(payload.urlsToCache.map((entry) => {\n if (typeof entry === 'string') {\n entry = [entry];\n }\n const request = new Request(...entry);\n return this.handleRequest({ request, event });\n // TODO(philipwalton): TypeScript errors without this typecast for\n // some reason (probably a bug). The real type here should work but\n // doesn't: `Array | undefined>`.\n })); // TypeScript\n event.waitUntil(requestPromises);\n // If a MessageChannel was used, reply to the message on success.\n if (event.ports && event.ports[0]) {\n void requestPromises.then(() => event.ports[0].postMessage(true));\n }\n }\n }));\n }\n /**\n * Apply the routing rules to a FetchEvent object to get a Response from an\n * appropriate Route's handler.\n *\n * @param {Object} options\n * @param {Request} options.request The request to handle.\n * @param {ExtendableEvent} options.event The event that triggered the\n * request.\n * @return {Promise|undefined} A promise is returned if a\n * registered route can handle the request. If there is no matching\n * route and there's no `defaultHandler`, `undefined` is returned.\n */\n handleRequest({ request, event, }) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'handleRequest',\n paramName: 'options.request',\n });\n }\n const url = new URL(request.url, location.href);\n if (!url.protocol.startsWith('http')) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Workbox Router only supports URLs that start with 'http'.`);\n }\n return;\n }\n const sameOrigin = url.origin === location.origin;\n const { params, route } = this.findMatchingRoute({\n event,\n request,\n sameOrigin,\n url,\n });\n let handler = route && route.handler;\n const debugMessages = [];\n if (process.env.NODE_ENV !== 'production') {\n if (handler) {\n debugMessages.push([`Found a route to handle this request:`, route]);\n if (params) {\n debugMessages.push([\n `Passing the following params to the route's handler:`,\n params,\n ]);\n }\n }\n }\n // If we don't have a handler because there was no matching route, then\n // fall back to defaultHandler if that's defined.\n const method = request.method;\n if (!handler && this._defaultHandlerMap.has(method)) {\n if (process.env.NODE_ENV !== 'production') {\n debugMessages.push(`Failed to find a matching route. Falling ` +\n `back to the default handler for ${method}.`);\n }\n handler = this._defaultHandlerMap.get(method);\n }\n if (!handler) {\n if (process.env.NODE_ENV !== 'production') {\n // No handler so Workbox will do nothing. If logs is set of debug\n // i.e. verbose, we should print out this information.\n logger.debug(`No route found for: ${getFriendlyURL(url)}`);\n }\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // We have a handler, meaning Workbox is going to handle the route.\n // print the routing details to the console.\n logger.groupCollapsed(`Router is responding to: ${getFriendlyURL(url)}`);\n debugMessages.forEach((msg) => {\n if (Array.isArray(msg)) {\n logger.log(...msg);\n }\n else {\n logger.log(msg);\n }\n });\n logger.groupEnd();\n }\n // Wrap in try and catch in case the handle method throws a synchronous\n // error. It should still callback to the catch handler.\n let responsePromise;\n try {\n responsePromise = handler.handle({ url, request, event, params });\n }\n catch (err) {\n responsePromise = Promise.reject(err);\n }\n // Get route's catch handler, if it exists\n const catchHandler = route && route.catchHandler;\n if (responsePromise instanceof Promise &&\n (this._catchHandler || catchHandler)) {\n responsePromise = responsePromise.catch(async (err) => {\n // If there's a route catch handler, process that first\n if (catchHandler) {\n if (process.env.NODE_ENV !== 'production') {\n // Still include URL here as it will be async from the console group\n // and may not make sense without the URL\n logger.groupCollapsed(`Error thrown when responding to: ` +\n ` ${getFriendlyURL(url)}. Falling back to route's Catch Handler.`);\n logger.error(`Error thrown by:`, route);\n logger.error(err);\n logger.groupEnd();\n }\n try {\n return await catchHandler.handle({ url, request, event, params });\n }\n catch (catchErr) {\n if (catchErr instanceof Error) {\n err = catchErr;\n }\n }\n }\n if (this._catchHandler) {\n if (process.env.NODE_ENV !== 'production') {\n // Still include URL here as it will be async from the console group\n // and may not make sense without the URL\n logger.groupCollapsed(`Error thrown when responding to: ` +\n ` ${getFriendlyURL(url)}. Falling back to global Catch Handler.`);\n logger.error(`Error thrown by:`, route);\n logger.error(err);\n logger.groupEnd();\n }\n return this._catchHandler.handle({ url, request, event });\n }\n throw err;\n });\n }\n return responsePromise;\n }\n /**\n * Checks a request and URL (and optionally an event) against the list of\n * registered routes, and if there's a match, returns the corresponding\n * route along with any params generated by the match.\n *\n * @param {Object} options\n * @param {URL} options.url\n * @param {boolean} options.sameOrigin The result of comparing `url.origin`\n * against the current origin.\n * @param {Request} options.request The request to match.\n * @param {Event} options.event The corresponding event.\n * @return {Object} An object with `route` and `params` properties.\n * They are populated if a matching route was found or `undefined`\n * otherwise.\n */\n findMatchingRoute({ url, sameOrigin, request, event, }) {\n const routes = this._routes.get(request.method) || [];\n for (const route of routes) {\n let params;\n // route.match returns type any, not possible to change right now.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const matchResult = route.match({ url, sameOrigin, request, event });\n if (matchResult) {\n if (process.env.NODE_ENV !== 'production') {\n // Warn developers that using an async matchCallback is almost always\n // not the right thing to do.\n if (matchResult instanceof Promise) {\n logger.warn(`While routing ${getFriendlyURL(url)}, an async ` +\n `matchCallback function was used. Please convert the ` +\n `following route to use a synchronous matchCallback function:`, route);\n }\n }\n // See https://github.com/GoogleChrome/workbox/issues/2079\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n params = matchResult;\n if (Array.isArray(params) && params.length === 0) {\n // Instead of passing an empty array in as params, use undefined.\n params = undefined;\n }\n else if (matchResult.constructor === Object && // eslint-disable-line\n Object.keys(matchResult).length === 0) {\n // Instead of passing an empty object in as params, use undefined.\n params = undefined;\n }\n else if (typeof matchResult === 'boolean') {\n // For the boolean value true (rather than just something truth-y),\n // don't set params.\n // See https://github.com/GoogleChrome/workbox/pull/2134#issuecomment-513924353\n params = undefined;\n }\n // Return early if have a match.\n return { route, params };\n }\n }\n // If no match was found above, return and empty object.\n return {};\n }\n /**\n * Define a default `handler` that's called when no routes explicitly\n * match the incoming request.\n *\n * Each HTTP method ('GET', 'POST', etc.) gets its own default handler.\n *\n * Without a default handler, unmatched requests will go against the\n * network as if there were no service worker present.\n *\n * @param {module:workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n * @param {string} [method='GET'] The HTTP method to associate with this\n * default handler. Each method has its own default.\n */\n setDefaultHandler(handler, method = defaultMethod) {\n this._defaultHandlerMap.set(method, normalizeHandler(handler));\n }\n /**\n * If a Route throws an error while handling a request, this `handler`\n * will be called and given a chance to provide a response.\n *\n * @param {module:workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n */\n setCatchHandler(handler) {\n this._catchHandler = normalizeHandler(handler);\n }\n /**\n * Registers a route with the router.\n *\n * @param {module:workbox-routing.Route} route The route to register.\n */\n registerRoute(route) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(route, 'object', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.hasMethod(route, 'match', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.isType(route.handler, 'object', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.hasMethod(route.handler, 'handle', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route.handler',\n });\n assert.isType(route.method, 'string', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route.method',\n });\n }\n if (!this._routes.has(route.method)) {\n this._routes.set(route.method, []);\n }\n // Give precedence to all of the earlier routes by adding this additional\n // route to the end of the array.\n this._routes.get(route.method).push(route);\n }\n /**\n * Unregisters a route with the router.\n *\n * @param {module:workbox-routing.Route} route The route to unregister.\n */\n unregisterRoute(route) {\n if (!this._routes.has(route.method)) {\n throw new WorkboxError('unregister-route-but-not-found-with-method', {\n method: route.method,\n });\n }\n const routeIndex = this._routes.get(route.method).indexOf(route);\n if (routeIndex > -1) {\n this._routes.get(route.method).splice(routeIndex, 1);\n }\n else {\n throw new WorkboxError('unregister-route-route-not-registered');\n }\n }\n}\nexport { Router };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { Router } from '../Router.js';\nimport '../_version.js';\nlet defaultRouter;\n/**\n * Creates a new, singleton Router instance if one does not exist. If one\n * does already exist, that instance is returned.\n *\n * @private\n * @return {Router}\n */\nexport const getOrCreateDefaultRouter = () => {\n if (!defaultRouter) {\n defaultRouter = new Router();\n // The helpers that use the default Router assume these listeners exist.\n defaultRouter.addFetchListener();\n defaultRouter.addCacheListener();\n }\n return defaultRouter;\n};\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Route } from './Route.js';\nimport { RegExpRoute } from './RegExpRoute.js';\nimport { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';\nimport './_version.js';\n/**\n * Easily register a RegExp, string, or function with a caching\n * strategy to a singleton Router instance.\n *\n * This method will generate a Route for you if needed and\n * call [registerRoute()]{@link module:workbox-routing.Router#registerRoute}.\n *\n * @param {RegExp|string|module:workbox-routing.Route~matchCallback|module:workbox-routing.Route} capture\n * If the capture param is a `Route`, all other arguments will be ignored.\n * @param {module:workbox-routing~handlerCallback} [handler] A callback\n * function that returns a Promise resulting in a Response. This parameter\n * is required if `capture` is not a `Route` object.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n * @return {module:workbox-routing.Route} The generated `Route`(Useful for\n * unregistering).\n *\n * @memberof module:workbox-routing\n */\nfunction registerRoute(capture, handler, method) {\n let route;\n if (typeof capture === 'string') {\n const captureUrl = new URL(capture, location.href);\n if (process.env.NODE_ENV !== 'production') {\n if (!(capture.startsWith('/') || capture.startsWith('http'))) {\n throw new WorkboxError('invalid-string', {\n moduleName: 'workbox-routing',\n funcName: 'registerRoute',\n paramName: 'capture',\n });\n }\n // We want to check if Express-style wildcards are in the pathname only.\n // TODO: Remove this log message in v4.\n const valueToCheck = capture.startsWith('http')\n ? captureUrl.pathname\n : capture;\n // See https://github.com/pillarjs/path-to-regexp#parameters\n const wildcards = '[*:?+]';\n if (new RegExp(`${wildcards}`).exec(valueToCheck)) {\n logger.debug(`The '$capture' parameter contains an Express-style wildcard ` +\n `character (${wildcards}). Strings are now always interpreted as ` +\n `exact matches; use a RegExp for partial or wildcard matches.`);\n }\n }\n const matchCallback = ({ url }) => {\n if (process.env.NODE_ENV !== 'production') {\n if (url.pathname === captureUrl.pathname &&\n url.origin !== captureUrl.origin) {\n logger.debug(`${capture} only partially matches the cross-origin URL ` +\n `${url.toString()}. This route will only handle cross-origin requests ` +\n `if they match the entire URL.`);\n }\n }\n return url.href === captureUrl.href;\n };\n // If `capture` is a string then `handler` and `method` must be present.\n route = new Route(matchCallback, handler, method);\n }\n else if (capture instanceof RegExp) {\n // If `capture` is a `RegExp` then `handler` and `method` must be present.\n route = new RegExpRoute(capture, handler, method);\n }\n else if (typeof capture === 'function') {\n // If `capture` is a function then `handler` and `method` must be present.\n route = new Route(capture, handler, method);\n }\n else if (capture instanceof Route) {\n route = capture;\n }\n else {\n throw new WorkboxError('unsupported-route-type', {\n moduleName: 'workbox-routing',\n funcName: 'registerRoute',\n paramName: 'capture',\n });\n }\n const defaultRouter = getOrCreateDefaultRouter();\n defaultRouter.registerRoute(route);\n return route;\n}\nexport { registerRoute };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst _cacheNameDetails = {\n googleAnalytics: 'googleAnalytics',\n precache: 'precache-v2',\n prefix: 'workbox',\n runtime: 'runtime',\n suffix: typeof registration !== 'undefined' ? registration.scope : '',\n};\nconst _createCacheName = (cacheName) => {\n return [_cacheNameDetails.prefix, cacheName, _cacheNameDetails.suffix]\n .filter((value) => value && value.length > 0)\n .join('-');\n};\nconst eachCacheNameDetail = (fn) => {\n for (const key of Object.keys(_cacheNameDetails)) {\n fn(key);\n }\n};\nexport const cacheNames = {\n updateDetails: (details) => {\n eachCacheNameDetail((key) => {\n if (typeof details[key] === 'string') {\n _cacheNameDetails[key] = details[key];\n }\n });\n },\n getGoogleAnalyticsName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.googleAnalytics);\n },\n getPrecacheName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.precache);\n },\n getPrefix: () => {\n return _cacheNameDetails.prefix;\n },\n getRuntimeName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.runtime);\n },\n getSuffix: () => {\n return _cacheNameDetails.suffix;\n },\n};\n","/*\n Copyright 2020 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nfunction stripParams(fullURL, ignoreParams) {\n const strippedURL = new URL(fullURL);\n for (const param of ignoreParams) {\n strippedURL.searchParams.delete(param);\n }\n return strippedURL.href;\n}\n/**\n * Matches an item in the cache, ignoring specific URL params. This is similar\n * to the `ignoreSearch` option, but it allows you to ignore just specific\n * params (while continuing to match on the others).\n *\n * @private\n * @param {Cache} cache\n * @param {Request} request\n * @param {Object} matchOptions\n * @param {Array} ignoreParams\n * @return {Promise}\n */\nasync function cacheMatchIgnoreParams(cache, request, ignoreParams, matchOptions) {\n const strippedRequestURL = stripParams(request.url, ignoreParams);\n // If the request doesn't include any ignored params, match as normal.\n if (request.url === strippedRequestURL) {\n return cache.match(request, matchOptions);\n }\n // Otherwise, match by comparing keys\n const keysOptions = Object.assign(Object.assign({}, matchOptions), { ignoreSearch: true });\n const cacheKeys = await cache.keys(request, keysOptions);\n for (const cacheKey of cacheKeys) {\n const strippedCacheKeyURL = stripParams(cacheKey.url, ignoreParams);\n if (strippedRequestURL === strippedCacheKeyURL) {\n return cache.match(cacheKey, matchOptions);\n }\n }\n return;\n}\nexport { cacheMatchIgnoreParams };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * The Deferred class composes Promises in a way that allows for them to be\n * resolved or rejected from outside the constructor. In most cases promises\n * should be used directly, but Deferreds can be necessary when the logic to\n * resolve a promise must be separate.\n *\n * @private\n */\nclass Deferred {\n /**\n * Creates a promise and exposes its resolve and reject functions as methods.\n */\n constructor() {\n this.promise = new Promise((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n }\n}\nexport { Deferred };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n// Callbacks to be executed whenever there's a quota error.\n// Can't change Function type right now.\n// eslint-disable-next-line @typescript-eslint/ban-types\nconst quotaErrorCallbacks = new Set();\nexport { quotaErrorCallbacks };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:strategies:6.4.1'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheMatchIgnoreParams } from 'workbox-core/_private/cacheMatchIgnoreParams.js';\nimport { Deferred } from 'workbox-core/_private/Deferred.js';\nimport { executeQuotaErrorCallbacks } from 'workbox-core/_private/executeQuotaErrorCallbacks.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { timeout } from 'workbox-core/_private/timeout.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport './_version.js';\nfunction toRequest(input) {\n return typeof input === 'string' ? new Request(input) : input;\n}\n/**\n * A class created every time a Strategy instance instance calls\n * [handle()]{@link module:workbox-strategies.Strategy~handle} or\n * [handleAll()]{@link module:workbox-strategies.Strategy~handleAll} that wraps all fetch and\n * cache actions around plugin callbacks and keeps track of when the strategy\n * is \"done\" (i.e. all added `event.waitUntil()` promises have resolved).\n *\n * @memberof module:workbox-strategies\n */\nclass StrategyHandler {\n /**\n * Creates a new instance associated with the passed strategy and event\n * that's handling the request.\n *\n * The constructor also initializes the state that will be passed to each of\n * the plugins handling this request.\n *\n * @param {module:workbox-strategies.Strategy} strategy\n * @param {Object} options\n * @param {Request|string} options.request A request to run this strategy for.\n * @param {ExtendableEvent} options.event The event associated with the\n * request.\n * @param {URL} [options.url]\n * @param {*} [options.params]\n * [match callback]{@link module:workbox-routing~matchCallback},\n * (if applicable).\n */\n constructor(strategy, options) {\n this._cacheKeys = {};\n /**\n * The request the strategy is performing (passed to the strategy's\n * `handle()` or `handleAll()` method).\n * @name request\n * @instance\n * @type {Request}\n * @memberof module:workbox-strategies.StrategyHandler\n */\n /**\n * The event associated with this request.\n * @name event\n * @instance\n * @type {ExtendableEvent}\n * @memberof module:workbox-strategies.StrategyHandler\n */\n /**\n * A `URL` instance of `request.url` (if passed to the strategy's\n * `handle()` or `handleAll()` method).\n * Note: the `url` param will be present if the strategy was invoked\n * from a workbox `Route` object.\n * @name url\n * @instance\n * @type {URL|undefined}\n * @memberof module:workbox-strategies.StrategyHandler\n */\n /**\n * A `param` value (if passed to the strategy's\n * `handle()` or `handleAll()` method).\n * Note: the `param` param will be present if the strategy was invoked\n * from a workbox `Route` object and the\n * [match callback]{@link module:workbox-routing~matchCallback} returned\n * a truthy value (it will be that value).\n * @name params\n * @instance\n * @type {*|undefined}\n * @memberof module:workbox-strategies.StrategyHandler\n */\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(options.event, ExtendableEvent, {\n moduleName: 'workbox-strategies',\n className: 'StrategyHandler',\n funcName: 'constructor',\n paramName: 'options.event',\n });\n }\n Object.assign(this, options);\n this.event = options.event;\n this._strategy = strategy;\n this._handlerDeferred = new Deferred();\n this._extendLifetimePromises = [];\n // Copy the plugins list (since it's mutable on the strategy),\n // so any mutations don't affect this handler instance.\n this._plugins = [...strategy.plugins];\n this._pluginStateMap = new Map();\n for (const plugin of this._plugins) {\n this._pluginStateMap.set(plugin, {});\n }\n this.event.waitUntil(this._handlerDeferred.promise);\n }\n /**\n * Fetches a given request (and invokes any applicable plugin callback\n * methods) using the `fetchOptions` (for non-navigation requests) and\n * `plugins` defined on the `Strategy` object.\n *\n * The following plugin lifecycle methods are invoked when using this method:\n * - `requestWillFetch()`\n * - `fetchDidSucceed()`\n * - `fetchDidFail()`\n *\n * @param {Request|string} input The URL or request to fetch.\n * @return {Promise}\n */\n async fetch(input) {\n const { event } = this;\n let request = toRequest(input);\n if (request.mode === 'navigate' &&\n event instanceof FetchEvent &&\n event.preloadResponse) {\n const possiblePreloadResponse = (await event.preloadResponse);\n if (possiblePreloadResponse) {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Using a preloaded navigation response for ` +\n `'${getFriendlyURL(request.url)}'`);\n }\n return possiblePreloadResponse;\n }\n }\n // If there is a fetchDidFail plugin, we need to save a clone of the\n // original request before it's either modified by a requestWillFetch\n // plugin or before the original request's body is consumed via fetch().\n const originalRequest = this.hasCallback('fetchDidFail')\n ? request.clone()\n : null;\n try {\n for (const cb of this.iterateCallbacks('requestWillFetch')) {\n request = await cb({ request: request.clone(), event });\n }\n }\n catch (err) {\n if (err instanceof Error) {\n throw new WorkboxError('plugin-error-request-will-fetch', {\n thrownErrorMessage: err.message,\n });\n }\n }\n // The request can be altered by plugins with `requestWillFetch` making\n // the original request (most likely from a `fetch` event) different\n // from the Request we make. Pass both to `fetchDidFail` to aid debugging.\n const pluginFilteredRequest = request.clone();\n try {\n let fetchResponse;\n // See https://github.com/GoogleChrome/workbox/issues/1796\n fetchResponse = await fetch(request, request.mode === 'navigate' ? undefined : this._strategy.fetchOptions);\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Network request for ` +\n `'${getFriendlyURL(request.url)}' returned a response with ` +\n `status '${fetchResponse.status}'.`);\n }\n for (const callback of this.iterateCallbacks('fetchDidSucceed')) {\n fetchResponse = await callback({\n event,\n request: pluginFilteredRequest,\n response: fetchResponse,\n });\n }\n return fetchResponse;\n }\n catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Network request for ` +\n `'${getFriendlyURL(request.url)}' threw an error.`, error);\n }\n // `originalRequest` will only exist if a `fetchDidFail` callback\n // is being used (see above).\n if (originalRequest) {\n await this.runCallbacks('fetchDidFail', {\n error: error,\n event,\n originalRequest: originalRequest.clone(),\n request: pluginFilteredRequest.clone(),\n });\n }\n throw error;\n }\n }\n /**\n * Calls `this.fetch()` and (in the background) runs `this.cachePut()` on\n * the response generated by `this.fetch()`.\n *\n * The call to `this.cachePut()` automatically invokes `this.waitUntil()`,\n * so you do not have to manually call `waitUntil()` on the event.\n *\n * @param {Request|string} input The request or URL to fetch and cache.\n * @return {Promise}\n */\n async fetchAndCachePut(input) {\n const response = await this.fetch(input);\n const responseClone = response.clone();\n void this.waitUntil(this.cachePut(input, responseClone));\n return response;\n }\n /**\n * Matches a request from the cache (and invokes any applicable plugin\n * callback methods) using the `cacheName`, `matchOptions`, and `plugins`\n * defined on the strategy object.\n *\n * The following plugin lifecycle methods are invoked when using this method:\n * - cacheKeyWillByUsed()\n * - cachedResponseWillByUsed()\n *\n * @param {Request|string} key The Request or URL to use as the cache key.\n * @return {Promise} A matching response, if found.\n */\n async cacheMatch(key) {\n const request = toRequest(key);\n let cachedResponse;\n const { cacheName, matchOptions } = this._strategy;\n const effectiveRequest = await this.getCacheKey(request, 'read');\n const multiMatchOptions = Object.assign(Object.assign({}, matchOptions), { cacheName });\n cachedResponse = await caches.match(effectiveRequest, multiMatchOptions);\n if (process.env.NODE_ENV !== 'production') {\n if (cachedResponse) {\n logger.debug(`Found a cached response in '${cacheName}'.`);\n }\n else {\n logger.debug(`No cached response found in '${cacheName}'.`);\n }\n }\n for (const callback of this.iterateCallbacks('cachedResponseWillBeUsed')) {\n cachedResponse =\n (await callback({\n cacheName,\n matchOptions,\n cachedResponse,\n request: effectiveRequest,\n event: this.event,\n })) || undefined;\n }\n return cachedResponse;\n }\n /**\n * Puts a request/response pair in the cache (and invokes any applicable\n * plugin callback methods) using the `cacheName` and `plugins` defined on\n * the strategy object.\n *\n * The following plugin lifecycle methods are invoked when using this method:\n * - cacheKeyWillByUsed()\n * - cacheWillUpdate()\n * - cacheDidUpdate()\n *\n * @param {Request|string} key The request or URL to use as the cache key.\n * @param {Response} response The response to cache.\n * @return {Promise} `false` if a cacheWillUpdate caused the response\n * not be cached, and `true` otherwise.\n */\n async cachePut(key, response) {\n const request = toRequest(key);\n // Run in the next task to avoid blocking other cache reads.\n // https://github.com/w3c/ServiceWorker/issues/1397\n await timeout(0);\n const effectiveRequest = await this.getCacheKey(request, 'write');\n if (process.env.NODE_ENV !== 'production') {\n if (effectiveRequest.method && effectiveRequest.method !== 'GET') {\n throw new WorkboxError('attempt-to-cache-non-get-request', {\n url: getFriendlyURL(effectiveRequest.url),\n method: effectiveRequest.method,\n });\n }\n // See https://github.com/GoogleChrome/workbox/issues/2818\n const vary = response.headers.get('Vary');\n if (vary) {\n logger.debug(`The response for ${getFriendlyURL(effectiveRequest.url)} ` +\n `has a 'Vary: ${vary}' header. ` +\n `Consider setting the {ignoreVary: true} option on your strategy ` +\n `to ensure cache matching and deletion works as expected.`);\n }\n }\n if (!response) {\n if (process.env.NODE_ENV !== 'production') {\n logger.error(`Cannot cache non-existent response for ` +\n `'${getFriendlyURL(effectiveRequest.url)}'.`);\n }\n throw new WorkboxError('cache-put-with-no-response', {\n url: getFriendlyURL(effectiveRequest.url),\n });\n }\n const responseToCache = await this._ensureResponseSafeToCache(response);\n if (!responseToCache) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Response '${getFriendlyURL(effectiveRequest.url)}' ` +\n `will not be cached.`, responseToCache);\n }\n return false;\n }\n const { cacheName, matchOptions } = this._strategy;\n const cache = await self.caches.open(cacheName);\n const hasCacheUpdateCallback = this.hasCallback('cacheDidUpdate');\n const oldResponse = hasCacheUpdateCallback\n ? await cacheMatchIgnoreParams(\n // TODO(philipwalton): the `__WB_REVISION__` param is a precaching\n // feature. Consider into ways to only add this behavior if using\n // precaching.\n cache, effectiveRequest.clone(), ['__WB_REVISION__'], matchOptions)\n : null;\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Updating the '${cacheName}' cache with a new Response ` +\n `for ${getFriendlyURL(effectiveRequest.url)}.`);\n }\n try {\n await cache.put(effectiveRequest, hasCacheUpdateCallback ? responseToCache.clone() : responseToCache);\n }\n catch (error) {\n if (error instanceof Error) {\n // See https://developer.mozilla.org/en-US/docs/Web/API/DOMException#exception-QuotaExceededError\n if (error.name === 'QuotaExceededError') {\n await executeQuotaErrorCallbacks();\n }\n throw error;\n }\n }\n for (const callback of this.iterateCallbacks('cacheDidUpdate')) {\n await callback({\n cacheName,\n oldResponse,\n newResponse: responseToCache.clone(),\n request: effectiveRequest,\n event: this.event,\n });\n }\n return true;\n }\n /**\n * Checks the list of plugins for the `cacheKeyWillBeUsed` callback, and\n * executes any of those callbacks found in sequence. The final `Request`\n * object returned by the last plugin is treated as the cache key for cache\n * reads and/or writes. If no `cacheKeyWillBeUsed` plugin callbacks have\n * been registered, the passed request is returned unmodified\n *\n * @param {Request} request\n * @param {string} mode\n * @return {Promise}\n */\n async getCacheKey(request, mode) {\n const key = `${request.url} | ${mode}`;\n if (!this._cacheKeys[key]) {\n let effectiveRequest = request;\n for (const callback of this.iterateCallbacks('cacheKeyWillBeUsed')) {\n effectiveRequest = toRequest(await callback({\n mode,\n request: effectiveRequest,\n event: this.event,\n // params has a type any can't change right now.\n params: this.params, // eslint-disable-line\n }));\n }\n this._cacheKeys[key] = effectiveRequest;\n }\n return this._cacheKeys[key];\n }\n /**\n * Returns true if the strategy has at least one plugin with the given\n * callback.\n *\n * @param {string} name The name of the callback to check for.\n * @return {boolean}\n */\n hasCallback(name) {\n for (const plugin of this._strategy.plugins) {\n if (name in plugin) {\n return true;\n }\n }\n return false;\n }\n /**\n * Runs all plugin callbacks matching the given name, in order, passing the\n * given param object (merged ith the current plugin state) as the only\n * argument.\n *\n * Note: since this method runs all plugins, it's not suitable for cases\n * where the return value of a callback needs to be applied prior to calling\n * the next callback. See\n * [`iterateCallbacks()`]{@link module:workbox-strategies.StrategyHandler#iterateCallbacks}\n * below for how to handle that case.\n *\n * @param {string} name The name of the callback to run within each plugin.\n * @param {Object} param The object to pass as the first (and only) param\n * when executing each callback. This object will be merged with the\n * current plugin state prior to callback execution.\n */\n async runCallbacks(name, param) {\n for (const callback of this.iterateCallbacks(name)) {\n // TODO(philipwalton): not sure why `any` is needed. It seems like\n // this should work with `as WorkboxPluginCallbackParam[C]`.\n await callback(param);\n }\n }\n /**\n * Accepts a callback and returns an iterable of matching plugin callbacks,\n * where each callback is wrapped with the current handler state (i.e. when\n * you call each callback, whatever object parameter you pass it will\n * be merged with the plugin's current state).\n *\n * @param {string} name The name fo the callback to run\n * @return {Array}\n */\n *iterateCallbacks(name) {\n for (const plugin of this._strategy.plugins) {\n if (typeof plugin[name] === 'function') {\n const state = this._pluginStateMap.get(plugin);\n const statefulCallback = (param) => {\n const statefulParam = Object.assign(Object.assign({}, param), { state });\n // TODO(philipwalton): not sure why `any` is needed. It seems like\n // this should work with `as WorkboxPluginCallbackParam[C]`.\n return plugin[name](statefulParam);\n };\n yield statefulCallback;\n }\n }\n }\n /**\n * Adds a promise to the\n * [extend lifetime promises]{@link https://w3c.github.io/ServiceWorker/#extendableevent-extend-lifetime-promises}\n * of the event event associated with the request being handled (usually a\n * `FetchEvent`).\n *\n * Note: you can await\n * [`doneWaiting()`]{@link module:workbox-strategies.StrategyHandler~doneWaiting}\n * to know when all added promises have settled.\n *\n * @param {Promise} promise A promise to add to the extend lifetime promises\n * of the event that triggered the request.\n */\n waitUntil(promise) {\n this._extendLifetimePromises.push(promise);\n return promise;\n }\n /**\n * Returns a promise that resolves once all promises passed to\n * [`waitUntil()`]{@link module:workbox-strategies.StrategyHandler~waitUntil}\n * have settled.\n *\n * Note: any work done after `doneWaiting()` settles should be manually\n * passed to an event's `waitUntil()` method (not this handler's\n * `waitUntil()` method), otherwise the service worker thread my be killed\n * prior to your work completing.\n */\n async doneWaiting() {\n let promise;\n while ((promise = this._extendLifetimePromises.shift())) {\n await promise;\n }\n }\n /**\n * Stops running the strategy and immediately resolves any pending\n * `waitUntil()` promises.\n */\n destroy() {\n this._handlerDeferred.resolve(null);\n }\n /**\n * This method will call cacheWillUpdate on the available plugins (or use\n * status === 200) to determine if the Response is safe and valid to cache.\n *\n * @param {Request} options.request\n * @param {Response} options.response\n * @return {Promise}\n *\n * @private\n */\n async _ensureResponseSafeToCache(response) {\n let responseToCache = response;\n let pluginsUsed = false;\n for (const callback of this.iterateCallbacks('cacheWillUpdate')) {\n responseToCache =\n (await callback({\n request: this.request,\n response: responseToCache,\n event: this.event,\n })) || undefined;\n pluginsUsed = true;\n if (!responseToCache) {\n break;\n }\n }\n if (!pluginsUsed) {\n if (responseToCache && responseToCache.status !== 200) {\n responseToCache = undefined;\n }\n if (process.env.NODE_ENV !== 'production') {\n if (responseToCache) {\n if (responseToCache.status !== 200) {\n if (responseToCache.status === 0) {\n logger.warn(`The response for '${this.request.url}' ` +\n `is an opaque response. The caching strategy that you're ` +\n `using will not cache opaque responses by default.`);\n }\n else {\n logger.debug(`The response for '${this.request.url}' ` +\n `returned a status code of '${response.status}' and won't ` +\n `be cached as a result.`);\n }\n }\n }\n }\n }\n return responseToCache;\n }\n}\nexport { StrategyHandler };\n","/*\n Copyright 2019 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * Returns a promise that resolves and the passed number of milliseconds.\n * This utility is an async/await-friendly version of `setTimeout`.\n *\n * @param {number} ms\n * @return {Promise}\n * @private\n */\nexport function timeout(ms) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst getFriendlyURL = (url) => {\n const urlObj = new URL(String(url), location.href);\n // See https://github.com/GoogleChrome/workbox/issues/2323\n // We want to include everything, except for the origin if it's same-origin.\n return urlObj.href.replace(new RegExp(`^${location.origin}`), '');\n};\nexport { getFriendlyURL };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from '../_private/logger.js';\nimport { quotaErrorCallbacks } from '../models/quotaErrorCallbacks.js';\nimport '../_version.js';\n/**\n * Runs all of the callback functions, one at a time sequentially, in the order\n * in which they were registered.\n *\n * @memberof module:workbox-core\n * @private\n */\nasync function executeQuotaErrorCallbacks() {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`About to run ${quotaErrorCallbacks.size} ` +\n `callbacks to clean up caches.`);\n }\n for (const callback of quotaErrorCallbacks) {\n await callback();\n if (process.env.NODE_ENV !== 'production') {\n logger.log(callback, 'is complete.');\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.log('Finished running callbacks.');\n }\n}\nexport { executeQuotaErrorCallbacks };\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { StrategyHandler } from './StrategyHandler.js';\nimport './_version.js';\n/**\n * An abstract base class that all other strategy classes must extend from:\n *\n * @memberof module:workbox-strategies\n */\nclass Strategy {\n /**\n * Creates a new instance of the strategy and sets all documented option\n * properties as public instance properties.\n *\n * Note: if a custom strategy class extends the base Strategy class and does\n * not need more than these properties, it does not need to define its own\n * constructor.\n *\n * @param {Object} [options]\n * @param {string} [options.cacheName] Cache name to store and retrieve\n * requests. Defaults to the cache names provided by\n * [workbox-core]{@link module:workbox-core.cacheNames}.\n * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} [options.fetchOptions] Values passed along to the\n * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)\n * `fetch()` requests made by this strategy.\n * @param {Object} [options.matchOptions] The\n * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}\n * for any `cache.match()` or `cache.put()` calls made by this strategy.\n */\n constructor(options = {}) {\n /**\n * Cache name to store and retrieve\n * requests. Defaults to the cache names provided by\n * [workbox-core]{@link module:workbox-core.cacheNames}.\n *\n * @type {string}\n */\n this.cacheName = cacheNames.getRuntimeName(options.cacheName);\n /**\n * The list\n * [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * used by this strategy.\n *\n * @type {Array}\n */\n this.plugins = options.plugins || [];\n /**\n * Values passed along to the\n * [`init`]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters}\n * of all fetch() requests made by this strategy.\n *\n * @type {Object}\n */\n this.fetchOptions = options.fetchOptions;\n /**\n * The\n * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}\n * for any `cache.match()` or `cache.put()` calls made by this strategy.\n *\n * @type {Object}\n */\n this.matchOptions = options.matchOptions;\n }\n /**\n * Perform a request strategy and returns a `Promise` that will resolve with\n * a `Response`, invoking all relevant plugin callbacks.\n *\n * When a strategy instance is registered with a Workbox\n * [route]{@link module:workbox-routing.Route}, this method is automatically\n * called when the route matches.\n *\n * Alternatively, this method can be used in a standalone `FetchEvent`\n * listener by passing it to `event.respondWith()`.\n *\n * @param {FetchEvent|Object} options A `FetchEvent` or an object with the\n * properties listed below.\n * @param {Request|string} options.request A request to run this strategy for.\n * @param {ExtendableEvent} options.event The event associated with the\n * request.\n * @param {URL} [options.url]\n * @param {*} [options.params]\n */\n handle(options) {\n const [responseDone] = this.handleAll(options);\n return responseDone;\n }\n /**\n * Similar to [`handle()`]{@link module:workbox-strategies.Strategy~handle}, but\n * instead of just returning a `Promise` that resolves to a `Response` it\n * it will return an tuple of [response, done] promises, where the former\n * (`response`) is equivalent to what `handle()` returns, and the latter is a\n * Promise that will resolve once any promises that were added to\n * `event.waitUntil()` as part of performing the strategy have completed.\n *\n * You can await the `done` promise to ensure any extra work performed by\n * the strategy (usually caching responses) completes successfully.\n *\n * @param {FetchEvent|Object} options A `FetchEvent` or an object with the\n * properties listed below.\n * @param {Request|string} options.request A request to run this strategy for.\n * @param {ExtendableEvent} options.event The event associated with the\n * request.\n * @param {URL} [options.url]\n * @param {*} [options.params]\n * @return {Array} A tuple of [response, done]\n * promises that can be used to determine when the response resolves as\n * well as when the handler has completed all its work.\n */\n handleAll(options) {\n // Allow for flexible options to be passed.\n if (options instanceof FetchEvent) {\n options = {\n event: options,\n request: options.request,\n };\n }\n const event = options.event;\n const request = typeof options.request === 'string'\n ? new Request(options.request)\n : options.request;\n const params = 'params' in options ? options.params : undefined;\n const handler = new StrategyHandler(this, { event, request, params });\n const responseDone = this._getResponse(handler, request, event);\n const handlerDone = this._awaitComplete(responseDone, handler, request, event);\n // Return an array of promises, suitable for use with Promise.all().\n return [responseDone, handlerDone];\n }\n async _getResponse(handler, request, event) {\n await handler.runCallbacks('handlerWillStart', { event, request });\n let response = undefined;\n try {\n response = await this._handle(request, handler);\n // The \"official\" Strategy subclasses all throw this error automatically,\n // but in case a third-party Strategy doesn't, ensure that we have a\n // consistent failure when there's no response or an error response.\n if (!response || response.type === 'error') {\n throw new WorkboxError('no-response', { url: request.url });\n }\n }\n catch (error) {\n if (error instanceof Error) {\n for (const callback of handler.iterateCallbacks('handlerDidError')) {\n response = await callback({ error, event, request });\n if (response) {\n break;\n }\n }\n }\n if (!response) {\n throw error;\n }\n else if (process.env.NODE_ENV !== 'production') {\n logger.log(`While responding to '${getFriendlyURL(request.url)}', ` +\n `an ${error instanceof Error ? error.toString() : ''} error occurred. Using a fallback response provided by ` +\n `a handlerDidError plugin.`);\n }\n }\n for (const callback of handler.iterateCallbacks('handlerWillRespond')) {\n response = await callback({ event, request, response });\n }\n return response;\n }\n async _awaitComplete(responseDone, handler, request, event) {\n let response;\n let error;\n try {\n response = await responseDone;\n }\n catch (error) {\n // Ignore errors, as response errors should be caught via the `response`\n // promise above. The `done` promise will only throw for errors in\n // promises passed to `handler.waitUntil()`.\n }\n try {\n await handler.runCallbacks('handlerDidRespond', {\n event,\n request,\n response,\n });\n await handler.doneWaiting();\n }\n catch (waitUntilError) {\n if (waitUntilError instanceof Error) {\n error = waitUntilError;\n }\n }\n await handler.runCallbacks('handlerDidComplete', {\n event,\n request,\n response,\n error: error,\n });\n handler.destroy();\n if (error) {\n throw error;\n }\n }\n}\nexport { Strategy };\n/**\n * Classes extending the `Strategy` based class should implement this method,\n * and leverage the [`handler`]{@link module:workbox-strategies.StrategyHandler}\n * arg to perform all fetching and cache logic, which will ensure all relevant\n * cache, cache options, fetch options and plugins are used (per the current\n * strategy instance).\n *\n * @name _handle\n * @instance\n * @abstract\n * @function\n * @param {Request} request\n * @param {module:workbox-strategies.StrategyHandler} handler\n * @return {Promise}\n *\n * @memberof module:workbox-strategies.Strategy\n */\n","/*\n Copyright 2020 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A utility method that makes it easier to use `event.waitUntil` with\n * async functions and return the result.\n *\n * @param {ExtendableEvent} event\n * @param {Function} asyncFn\n * @return {Function}\n * @private\n */\nfunction waitUntil(event, asyncFn) {\n const returnPromise = asyncFn();\n event.waitUntil(returnPromise);\n return returnPromise;\n}\nexport { waitUntil };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:precaching:6.4.1'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport '../_version.js';\n// Name of the search parameter used to store revision info.\nconst REVISION_SEARCH_PARAM = '__WB_REVISION__';\n/**\n * Converts a manifest entry into a versioned URL suitable for precaching.\n *\n * @param {Object|string} entry\n * @return {string} A URL with versioning info.\n *\n * @private\n * @memberof module:workbox-precaching\n */\nexport function createCacheKey(entry) {\n if (!entry) {\n throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\n }\n // If a precache manifest entry is a string, it's assumed to be a versioned\n // URL, like '/app.abcd1234.js'. Return as-is.\n if (typeof entry === 'string') {\n const urlObject = new URL(entry, location.href);\n return {\n cacheKey: urlObject.href,\n url: urlObject.href,\n };\n }\n const { revision, url } = entry;\n if (!url) {\n throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\n }\n // If there's just a URL and no revision, then it's also assumed to be a\n // versioned URL.\n if (!revision) {\n const urlObject = new URL(url, location.href);\n return {\n cacheKey: urlObject.href,\n url: urlObject.href,\n };\n }\n // Otherwise, construct a properly versioned URL using the custom Workbox\n // search parameter along with the revision info.\n const cacheKeyURL = new URL(url, location.href);\n const originalURL = new URL(url, location.href);\n cacheKeyURL.searchParams.set(REVISION_SEARCH_PARAM, revision);\n return {\n cacheKey: cacheKeyURL.href,\n url: originalURL.href,\n };\n}\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A plugin, designed to be used with PrecacheController, to determine the\n * of assets that were updated (or not updated) during the install event.\n *\n * @private\n */\nclass PrecacheInstallReportPlugin {\n constructor() {\n this.updatedURLs = [];\n this.notUpdatedURLs = [];\n this.handlerWillStart = async ({ request, state, }) => {\n // TODO: `state` should never be undefined...\n if (state) {\n state.originalRequest = request;\n }\n };\n this.cachedResponseWillBeUsed = async ({ event, state, cachedResponse, }) => {\n if (event.type === 'install') {\n if (state &&\n state.originalRequest &&\n state.originalRequest instanceof Request) {\n // TODO: `state` should never be undefined...\n const url = state.originalRequest.url;\n if (cachedResponse) {\n this.notUpdatedURLs.push(url);\n }\n else {\n this.updatedURLs.push(url);\n }\n }\n }\n return cachedResponse;\n };\n }\n}\nexport { PrecacheInstallReportPlugin };\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A plugin, designed to be used with PrecacheController, to translate URLs into\n * the corresponding cache key, based on the current revision info.\n *\n * @private\n */\nclass PrecacheCacheKeyPlugin {\n constructor({ precacheController }) {\n this.cacheKeyWillBeUsed = async ({ request, params, }) => {\n // Params is type any, can't change right now.\n /* eslint-disable */\n const cacheKey = (params === null || params === void 0 ? void 0 : params.cacheKey) ||\n this._precacheController.getCacheKeyForURL(request.url);\n /* eslint-enable */\n return cacheKey\n ? new Request(cacheKey, { headers: request.headers })\n : request;\n };\n this._precacheController = precacheController;\n }\n}\nexport { PrecacheCacheKeyPlugin };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nlet supportStatus;\n/**\n * A utility function that determines whether the current browser supports\n * constructing a new `Response` from a `response.body` stream.\n *\n * @return {boolean} `true`, if the current browser can successfully\n * construct a `Response` from a `response.body` stream, `false` otherwise.\n *\n * @private\n */\nfunction canConstructResponseFromBodyStream() {\n if (supportStatus === undefined) {\n const testResponse = new Response('');\n if ('body' in testResponse) {\n try {\n new Response(testResponse.body);\n supportStatus = true;\n }\n catch (error) {\n supportStatus = false;\n }\n }\n supportStatus = false;\n }\n return supportStatus;\n}\nexport { canConstructResponseFromBodyStream };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { PrecacheController } from '../PrecacheController.js';\nimport '../_version.js';\nlet precacheController;\n/**\n * @return {PrecacheController}\n * @private\n */\nexport const getOrCreatePrecacheController = () => {\n if (!precacheController) {\n precacheController = new PrecacheController();\n }\n return precacheController;\n};\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { canConstructResponseFromBodyStream } from './_private/canConstructResponseFromBodyStream.js';\nimport { WorkboxError } from './_private/WorkboxError.js';\nimport './_version.js';\n/**\n * Allows developers to copy a response and modify its `headers`, `status`,\n * or `statusText` values (the values settable via a\n * [`ResponseInit`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#Syntax}\n * object in the constructor).\n * To modify these values, pass a function as the second argument. That\n * function will be invoked with a single object with the response properties\n * `{headers, status, statusText}`. The return value of this function will\n * be used as the `ResponseInit` for the new `Response`. To change the values\n * either modify the passed parameter(s) and return it, or return a totally\n * new object.\n *\n * This method is intentionally limited to same-origin responses, regardless of\n * whether CORS was used or not.\n *\n * @param {Response} response\n * @param {Function} modifier\n * @memberof module:workbox-core\n */\nasync function copyResponse(response, modifier) {\n let origin = null;\n // If response.url isn't set, assume it's cross-origin and keep origin null.\n if (response.url) {\n const responseURL = new URL(response.url);\n origin = responseURL.origin;\n }\n if (origin !== self.location.origin) {\n throw new WorkboxError('cross-origin-copy-response', { origin });\n }\n const clonedResponse = response.clone();\n // Create a fresh `ResponseInit` object by cloning the headers.\n const responseInit = {\n headers: new Headers(clonedResponse.headers),\n status: clonedResponse.status,\n statusText: clonedResponse.statusText,\n };\n // Apply any user modifications.\n const modifiedResponseInit = modifier ? modifier(responseInit) : responseInit;\n // Create the new response from the body stream and `ResponseInit`\n // modifications. Note: not all browsers support the Response.body stream,\n // so fall back to reading the entire body into memory as a blob.\n const body = canConstructResponseFromBodyStream()\n ? clonedResponse.body\n : await clonedResponse.blob();\n return new Response(body, modifiedResponseInit);\n}\nexport { copyResponse };\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { copyResponse } from 'workbox-core/copyResponse.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Strategy } from 'workbox-strategies/Strategy.js';\nimport './_version.js';\n/**\n * A [Strategy]{@link module:workbox-strategies.Strategy} implementation\n * specifically designed to work with\n * [PrecacheController]{@link module:workbox-precaching.PrecacheController}\n * to both cache and fetch precached assets.\n *\n * Note: an instance of this class is created automatically when creating a\n * `PrecacheController`; it's generally not necessary to create this yourself.\n *\n * @extends module:workbox-strategies.Strategy\n * @memberof module:workbox-precaching\n */\nclass PrecacheStrategy extends Strategy {\n /**\n *\n * @param {Object} [options]\n * @param {string} [options.cacheName] Cache name to store and retrieve\n * requests. Defaults to the cache names provided by\n * [workbox-core]{@link module:workbox-core.cacheNames}.\n * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} [options.fetchOptions] Values passed along to the\n * [`init`]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters}\n * of all fetch() requests made by this strategy.\n * @param {Object} [options.matchOptions] The\n * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}\n * for any `cache.match()` or `cache.put()` calls made by this strategy.\n * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to\n * get the response from the network if there's a precache miss.\n */\n constructor(options = {}) {\n options.cacheName = cacheNames.getPrecacheName(options.cacheName);\n super(options);\n this._fallbackToNetwork =\n options.fallbackToNetwork === false ? false : true;\n // Redirected responses cannot be used to satisfy a navigation request, so\n // any redirected response must be \"copied\" rather than cloned, so the new\n // response doesn't contain the `redirected` flag. See:\n // https://bugs.chromium.org/p/chromium/issues/detail?id=669363&desc=2#c1\n this.plugins.push(PrecacheStrategy.copyRedirectedCacheableResponsesPlugin);\n }\n /**\n * @private\n * @param {Request|string} request A request to run this strategy for.\n * @param {module:workbox-strategies.StrategyHandler} handler The event that\n * triggered the request.\n * @return {Promise}\n */\n async _handle(request, handler) {\n const response = await handler.cacheMatch(request);\n if (response) {\n return response;\n }\n // If this is an `install` event for an entry that isn't already cached,\n // then populate the cache.\n if (handler.event && handler.event.type === 'install') {\n return await this._handleInstall(request, handler);\n }\n // Getting here means something went wrong. An entry that should have been\n // precached wasn't found in the cache.\n return await this._handleFetch(request, handler);\n }\n async _handleFetch(request, handler) {\n let response;\n const params = (handler.params || {});\n // Fall back to the network if we're configured to do so.\n if (this._fallbackToNetwork) {\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(`The precached response for ` +\n `${getFriendlyURL(request.url)} in ${this.cacheName} was not ` +\n `found. Falling back to the network.`);\n }\n const integrityInManifest = params.integrity;\n const integrityInRequest = request.integrity;\n const noIntegrityConflict = !integrityInRequest || integrityInRequest === integrityInManifest;\n response = await handler.fetch(new Request(request, {\n integrity: integrityInRequest || integrityInManifest,\n }));\n // It's only \"safe\" to repair the cache if we're using SRI to guarantee\n // that the response matches the precache manifest's expectations,\n // and there's either a) no integrity property in the incoming request\n // or b) there is an integrity, and it matches the precache manifest.\n // See https://github.com/GoogleChrome/workbox/issues/2858\n if (integrityInManifest && noIntegrityConflict) {\n this._useDefaultCacheabilityPluginIfNeeded();\n const wasCached = await handler.cachePut(request, response.clone());\n if (process.env.NODE_ENV !== 'production') {\n if (wasCached) {\n logger.log(`A response for ${getFriendlyURL(request.url)} ` +\n `was used to \"repair\" the precache.`);\n }\n }\n }\n }\n else {\n // This shouldn't normally happen, but there are edge cases:\n // https://github.com/GoogleChrome/workbox/issues/1441\n throw new WorkboxError('missing-precache-entry', {\n cacheName: this.cacheName,\n url: request.url,\n });\n }\n if (process.env.NODE_ENV !== 'production') {\n const cacheKey = params.cacheKey || (await handler.getCacheKey(request, 'read'));\n // Workbox is going to handle the route.\n // print the routing details to the console.\n logger.groupCollapsed(`Precaching is responding to: ` + getFriendlyURL(request.url));\n logger.log(`Serving the precached url: ${getFriendlyURL(cacheKey instanceof Request ? cacheKey.url : cacheKey)}`);\n logger.groupCollapsed(`View request details here.`);\n logger.log(request);\n logger.groupEnd();\n logger.groupCollapsed(`View response details here.`);\n logger.log(response);\n logger.groupEnd();\n logger.groupEnd();\n }\n return response;\n }\n async _handleInstall(request, handler) {\n this._useDefaultCacheabilityPluginIfNeeded();\n const response = await handler.fetch(request);\n // Make sure we defer cachePut() until after we know the response\n // should be cached; see https://github.com/GoogleChrome/workbox/issues/2737\n const wasCached = await handler.cachePut(request, response.clone());\n if (!wasCached) {\n // Throwing here will lead to the `install` handler failing, which\n // we want to do if *any* of the responses aren't safe to cache.\n throw new WorkboxError('bad-precaching-response', {\n url: request.url,\n status: response.status,\n });\n }\n return response;\n }\n /**\n * This method is complex, as there a number of things to account for:\n *\n * The `plugins` array can be set at construction, and/or it might be added to\n * to at any time before the strategy is used.\n *\n * At the time the strategy is used (i.e. during an `install` event), there\n * needs to be at least one plugin that implements `cacheWillUpdate` in the\n * array, other than `copyRedirectedCacheableResponsesPlugin`.\n *\n * - If this method is called and there are no suitable `cacheWillUpdate`\n * plugins, we need to add `defaultPrecacheCacheabilityPlugin`.\n *\n * - If this method is called and there is exactly one `cacheWillUpdate`, then\n * we don't have to do anything (this might be a previously added\n * `defaultPrecacheCacheabilityPlugin`, or it might be a custom plugin).\n *\n * - If this method is called and there is more than one `cacheWillUpdate`,\n * then we need to check if one is `defaultPrecacheCacheabilityPlugin`. If so,\n * we need to remove it. (This situation is unlikely, but it could happen if\n * the strategy is used multiple times, the first without a `cacheWillUpdate`,\n * and then later on after manually adding a custom `cacheWillUpdate`.)\n *\n * See https://github.com/GoogleChrome/workbox/issues/2737 for more context.\n *\n * @private\n */\n _useDefaultCacheabilityPluginIfNeeded() {\n let defaultPluginIndex = null;\n let cacheWillUpdatePluginCount = 0;\n for (const [index, plugin] of this.plugins.entries()) {\n // Ignore the copy redirected plugin when determining what to do.\n if (plugin === PrecacheStrategy.copyRedirectedCacheableResponsesPlugin) {\n continue;\n }\n // Save the default plugin's index, in case it needs to be removed.\n if (plugin === PrecacheStrategy.defaultPrecacheCacheabilityPlugin) {\n defaultPluginIndex = index;\n }\n if (plugin.cacheWillUpdate) {\n cacheWillUpdatePluginCount++;\n }\n }\n if (cacheWillUpdatePluginCount === 0) {\n this.plugins.push(PrecacheStrategy.defaultPrecacheCacheabilityPlugin);\n }\n else if (cacheWillUpdatePluginCount > 1 && defaultPluginIndex !== null) {\n // Only remove the default plugin; multiple custom plugins are allowed.\n this.plugins.splice(defaultPluginIndex, 1);\n }\n // Nothing needs to be done if cacheWillUpdatePluginCount is 1\n }\n}\nPrecacheStrategy.defaultPrecacheCacheabilityPlugin = {\n async cacheWillUpdate({ response }) {\n if (!response || response.status >= 400) {\n return null;\n }\n return response;\n },\n};\nPrecacheStrategy.copyRedirectedCacheableResponsesPlugin = {\n async cacheWillUpdate({ response }) {\n return response.redirected ? await copyResponse(response) : response;\n },\n};\nexport { PrecacheStrategy };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { waitUntil } from 'workbox-core/_private/waitUntil.js';\nimport { createCacheKey } from './utils/createCacheKey.js';\nimport { PrecacheInstallReportPlugin } from './utils/PrecacheInstallReportPlugin.js';\nimport { PrecacheCacheKeyPlugin } from './utils/PrecacheCacheKeyPlugin.js';\nimport { printCleanupDetails } from './utils/printCleanupDetails.js';\nimport { printInstallDetails } from './utils/printInstallDetails.js';\nimport { PrecacheStrategy } from './PrecacheStrategy.js';\nimport './_version.js';\n/**\n * Performs efficient precaching of assets.\n *\n * @memberof module:workbox-precaching\n */\nclass PrecacheController {\n /**\n * Create a new PrecacheController.\n *\n * @param {Object} [options]\n * @param {string} [options.cacheName] The cache to use for precaching.\n * @param {string} [options.plugins] Plugins to use when precaching as well\n * as responding to fetch events for precached assets.\n * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to\n * get the response from the network if there's a precache miss.\n */\n constructor({ cacheName, plugins = [], fallbackToNetwork = true, } = {}) {\n this._urlsToCacheKeys = new Map();\n this._urlsToCacheModes = new Map();\n this._cacheKeysToIntegrities = new Map();\n this._strategy = new PrecacheStrategy({\n cacheName: cacheNames.getPrecacheName(cacheName),\n plugins: [\n ...plugins,\n new PrecacheCacheKeyPlugin({ precacheController: this }),\n ],\n fallbackToNetwork,\n });\n // Bind the install and activate methods to the instance.\n this.install = this.install.bind(this);\n this.activate = this.activate.bind(this);\n }\n /**\n * @type {module:workbox-precaching.PrecacheStrategy} The strategy created by this controller and\n * used to cache assets and respond to fetch events.\n */\n get strategy() {\n return this._strategy;\n }\n /**\n * Adds items to the precache list, removing any duplicates and\n * stores the files in the\n * [\"precache cache\"]{@link module:workbox-core.cacheNames} when the service\n * worker installs.\n *\n * This method can be called multiple times.\n *\n * @param {Array} [entries=[]] Array of entries to precache.\n */\n precache(entries) {\n this.addToCacheList(entries);\n if (!this._installAndActiveListenersAdded) {\n self.addEventListener('install', this.install);\n self.addEventListener('activate', this.activate);\n this._installAndActiveListenersAdded = true;\n }\n }\n /**\n * This method will add items to the precache list, removing duplicates\n * and ensuring the information is valid.\n *\n * @param {Array} entries\n * Array of entries to precache.\n */\n addToCacheList(entries) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isArray(entries, {\n moduleName: 'workbox-precaching',\n className: 'PrecacheController',\n funcName: 'addToCacheList',\n paramName: 'entries',\n });\n }\n const urlsToWarnAbout = [];\n for (const entry of entries) {\n // See https://github.com/GoogleChrome/workbox/issues/2259\n if (typeof entry === 'string') {\n urlsToWarnAbout.push(entry);\n }\n else if (entry && entry.revision === undefined) {\n urlsToWarnAbout.push(entry.url);\n }\n const { cacheKey, url } = createCacheKey(entry);\n const cacheMode = typeof entry !== 'string' && entry.revision ? 'reload' : 'default';\n if (this._urlsToCacheKeys.has(url) &&\n this._urlsToCacheKeys.get(url) !== cacheKey) {\n throw new WorkboxError('add-to-cache-list-conflicting-entries', {\n firstEntry: this._urlsToCacheKeys.get(url),\n secondEntry: cacheKey,\n });\n }\n if (typeof entry !== 'string' && entry.integrity) {\n if (this._cacheKeysToIntegrities.has(cacheKey) &&\n this._cacheKeysToIntegrities.get(cacheKey) !== entry.integrity) {\n throw new WorkboxError('add-to-cache-list-conflicting-integrities', {\n url,\n });\n }\n this._cacheKeysToIntegrities.set(cacheKey, entry.integrity);\n }\n this._urlsToCacheKeys.set(url, cacheKey);\n this._urlsToCacheModes.set(url, cacheMode);\n if (urlsToWarnAbout.length > 0) {\n const warningMessage = `Workbox is precaching URLs without revision ` +\n `info: ${urlsToWarnAbout.join(', ')}\\nThis is generally NOT safe. ` +\n `Learn more at https://bit.ly/wb-precache`;\n if (process.env.NODE_ENV === 'production') {\n // Use console directly to display this warning without bloating\n // bundle sizes by pulling in all of the logger codebase in prod.\n console.warn(warningMessage);\n }\n else {\n logger.warn(warningMessage);\n }\n }\n }\n }\n /**\n * Precaches new and updated assets. Call this method from the service worker\n * install event.\n *\n * Note: this method calls `event.waitUntil()` for you, so you do not need\n * to call it yourself in your event handlers.\n *\n * @param {ExtendableEvent} event\n * @return {Promise}\n */\n install(event) {\n // waitUntil returns Promise\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return waitUntil(event, async () => {\n const installReportPlugin = new PrecacheInstallReportPlugin();\n this.strategy.plugins.push(installReportPlugin);\n // Cache entries one at a time.\n // See https://github.com/GoogleChrome/workbox/issues/2528\n for (const [url, cacheKey] of this._urlsToCacheKeys) {\n const integrity = this._cacheKeysToIntegrities.get(cacheKey);\n const cacheMode = this._urlsToCacheModes.get(url);\n const request = new Request(url, {\n integrity,\n cache: cacheMode,\n credentials: 'same-origin',\n });\n await Promise.all(this.strategy.handleAll({\n params: { cacheKey },\n request,\n event,\n }));\n }\n const { updatedURLs, notUpdatedURLs } = installReportPlugin;\n if (process.env.NODE_ENV !== 'production') {\n printInstallDetails(updatedURLs, notUpdatedURLs);\n }\n return { updatedURLs, notUpdatedURLs };\n });\n }\n /**\n * Deletes assets that are no longer present in the current precache manifest.\n * Call this method from the service worker activate event.\n *\n * Note: this method calls `event.waitUntil()` for you, so you do not need\n * to call it yourself in your event handlers.\n *\n * @param {ExtendableEvent} event\n * @return {Promise}\n */\n activate(event) {\n // waitUntil returns Promise\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return waitUntil(event, async () => {\n const cache = await self.caches.open(this.strategy.cacheName);\n const currentlyCachedRequests = await cache.keys();\n const expectedCacheKeys = new Set(this._urlsToCacheKeys.values());\n const deletedURLs = [];\n for (const request of currentlyCachedRequests) {\n if (!expectedCacheKeys.has(request.url)) {\n await cache.delete(request);\n deletedURLs.push(request.url);\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n printCleanupDetails(deletedURLs);\n }\n return { deletedURLs };\n });\n }\n /**\n * Returns a mapping of a precached URL to the corresponding cache key, taking\n * into account the revision information for the URL.\n *\n * @return {Map} A URL to cache key mapping.\n */\n getURLsToCacheKeys() {\n return this._urlsToCacheKeys;\n }\n /**\n * Returns a list of all the URLs that have been precached by the current\n * service worker.\n *\n * @return {Array} The precached URLs.\n */\n getCachedURLs() {\n return [...this._urlsToCacheKeys.keys()];\n }\n /**\n * Returns the cache key used for storing a given URL. If that URL is\n * unversioned, like `/index.html', then the cache key will be the original\n * URL with a search parameter appended to it.\n *\n * @param {string} url A URL whose cache key you want to look up.\n * @return {string} The versioned URL that corresponds to a cache key\n * for the original URL, or undefined if that URL isn't precached.\n */\n getCacheKeyForURL(url) {\n const urlObject = new URL(url, location.href);\n return this._urlsToCacheKeys.get(urlObject.href);\n }\n /**\n * @param {string} url A cache key whose SRI you want to look up.\n * @return {string} The subresource integrity associated with the cache key,\n * or undefined if it's not set.\n */\n getIntegrityForCacheKey(cacheKey) {\n return this._cacheKeysToIntegrities.get(cacheKey);\n }\n /**\n * This acts as a drop-in replacement for\n * [`cache.match()`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match)\n * with the following differences:\n *\n * - It knows what the name of the precache is, and only checks in that cache.\n * - It allows you to pass in an \"original\" URL without versioning parameters,\n * and it will automatically look up the correct cache key for the currently\n * active revision of that URL.\n *\n * E.g., `matchPrecache('index.html')` will find the correct precached\n * response for the currently active service worker, even if the actual cache\n * key is `'/index.html?__WB_REVISION__=1234abcd'`.\n *\n * @param {string|Request} request The key (without revisioning parameters)\n * to look up in the precache.\n * @return {Promise}\n */\n async matchPrecache(request) {\n const url = request instanceof Request ? request.url : request;\n const cacheKey = this.getCacheKeyForURL(url);\n if (cacheKey) {\n const cache = await self.caches.open(this.strategy.cacheName);\n return cache.match(cacheKey);\n }\n return undefined;\n }\n /**\n * Returns a function that looks up `url` in the precache (taking into\n * account revision information), and returns the corresponding `Response`.\n *\n * @param {string} url The precached URL which will be used to lookup the\n * `Response`.\n * @return {module:workbox-routing~handlerCallback}\n */\n createHandlerBoundToURL(url) {\n const cacheKey = this.getCacheKeyForURL(url);\n if (!cacheKey) {\n throw new WorkboxError('non-precached-url', { url });\n }\n return (options) => {\n options.request = new Request(url);\n options.params = Object.assign({ cacheKey }, options.params);\n return this.strategy.handle(options);\n };\n }\n}\nexport { PrecacheController };\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { Route } from 'workbox-routing/Route.js';\nimport { generateURLVariations } from './utils/generateURLVariations.js';\nimport './_version.js';\n/**\n * A subclass of [Route]{@link module:workbox-routing.Route} that takes a\n * [PrecacheController]{@link module:workbox-precaching.PrecacheController}\n * instance and uses it to match incoming requests and handle fetching\n * responses from the precache.\n *\n * @memberof module:workbox-precaching\n * @extends module:workbox-routing.Route\n */\nclass PrecacheRoute extends Route {\n /**\n * @param {PrecacheController} precacheController A `PrecacheController`\n * instance used to both match requests and respond to fetch events.\n * @param {Object} [options] Options to control how requests are matched\n * against the list of precached URLs.\n * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will\n * check cache entries for a URLs ending with '/' to see if there is a hit when\n * appending the `directoryIndex` value.\n * @param {Array} [options.ignoreURLParametersMatching=[/^utm_/, /^fbclid$/]] An\n * array of regex's to remove search params when looking for a cache match.\n * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will\n * check the cache for the URL with a `.html` added to the end of the end.\n * @param {module:workbox-precaching~urlManipulation} [options.urlManipulation]\n * This is a function that should take a URL and return an array of\n * alternative URLs that should be checked for precache matches.\n */\n constructor(precacheController, options) {\n const match = ({ request, }) => {\n const urlsToCacheKeys = precacheController.getURLsToCacheKeys();\n for (const possibleURL of generateURLVariations(request.url, options)) {\n const cacheKey = urlsToCacheKeys.get(possibleURL);\n if (cacheKey) {\n const integrity = precacheController.getIntegrityForCacheKey(cacheKey);\n return { cacheKey, integrity };\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Precaching did not find a match for ` + getFriendlyURL(request.url));\n }\n return;\n };\n super(match, precacheController.strategy);\n }\n}\nexport { PrecacheRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { removeIgnoredSearchParams } from './removeIgnoredSearchParams.js';\nimport '../_version.js';\n/**\n * Generator function that yields possible variations on the original URL to\n * check, one at a time.\n *\n * @param {string} url\n * @param {Object} options\n *\n * @private\n * @memberof module:workbox-precaching\n */\nexport function* generateURLVariations(url, { ignoreURLParametersMatching = [/^utm_/, /^fbclid$/], directoryIndex = 'index.html', cleanURLs = true, urlManipulation, } = {}) {\n const urlObject = new URL(url, location.href);\n urlObject.hash = '';\n yield urlObject.href;\n const urlWithoutIgnoredParams = removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching);\n yield urlWithoutIgnoredParams.href;\n if (directoryIndex && urlWithoutIgnoredParams.pathname.endsWith('/')) {\n const directoryURL = new URL(urlWithoutIgnoredParams.href);\n directoryURL.pathname += directoryIndex;\n yield directoryURL.href;\n }\n if (cleanURLs) {\n const cleanURL = new URL(urlWithoutIgnoredParams.href);\n cleanURL.pathname += '.html';\n yield cleanURL.href;\n }\n if (urlManipulation) {\n const additionalURLs = urlManipulation({ url: urlObject });\n for (const urlToAttempt of additionalURLs) {\n yield urlToAttempt.href;\n }\n }\n}\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * Removes any URL search parameters that should be ignored.\n *\n * @param {URL} urlObject The original URL.\n * @param {Array} ignoreURLParametersMatching RegExps to test against\n * each search parameter name. Matches mean that the search parameter should be\n * ignored.\n * @return {URL} The URL with any ignored search parameters removed.\n *\n * @private\n * @memberof module:workbox-precaching\n */\nexport function removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching = []) {\n // Convert the iterable into an array at the start of the loop to make sure\n // deletion doesn't mess up iteration.\n for (const paramName of [...urlObject.searchParams.keys()]) {\n if (ignoreURLParametersMatching.some((regExp) => regExp.test(paramName))) {\n urlObject.searchParams.delete(paramName);\n }\n }\n return urlObject;\n}\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Strategy } from './Strategy.js';\nimport { messages } from './utils/messages.js';\nimport './_version.js';\n/**\n * An implementation of a [cache-first]{@link https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#cache-falling-back-to-network}\n * request strategy.\n *\n * A cache first strategy is useful for assets that have been revisioned,\n * such as URLs like `/styles/example.a8f5f1.css`, since they\n * can be cached for long periods of time.\n *\n * If the network request fails, and there is no cache match, this will throw\n * a `WorkboxError` exception.\n *\n * @extends module:workbox-strategies.Strategy\n * @memberof module:workbox-strategies\n */\nclass CacheFirst extends Strategy {\n /**\n * @private\n * @param {Request|string} request A request to run this strategy for.\n * @param {module:workbox-strategies.StrategyHandler} handler The event that\n * triggered the request.\n * @return {Promise}\n */\n async _handle(request, handler) {\n const logs = [];\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n moduleName: 'workbox-strategies',\n className: this.constructor.name,\n funcName: 'makeRequest',\n paramName: 'request',\n });\n }\n let response = await handler.cacheMatch(request);\n let error = undefined;\n if (!response) {\n if (process.env.NODE_ENV !== 'production') {\n logs.push(`No response found in the '${this.cacheName}' cache. ` +\n `Will respond with a network request.`);\n }\n try {\n response = await handler.fetchAndCachePut(request);\n }\n catch (err) {\n if (err instanceof Error) {\n error = err;\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n if (response) {\n logs.push(`Got response from network.`);\n }\n else {\n logs.push(`Unable to get a response from the network.`);\n }\n }\n }\n else {\n if (process.env.NODE_ENV !== 'production') {\n logs.push(`Found a cached response in the '${this.cacheName}' cache.`);\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));\n for (const log of logs) {\n logger.log(log);\n }\n messages.printFinalResponse(response);\n logger.groupEnd();\n }\n if (!response) {\n throw new WorkboxError('no-response', { url: request.url, error });\n }\n return response;\n }\n}\nexport { CacheFirst };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { addRoute } from './addRoute.js';\nimport { precache } from './precache.js';\nimport './_version.js';\n/**\n * This method will add entries to the precache list and add a route to\n * respond to fetch events.\n *\n * This is a convenience method that will call\n * [precache()]{@link module:workbox-precaching.precache} and\n * [addRoute()]{@link module:workbox-precaching.addRoute} in a single call.\n *\n * @param {Array} entries Array of entries to precache.\n * @param {Object} [options] See\n * [PrecacheRoute options]{@link module:workbox-precaching.PrecacheRoute}.\n *\n * @memberof module:workbox-precaching\n */\nfunction precacheAndRoute(entries, options) {\n precache(entries);\n addRoute(options);\n}\nexport { precacheAndRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport './_version.js';\n/**\n * Adds items to the precache list, removing any duplicates and\n * stores the files in the\n * [\"precache cache\"]{@link module:workbox-core.cacheNames} when the service\n * worker installs.\n *\n * This method can be called multiple times.\n *\n * Please note: This method **will not** serve any of the cached files for you.\n * It only precaches files. To respond to a network request you call\n * [addRoute()]{@link module:workbox-precaching.addRoute}.\n *\n * If you have a single array of files to precache, you can just call\n * [precacheAndRoute()]{@link module:workbox-precaching.precacheAndRoute}.\n *\n * @param {Array} [entries=[]] Array of entries to precache.\n *\n * @memberof module:workbox-precaching\n */\nfunction precache(entries) {\n const precacheController = getOrCreatePrecacheController();\n precacheController.precache(entries);\n}\nexport { precache };\n","/*\n Copyright 2019 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { registerRoute } from 'workbox-routing/registerRoute.js';\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport { PrecacheRoute } from './PrecacheRoute.js';\nimport './_version.js';\n/**\n * Add a `fetch` listener to the service worker that will\n * respond to\n * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests}\n * with precached assets.\n *\n * Requests for assets that aren't precached, the `FetchEvent` will not be\n * responded to, allowing the event to fall through to other `fetch` event\n * listeners.\n *\n * @param {Object} [options] See\n * [PrecacheRoute options]{@link module:workbox-precaching.PrecacheRoute}.\n *\n * @memberof module:workbox-precaching\n */\nfunction addRoute(options) {\n const precacheController = getOrCreatePrecacheController();\n const precacheRoute = new PrecacheRoute(precacheController, options);\n registerRoute(precacheRoute);\n}\nexport { addRoute };\n"],"names":["self","_","e","messageGenerator","code","args","msg","length","JSON","stringify","WorkboxError","Error","constructor","errorCode","details","name","normalizeHandler","handler","handle","Route","match","method","setCatchHandler","catchHandler","RegExpRoute","regExp","url","result","exec","href","origin","location","index","slice","Router","_routes","Map","_defaultHandlerMap","routes","this","addFetchListener","addEventListener","event","request","responsePromise","handleRequest","respondWith","addCacheListener","data","type","payload","requestPromises","Promise","all","urlsToCache","map","entry","Request","waitUntil","ports","then","postMessage","URL","protocol","startsWith","sameOrigin","params","route","findMatchingRoute","has","get","err","reject","_catchHandler","catch","async","catchErr","matchResult","Array","isArray","Object","keys","undefined","setDefaultHandler","set","registerRoute","push","unregisterRoute","routeIndex","indexOf","splice","defaultRouter","getOrCreateDefaultRouter","capture","captureUrl","RegExp","moduleName","funcName","paramName","_cacheNameDetails","googleAnalytics","precache","prefix","runtime","suffix","registration","scope","_createCacheName","cacheName","filter","value","join","cacheNames","userCacheName","stripParams","fullURL","ignoreParams","strippedURL","param","searchParams","delete","Deferred","promise","resolve","quotaErrorCallbacks","Set","toRequest","input","StrategyHandler","strategy","options","_cacheKeys","assign","_strategy","_handlerDeferred","_extendLifetimePromises","_plugins","plugins","_pluginStateMap","plugin","mode","FetchEvent","preloadResponse","possiblePreloadResponse","originalRequest","hasCallback","clone","cb","iterateCallbacks","thrownErrorMessage","message","pluginFilteredRequest","fetchResponse","fetch","fetchOptions","callback","response","error","runCallbacks","responseClone","cachePut","key","cachedResponse","matchOptions","effectiveRequest","getCacheKey","multiMatchOptions","caches","ms","setTimeout","String","replace","responseToCache","_ensureResponseSafeToCache","cache","open","hasCacheUpdateCallback","oldResponse","strippedRequestURL","keysOptions","ignoreSearch","cacheKeys","cacheKey","cacheMatchIgnoreParams","put","executeQuotaErrorCallbacks","newResponse","state","statefulCallback","statefulParam","shift","destroy","pluginsUsed","status","Strategy","responseDone","handleAll","_getResponse","_awaitComplete","_handle","doneWaiting","waitUntilError","asyncFn","returnPromise","createCacheKey","urlObject","revision","cacheKeyURL","originalURL","PrecacheInstallReportPlugin","updatedURLs","notUpdatedURLs","handlerWillStart","cachedResponseWillBeUsed","PrecacheCacheKeyPlugin","precacheController","cacheKeyWillBeUsed","_precacheController","getCacheKeyForURL","headers","supportStatus","copyResponse","modifier","clonedResponse","responseInit","Headers","statusText","modifiedResponseInit","body","testResponse","Response","canConstructResponseFromBodyStream","blob","PrecacheStrategy","_fallbackToNetwork","fallbackToNetwork","copyRedirectedCacheableResponsesPlugin","cacheMatch","_handleInstall","_handleFetch","integrityInManifest","integrity","integrityInRequest","noIntegrityConflict","_useDefaultCacheabilityPluginIfNeeded","defaultPluginIndex","cacheWillUpdatePluginCount","entries","defaultPrecacheCacheabilityPlugin","cacheWillUpdate","redirected","PrecacheController","_urlsToCacheKeys","_urlsToCacheModes","_cacheKeysToIntegrities","install","bind","activate","addToCacheList","_installAndActiveListenersAdded","urlsToWarnAbout","cacheMode","firstEntry","secondEntry","warningMessage","console","warn","installReportPlugin","credentials","currentlyCachedRequests","expectedCacheKeys","values","deletedURLs","getURLsToCacheKeys","getCachedURLs","getIntegrityForCacheKey","createHandlerBoundToURL","getOrCreatePrecacheController","PrecacheRoute","urlsToCacheKeys","possibleURL","ignoreURLParametersMatching","directoryIndex","cleanURLs","urlManipulation","hash","urlWithoutIgnoredParams","some","test","removeIgnoredSearchParams","pathname","endsWith","directoryURL","cleanURL","additionalURLs","urlToAttempt","generateURLVariations","fetchAndCachePut","addRoute"],"mappings":"6CAEA,IACIA,KAAK,uBAAyBC,IAElC,MAAOC,ICEP,MCgBaC,EAdI,CAACC,KAASC,SACnBC,EAAMF,SACNC,EAAKE,OAAS,IACdD,GAAQ,OAAME,KAAKC,UAAUJ,MAE1BC,GCIX,MAAMI,UAAqBC,MASvBC,YAAYC,EAAWC,SACHX,EAAiBU,EAAWC,SAEvCC,KAAOF,OACPC,QAAUA,GC7BvB,IACId,KAAK,0BAA4BC,IAErC,MAAOC,ICWA,MCAMc,EAAoBC,GACzBA,GAA8B,iBAAZA,EASXA,EAWA,CAAEC,OAAQD,GCjBzB,MAAME,EAYFP,YAAYQ,EAAOH,EAASI,EFhBH,YE8BhBJ,QAAUD,EAAiBC,QAC3BG,MAAQA,OACRC,OAASA,EAOlBC,gBAAgBL,QACPM,aAAeP,EAAiBC,IChC7C,MAAMO,UAAoBL,EActBP,YAAYa,EAAQR,EAASI,UASX,EAAGK,IAAAA,YACPC,EAASF,EAAOG,KAAKF,EAAIG,SAE1BF,IAODD,EAAII,SAAWC,SAASD,QAA2B,IAAjBH,EAAOK,cAYtCL,EAAOM,MAAM,KAEXhB,EAASI,ICxC9B,MAAMa,EAIFtB,mBACSuB,EAAU,IAAIC,SACdC,EAAqB,IAAID,IAO9BE,oBACOC,KAAKJ,EAMhBK,mBAEIxC,KAAKyC,iBAAiB,SAAWC,UACvBC,QAAEA,GAAYD,EACdE,EAAkBL,KAAKM,cAAc,CAAEF,QAAAA,EAASD,MAAAA,IAClDE,GACAF,EAAMI,YAAYF,MA0B9BG,mBAEI/C,KAAKyC,iBAAiB,WAAaC,OAG3BA,EAAMM,MAA4B,eAApBN,EAAMM,KAAKC,KAAuB,OAE1CC,QAAEA,GAAYR,EAAMM,KAIpBG,EAAkBC,QAAQC,IAAIH,EAAQI,YAAYC,KAAKC,IACpC,iBAAVA,IACPA,EAAQ,CAACA,UAEPb,EAAU,IAAIc,WAAWD,UACxBjB,KAAKM,cAAc,CAAEF,QAAAA,EAASD,MAAAA,QAKzCA,EAAMgB,UAAUP,GAEZT,EAAMiB,OAASjB,EAAMiB,MAAM,IACtBR,EAAgBS,MAAK,IAAMlB,EAAMiB,MAAM,GAAGE,aAAY,SAiB3EhB,eAAcF,QAAEA,EAAFD,MAAWA,UASfhB,EAAM,IAAIoC,IAAInB,EAAQjB,IAAKK,SAASF,UACrCH,EAAIqC,SAASC,WAAW,qBAMvBC,EAAavC,EAAII,SAAWC,SAASD,QACrCoC,OAAEA,EAAFC,MAAUA,GAAU5B,KAAK6B,kBAAkB,CAC7C1B,MAAAA,EACAC,QAAAA,EACAsB,WAAAA,EACAvC,IAAAA,QAEAT,EAAUkD,GAASA,EAAMlD,cAevBI,EAASsB,EAAQtB,WAClBJ,GAAWsB,KAAKF,EAAmBgC,IAAIhD,KAKxCJ,EAAUsB,KAAKF,EAAmBiC,IAAIjD,KAErCJ,aAwBD2B,MAEAA,EAAkB3B,EAAQC,OAAO,CAAEQ,IAAAA,EAAKiB,QAAAA,EAASD,MAAAA,EAAOwB,OAAAA,IAE5D,MAAOK,GACH3B,EAAkBQ,QAAQoB,OAAOD,SAG/BhD,EAAe4C,GAASA,EAAM5C,oBAChCqB,aAA2BQ,UAC1Bb,KAAKkC,GAAiBlD,KACvBqB,EAAkBA,EAAgB8B,OAAMC,MAAAA,OAEhCpD,mBAWiBA,EAAaL,OAAO,CAAEQ,IAAAA,EAAKiB,QAAAA,EAASD,MAAAA,EAAOwB,OAAAA,IAE5D,MAAOU,GACCA,aAAoBjE,QACpB4D,EAAMK,MAIdrC,KAAKkC,SAUElC,KAAKkC,EAAcvD,OAAO,CAAEQ,IAAAA,EAAKiB,QAAAA,EAASD,MAAAA,UAE/C6B,MAGP3B,EAiBXwB,mBAAkB1C,IAAEA,EAAFuC,WAAOA,EAAPtB,QAAmBA,EAAnBD,MAA4BA,UACpCJ,EAASC,KAAKJ,EAAQmC,IAAI3B,EAAQtB,SAAW,OAC9C,MAAM8C,KAAS7B,EAAQ,KACpB4B,QAGEW,EAAcV,EAAM/C,MAAM,CAAEM,IAAAA,EAAKuC,WAAAA,EAAYtB,QAAAA,EAASD,MAAAA,OACxDmC,SAYAX,EAASW,GACLC,MAAMC,QAAQb,IAA6B,IAAlBA,EAAO3D,QAI3BsE,EAAYjE,cAAgBoE,QACG,IAApCA,OAAOC,KAAKJ,GAAatE,QAIG,kBAAhBsE,KAPZX,OAASgB,GAcN,CAAEf,MAAAA,EAAOD,OAAAA,SAIjB,GAgBXiB,kBAAkBlE,EAASI,EJ1SF,YI2ShBgB,EAAmB+C,IAAI/D,EAAQL,EAAiBC,IASzDK,gBAAgBL,QACPwD,EAAgBzD,EAAiBC,GAO1CoE,cAAclB,GAiCL5B,KAAKJ,EAAQkC,IAAIF,EAAM9C,cACnBc,EAAQiD,IAAIjB,EAAM9C,OAAQ,SAI9Bc,EAAQmC,IAAIH,EAAM9C,QAAQiE,KAAKnB,GAOxCoB,gBAAgBpB,OACP5B,KAAKJ,EAAQkC,IAAIF,EAAM9C,cAClB,IAAIX,EAAa,6CAA8C,CACjEW,OAAQ8C,EAAM9C,eAGhBmE,EAAajD,KAAKJ,EAAQmC,IAAIH,EAAM9C,QAAQoE,QAAQtB,QACtDqB,GAAc,SAIR,IAAI9E,EAAa,8CAHlByB,EAAQmC,IAAIH,EAAM9C,QAAQqE,OAAOF,EAAY,ICxX9D,IAAIG,EAQG,MAAMC,EAA2B,KAC/BD,IACDA,EAAgB,IAAIzD,EAEpByD,EAAcnD,mBACdmD,EAAc5C,oBAEX4C,GCQX,SAASN,EAAcQ,EAAS5E,EAASI,OACjC8C,KACmB,iBAAZ0B,EAAsB,OACvBC,EAAa,IAAIhC,IAAI+B,EAAS9D,SAASF,MAkC7CsC,EAAQ,IAAIhD,GAZU,EAAGO,IAAAA,KASdA,EAAIG,OAASiE,EAAWjE,MAGFZ,EAASI,QAEzC,GAAIwE,aAAmBE,OAExB5B,EAAQ,IAAI3C,EAAYqE,EAAS5E,EAASI,QAEzC,GAAuB,mBAAZwE,EAEZ1B,EAAQ,IAAIhD,EAAM0E,EAAS5E,EAASI,OAEnC,CAAA,KAAIwE,aAAmB1E,SAIlB,IAAIT,EAAa,yBAA0B,CAC7CsF,WAAY,kBACZC,SAAU,gBACVC,UAAW,YANf/B,EAAQ0B,SASUD,IACRP,cAAclB,GACrBA,ECnFX,MAAMgC,EAAoB,CACtBC,gBAAiB,kBACjBC,SAAU,cACVC,OAAQ,UACRC,QAAS,UACTC,OAAgC,oBAAjBC,aAA+BA,aAAaC,MAAQ,IAEjEC,EAAoBC,GACf,CAACT,EAAkBG,OAAQM,EAAWT,EAAkBK,QAC1DK,QAAQC,GAAUA,GAASA,EAAMvG,OAAS,IAC1CwG,KAAK,KAODC,EAWSC,GACPA,GAAiBN,EAAiBR,EAAkBE,UAZtDW,EAiBQC,GACNA,GAAiBN,EAAiBR,EAAkBI,SCpCnE,SAASW,EAAYC,EAASC,SACpBC,EAAc,IAAIvD,IAAIqD,OACvB,MAAMG,KAASF,EAChBC,EAAYE,aAAaC,OAAOF,UAE7BD,EAAYxF,KCIvB,MAAM4F,EAIF7G,mBACS8G,QAAU,IAAItE,SAAQ,CAACuE,EAASnD,UAC5BmD,QAAUA,OACVnD,OAASA,MCZ1B,MAAMoD,EAAsB,IAAIC,ICThC,IACI7H,KAAK,6BAA+BC,IAExC,MAAOC,ICWP,SAAS4H,EAAUC,SACS,iBAAVA,EAAqB,IAAItE,QAAQsE,GAASA,EAW5D,MAAMC,EAkBFpH,YAAYqH,EAAUC,QACbC,EAAa,GA8ClBnD,OAAOoD,OAAO7F,KAAM2F,QACfxF,MAAQwF,EAAQxF,WAChB2F,EAAYJ,OACZK,EAAmB,IAAIb,OACvBc,EAA0B,QAG1BC,EAAW,IAAIP,EAASQ,cACxBC,EAAkB,IAAItG,QACtB,MAAMuG,KAAUpG,KAAKiG,OACjBE,EAAgBtD,IAAIuD,EAAQ,SAEhCjG,MAAMgB,UAAUnB,KAAK+F,EAAiBZ,qBAenCK,SACFrF,MAAEA,GAAUH,SACdI,EAAUmF,EAAUC,MACH,aAAjBpF,EAAQiG,MACRlG,aAAiBmG,YACjBnG,EAAMoG,gBAAiB,OACjBC,QAAiCrG,EAAMoG,mBACzCC,SAKOA,QAMTC,EAAkBzG,KAAK0G,YAAY,gBACnCtG,EAAQuG,QACR,aAEG,MAAMC,KAAM5G,KAAK6G,iBAAiB,oBACnCzG,QAAgBwG,EAAG,CAAExG,QAASA,EAAQuG,QAASxG,MAAAA,IAGvD,MAAO6B,MACCA,aAAe5D,YACT,IAAID,EAAa,kCAAmC,CACtD2I,mBAAoB9E,EAAI+E,gBAO9BC,EAAwB5G,EAAQuG,gBAE9BM,EAEJA,QAAsBC,MAAM9G,EAA0B,aAAjBA,EAAQiG,UAAsB1D,EAAY3C,KAAK8F,EAAUqB,kBAMzF,MAAMC,KAAYpH,KAAK6G,iBAAiB,mBACzCI,QAAsBG,EAAS,CAC3BjH,MAAAA,EACAC,QAAS4G,EACTK,SAAUJ,WAGXA,EAEX,MAAOK,SAOCb,SACMzG,KAAKuH,aAAa,eAAgB,CACpCD,MAAOA,EACPnH,MAAAA,EACAsG,gBAAiBA,EAAgBE,QACjCvG,QAAS4G,EAAsBL,UAGjCW,0BAaS9B,SACb6B,QAAiBrH,KAAKkH,MAAM1B,GAC5BgC,EAAgBH,EAASV,eAC1B3G,KAAKmB,UAAUnB,KAAKyH,SAASjC,EAAOgC,IAClCH,mBAcMK,SACPtH,EAAUmF,EAAUmC,OACtBC,QACEtD,UAAEA,EAAFuD,aAAaA,GAAiB5H,KAAK8F,EACnC+B,QAAyB7H,KAAK8H,YAAY1H,EAAS,QACnD2H,EAAoBtF,OAAOoD,OAAOpD,OAAOoD,OAAO,GAAI+B,GAAe,CAAEvD,UAAAA,IAC3EsD,QAAuBK,OAAOnJ,MAAMgJ,EAAkBE,OASjD,MAAMX,KAAYpH,KAAK6G,iBAAiB,4BACzCc,QACWP,EAAS,CACZ/C,UAAAA,EACAuD,aAAAA,EACAD,eAAAA,EACAvH,QAASyH,EACT1H,MAAOH,KAAKG,cACTwC,SAERgF,iBAiBID,EAAKL,SACVjH,EAAUmF,EAAUmC,GCzP3B,IAAiBO,QAAAA,ED4PF,EC3PX,IAAIpH,SAASuE,GAAY8C,WAAW9C,EAAS6C,YD4P1CJ,QAAyB7H,KAAK8H,YAAY1H,EAAS,aAiBpDiH,QAKK,IAAIlJ,EAAa,6BAA8B,CACjDgB,KE3RQA,EF2RY0I,EAAiB1I,IE1RlC,IAAIoC,IAAI4G,OAAOhJ,GAAMK,SAASF,MAG/BA,KAAK8I,QAAQ,IAAI5E,OAAQ,IAAGhE,SAASD,UAAW,OAJ1CJ,IAAAA,QF8RVkJ,QAAwBrI,KAAKsI,EAA2BjB,OACzDgB,SAKM,QAELhE,UAAEA,EAAFuD,aAAaA,GAAiB5H,KAAK8F,EACnCyC,QAAc9K,KAAKuK,OAAOQ,KAAKnE,GAC/BoE,EAAyBzI,KAAK0G,YAAY,kBAC1CgC,EAAcD,QJvR5BrG,eAAsCmG,EAAOnI,EAASyE,EAAc+C,SAC1De,EAAqBhE,EAAYvE,EAAQjB,IAAK0F,MAEhDzE,EAAQjB,MAAQwJ,SACTJ,EAAM1J,MAAMuB,EAASwH,SAG1BgB,EAAcnG,OAAOoD,OAAOpD,OAAOoD,OAAO,GAAI+B,GAAe,CAAEiB,cAAc,IAC7EC,QAAkBP,EAAM7F,KAAKtC,EAASwI,OACvC,MAAMG,KAAYD,KAEfH,IADwBhE,EAAYoE,EAAS5J,IAAK0F,UAE3C0D,EAAM1J,MAAMkK,EAAUnB,GI4QrBoB,CAIRT,EAAOV,EAAiBlB,QAAS,CAAC,mBAAoBiB,GACpD,eAMIW,EAAMU,IAAIpB,EAAkBY,EAAyBJ,EAAgB1B,QAAU0B,GAEzF,MAAOf,MACCA,aAAiBlJ,WAEE,uBAAfkJ,EAAM9I,YGjT1B4D,qBAKS,MAAMgF,KAAY/B,QACb+B,IH4SY8B,GAEJ5B,MAGT,MAAMF,KAAYpH,KAAK6G,iBAAiB,wBACnCO,EAAS,CACX/C,UAAAA,EACAqE,YAAAA,EACAS,YAAad,EAAgB1B,QAC7BvG,QAASyH,EACT1H,MAAOH,KAAKG,eAGb,oBAaOC,EAASiG,SACjBqB,EAAO,GAAEtH,EAAQjB,SAASkH,QAC3BrG,KAAK4F,EAAW8B,GAAM,KACnBG,EAAmBzH,MAClB,MAAMgH,KAAYpH,KAAK6G,iBAAiB,sBACzCgB,EAAmBtC,QAAgB6B,EAAS,CACxCf,KAAAA,EACAjG,QAASyH,EACT1H,MAAOH,KAAKG,MAEZwB,OAAQ3B,KAAK2B,eAGhBiE,EAAW8B,GAAOG,SAEpB7H,KAAK4F,EAAW8B,GAS3BhB,YAAYlI,OACH,MAAM4H,KAAUpG,KAAK8F,EAAUI,WAC5B1H,KAAQ4H,SACD,SAGR,qBAkBQ5H,EAAMuG,OAChB,MAAMqC,KAAYpH,KAAK6G,iBAAiBrI,SAGnC4I,EAASrC,qBAYLvG,OACT,MAAM4H,KAAUpG,KAAK8F,EAAUI,WACJ,mBAAjBE,EAAO5H,GAAsB,OAC9B4K,EAAQpJ,KAAKmG,EAAgBpE,IAAIqE,GACjCiD,EAAoBtE,UAChBuE,EAAgB7G,OAAOoD,OAAOpD,OAAOoD,OAAO,GAAId,GAAQ,CAAEqE,MAAAA,WAGzDhD,EAAO5H,GAAM8K,UAElBD,GAiBlBlI,UAAUgE,eACDa,EAAwBjD,KAAKoC,GAC3BA,0BAaHA,OACIA,EAAUnF,KAAKgG,EAAwBuD,eACrCpE,EAOdqE,eACSzD,EAAiBX,QAAQ,cAYDiC,OACzBgB,EAAkBhB,EAClBoC,GAAc,MACb,MAAMrC,KAAYpH,KAAK6G,iBAAiB,sBACzCwB,QACWjB,EAAS,CACZhH,QAASJ,KAAKI,QACdiH,SAAUgB,EACVlI,MAAOH,KAAKG,cACTwC,EACX8G,GAAc,GACTpB,eAIJoB,GACGpB,GAA8C,MAA3BA,EAAgBqB,SACnCrB,OAAkB1F,GAmBnB0F,GIhff,MAAMsB,EAuBFtL,YAAYsH,EAAU,SAQbtB,UAAYI,EAA0BkB,EAAQtB,gBAQ9C6B,QAAUP,EAAQO,SAAW,QAQ7BiB,aAAexB,EAAQwB,kBAQvBS,aAAejC,EAAQiC,aAqBhCjJ,OAAOgH,SACIiE,GAAgB5J,KAAK6J,UAAUlE,UAC/BiE,EAwBXC,UAAUlE,GAEFA,aAAmBW,aACnBX,EAAU,CACNxF,MAAOwF,EACPvF,QAASuF,EAAQvF,gBAGnBD,EAAQwF,EAAQxF,MAChBC,EAAqC,iBAApBuF,EAAQvF,QACzB,IAAIc,QAAQyE,EAAQvF,SACpBuF,EAAQvF,QACRuB,EAAS,WAAYgE,EAAUA,EAAQhE,YAASgB,EAChDjE,EAAU,IAAI+G,EAAgBzF,KAAM,CAAEG,MAAAA,EAAOC,QAAAA,EAASuB,OAAAA,IACtDiI,EAAe5J,KAAK8J,EAAapL,EAAS0B,EAASD,SAGlD,CAACyJ,EAFY5J,KAAK+J,EAAeH,EAAclL,EAAS0B,EAASD,YAIzDzB,EAAS0B,EAASD,OAE7BkH,QADE3I,EAAQ6I,aAAa,mBAAoB,CAAEpH,MAAAA,EAAOC,QAAAA,WAGpDiH,QAAiBrH,KAAKgK,EAAQ5J,EAAS1B,IAIlC2I,GAA8B,UAAlBA,EAAS3G,WAChB,IAAIvC,EAAa,cAAe,CAAEgB,IAAKiB,EAAQjB,MAG7D,MAAOmI,MACCA,aAAiBlJ,UACZ,MAAMgJ,KAAY1I,EAAQmI,iBAAiB,sBAC5CQ,QAAiBD,EAAS,CAAEE,MAAAA,EAAOnH,MAAAA,EAAOC,QAAAA,IACtCiH,YAKPA,QACKC,MAQT,MAAMF,KAAY1I,EAAQmI,iBAAiB,sBAC5CQ,QAAiBD,EAAS,CAAEjH,MAAAA,EAAOC,QAAAA,EAASiH,SAAAA,WAEzCA,UAEUuC,EAAclL,EAAS0B,EAASD,OAC7CkH,EACAC,MAEAD,QAAiBuC,EAErB,MAAOtC,cAMG5I,EAAQ6I,aAAa,oBAAqB,CAC5CpH,MAAAA,EACAC,QAAAA,EACAiH,SAAAA,UAEE3I,EAAQuL,cAElB,MAAOC,GACCA,aAA0B9L,QAC1BkJ,EAAQ4C,YAGVxL,EAAQ6I,aAAa,qBAAsB,CAC7CpH,MAAAA,EACAC,QAAAA,EACAiH,SAAAA,EACAC,MAAOA,IAEX5I,EAAQ8K,UACJlC,QACMA,GC9LlB,SAASnG,EAAUhB,EAAOgK,SAChBC,EAAgBD,WACtBhK,EAAMgB,UAAUiJ,GACTA,ECjBX,IACI3M,KAAK,6BAA+BC,IAExC,MAAOC,ICeA,SAAS0M,EAAepJ,OACtBA,QACK,IAAI9C,EAAa,oCAAqC,CAAE8C,MAAAA,OAI7C,iBAAVA,EAAoB,OACrBqJ,EAAY,IAAI/I,IAAIN,EAAOzB,SAASF,YACnC,CACHyJ,SAAUuB,EAAUhL,KACpBH,IAAKmL,EAAUhL,YAGjBiL,SAAEA,EAAFpL,IAAYA,GAAQ8B,MACrB9B,QACK,IAAIhB,EAAa,oCAAqC,CAAE8C,MAAAA,QAI7DsJ,EAAU,OACLD,EAAY,IAAI/I,IAAIpC,EAAKK,SAASF,YACjC,CACHyJ,SAAUuB,EAAUhL,KACpBH,IAAKmL,EAAUhL,YAKjBkL,EAAc,IAAIjJ,IAAIpC,EAAKK,SAASF,MACpCmL,EAAc,IAAIlJ,IAAIpC,EAAKK,SAASF,aAC1CkL,EAAYxF,aAAanC,IAxCC,kBAwC0B0H,GAC7C,CACHxB,SAAUyB,EAAYlL,KACtBH,IAAKsL,EAAYnL,MCvCzB,MAAMoL,EACFrM,mBACSsM,YAAc,QACdC,eAAiB,QACjBC,iBAAmBzI,OAAShC,QAAAA,EAASgJ,MAAAA,MAElCA,IACAA,EAAM3C,gBAAkBrG,SAG3B0K,yBAA2B1I,OAASjC,MAAAA,EAAOiJ,MAAAA,EAAOzB,eAAAA,SAChC,YAAfxH,EAAMO,MACF0I,GACAA,EAAM3C,iBACN2C,EAAM3C,2BAA2BvF,QAAS,OAEpC/B,EAAMiK,EAAM3C,gBAAgBtH,IAC9BwI,OACKiD,eAAe7H,KAAK5D,QAGpBwL,YAAY5H,KAAK5D,UAI3BwI,ICzBnB,MAAMoD,EACF1M,aAAY2M,mBAAEA,SACLC,mBAAqB7I,OAAShC,QAAAA,EAASuB,OAAAA,YAGlCoH,GAAYpH,MAAAA,OAAuC,EAASA,EAAOoH,WACrE/I,KAAKkL,EAAoBC,kBAAkB/K,EAAQjB,YAEhD4J,EACD,IAAI7H,QAAQ6H,EAAU,CAAEqC,QAAShL,EAAQgL,UACzChL,QAEL8K,EAAsBF,GClBnC,IAAIK,ECCAL,ECoBJ5I,eAAekJ,EAAajE,EAAUkE,OAC9BhM,EAAS,QAET8H,EAASlI,IAAK,CAEdI,EADoB,IAAIgC,IAAI8F,EAASlI,KAChBI,UAErBA,IAAW9B,KAAK+B,SAASD,aACnB,IAAIpB,EAAa,6BAA8B,CAAEoB,OAAAA,UAErDiM,EAAiBnE,EAASV,QAE1B8E,EAAe,CACjBL,QAAS,IAAIM,QAAQF,EAAeJ,SACpC1B,OAAQ8B,EAAe9B,OACvBiC,WAAYH,EAAeG,YAGzBC,EAAuBL,EAAWA,EAASE,GAAgBA,EAI3DI,EFjCV,mBAC0BlJ,IAAlB0I,EAA6B,OACvBS,EAAe,IAAIC,SAAS,OAC9B,SAAUD,UAEFC,SAASD,EAAaD,MAC1BR,GAAgB,EAEpB,MAAO/D,GACH+D,GAAgB,EAGxBA,GAAgB,SAEbA,EEmBMW,GACPR,EAAeK,WACTL,EAAeS,cACpB,IAAIF,SAASF,EAAMD,GC5B9B,MAAMM,UAAyBvC,EAkB3BtL,YAAYsH,EAAU,IAClBA,EAAQtB,UAAYI,EAA2BkB,EAAQtB,iBACjDsB,QACDwG,GAC6B,IAA9BxG,EAAQyG,uBAKPlG,QAAQnD,KAAKmJ,EAAiBG,gDASzBjM,EAAS1B,SACb2I,QAAiB3I,EAAQ4N,WAAWlM,UACtCiH,IAKA3I,EAAQyB,OAAgC,YAAvBzB,EAAQyB,MAAMO,WAClBV,KAAKuM,EAAenM,EAAS1B,SAIjCsB,KAAKwM,EAAapM,EAAS1B,YAEzB0B,EAAS1B,OACpB2I,QACE1F,EAAUjD,EAAQiD,QAAU,OAE9B3B,KAAKmM,QA+BC,IAAIhO,EAAa,yBAA0B,CAC7CkG,UAAWrE,KAAKqE,UAChBlF,IAAKiB,EAAQjB,MAjCQ,OAMnBsN,EAAsB9K,EAAO+K,UAC7BC,EAAqBvM,EAAQsM,UAC7BE,GAAuBD,GAAsBA,IAAuBF,EAC1EpF,QAAiB3I,EAAQwI,MAAM,IAAIhG,QAAQd,EAAS,CAChDsM,UAAWC,GAAsBF,KAOjCA,GAAuBG,SAClBC,UACmBnO,EAAQ+I,SAASrH,EAASiH,EAASV,iBA+B5DU,UAEUjH,EAAS1B,QACrBmO,UACCxF,QAAiB3I,EAAQwI,MAAM9G,aAGb1B,EAAQ+I,SAASrH,EAASiH,EAASV,eAIjD,IAAIxI,EAAa,0BAA2B,CAC9CgB,IAAKiB,EAAQjB,IACbuK,OAAQrC,EAASqC,gBAGlBrC,EA6BXwF,QACQC,EAAqB,KACrBC,EAA6B,MAC5B,MAAOtN,EAAO2G,KAAWpG,KAAKkG,QAAQ8G,UAEnC5G,IAAW8F,EAAiBG,yCAI5BjG,IAAW8F,EAAiBe,oCAC5BH,EAAqBrN,GAErB2G,EAAO8G,iBACPH,KAG2B,IAA/BA,OACK7G,QAAQnD,KAAKmJ,EAAiBe,mCAE9BF,EAA6B,GAA4B,OAAvBD,QAElC5G,QAAQ/C,OAAO2J,EAAoB,IAKpDZ,EAAiBe,kCAAoC,iBACjD,OAAsB5F,SAAEA,MACfA,GAAYA,EAASqC,QAAU,IACzB,KAEJrC,GAGf6E,EAAiBG,uCAAyC,iBACtD,OAAsBhF,SAAEA,KACbA,EAAS8F,iBAAmB7B,EAAajE,GAAYA,GC3LpE,MAAM+F,EAWF/O,aAAYgG,UAAEA,EAAF6B,QAAaA,EAAU,GAAvBkG,kBAA2BA,GAAoB,GAAU,SAC5DiB,EAAmB,IAAIxN,SACvByN,EAAoB,IAAIzN,SACxB0N,EAA0B,IAAI1N,SAC9BiG,EAAY,IAAIoG,EAAiB,CAClC7H,UAAWI,EAA2BJ,GACtC6B,QAAS,IACFA,EACH,IAAI6E,EAAuB,CAAEC,mBAAoBhL,QAErDoM,kBAAAA,SAGCoB,QAAUxN,KAAKwN,QAAQC,KAAKzN,WAC5B0N,SAAW1N,KAAK0N,SAASD,KAAKzN,MAMnC0F,sBACO1F,KAAK8F,EAYhBhC,SAASkJ,QACAW,eAAeX,GACfhN,KAAK4N,IACNnQ,KAAKyC,iBAAiB,UAAWF,KAAKwN,SACtC/P,KAAKyC,iBAAiB,WAAYF,KAAK0N,eAClCE,GAAkC,GAU/CD,eAAeX,SASLa,EAAkB,OACnB,MAAM5M,KAAS+L,EAAS,CAEJ,iBAAV/L,EACP4M,EAAgB9K,KAAK9B,GAEhBA,QAA4B0B,IAAnB1B,EAAMsJ,UACpBsD,EAAgB9K,KAAK9B,EAAM9B,WAEzB4J,SAAEA,EAAF5J,IAAYA,GAAQkL,EAAepJ,GACnC6M,EAA6B,iBAAV7M,GAAsBA,EAAMsJ,SAAW,SAAW,aACvEvK,KAAKqN,EAAiBvL,IAAI3C,IAC1Ba,KAAKqN,EAAiBtL,IAAI5C,KAAS4J,QAC7B,IAAI5K,EAAa,wCAAyC,CAC5D4P,WAAY/N,KAAKqN,EAAiBtL,IAAI5C,GACtC6O,YAAajF,OAGA,iBAAV9H,GAAsBA,EAAMyL,UAAW,IAC1C1M,KAAKuN,EAAwBzL,IAAIiH,IACjC/I,KAAKuN,EAAwBxL,IAAIgH,KAAc9H,EAAMyL,gBAC/C,IAAIvO,EAAa,4CAA6C,CAChEgB,IAAAA,SAGHoO,EAAwB1K,IAAIkG,EAAU9H,EAAMyL,mBAEhDW,EAAiBxK,IAAI1D,EAAK4J,QAC1BuE,EAAkBzK,IAAI1D,EAAK2O,GAC5BD,EAAgB7P,OAAS,EAAG,OACtBiQ,EACD,qDAAQJ,EAAgBrJ,KAAK,8EAK9B0J,QAAQC,KAAKF,KAkB7BT,QAAQrN,UAGGgB,EAAUhB,GAAOiC,gBACdgM,EAAsB,IAAI1D,OAC3BhF,SAASQ,QAAQnD,KAAKqL,OAGtB,MAAOjP,EAAK4J,KAAa/I,KAAKqN,EAAkB,OAC3CX,EAAY1M,KAAKuN,EAAwBxL,IAAIgH,GAC7C+E,EAAY9N,KAAKsN,EAAkBvL,IAAI5C,GACvCiB,EAAU,IAAIc,QAAQ/B,EAAK,CAC7BuN,UAAAA,EACAnE,MAAOuF,EACPO,YAAa,sBAEXxN,QAAQC,IAAId,KAAK0F,SAASmE,UAAU,CACtClI,OAAQ,CAAEoH,SAAAA,GACV3I,QAAAA,EACAD,MAAAA,WAGFwK,YAAEA,EAAFC,eAAeA,GAAmBwD,QAIjC,CAAEzD,YAAAA,EAAaC,eAAAA,MAa9B8C,SAASvN,UAGEgB,EAAUhB,GAAOiC,gBACdmG,QAAc9K,KAAKuK,OAAOQ,KAAKxI,KAAK0F,SAASrB,WAC7CiK,QAAgC/F,EAAM7F,OACtC6L,EAAoB,IAAIjJ,IAAItF,KAAKqN,EAAiBmB,UAClDC,EAAc,OACf,MAAMrO,KAAWkO,EACbC,EAAkBzM,IAAI1B,EAAQjB,aACzBoJ,EAAMtD,OAAO7E,GACnBqO,EAAY1L,KAAK3C,EAAQjB,YAM1B,CAAEsP,YAAAA,MASjBC,4BACW1O,KAAKqN,EAQhBsB,sBACW,IAAI3O,KAAKqN,EAAiB3K,QAWrCyI,kBAAkBhM,SACRmL,EAAY,IAAI/I,IAAIpC,EAAKK,SAASF,aACjCU,KAAKqN,EAAiBtL,IAAIuI,EAAUhL,MAO/CsP,wBAAwB7F,UACb/I,KAAKuN,EAAwBxL,IAAIgH,uBAoBxB3I,SACVjB,EAAMiB,aAAmBc,QAAUd,EAAQjB,IAAMiB,EACjD2I,EAAW/I,KAAKmL,kBAAkBhM,MACpC4J,EAAU,cACUtL,KAAKuK,OAAOQ,KAAKxI,KAAK0F,SAASrB,YACtCxF,MAAMkK,IAY3B8F,wBAAwB1P,SACd4J,EAAW/I,KAAKmL,kBAAkBhM,OACnC4J,QACK,IAAI5K,EAAa,oBAAqB,CAAEgB,IAAAA,WAE1CwG,IACJA,EAAQvF,QAAU,IAAIc,QAAQ/B,GAC9BwG,EAAQhE,OAASc,OAAOoD,OAAO,CAAEkD,SAAAA,GAAYpD,EAAQhE,QAC9C3B,KAAK0F,SAAS/G,OAAOgH,KHjRjC,MAAMmJ,EAAgC,KACpC9D,IACDA,EAAqB,IAAIoC,GAEtBpC,GIGX,MAAM+D,UAAsBnQ,EAiBxBP,YAAY2M,EAAoBrF,UACd,EAAGvF,QAAAA,YACP4O,EAAkBhE,EAAmB0D,yBACtC,MAAMO,KCtBhB,UAAgC9P,GAAK+P,4BAAEA,EAA8B,CAAC,QAAS,YAA1CC,eAAuDA,EAAiB,aAAxEC,UAAsFA,GAAY,EAAlGC,gBAAwGA,GAAqB,UAC/J/E,EAAY,IAAI/I,IAAIpC,EAAKK,SAASF,MACxCgL,EAAUgF,KAAO,SACXhF,EAAUhL,WACViQ,ECHH,SAAmCjF,EAAW4E,EAA8B,QAG1E,MAAMvL,IAAa,IAAI2G,EAAUtF,aAAatC,QAC3CwM,EAA4BM,MAAMtQ,GAAWA,EAAOuQ,KAAK9L,MACzD2G,EAAUtF,aAAaC,OAAOtB,UAG/B2G,EDLyBoF,CAA0BpF,EAAW4E,YAC/DK,EAAwBjQ,KAC1B6P,GAAkBI,EAAwBI,SAASC,SAAS,KAAM,OAC5DC,EAAe,IAAItO,IAAIgO,EAAwBjQ,MACrDuQ,EAAaF,UAAYR,QACnBU,EAAavQ,QAEnB8P,EAAW,OACLU,EAAW,IAAIvO,IAAIgO,EAAwBjQ,MACjDwQ,EAASH,UAAY,cACfG,EAASxQ,QAEf+P,EAAiB,OACXU,EAAiBV,EAAgB,CAAElQ,IAAKmL,QACzC,MAAM0F,KAAgBD,QACjBC,EAAa1Q,MDGO2Q,CAAsB7P,EAAQjB,IAAKwG,GAAU,OAC7DoD,EAAWiG,EAAgBjN,IAAIkN,MACjClG,EAAU,OAEH,CAAEA,SAAAA,EAAU2D,UADD1B,EAAmB4D,wBAAwB7F,QAS5DiC,EAAmBtF,wBG1BxC,cAAyBiE,UAQPvJ,EAAS1B,OAWf4I,EADAD,QAAiB3I,EAAQ4N,WAAWlM,OAEnCiH,MAMGA,QAAiB3I,EAAQwR,iBAAiB9P,GAE9C,MAAO4B,GACCA,aAAe5D,QACfkJ,EAAQtF,OAyBfqF,QACK,IAAIlJ,EAAa,cAAe,CAAEgB,IAAKiB,EAAQjB,IAAKmI,MAAAA,WAEvDD,uBC7Df,SAA0B2F,EAASrH,ICInC,SAAkBqH,GACa8B,IACRhL,SAASkJ,GDL5BlJ,CAASkJ,GEAb,SAAkBrH,SACRqF,EAAqB8D,IAE3BhM,EADsB,IAAIiM,EAAc/D,EAAoBrF,IFD5DwK,CAASxK"} \ No newline at end of file diff --git a/resources/functions/cider-base.js b/src/main/cider-base.js similarity index 97% rename from resources/functions/cider-base.js rename to src/main/cider-base.js index 301a1ac9..fbddc674 100644 --- a/resources/functions/cider-base.js +++ b/src/main/cider-base.js @@ -21,7 +21,7 @@ const CiderBase = { let win = null const options = { - icon: join(__dirname, `../icons/icon.ico`), + icon: join(__dirname, `../../resources/icons/icon.ico`), width: mainWindowState.width, height: mainWindowState.height, x: mainWindowState.x, @@ -174,7 +174,7 @@ const CiderBase = { async InitWebServer() { const webRemotePort = await getPort({port : 9000}); const webapp = express(); - const webRemotePath = path.join(__dirname, '../cider-ui/'); + const webRemotePath = path.join(__dirname, '../renderer/'); webapp.set("views", path.join(webRemotePath, "views")); webapp.set("view engine", "ejs"); diff --git a/src/main/init.js b/src/main/init.js new file mode 100644 index 00000000..69f2a796 --- /dev/null +++ b/src/main/init.js @@ -0,0 +1,5 @@ +const {app} = require('electron'); + +module.export = () => { + if (process.platform === "linux") app.commandLine.appendSwitch('disable-features', 'MediaSessionService'); +} \ No newline at end of file diff --git a/src/main/mpris.js b/src/main/mpris.js new file mode 100644 index 00000000..cd7d2a73 --- /dev/null +++ b/src/main/mpris.js @@ -0,0 +1,102 @@ +const {app} = require('electron'), + Player = require('mpris-service'); + +// Remember to use playerctl when debugging this. +// I'm just putting this here as I keep forgetting the command. +// Copied from AME + +let mediaPlayer; + +module.exports = { + connect: (win) => { + if (process.platform !== "linux") return; + + mediaPlayer = Player({ + name: 'Cider', + identity: 'Cider', + supportedUriSchemes: [], + supportedMimeTypes: [], + supportedInterfaces: ['player'] + }); + mediaPlayer = Object.assign(mediaPlayer, { canQuit: true, canControl: true, canPause: true, canPlay: true, canGoNext: true }) + + + let pos_atr = {durationInMillis: 0}; + mediaPlayer.getPosition = function () { + const durationInMicro = pos_atr.durationInMillis * 1000; + const percentage = parseFloat(0) || 0; + return durationInMicro * percentage; + } + + mediaPlayer.active = true + + mediaPlayer.on('playpause', async () => { + win.webContents.executeJavaScript('MusicKitInterop.pausePlay()').catch(err => console.error(err)) + }); + + mediaPlayer.on('play', async () => { + win.webContents.executeJavaScript('MusicKitInterop.pausePlay()').catch(err => console.error(err)) + }); + + mediaPlayer.on('pause', async () => { + win.webContents.executeJavaScript('MusicKitInterop.pausePlay()').catch(err => console.error(err)) + }); + + mediaPlayer.on('next', async () => { + win.webContents.executeJavaScript('MusicKitInterop.nextTrack()').catch(err => console.error(err)) + }); + + mediaPlayer.on('previous', async () => { + win.webContents.executeJavaScript('MusicKitInterop.previousTrack()').catch(err => console.error(err)) + }); + }, + + updateAttributes: (attributes) => { + if (process.platform !== "linux") return; + + const MetaData = { + 'mpris:trackid': mediaPlayer.objectPath(`track/${attributes.playParams.id.replace(/[.]+/g, "")}`), + 'mpris:length': attributes.durationInMillis * 1000, // In microseconds + 'mpris:artUrl': (attributes.artwork.url.replace('/{w}x{h}bb', '/512x512bb')).replace('/2000x2000bb', '/35x35bb'), + 'xesam:title': `${attributes.name}`, + 'xesam:album': `${attributes.albumName}`, + 'xesam:artist': [`${attributes.artistName}`,], + 'xesam:genre': attributes.genreNames + } + + if (mediaPlayer.metadata["mpris:trackid"] === MetaData["mpris:trackid"]) { + return + } + + mediaPlayer.metadata = MetaData + }, + + updateState: (attributes) => { + if (process.platform !== "linux") return; + + function setPlaybackIfNeeded(status) { + if (mediaPlayer.playbackStatus === status) { + return + } + mediaPlayer.playbackStatus = status; + } + + switch (attributes.status) { + case true: // Playing + setPlaybackIfNeeded('Playing'); + break; + case false: // Paused + setPlaybackIfNeeded('Paused'); + break; + default: // Stopped + setPlaybackIfNeeded('Stopped'); + break; + } + }, + + clearActivity: () => { + if (process.platform !== "linux") return; + mediaPlayer.metadata = {'mpris:trackid': '/org/mpris/MediaPlayer2/TrackList/NoTrack'} + mediaPlayer.playbackStatus = 'Stopped'; + }, +} \ No newline at end of file diff --git a/resources/preload/cider-preload.js b/src/preload/cider-preload.js similarity index 100% rename from resources/preload/cider-preload.js rename to src/preload/cider-preload.js diff --git a/resources/cider-ui/ameframework.css b/src/renderer/ameframework.css similarity index 100% rename from resources/cider-ui/ameframework.css rename to src/renderer/ameframework.css diff --git a/resources/cider-ui/apple-hls.js b/src/renderer/apple-hls.js similarity index 100% rename from resources/cider-ui/apple-hls.js rename to src/renderer/apple-hls.js diff --git a/resources/cider-ui/assets/RatingsLove.png b/src/renderer/assets/RatingsLove.png similarity index 100% rename from resources/cider-ui/assets/RatingsLove.png rename to src/renderer/assets/RatingsLove.png diff --git a/oldshit/resources/web-remote/assets/arrow-left.svg b/src/renderer/assets/arrow-left.svg similarity index 100% rename from oldshit/resources/web-remote/assets/arrow-left.svg rename to src/renderer/assets/arrow-left.svg diff --git a/oldshit/resources/web-remote/assets/backward.svg b/src/renderer/assets/backward.svg similarity index 100% rename from oldshit/resources/web-remote/assets/backward.svg rename to src/renderer/assets/backward.svg diff --git a/resources/cider-ui/assets/cast_white.svg b/src/renderer/assets/cast_white.svg similarity index 100% rename from resources/cider-ui/assets/cast_white.svg rename to src/renderer/assets/cast_white.svg diff --git a/resources/cider-ui/assets/chevron-left.svg b/src/renderer/assets/chevron-left.svg similarity index 100% rename from resources/cider-ui/assets/chevron-left.svg rename to src/renderer/assets/chevron-left.svg diff --git a/oldshit/resources/web-remote/assets/forward.svg b/src/renderer/assets/forward.svg similarity index 100% rename from oldshit/resources/web-remote/assets/forward.svg rename to src/renderer/assets/forward.svg diff --git a/oldshit/resources/web-remote/assets/list.svg b/src/renderer/assets/list.svg similarity index 100% rename from oldshit/resources/web-remote/assets/list.svg rename to src/renderer/assets/list.svg diff --git a/resources/cider-ui/assets/logocut.png b/src/renderer/assets/logocut.png similarity index 100% rename from resources/cider-ui/assets/logocut.png rename to src/renderer/assets/logocut.png diff --git a/resources/cider-ui/assets/lossless.svg b/src/renderer/assets/lossless.svg similarity index 100% rename from resources/cider-ui/assets/lossless.svg rename to src/renderer/assets/lossless.svg diff --git a/oldshit/resources/web-remote/assets/pause.svg b/src/renderer/assets/pause.svg similarity index 100% rename from oldshit/resources/web-remote/assets/pause.svg rename to src/renderer/assets/pause.svg diff --git a/oldshit/resources/web-remote/assets/play.svg b/src/renderer/assets/play.svg similarity index 100% rename from oldshit/resources/web-remote/assets/play.svg rename to src/renderer/assets/play.svg diff --git a/oldshit/resources/web-remote/assets/quote-right.svg b/src/renderer/assets/quote-right.svg similarity index 100% rename from oldshit/resources/web-remote/assets/quote-right.svg rename to src/renderer/assets/quote-right.svg diff --git a/oldshit/resources/web-remote/assets/repeat.svg b/src/renderer/assets/repeat.svg similarity index 100% rename from oldshit/resources/web-remote/assets/repeat.svg rename to src/renderer/assets/repeat.svg diff --git a/oldshit/resources/web-remote/assets/search.svg b/src/renderer/assets/search.svg similarity index 100% rename from oldshit/resources/web-remote/assets/search.svg rename to src/renderer/assets/search.svg diff --git a/oldshit/resources/web-remote/assets/shuffle.svg b/src/renderer/assets/shuffle.svg similarity index 100% rename from oldshit/resources/web-remote/assets/shuffle.svg rename to src/renderer/assets/shuffle.svg diff --git a/resources/cider-ui/assets/transparent.png b/src/renderer/assets/transparent.png similarity index 100% rename from resources/cider-ui/assets/transparent.png rename to src/renderer/assets/transparent.png diff --git a/oldshit/resources/web-remote/assets/volume-down.svg b/src/renderer/assets/volume-down.svg similarity index 100% rename from oldshit/resources/web-remote/assets/volume-down.svg rename to src/renderer/assets/volume-down.svg diff --git a/oldshit/resources/web-remote/assets/volume-up.svg b/src/renderer/assets/volume-up.svg similarity index 100% rename from oldshit/resources/web-remote/assets/volume-up.svg rename to src/renderer/assets/volume-up.svg diff --git a/resources/cider-ui/hlscider.js b/src/renderer/hlscider.js similarity index 100% rename from resources/cider-ui/hlscider.js rename to src/renderer/hlscider.js diff --git a/resources/cider-ui/index.js b/src/renderer/index.js similarity index 94% rename from resources/cider-ui/index.js rename to src/renderer/index.js index 1a743a6a..41aa4e2d 100644 --- a/resources/cider-ui/index.js +++ b/src/renderer/index.js @@ -131,6 +131,7 @@ const app = new Vue({ }, browsepage: [], listennow: [], + madeforyou: [], radio: { personal: [] }, @@ -140,6 +141,7 @@ const app = new Vue({ loading: false }, showingPlaylist: [], + appleCurator: [], artistPage: { data: {}, }, @@ -175,8 +177,8 @@ const app = new Vue({ "releaseDate": "Release Date" }, viewAs: 'covers', - sorting: "name", - sortOrder: "asc", + sorting: ["dateAdded", "name"], // [0] = recentlyadded page, [1] = albums page + sortOrder: ["desc", "asc"], // [0] = recentlyadded page, [1] = albums page listing: [], meta: {total: 0, progress: 0}, search: "", @@ -577,10 +579,19 @@ const app = new Vue({ ; let isLibrary = item.attributes.playParams ? (item.attributes.playParams.isLibrary ?? false) : false; console.log(kind, id, isLibrary) - // disable apple-curators because they can't be played in MKjs - if (!kind.toString().includes("apple-curator")) { + + if (true) { app.showingPlaylist = []; - if (kind.toString().includes("artist")) { + if (kind.toString().includes("apple-curator")){ + kind = "appleCurator" + app.getTypeFromID("appleCurator", (id), false, { + platform: "web", + include: "grouping,playlists", + extend: "editorialArtwork", + "art[url]": "f" + }); + } + else if (kind.toString().includes("artist")) { app.getArtistInfo(id, isLibrary) } else if (kind.toString().includes("record-label") || kind.toString().includes("curator")) { if (kind.toString().includes("record-label")) { @@ -767,54 +778,37 @@ const app = new Vue({ let self = this function sortSongs() { - if (self.library.songs.sortOrder == "asc") { - // sort this.library.songs.displayListing by song.attributes[self.library.songs.sorting] in ascending order based on alphabetical order and numeric order - // check if song.attributes[self.library.songs.sorting] is a number and if so, sort by number if not, sort by alphabetical order ignoring case - self.library.songs.displayListing.sort((a, b) => { - let aa = null; - let bb = null; - if (self.library.songs.sorting == "genre") { - aa = a.attributes.genreNames[0] - bb = b.attributes.genreNames[0] - } - aa = a.attributes[self.library.songs.sorting] - bb = b.attributes[self.library.songs.sorting] - if (aa == null) { - aa = "" - } - if (bb == null) { - bb = "" - } + // sort this.library.songs.displayListing by song.attributes[self.library.songs.sorting] in descending or ascending order based on alphabetical order and numeric order + // check if song.attributes[self.library.songs.sorting] is a number and if so, sort by number if not, sort by alphabetical order ignoring case + self.library.songs.displayListing.sort((a, b) => { + let aa = null; + let bb = null; + if (self.library.songs.sorting == "genre") { + aa = a.attributes.genreNames[0] + bb = b.attributes.genreNames[0] + } + aa = a.attributes[self.library.songs.sorting] + bb = b.attributes[self.library.songs.sorting] + if (aa == null) { + aa = "" + } + if (bb == null) { + bb = "" + } + if (self.library.songs.sortOrder == "asc") { if (aa.toString().match(/^\d+$/) && bb.toString().match(/^\d+$/)) { return aa - bb } else { return aa.toString().toLowerCase().localeCompare(bb.toString().toLowerCase()) } - }) - } - if (self.library.songs.sortOrder == "desc") { - // sort this.library.songs.displayListing by song.attributes[self.library.songs.sorting] in descending order based on alphabetical order and numeric order - // check if song.attributes[self.library.songs.sorting] is a number and if so, sort by number if not, sort by alphabetical order ignoring case - self.library.songs.displayListing.sort((a, b) => { - if (self.library.songs.sorting == "genre") { - aa = a.attributes.genreNames[0] - bb = b.attributes.genreNames[0] - } - let aa = a.attributes[self.library.songs.sorting] - let bb = b.attributes[self.library.songs.sorting] - if (aa == null) { - aa = "" - } - if (bb == null) { - bb = "" - } + } else if (self.library.songs.sortOrder == "desc") { if (aa.toString().match(/^\d+$/) && bb.toString().match(/^\d+$/)) { return bb - aa } else { return bb.toString().toLowerCase().localeCompare(aa.toString().toLowerCase()) } - }) - } + } + }) } if (this.library.songs.search == "") { @@ -847,58 +841,45 @@ const app = new Vue({ } }, // make a copy of searchLibrarySongs except use Albums instead of Songs - searchLibraryAlbums() { + searchLibraryAlbums(index) { let self = this function sortAlbums() { - if (self.library.albums.sortOrder == "asc") { - // sort this.library.albums.displayListing by album.attributes[self.library.albums.sorting] in ascending order based on alphabetical order and numeric order - // check if album.attributes[self.library.albums.sorting] is a number and if so, sort by number if not, sort by alphabetical order ignoring case - self.library.albums.displayListing.sort((a, b) => { - let aa = null; - let bb = null; - if (self.library.albums.sorting == "genre") { - aa = a.attributes.genreNames[0] - bb = b.attributes.genreNames[0] - } - aa = a.attributes[self.library.albums.sorting] - bb = b.attributes[self.library.albums.sorting] - if (aa == null) { - aa = "" - } - if (bb == null) { - bb = "" - } + // sort this.library.albums.displayListing by album.attributes[self.library.albums.sorting[index]] in descending or ascending order based on alphabetical order and numeric order + // check if album.attributes[self.library.albums.sorting[index]] is a number and if so, sort by number if not, sort by alphabetical order ignoring case + let aa = null; + let bb = null; + self.library.albums.displayListing.sort((a, b) => { + if (self.library.albums.sorting[index] == "genre") { + aa = a.attributes.genreNames[0] + bb = b.attributes.genreNames[0] + } + if (self.library.albums.sorting[index] == "dateAdded") { + aa = new Date(a.attributes.dateAdded).getTime() + bb = new Date(b.attributes.dateAdded).getTime() + } + aa = a.attributes[self.library.albums.sorting[index]] + bb = b.attributes[self.library.albums.sorting[index]] + if (aa == null) { + aa = "" + } + if (bb == null) { + bb = "" + } + if (self.library.albums.sortOrder[index] == "asc") { if (aa.toString().match(/^\d+$/) && bb.toString().match(/^\d+$/)) { return aa - bb } else { return aa.toString().toLowerCase().localeCompare(bb.toString().toLowerCase()) } - }) - } - if (self.library.albums.sortOrder == "desc") { - // sort this.library.albums.displayListing by album.attributes[self.library.albums.sorting] in descending order based on alphabetical order and numeric order - // check if album.attributes[self.library.albums.sorting] is a number and if so, sort by number if not, sort by alphabetical order ignoring case - self.library.albums.displayListing.sort((a, b) => { - if (self.library.albums.sorting == "genre") { - aa = a.attributes.genreNames[0] - bb = b.attributes.genreNames[0] - } - let aa = a.attributes[self.library.albums.sorting] - let bb = b.attributes[self.library.albums.sorting] - if (aa == null) { - aa = "" - } - if (bb == null) { - bb = "" - } + } else if (self.library.albums.sortOrder[index] == "desc") { if (aa.toString().match(/^\d+$/) && bb.toString().match(/^\d+$/)) { return bb - aa } else { return bb.toString().toLowerCase().localeCompare(aa.toString().toLowerCase()) } - }) - } + } + }) } if (this.library.albums.search == "") { @@ -1042,7 +1023,7 @@ const app = new Vue({ downloadChunk() }, // copy the getLibrarySongsFull function except change Songs to Albums - async getLibraryAlbumsFull(force = false) { + async getLibraryAlbumsFull(force = false, index) { let self = this let library = [] let downloaded = null; @@ -1051,7 +1032,7 @@ const app = new Vue({ } if (localStorage.getItem("libraryAlbums") != null) { this.library.albums.listing = JSON.parse(localStorage.getItem("libraryAlbums")) - this.searchLibraryAlbums() + this.searchLibraryAlbums(index) } if (this.songstest) { return @@ -1090,7 +1071,7 @@ const app = new Vue({ self.library.albums.downloadState = 2 self.library.downloadNotification.show = false localStorage.setItem("libraryAlbums", JSON.stringify(library)) - self.searchLibraryAlbums() + self.searchLibraryAlbums(index) } if (downloaded.meta.total > library.length || typeof downloaded.meta.next != "undefined") { console.log(`downloading next chunk - ${library.length @@ -1101,7 +1082,7 @@ const app = new Vue({ self.library.albums.downloadState = 2 self.library.downloadNotification.show = false localStorage.setItem("libraryAlbums", JSON.stringify(library)) - self.searchLibraryAlbums() + self.searchLibraryAlbums(index) console.log(library) } } @@ -1206,6 +1187,18 @@ const app = new Vue({ this.getRadioStations(attempt + 1) } }, + async getMadeForYou(attempt = 0) { + if (attempt > 3) { + return + } + try { + mfu = await app.mk.api.v3.music("/v1/me/library/playlists?platform=web&extend=editorialVideo&fields%5Bplaylists%5D=lastModifiedDate&filter%5Bfeatured%5D=made-for-you&include%5Blibrary-playlists%5D=catalog&fields%5Blibrary-playlists%5D=artwork%2Cname%2CplayParams%2CdateAdded") + this.madeforyou = mfu.data + } catch (e) { + console.log(e) + this.getMadeForYou(attempt + 1) + } + }, unauthorize() { this.mk.unauthorize() }, @@ -1554,8 +1547,11 @@ const app = new Vue({ console.log(truekind,id) try { - if (parent == "librarysongs"){ - console.log("asc") + if (app.library.songs.listing.length > childIndex && parent == "librarysongs"){ + console.log(item) + if (item && ((app.library.songs.listing[childIndex].id != item.id))){ + childIndex = app.library.songs.listing.indexOf(item) + } let query = app.library.songs.listing.map(item => new MusicKit.MediaItem(item)); this.mk.clearQueue().then(function (_) { app.mk.queue.append(query) @@ -1949,3 +1945,11 @@ var checkIfScrollIsStatic = setInterval(() => { } }, 50); + +// WebGPU Console Notification +async function webGPU() { + const currentGPU = await navigator.gpu.requestAdapter() + console.log("WebGPU enabled on", currentGPU.name,"with feature ID", currentGPU.features.size) +} +webGPU().then() + diff --git a/resources/cider-ui/index_old.html b/src/renderer/index_old.html similarity index 100% rename from resources/cider-ui/index_old.html rename to src/renderer/index_old.html diff --git a/resources/cider-ui/less.js b/src/renderer/less.js similarity index 100% rename from resources/cider-ui/less.js rename to src/renderer/less.js diff --git a/resources/cider-ui/logotmp.png b/src/renderer/logotmp.png similarity index 100% rename from resources/cider-ui/logotmp.png rename to src/renderer/logotmp.png diff --git a/resources/cider-ui/sortable.min.js b/src/renderer/sortable.min.js similarity index 100% rename from resources/cider-ui/sortable.min.js rename to src/renderer/sortable.min.js diff --git a/resources/cider-ui/style-old.css b/src/renderer/style-old.css similarity index 100% rename from resources/cider-ui/style-old.css rename to src/renderer/style-old.css diff --git a/resources/cider-ui/style.less b/src/renderer/style.less similarity index 99% rename from resources/cider-ui/style.less rename to src/renderer/style.less index 5ad86618..f8c8449f 100644 --- a/resources/cider-ui/style.less +++ b/src/renderer/style.less @@ -2031,7 +2031,7 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb { flex: 0 0 auto; flex-direction: row; font-size: 14px; - justify-content: center; + justify-content: center-between; align-items: center; border-bottom: 1px solid rgb(200 200 200 / 10%); @@ -2744,4 +2744,8 @@ input[type=checkbox][switch]:checked:active::before { left: -1px; } -/* End Switch Checkbox */ \ No newline at end of file +/* End Switch Checkbox */ + +.madeforyou-body{ + margin-top: 15px; +} \ No newline at end of file diff --git a/resources/cider-ui/sw.js b/src/renderer/sw.js similarity index 100% rename from resources/cider-ui/sw.js rename to src/renderer/sw.js diff --git a/resources/cider-ui/todo.js b/src/renderer/todo.js similarity index 100% rename from resources/cider-ui/todo.js rename to src/renderer/todo.js diff --git a/resources/cider-ui/views/components/animatedartwork-view.ejs b/src/renderer/views/components/animatedartwork-view.ejs similarity index 100% rename from resources/cider-ui/views/components/animatedartwork-view.ejs rename to src/renderer/views/components/animatedartwork-view.ejs diff --git a/resources/cider-ui/views/components/editorialNotes.ejs b/src/renderer/views/components/editorialNotes.ejs similarity index 100% rename from resources/cider-ui/views/components/editorialNotes.ejs rename to src/renderer/views/components/editorialNotes.ejs diff --git a/resources/cider-ui/views/components/hello-world.ejs b/src/renderer/views/components/hello-world.ejs similarity index 100% rename from resources/cider-ui/views/components/hello-world.ejs rename to src/renderer/views/components/hello-world.ejs diff --git a/resources/cider-ui/views/components/karaoke-in.ejs b/src/renderer/views/components/karaoke-in.ejs similarity index 100% rename from resources/cider-ui/views/components/karaoke-in.ejs rename to src/renderer/views/components/karaoke-in.ejs diff --git a/resources/cider-ui/views/components/lyrics-view.ejs b/src/renderer/views/components/lyrics-view.ejs similarity index 90% rename from resources/cider-ui/views/components/lyrics-view.ejs rename to src/renderer/views/components/lyrics-view.ejs index ff8a7d13..26e3146f 100644 --- a/resources/cider-ui/views/components/lyrics-view.ejs +++ b/src/renderer/views/components/lyrics-view.ejs @@ -1,13 +1,13 @@ + + \ No newline at end of file diff --git a/src/renderer/views/components/mediaitem-square-sp.ejs b/src/renderer/views/components/mediaitem-square-sp.ejs new file mode 100644 index 00000000..d5635965 --- /dev/null +++ b/src/renderer/views/components/mediaitem-square-sp.ejs @@ -0,0 +1,179 @@ + + + \ No newline at end of file diff --git a/resources/cider-ui/views/components/mediaitem-square.ejs b/src/renderer/views/components/mediaitem-square.ejs similarity index 100% rename from resources/cider-ui/views/components/mediaitem-square.ejs rename to src/renderer/views/components/mediaitem-square.ejs diff --git a/resources/cider-ui/views/components/queue-item.ejs b/src/renderer/views/components/queue-item.ejs similarity index 100% rename from resources/cider-ui/views/components/queue-item.ejs rename to src/renderer/views/components/queue-item.ejs diff --git a/resources/cider-ui/views/components/queue.ejs b/src/renderer/views/components/queue.ejs similarity index 100% rename from resources/cider-ui/views/components/queue.ejs rename to src/renderer/views/components/queue.ejs diff --git a/resources/cider-ui/views/main.ejs b/src/renderer/views/main.ejs similarity index 96% rename from resources/cider-ui/views/main.ejs rename to src/renderer/views/main.ejs index 950b07d9..76f3d34f 100644 --- a/resources/cider-ui/views/main.ejs +++ b/src/renderer/views/main.ejs @@ -366,15 +366,32 @@ + + + <%- include('pages/library-recentlyadded') %>'); + <%- include('pages/library-songs') %> - + <%- include('pages/library-albums') %>'); %> + + + + + + + +
    @@ -447,6 +464,9 @@ <%- include('pages/collection-list') %> + +<%- include('pages/apple-curator') %> + <%- include('pages/artist') %> diff --git a/resources/cider-ui/views/pages/about.ejs b/src/renderer/views/pages/about.ejs similarity index 100% rename from resources/cider-ui/views/pages/about.ejs rename to src/renderer/views/pages/about.ejs diff --git a/src/renderer/views/pages/apple-curator.ejs b/src/renderer/views/pages/apple-curator.ejs new file mode 100644 index 00000000..8b5a8d00 --- /dev/null +++ b/src/renderer/views/pages/apple-curator.ejs @@ -0,0 +1,37 @@ + + + \ No newline at end of file diff --git a/resources/cider-ui/views/pages/artist.ejs b/src/renderer/views/pages/artist.ejs similarity index 96% rename from resources/cider-ui/views/pages/artist.ejs rename to src/renderer/views/pages/artist.ejs index cbac6172..b9c2a49d 100644 --- a/resources/cider-ui/views/pages/artist.ejs +++ b/src/renderer/views/pages/artist.ejs @@ -29,7 +29,14 @@

    {{ data.attributes.name }}

    - +
    diff --git a/resources/cider-ui/views/pages/browse.ejs b/src/renderer/views/pages/browse.ejs similarity index 100% rename from resources/cider-ui/views/pages/browse.ejs rename to src/renderer/views/pages/browse.ejs diff --git a/resources/cider-ui/views/pages/cider-playlist.ejs b/src/renderer/views/pages/cider-playlist.ejs similarity index 100% rename from resources/cider-ui/views/pages/cider-playlist.ejs rename to src/renderer/views/pages/cider-playlist.ejs diff --git a/resources/cider-ui/views/pages/collection-list.ejs b/src/renderer/views/pages/collection-list.ejs similarity index 100% rename from resources/cider-ui/views/pages/collection-list.ejs rename to src/renderer/views/pages/collection-list.ejs diff --git a/resources/cider-ui/views/pages/library-albums.ejs b/src/renderer/views/pages/library-albums.ejs similarity index 92% rename from resources/cider-ui/views/pages/library-albums.ejs rename to src/renderer/views/pages/library-albums.ejs index c5951034..643da2e1 100644 --- a/resources/cider-ui/views/pages/library-albums.ejs +++ b/src/renderer/views/pages/library-albums.ejs @@ -5,7 +5,7 @@

    Albums

    - +
    @@ -23,14 +23,14 @@
    -
    - diff --git a/src/renderer/views/pages/library-recentlyadded.ejs b/src/renderer/views/pages/library-recentlyadded.ejs new file mode 100644 index 00000000..ed1b33e1 --- /dev/null +++ b/src/renderer/views/pages/library-recentlyadded.ejs @@ -0,0 +1,49 @@ + \ No newline at end of file diff --git a/resources/cider-ui/views/pages/library-songs.ejs b/src/renderer/views/pages/library-songs.ejs similarity index 100% rename from resources/cider-ui/views/pages/library-songs.ejs rename to src/renderer/views/pages/library-songs.ejs diff --git a/resources/cider-ui/views/pages/listen_now.ejs b/src/renderer/views/pages/listen_now.ejs similarity index 100% rename from resources/cider-ui/views/pages/listen_now.ejs rename to src/renderer/views/pages/listen_now.ejs diff --git a/src/renderer/views/pages/madeforyou.ejs b/src/renderer/views/pages/madeforyou.ejs new file mode 100644 index 00000000..3dc85e79 --- /dev/null +++ b/src/renderer/views/pages/madeforyou.ejs @@ -0,0 +1,11 @@ +
    +
    +
    +

    Made For You

    +
    +
    +
    + + +
    +
    \ No newline at end of file diff --git a/resources/cider-ui/views/pages/radio.ejs b/src/renderer/views/pages/radio.ejs similarity index 100% rename from resources/cider-ui/views/pages/radio.ejs rename to src/renderer/views/pages/radio.ejs diff --git a/resources/cider-ui/views/pages/recordLabel.ejs b/src/renderer/views/pages/recordLabel.ejs similarity index 100% rename from resources/cider-ui/views/pages/recordLabel.ejs rename to src/renderer/views/pages/recordLabel.ejs diff --git a/resources/cider-ui/views/pages/search.ejs b/src/renderer/views/pages/search.ejs similarity index 100% rename from resources/cider-ui/views/pages/search.ejs rename to src/renderer/views/pages/search.ejs diff --git a/resources/cider-ui/views/pages/settings.ejs b/src/renderer/views/pages/settings.ejs similarity index 100% rename from resources/cider-ui/views/pages/settings.ejs rename to src/renderer/views/pages/settings.ejs diff --git a/resources/cider-ui/views/pages/webview.ejs b/src/renderer/views/pages/webview.ejs similarity index 100% rename from resources/cider-ui/views/pages/webview.ejs rename to src/renderer/views/pages/webview.ejs diff --git a/resources/cider-ui/views/pages/zoo.ejs b/src/renderer/views/pages/zoo.ejs similarity index 100% rename from resources/cider-ui/views/pages/zoo.ejs rename to src/renderer/views/pages/zoo.ejs diff --git a/resources/cider-ui/views/svg/arrow-up.svg b/src/renderer/views/svg/arrow-up.svg similarity index 100% rename from resources/cider-ui/views/svg/arrow-up.svg rename to src/renderer/views/svg/arrow-up.svg diff --git a/resources/cider-ui/views/svg/cast.svg b/src/renderer/views/svg/cast.svg similarity index 100% rename from resources/cider-ui/views/svg/cast.svg rename to src/renderer/views/svg/cast.svg diff --git a/resources/cider-ui/views/svg/chevron-left.svg b/src/renderer/views/svg/chevron-left.svg similarity index 100% rename from resources/cider-ui/views/svg/chevron-left.svg rename to src/renderer/views/svg/chevron-left.svg diff --git a/resources/cider-ui/views/svg/chevron-right.svg b/src/renderer/views/svg/chevron-right.svg similarity index 100% rename from resources/cider-ui/views/svg/chevron-right.svg rename to src/renderer/views/svg/chevron-right.svg diff --git a/resources/cider-ui/views/svg/fullscreen.svg b/src/renderer/views/svg/fullscreen.svg similarity index 100% rename from resources/cider-ui/views/svg/fullscreen.svg rename to src/renderer/views/svg/fullscreen.svg diff --git a/src/renderer/views/svg/more.svg b/src/renderer/views/svg/more.svg new file mode 100644 index 00000000..8abcf599 --- /dev/null +++ b/src/renderer/views/svg/more.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/resources/cider-ui/views/svg/play.svg b/src/renderer/views/svg/play.svg similarity index 100% rename from resources/cider-ui/views/svg/play.svg rename to src/renderer/views/svg/play.svg diff --git a/resources/cider-ui/views/svg/redo.svg b/src/renderer/views/svg/redo.svg similarity index 100% rename from resources/cider-ui/views/svg/redo.svg rename to src/renderer/views/svg/redo.svg diff --git a/resources/cider-ui/vue-observe-visibility.min.js b/src/renderer/vue-observe-visibility.min.js similarity index 100% rename from resources/cider-ui/vue-observe-visibility.min.js rename to src/renderer/vue-observe-visibility.min.js diff --git a/oldshit/resources/js/vue.js b/src/renderer/vue.js similarity index 100% rename from oldshit/resources/js/vue.js rename to src/renderer/vue.js diff --git a/oldshit/resources/web-remote/vuedraggable.umd.min.js b/src/renderer/vuedraggable.umd.min.js similarity index 100% rename from oldshit/resources/web-remote/vuedraggable.umd.min.js rename to src/renderer/vuedraggable.umd.min.js diff --git a/resources/cider-ui/workbox-962786f2.js b/src/renderer/workbox-962786f2.js similarity index 100% rename from resources/cider-ui/workbox-962786f2.js rename to src/renderer/workbox-962786f2.js diff --git a/workbox-config.js b/workbox-config.js index c82498f1..126cbf12 100644 --- a/workbox-config.js +++ b/workbox-config.js @@ -1,6 +1,6 @@ module.exports = { - globDirectory: 'resources/cider-ui/', - swDest: 'resources/cider-ui/sw.js', + globDirectory: 'src/renderer/', + swDest: 'src/renderer/sw.js', // Define runtime caching rules. runtimeCaching: [{ // Match any request that ends with .png, .jpg, .jpeg or .svg. @@ -36,4 +36,4 @@ module.exports = { /^X-Amz-Credential/, /^X-Amz-Signature/, ] -}; \ No newline at end of file +};