Merge branch 'master' into dev
This commit is contained in:
commit
dac3dc2331
92 files changed
+44642
-12345
No files matched your search
@@ -11,9 +11,261 @@ Web-Base is a php framework which provides basic web functionalities and a moder
|
||||
- REST API
|
||||
- Account management
|
||||
- Supporting MySQL + PostgreSQL
|
||||
- New: Page Routing
|
||||
- New: Admin Dashboard
|
||||
- New: Account & User functions
|
||||
- Dynamic Page Routing
|
||||
- Admin Dashboard
|
||||
- Account & User functions
|
||||
- File Sharing Dashboard
|
||||
|
||||
### Upcoming:
|
||||
I actually don't know what i want to implement here. There are quite to many CMS out there with alot of vulnerabilities. There also exist some frameworks already. This project is meant to provide a stable project base to implement what ever a developer wants to: Dynamic Homepages, Webshops, ..
|
||||
|
||||
## Installation
|
||||
|
||||
1. `git clone https://git.romanh.de/Projekte/web-base` (or `https://github.com/rhergenreder/web-base`)
|
||||
2. Create a [mysql](https://dev.mysql.com/doc/refman/5.7/en/creating-database.html) or [postgresql](https://www.postgresql.org/docs/9.0/sql-createdatabase.html) database
|
||||
or use an existing empty database (e.g. test or public)
|
||||
3. Open the webapp in your browser and follow the installation guide
|
||||
|
||||
For any changes made in [/adminPanel](/adminPanel) or [/fileControlPanel](/fileControlPanel), run:
|
||||
1. once: `npm i`
|
||||
2. build: `npm run build`
|
||||
The compiled dist files will be automatically moved to `/js`.
|
||||
|
||||
## Extending the Base
|
||||
|
||||
### Adding API-Endpoints
|
||||
|
||||
Each API endpoint has usually one overlying category, for example all user and authorization endpoints belong to the [UserAPI](/core/Api/UserAPI.class.php).
|
||||
These endpoints can be accessed by requesting URLs starting with `/api/user`, for example: `/api/user/login`. There are also endpoints, which don't have
|
||||
a category, e.g. [PatchSQL](/core/Api/PatchSQL.class.php). These functions can be called directly, for example with `/api/patchSQL`. Both methods have one thing in common:
|
||||
Each endpoint is represented by a class inheriting the [Request Class](/core/Api/Request.class.php). An example endpoint looks like this:
|
||||
|
||||
```php
|
||||
namespace Api;
|
||||
use Api\Parameter\Parameter;
|
||||
use Objects\User;
|
||||
|
||||
class SingleEndpoint extends Request {
|
||||
|
||||
public function __construct(User $user, bool $externalCall = false) {
|
||||
parent::__construct($user, $externalCall, array(
|
||||
"someParameter" => new Parameter("someParameter", Parameter::TYPE_INT, true, 100)
|
||||
));
|
||||
$this->forbidMethod("POST");
|
||||
}
|
||||
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
$this->result['someAttribute'] = $this->getParam("someParameter") * 2;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
An endpoint consists of two important functions:
|
||||
1. the constructor defining the expected parameters as well as some restrictions and endpoint configuration.
|
||||
2. the execute function, checking all requirements by calling the parent, and then executing the own method.
|
||||
|
||||
To create an API category containing multiple endpoints, a parent class inheriting from `Request`, e.g. `class MultipleAPI extends Request` is required.
|
||||
All endpoints inside this category then inherit from the `MultipleAPI` class.
|
||||
|
||||
The classes must be present inside the [Api](/core/Api) directory according to the other endpoints.
|
||||
|
||||
### Access Control
|
||||
|
||||
By default, and if not further specified or restricted, all endpoints have the following access rules:
|
||||
1. Allowed methods: GET and POST (`$this->allowedMethods`)
|
||||
2. No login is required (`$this->loginRequired`)
|
||||
3. CSRF-Token is required, if the user is logged in (`$this->csrfTokenRequired`)
|
||||
4. The function can be called from outside (`$this->isPublic`)
|
||||
5. An API-Key can be used to access this method (`$this->apiKeyAllowed`)
|
||||
6. All user groups can access the method (Database, Table: `ApiPermission`)
|
||||
|
||||
The first five restrictions can be modified inside the constructor, while the group permissions are changed using
|
||||
the [Admin Dashboard](/adminPanel). It's default values are set inside the [database script](/core/Configuration/CreateDatabase.class.php).
|
||||
|
||||
### Using the API internally
|
||||
|
||||
Some endpoints are set to private, which means, they can be only accessed inside the backend. These functions, as well as the public ones,
|
||||
can be used by creating the desired request object, and calling the execute function with our parameters like shown below:
|
||||
|
||||
```php
|
||||
$req = new \Api\Mail\Send($user);
|
||||
$success = $req->execute(array(
|
||||
"to" => "mail@example.org",
|
||||
"subject" => "Example Mail",
|
||||
"body" => "This is an example mail"
|
||||
));
|
||||
|
||||
if (!$success) {
|
||||
echo $req->getLastError();
|
||||
}
|
||||
```
|
||||
|
||||
The user object is usually obtained from the api (`$this->user`) or from the frontend document (`$document->getUser()`).
|
||||
If any result is expected from the api call, the `$req->getResult()` method can be used, which returns an array of all field.
|
||||
|
||||
### Modifying the database
|
||||
|
||||
This step is not really required, as and changes made to the database must not be presented inside the code.
|
||||
On the other hand, it is recommended to keep track of any modifications for later use or to deploy the application
|
||||
to other systems. Therefore, either the [default installation script](/core/Configuration/CreateDatabase.class.php) or
|
||||
an additional patch file, which can be executed using the API (`/api/PatchSQL`), can be created. The patch files are usually
|
||||
located in [/core/Configuration/Patch](/core/Configuration/Patch) and have the following structure:
|
||||
|
||||
```php
|
||||
namespace Configuration\Patch;
|
||||
|
||||
use Configuration\DatabaseScript;
|
||||
use Driver\SQL\SQL;
|
||||
|
||||
class example_patch extends DatabaseScript {
|
||||
public static function createQueries(SQL $sql): array {
|
||||
$queries = [];
|
||||
$queries[] = $sql->createTable("ExampleTable")
|
||||
->addSerial("exampleCol")
|
||||
->addString("someString", 32)
|
||||
->primaryKey("exampleCol");
|
||||
return $queries;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Routing
|
||||
|
||||
To access and view any frontend pages, the internal router is used. Available routes can be customized on the admin dashboard. There are four types of routes:
|
||||
|
||||
1. Permanent redirect (http status code: 308)
|
||||
2. Temporary redirect (http status code: 307)
|
||||
3. Static Route
|
||||
4. Dynamic Content
|
||||
|
||||
A static route targets a file, usually located in [/static](/static) and does nothing more, than returning its content. A dynamic route is usually the way to go:
|
||||
It takes two parameters, firstly the target document and secondly, an optional view. For example, take the following routing table:
|
||||
|
||||
| Route | Action | Target | Extra |
|
||||
| ----- | ------ | ------ | ----- |
|
||||
| `/funnyCatImage` | `Serve Static` | `/static/cat.jpg` | |
|
||||
| `/someRoute(/(.*))?` | `Redirect Dynamic` | `\Documents\MyDocument\` | `$2` |
|
||||
|
||||
The first route would return the cat image, if the case-insensitive path `/funnyCatImage` is requested.
|
||||
The second route is more interesting, as it firstly contains regex, which means, any route starting with `/someRoute/` or just `/someRoute` is accepted.
|
||||
Secondly, it passes the second group (`$2`), which is all the text after the last slash (or `null`) to the dynamically loaded document `MyDocument`.
|
||||
|
||||
### Creating and Modifying documents
|
||||
|
||||
A frontend page consists of a document, which again consists of a head and a body. Furthermore, a document can have various views, which have to be implemented
|
||||
programmatically. Usually, all pages inside a document look somehow similar, for example share a common side- or navbar, a header or a footer. If we think of a web-shop,
|
||||
we could have one document, when showing different articles and products, and a view for various pages, e.g. the dashboard with all the products, a single product view and so on.
|
||||
To create a new document, a class inside [/core/Documents](/core/Documents) is created with the following scheme:
|
||||
|
||||
```php
|
||||
namespace Documents {
|
||||
|
||||
use Elements\Document;
|
||||
use Objects\User;
|
||||
use Documents\Example\ExampleHead;
|
||||
use Documents\Example\ExampleBody;
|
||||
|
||||
class ExampleDocument extends Document {
|
||||
public function __construct(User $user, ?string $view = NULL) {
|
||||
parent::__construct($user, ExampleHead::class, ExampleBody::class, $view);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace Documents\Example {
|
||||
|
||||
use Elements\Head;
|
||||
use Elements\Body;
|
||||
|
||||
class ExampleHead extends Head {
|
||||
|
||||
public function __construct($document) {
|
||||
parent::__construct($document);
|
||||
}
|
||||
|
||||
protected function initSources() {
|
||||
$this->loadJQuery();
|
||||
$this->loadBootstrap();
|
||||
$this->loadFontawesome();
|
||||
}
|
||||
|
||||
protected function initMetas() : array {
|
||||
return array(
|
||||
array('charset' => 'utf-8'),
|
||||
);
|
||||
}
|
||||
|
||||
protected function initRawFields() : array {
|
||||
return array();
|
||||
}
|
||||
|
||||
protected function initTitle() : string {
|
||||
return "Example Document";
|
||||
}
|
||||
}
|
||||
|
||||
class ExampleBody extends Body {
|
||||
public function __construct($document) {
|
||||
parent::__construct($document);
|
||||
}
|
||||
|
||||
public function getCode(): string {
|
||||
$view = $this->getDocument()->getRequestedView() ?? "<Empty>";
|
||||
return "<b>Requested View:</b> " . htmlspecialchars($view);
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Of course, the head and body classes can be placed in any file, as the code might get big and complex.
|
||||
|
||||
### Localization
|
||||
|
||||
Currently, there are two languages specified, which are stored in the database: `en_US` and `de_DE`.
|
||||
A language is dynamically loaded according to the sent `Accept-Language`-Header, but can also be set using the `lang` parameter
|
||||
or [/api/language/set](/core/Api/LanguageAPI.class.php) endpoint. Localization of strings can be achieved using the [LanguageModule](/core/Objects/lang/LanguageModule.php)-Class.
|
||||
Let's look at this example:
|
||||
|
||||
```php
|
||||
class ExampleLangModule extends \Objects\lang\LanguageModule {
|
||||
public function getEntries(string $langCode) {
|
||||
$entries = array();
|
||||
switch ($langCode) {
|
||||
case 'de_DE':
|
||||
$entries["EXAMPLE_KEY"] = "Das ist eine Beispielübersetzung";
|
||||
$entries["Welcome"] = "Willkommen";
|
||||
break;
|
||||
default:
|
||||
$entries["EXAMPLE_KEY"] = "This is an example translation";
|
||||
break;
|
||||
}
|
||||
return $entries;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If any translation key is not defined, the key is returned, which means, we don't need to specify the string `Welcome` again. To access the translations,
|
||||
we firstly have to load the module. This is done by adding the class, or the object inside the constructor.
|
||||
To translate the defined strings, we can use the global `L()` function. The following code snipped shows the use of
|
||||
our sample language module:
|
||||
|
||||
```php
|
||||
class SomeView extends \Elements\View {
|
||||
public function __construct(\Elements\Document $document) {
|
||||
parent::__construct($document);
|
||||
$this->langModules[] = ExampleModule::class;
|
||||
}
|
||||
|
||||
public function getCode() : string{
|
||||
return L("Welcome") . "! " . L("EXAMPLE_KEY");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Anything more?
|
||||
|
||||
Feel free to contact me regarding this project and any other questions.
|
||||
@@ -0,0 +1 @@
|
||||
DENY FROM ALL
|
||||
Generated
+29362
-4266
File diff suppressed because it is too large.
Load diff
@@ -16,13 +16,14 @@
|
||||
"react-dom": "^16.13.1",
|
||||
"react-draft-wysiwyg": "^1.14.5",
|
||||
"react-router-dom": "^5.2.0",
|
||||
"react-scripts": "^3.4.1",
|
||||
"react-scripts": "^4.0.3",
|
||||
"react-select": "^3.1.0",
|
||||
"react-tooltip": "^4.2.7",
|
||||
"sanitize-html": "^1.27.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "webpack --mode production && mv dist/main.js ../js/admin.min.js"
|
||||
"build": "webpack --mode production && mv dist/main.js ../js/admin.min.js",
|
||||
"debug": "react-scripts start"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "react-app"
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/fontawesome.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -5,7 +5,7 @@ export default function Footer() {
|
||||
return (
|
||||
<footer className={"main-footer"}>
|
||||
Theme: <strong>Copyright © 2014-2019 <a href={"http://adminlte.io"}>AdminLTE.io</a>. <b>Version</b> 3.0.3</strong>
|
||||
CMS: <strong><a href={"https://git.romanh.de/Projekte/web-base"}>WebBase</a></strong>. <b>Version</b> 1.1.0
|
||||
CMS: <strong><a href={"https://git.romanh.de/Projekte/web-base"}>WebBase</a></strong>. <b>Version</b> 1.2.0
|
||||
</footer>
|
||||
)
|
||||
}
|
||||
@@ -75,7 +75,7 @@ export default function Sidebar(props) {
|
||||
let filePath = parent.filesPath;
|
||||
if (filePath) {
|
||||
li.push(<li className={"nav-item"} key={"files"}>
|
||||
<a href={filePath} className={"nav-link"} target={"_blank"} rel={"noopener noreferrer"}>
|
||||
<a href={filePath} className={"nav-link"} target={"_blank"} rel={"noopener"}>
|
||||
<Icon icon={"folder"} className={"nav-icon"} />
|
||||
<p>Files</p>
|
||||
</a>
|
||||
|
||||
@@ -121,7 +121,13 @@ export default function HelpPage() {
|
||||
<b>Project Lead & Main Developer</b>
|
||||
<ul className={"list-unstyled"}>
|
||||
<li><small><Icon icon={"address-card"} className={"mr-1"}/>Roman Hergenreder</small></li>
|
||||
<li><small><Icon icon={"globe"} className={"mr-1"}/><a href={"https://romanh.de/"} target={"_blank"}>https://romanh.de/</a></small></li>
|
||||
<li>
|
||||
<small><Icon icon={"globe"} className={"mr-1"}/>
|
||||
<a href={"https://romanh.de/"} target={"_blank"} rel={"noopener"}>
|
||||
https://romanh.de/
|
||||
</a>
|
||||
</small>
|
||||
</li>
|
||||
<li><small><Icon icon={"envelope"} className={"mr-1"}/><a href={"mailto:webmaster@romanh.de"}>webmaster@romanh.de</a></small></li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -422,7 +422,7 @@ export default class Settings extends React.Component {
|
||||
<label className={"form-check-label"} htmlFor={"recaptcha_enabled"}>
|
||||
Enable Google's reCaptcha
|
||||
<span className={"ml-2"}>
|
||||
(<a href={"https://www.google.com/recaptcha/intro/v3.html"} target={"_blank"}>
|
||||
(<a href={"https://www.google.com/recaptcha/intro/v3.html"} target={"_blank"} rel={"noopener noreferrer"}>
|
||||
More Info
|
||||
<sup><small><Icon icon={"external-link-alt"} className={"ml-1"}/></small></sup>
|
||||
</a>)
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Api\ApiKey {
|
||||
$this->loginRequired = true;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
|
||||
if(!parent::execute($values)) {
|
||||
return false;
|
||||
@@ -81,7 +81,7 @@ namespace Api\ApiKey {
|
||||
$this->loginRequired = true;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if(!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -127,7 +127,7 @@ namespace Api\ApiKey {
|
||||
$this->loginRequired = true;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if(!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -162,7 +162,7 @@ namespace Api\ApiKey {
|
||||
$this->loginRequired = true;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if(!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Api\Contact {
|
||||
parent::__construct($user, $externalCall, $parameters);
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
+13
-13
@@ -238,7 +238,7 @@ namespace Api\File {
|
||||
$this->csrfTokenRequired = false;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -292,7 +292,7 @@ namespace Api\File {
|
||||
$this->loginRequired = true;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -316,7 +316,7 @@ namespace Api\File {
|
||||
$this->csrfTokenRequired = true;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -360,7 +360,7 @@ namespace Api\File {
|
||||
$this->csrfTokenRequired = false;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -407,7 +407,7 @@ namespace Api\File {
|
||||
$this->csrfTokenRequired = false;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -450,7 +450,7 @@ namespace Api\File {
|
||||
$this->loginRequired = true;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -482,7 +482,7 @@ namespace Api\File {
|
||||
));
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -551,7 +551,7 @@ namespace Api\File {
|
||||
$this->loginRequired = true;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -653,7 +653,7 @@ namespace Api\File {
|
||||
$this->csrfTokenRequired = false;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -826,7 +826,7 @@ namespace Api\File {
|
||||
$this->csrfTokenRequired = false;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -891,7 +891,7 @@ namespace Api\File {
|
||||
$this->csrfTokenRequired = true;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -946,7 +946,7 @@ namespace Api\File {
|
||||
$this->csrfTokenRequired = false;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -1017,7 +1017,7 @@ namespace Api\File {
|
||||
$this->csrfTokenRequired = false;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Api\Groups {
|
||||
return $this->success;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if(!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -116,7 +116,7 @@ namespace Api\Groups {
|
||||
));
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -162,7 +162,7 @@ namespace Api\Groups {
|
||||
));
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Api\Language {
|
||||
parent::__construct($user, $externalCall, array());
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if(!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ namespace Api\Language {
|
||||
return $this->success;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if(!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Api\Mail {
|
||||
));
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -77,7 +77,7 @@ namespace Api\Mail {
|
||||
return null;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if(!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace Api\Notifications {
|
||||
return $this->success;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if(!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -213,7 +213,7 @@ namespace Api\Notifications {
|
||||
return $this->success;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if(!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -235,7 +235,7 @@ namespace Api\Notifications {
|
||||
$this->loginRequired = true;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -8,14 +8,22 @@ class ArrayType extends Parameter {
|
||||
public int $elementType;
|
||||
public int $canBeOne;
|
||||
|
||||
public function __construct($name, $elementType = Parameter::TYPE_MIXED, $canBeOne=false, $optional = FALSE, $defaultValue = NULL) {
|
||||
/**
|
||||
* ArrayType constructor.
|
||||
* @param string $name the name of the parameter
|
||||
* @param int $elementType element type inside the array, for example, allow only integer values (Parameter::TYPE_INT)
|
||||
* @param bool $canBeOne true, if a single element can be passed inside the request (e.g. array=1 instead of array[]=1). Will be automatically casted to an array
|
||||
* @param bool $optional true if the parameter is optional
|
||||
* @param array|null $defaultValue the default value to use, if the parameter is not given
|
||||
*/
|
||||
public function __construct(string $name, int $elementType = Parameter::TYPE_MIXED, bool $canBeOne = false, bool $optional = FALSE, ?array $defaultValue = NULL) {
|
||||
$this->elementType = $elementType;
|
||||
$this->elementParameter = new Parameter('', $elementType);
|
||||
$this->canBeOne = $canBeOne;
|
||||
parent::__construct($name, Parameter::TYPE_ARRAY, $optional, $defaultValue);
|
||||
}
|
||||
|
||||
public function parseParam($value) {
|
||||
public function parseParam($value): bool {
|
||||
if(!is_array($value)) {
|
||||
if (!$this->canBeOne) {
|
||||
return false;
|
||||
@@ -38,12 +46,12 @@ class ArrayType extends Parameter {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getTypeName() {
|
||||
public function getTypeName(): string {
|
||||
$elementType = $this->elementParameter->getTypeName();
|
||||
return parent::getTypeName() . "($elementType)";
|
||||
}
|
||||
|
||||
public function toString() {
|
||||
public function toString(): string {
|
||||
$typeName = $this->getTypeName();
|
||||
$str = "$typeName $this->name";
|
||||
$defaultValue = (is_null($this->value) ? 'NULL' : (is_array($this->value) ? '[' . implode(",", $this->value) . ']' : $this->value));
|
||||
|
||||
@@ -26,11 +26,11 @@ class Parameter {
|
||||
|
||||
public string $name;
|
||||
public $value;
|
||||
public $optional;
|
||||
public bool $optional;
|
||||
public int $type;
|
||||
public string $typeName;
|
||||
|
||||
public function __construct($name, $type, $optional = FALSE, $defaultValue = NULL) {
|
||||
public function __construct(string $name, int $type, bool $optional = FALSE, $defaultValue = NULL) {
|
||||
$this->name = $name;
|
||||
$this->optional = $optional;
|
||||
$this->value = $defaultValue;
|
||||
@@ -38,11 +38,11 @@ class Parameter {
|
||||
$this->typeName = $this->getTypeName();
|
||||
}
|
||||
|
||||
public function getTypeName() {
|
||||
public function getTypeName(): string {
|
||||
return ($this->type >= 0 && $this->type < count(Parameter::names)) ? Parameter::names[$this->type] : "INVALID";
|
||||
}
|
||||
|
||||
public function toString() {
|
||||
public function toString(): string {
|
||||
$typeName = Parameter::names[$this->type];
|
||||
|
||||
$str = "$typeName $this->name";
|
||||
@@ -54,7 +54,7 @@ class Parameter {
|
||||
return $str;
|
||||
}
|
||||
|
||||
public static function parseType($value) {
|
||||
public static function parseType($value): int {
|
||||
if(is_array($value))
|
||||
return Parameter::TYPE_ARRAY;
|
||||
else if(is_numeric($value) && intval($value) == $value)
|
||||
@@ -77,7 +77,7 @@ class Parameter {
|
||||
return Parameter::TYPE_STRING;
|
||||
}
|
||||
|
||||
public function parseParam($value) {
|
||||
public function parseParam($value): bool {
|
||||
switch($this->type) {
|
||||
case Parameter::TYPE_INT:
|
||||
if(is_numeric($value) && intval($value) == $value) {
|
||||
|
||||
@@ -5,12 +5,12 @@ namespace Api\Parameter;
|
||||
class StringType extends Parameter {
|
||||
|
||||
public int $maxLength;
|
||||
public function __construct($name, $maxLength = -1, $optional = FALSE, $defaultValue = NULL) {
|
||||
public function __construct(string $name, int $maxLength = -1, bool $optional = FALSE, ?string $defaultValue = NULL) {
|
||||
$this->maxLength = $maxLength;
|
||||
parent::__construct($name, Parameter::TYPE_STRING, $optional, $defaultValue);
|
||||
}
|
||||
|
||||
public function parseParam($value) {
|
||||
public function parseParam($value): bool {
|
||||
if(!is_string($value)) {
|
||||
return false;
|
||||
}
|
||||
@@ -23,12 +23,12 @@ class StringType extends Parameter {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getTypeName() {
|
||||
public function getTypeName(): string {
|
||||
$maxLength = ($this->maxLength > 0 ? "($this->maxLength)" : "");
|
||||
return parent::getTypeName() . $maxLength;
|
||||
}
|
||||
|
||||
public function toString() {
|
||||
public function toString(): string {
|
||||
$typeName = $this->getTypeName();
|
||||
$str = "$typeName $this->name";
|
||||
$defaultValue = (is_null($this->value) ? 'NULL' : $this->value);
|
||||
|
||||
@@ -16,7 +16,7 @@ class PatchSQL extends Request {
|
||||
$this->csrfTokenRequired = false;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Api\Permission {
|
||||
$this->isPublic = false;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -102,7 +102,7 @@ namespace Api\Permission {
|
||||
return $this->success;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -147,7 +147,7 @@ namespace Api\Permission {
|
||||
));
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
+54
-34
@@ -18,13 +18,13 @@ class Request {
|
||||
protected bool $apiKeyAllowed;
|
||||
protected bool $csrfTokenRequired;
|
||||
|
||||
private array $aDefaultParams;
|
||||
private array $defaultParams;
|
||||
private array $allowedMethods;
|
||||
private bool $externalCall;
|
||||
|
||||
public function __construct(User $user, bool $externalCall = false, array $params = array()) {
|
||||
$this->user = $user;
|
||||
$this->aDefaultParams = $params;
|
||||
$this->defaultParams = $params;
|
||||
|
||||
$this->success = false;
|
||||
$this->result = array();
|
||||
@@ -45,29 +45,30 @@ class Request {
|
||||
}
|
||||
}
|
||||
|
||||
public function parseParams($values) {
|
||||
public function parseParams($values): bool {
|
||||
|
||||
foreach($this->params as $name => $param) {
|
||||
foreach ($this->params as $name => $param) {
|
||||
$value = $values[$name] ?? NULL;
|
||||
|
||||
$isEmpty = (is_string($value) && strlen($value) === 0) || (is_array($value) && empty($value));
|
||||
if(!$param->optional && (is_null($value) || $isEmpty)) {
|
||||
if (!$param->optional && (is_null($value) || $isEmpty)) {
|
||||
return $this->createError("Missing parameter: $name");
|
||||
}
|
||||
|
||||
if(!is_null($value) && !$isEmpty) {
|
||||
if(!$param->parseParam($value)) {
|
||||
if (!is_null($value) && !$isEmpty) {
|
||||
if (!$param->parseParam($value)) {
|
||||
$value = print_r($value, true);
|
||||
return $this->createError("Invalid Type for parameter: $name '$value' (Required: " . $param->getTypeName() . ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function parseVariableParams($values) {
|
||||
foreach($values as $name => $value) {
|
||||
if(isset($this->params[$name])) continue;
|
||||
foreach ($values as $name => $value) {
|
||||
if (isset($this->params[$name])) continue;
|
||||
$type = Parameter\Parameter::parseType($value);
|
||||
$param = new Parameter\Parameter($name, $type, true);
|
||||
$param->parseParam($value);
|
||||
@@ -75,19 +76,19 @@ class Request {
|
||||
}
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
$this->params = $this->aDefaultParams;
|
||||
public function execute($values = array()): bool {
|
||||
$this->params = array_merge([], $this->defaultParams);
|
||||
$this->success = false;
|
||||
$this->result = array();
|
||||
$this->lastError = '';
|
||||
|
||||
if($this->user->isLoggedIn()) {
|
||||
if ($this->user->isLoggedIn()) {
|
||||
$this->result['logoutIn'] = $this->user->getSession()->getExpiresSeconds();
|
||||
}
|
||||
|
||||
if($this->externalCall) {
|
||||
if ($this->externalCall) {
|
||||
$values = $_REQUEST;
|
||||
if($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_SERVER["CONTENT_TYPE"]) && in_array("application/json", explode(";", $_SERVER["CONTENT_TYPE"]))) {
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_SERVER["CONTENT_TYPE"]) && in_array("application/json", explode(";", $_SERVER["CONTENT_TYPE"]))) {
|
||||
$jsonData = json_decode(file_get_contents('php://input'), true);
|
||||
if ($jsonData) {
|
||||
$values = array_merge($values, $jsonData);
|
||||
@@ -99,34 +100,34 @@ class Request {
|
||||
}
|
||||
}
|
||||
|
||||
if($this->isDisabled) {
|
||||
if ($this->isDisabled) {
|
||||
$this->lastError = "This function is currently disabled.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if($this->externalCall && !$this->isPublic) {
|
||||
if ($this->externalCall && !$this->isPublic) {
|
||||
$this->lastError = 'This function is private.';
|
||||
header('HTTP 1.1 403 Forbidden');
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!in_array($_SERVER['REQUEST_METHOD'], $this->allowedMethods)) {
|
||||
if (!in_array($_SERVER['REQUEST_METHOD'], $this->allowedMethods)) {
|
||||
$this->lastError = 'This method is not allowed';
|
||||
header('HTTP 1.1 405 Method Not Allowed');
|
||||
return false;
|
||||
}
|
||||
|
||||
if($this->externalCall) {
|
||||
if ($this->externalCall) {
|
||||
$apiKeyAuthorized = false;
|
||||
|
||||
// Logged in or api key authorized?
|
||||
if ($this->loginRequired) {
|
||||
if(isset($values['api_key']) && $this->apiKeyAllowed) {
|
||||
if (isset($values['api_key']) && $this->apiKeyAllowed) {
|
||||
$apiKey = $values['api_key'];
|
||||
$apiKeyAuthorized = $this->user->authorize($apiKey);
|
||||
}
|
||||
|
||||
if(!$this->user->isLoggedIn() && !$apiKeyAuthorized) {
|
||||
if (!$this->user->isLoggedIn() && !$apiKeyAuthorized) {
|
||||
$this->lastError = 'You are not logged in.';
|
||||
header('HTTP 1.1 401 Unauthorized');
|
||||
return false;
|
||||
@@ -134,7 +135,7 @@ class Request {
|
||||
}
|
||||
|
||||
// CSRF Token
|
||||
if($this->csrfTokenRequired && $this->user->isLoggedIn()) {
|
||||
if ($this->csrfTokenRequired && $this->user->isLoggedIn()) {
|
||||
// csrf token required + external call
|
||||
// if it's not a call with API_KEY, check for csrf_token
|
||||
if (!isset($values["csrf_token"]) || strcmp($values["csrf_token"], $this->user->getSession()->getCsrfToken()) !== 0) {
|
||||
@@ -155,13 +156,15 @@ class Request {
|
||||
}
|
||||
}
|
||||
|
||||
if(!$this->parseParams($values))
|
||||
if (!$this->parseParams($values)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if($this->variableParamCount)
|
||||
if ($this->variableParamCount) {
|
||||
$this->parseVariableParams($values);
|
||||
}
|
||||
|
||||
if(!$this->user->getSQL()->isConnected()) {
|
||||
if (!$this->user->getSQL()->isConnected()) {
|
||||
$this->lastError = $this->user->getSQL()->getLastError();
|
||||
return false;
|
||||
}
|
||||
@@ -171,23 +174,40 @@ class Request {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function createError($err) {
|
||||
protected function createError($err): bool {
|
||||
$this->success = false;
|
||||
$this->lastError = $err;
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getParam($name) {
|
||||
return isset($this->params[$name]) ? $this->params[$name]->value : NULL;
|
||||
// i don't know why phpstorm
|
||||
return (isset($this->params[$name]) ? $this->params[$name]->value : NULL);
|
||||
}
|
||||
|
||||
public function isPublic() { return $this->isPublic; }
|
||||
public function getLastError() { return $this->lastError; }
|
||||
public function getResult() { return $this->result; }
|
||||
public function success() { return $this->success; }
|
||||
public function loginRequired() { return $this->loginRequired; }
|
||||
public function isExternalCall() { return $this->externalCall; }
|
||||
public function clearError() { $this->success = true; $this->lastError = ""; }
|
||||
public function isPublic(): bool {
|
||||
return $this->isPublic;
|
||||
}
|
||||
|
||||
public function getLastError(): string {
|
||||
return $this->lastError;
|
||||
}
|
||||
|
||||
public function getResult(): array {
|
||||
return $this->result;
|
||||
}
|
||||
|
||||
public function success(): bool {
|
||||
return $this->success;
|
||||
}
|
||||
|
||||
public function loginRequired(): bool {
|
||||
return $this->loginRequired;
|
||||
}
|
||||
|
||||
public function isExternalCall(): bool {
|
||||
return $this->externalCall;
|
||||
}
|
||||
|
||||
private function getMethod() {
|
||||
$class = str_replace("\\", "/", get_class($this));
|
||||
@@ -195,7 +215,7 @@ class Request {
|
||||
return $class;
|
||||
}
|
||||
|
||||
public function getJsonResult() {
|
||||
public function getJsonResult(): string {
|
||||
$this->result['success'] = $this->success;
|
||||
$this->result['msg'] = $this->lastError;
|
||||
return json_encode($this->result);
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Api\Routes {
|
||||
parent::__construct($user, $externalCall, array());
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if(!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -81,7 +81,7 @@ namespace Api\Routes {
|
||||
$this->isPublic = false;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if(!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -133,7 +133,7 @@ namespace Api\Routes {
|
||||
));
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if(!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Api\Settings {
|
||||
));
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if(!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -72,7 +72,7 @@ namespace Api\Settings {
|
||||
));
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ class Stats extends Request {
|
||||
return ($this->success ? $res[0]["count"] : $this->success);
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if(!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
+17
-17
@@ -9,11 +9,11 @@ namespace Api {
|
||||
protected function userExists(?string $username, ?string $email) {
|
||||
|
||||
$conditions = array();
|
||||
if (!is_null($username) && !empty($username)) {
|
||||
if ($username) {
|
||||
$conditions[] = new Compare("User.name", $username);
|
||||
}
|
||||
|
||||
if (!is_null($email) && !empty($email)) {
|
||||
if ($email) {
|
||||
$conditions[] = new Compare("User.email", $email);
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace Api\User {
|
||||
$this->loginRequired = true;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -229,7 +229,7 @@ namespace Api\User {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -306,7 +306,7 @@ namespace Api\User {
|
||||
));
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -350,7 +350,7 @@ namespace Api\User {
|
||||
$this->csrfTokenRequired = false;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -377,7 +377,7 @@ namespace Api\User {
|
||||
$this->loginRequired = true;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -469,7 +469,7 @@ namespace Api\User {
|
||||
return $this->success;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -533,7 +533,7 @@ namespace Api\User {
|
||||
return $this->success;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -586,7 +586,7 @@ namespace Api\User {
|
||||
return $this->createError(L('Wrong username or password'));
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -648,7 +648,7 @@ namespace Api\User {
|
||||
$this->apiKeyAllowed = false;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -693,7 +693,7 @@ namespace Api\User {
|
||||
return $this->success;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -804,7 +804,7 @@ namespace Api\User {
|
||||
return array();
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -847,7 +847,7 @@ namespace Api\User {
|
||||
$this->loginRequired = true;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -945,7 +945,7 @@ namespace Api\User {
|
||||
$this->loginRequired = true;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -986,7 +986,7 @@ namespace Api\User {
|
||||
$this->csrfTokenRequired = false;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -1105,7 +1105,7 @@ namespace Api\User {
|
||||
return $this->success;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ class VerifyCaptcha extends Request {
|
||||
$this->isPublic = false;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if(!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Api\Visitors {
|
||||
$this->isPublic = false;
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ namespace Api\Visitors {
|
||||
}
|
||||
}
|
||||
|
||||
public function execute($values = array()) {
|
||||
public function execute($values = array()): bool {
|
||||
if (!parent::execute($values)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -15,27 +15,27 @@ class Configuration {
|
||||
|
||||
$class = \Configuration\Database::class;
|
||||
$path = getClassPath($class, true);
|
||||
if(file_exists($path) && is_readable($path)) {
|
||||
if (file_exists($path) && is_readable($path)) {
|
||||
include_once $path;
|
||||
if(class_exists($class)) {
|
||||
if (class_exists($class)) {
|
||||
$this->database = new \Configuration\Database();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getDatabase() : ?ConnectionData {
|
||||
public function getDatabase(): ?ConnectionData {
|
||||
return $this->database;
|
||||
}
|
||||
|
||||
public function getSettings() : Settings {
|
||||
public function getSettings(): Settings {
|
||||
return $this->settings;
|
||||
}
|
||||
|
||||
public function create(string $className, $data) {
|
||||
$path = getClassPath("\\Configuration\\$className");
|
||||
|
||||
if($data) {
|
||||
if(is_string($data)) {
|
||||
if ($data) {
|
||||
if (is_string($data)) {
|
||||
$key = addslashes($data);
|
||||
$code = intendCode(
|
||||
"<?php
|
||||
@@ -50,7 +50,7 @@ class Configuration {
|
||||
|
||||
}", false
|
||||
);
|
||||
} else if($data instanceof ConnectionData) {
|
||||
} else if ($data instanceof ConnectionData) {
|
||||
$superClass = get_class($data);
|
||||
$host = addslashes($data->getHost());
|
||||
$port = intval($data->getPort());
|
||||
@@ -58,7 +58,7 @@ class Configuration {
|
||||
$password = addslashes($data->getPassword());
|
||||
|
||||
$properties = "";
|
||||
foreach($data->getProperties() as $key => $val) {
|
||||
foreach ($data->getProperties() as $key => $val) {
|
||||
$key = addslashes($key);
|
||||
$val = is_string($val) ? "'" . addslashes($val) . "'" : $val;
|
||||
$properties .= "\n\$this->setProperty('$key', $val);";
|
||||
@@ -86,9 +86,9 @@ class Configuration {
|
||||
return @file_put_contents($path, $code);
|
||||
}
|
||||
|
||||
public function delete(string $className) {
|
||||
public function delete(string $className): bool {
|
||||
$path = getClassPath("\\Configuration\\$className");
|
||||
if(file_exists($path)) {
|
||||
if (file_exists($path)) {
|
||||
return unlink($path);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class CreateDatabase extends DatabaseScript {
|
||||
// NOTE:
|
||||
// explicit serial ids removed due to postgres' serial implementation
|
||||
|
||||
public static function createQueries(SQL $sql) {
|
||||
public static function createQueries(SQL $sql): array {
|
||||
$queries = array();
|
||||
|
||||
// Language
|
||||
@@ -24,8 +24,8 @@ class CreateDatabase extends DatabaseScript {
|
||||
->unique("name");
|
||||
|
||||
$queries[] = $sql->insert("Language", array("code", "name"))
|
||||
->addRow( "en_US", 'American English')
|
||||
->addRow( "de_DE", 'Deutsch Standard');
|
||||
->addRow("en_US", 'American English')
|
||||
->addRow("de_DE", 'Deutsch Standard');
|
||||
|
||||
$queries[] = $sql->createTable("User")
|
||||
->addSerial("uid")
|
||||
@@ -50,7 +50,7 @@ class CreateDatabase extends DatabaseScript {
|
||||
->addString("browser", 64)
|
||||
->addJson("data", false, '{}')
|
||||
->addBool("stay_logged_in", true)
|
||||
->addString("csrf_token", 16 )
|
||||
->addString("csrf_token", 16)
|
||||
->primaryKey("uid", "user_id")
|
||||
->foreignKey("user_id", "User", "uid", new CascadeStrategy());
|
||||
|
||||
@@ -82,7 +82,7 @@ class CreateDatabase extends DatabaseScript {
|
||||
|
||||
$queries[] = $sql->createTable("Notification")
|
||||
->addSerial("uid")
|
||||
->addEnum("type", array("default","message","warning"), false, "default")
|
||||
->addEnum("type", array("default", "message", "warning"), false, "default")
|
||||
->addDateTime("created_at", false, $sql->currentTimestamp())
|
||||
->addString("title", 32)
|
||||
->addString("message", 256)
|
||||
@@ -200,7 +200,7 @@ class CreateDatabase extends DatabaseScript {
|
||||
return $queries;
|
||||
}
|
||||
|
||||
private static function MessageConfirmEmail() : string {
|
||||
private static function MessageConfirmEmail(): string {
|
||||
return "Hello {{username}},<br>" .
|
||||
"You recently created an account on {{site_name}}. Please click on the following link to " .
|
||||
"confirm your email address and complete your registration. If you haven't registered an " .
|
||||
@@ -210,7 +210,7 @@ class CreateDatabase extends DatabaseScript {
|
||||
"{{site_name}} Administration";
|
||||
}
|
||||
|
||||
private static function MessageAcceptInvite() : string {
|
||||
private static function MessageAcceptInvite(): string {
|
||||
return "Hello {{username}},<br>" .
|
||||
"You were invited to create an account on {{site_name}}. Please click on the following link to " .
|
||||
"confirm your email address and complete your registration by choosing a new password. " .
|
||||
@@ -220,7 +220,7 @@ class CreateDatabase extends DatabaseScript {
|
||||
"{{site_name}} Administration";
|
||||
}
|
||||
|
||||
private static function MessageResetPassword() : string {
|
||||
private static function MessageResetPassword(): string {
|
||||
return "Hello {{username}},<br>" .
|
||||
"you requested a password reset on {{site_name}}. Please click on the following link to " .
|
||||
"choose a new password. If this request was not intended, you can simply ignore the email. The Link is valid for one hour:<br><br>" .
|
||||
@@ -233,7 +233,7 @@ class CreateDatabase extends DatabaseScript {
|
||||
$patchDirectory = './core/Configuration/Patch/';
|
||||
if (file_exists($patchDirectory) && is_dir($patchDirectory)) {
|
||||
$scan_arr = scandir($patchDirectory);
|
||||
$files_arr = array_diff($scan_arr, array('.','..'));
|
||||
$files_arr = array_diff($scan_arr, array('.', '..'));
|
||||
foreach ($files_arr as $file) {
|
||||
$suffix = ".class.php";
|
||||
if (endsWith($file, $suffix)) {
|
||||
@@ -241,7 +241,7 @@ class CreateDatabase extends DatabaseScript {
|
||||
$className = "\\Configuration\\Patch\\$className";
|
||||
$method = "$className::createQueries";
|
||||
$patchQueries = call_user_func($method, $sql);
|
||||
foreach($patchQueries as $query) $queries[] = $query;
|
||||
foreach ($patchQueries as $query) $queries[] = $query;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ use Driver\SQL\Strategy\UpdateStrategy;
|
||||
|
||||
class file_api extends DatabaseScript {
|
||||
|
||||
public static function createQueries(SQL $sql) {
|
||||
public static function createQueries(SQL $sql): array {
|
||||
|
||||
$queries = array();
|
||||
|
||||
|
||||
@@ -11,12 +11,16 @@ use Objects\User;
|
||||
|
||||
class Settings {
|
||||
|
||||
//
|
||||
private bool $installationComplete;
|
||||
|
||||
// settings
|
||||
private string $siteName;
|
||||
private string $baseUrl;
|
||||
private string $jwtSecret;
|
||||
private bool $installationComplete;
|
||||
private bool $registrationAllowed;
|
||||
private bool $recaptchaEnabled;
|
||||
private bool $mailEnabled;
|
||||
private string $recaptchaPublicKey;
|
||||
private string $recaptchaPrivateKey;
|
||||
|
||||
@@ -24,11 +28,11 @@ class Settings {
|
||||
return $this->jwtSecret;
|
||||
}
|
||||
|
||||
public function isInstalled() {
|
||||
public function isInstalled(): bool {
|
||||
return $this->installationComplete;
|
||||
}
|
||||
|
||||
public static function loadDefaults() : Settings {
|
||||
public static function loadDefaults(): Settings {
|
||||
$hostname = $_SERVER["SERVER_NAME"];
|
||||
$protocol = getProtocol();
|
||||
$jwt = generateRandomString(32);
|
||||
@@ -42,10 +46,11 @@ class Settings {
|
||||
$settings->recaptchaPublicKey = "";
|
||||
$settings->recaptchaPrivateKey = "";
|
||||
$settings->recaptchaEnabled = false;
|
||||
$settings->mailEnabled = false;
|
||||
return $settings;
|
||||
}
|
||||
|
||||
public function loadFromDatabase(User $user) {
|
||||
public function loadFromDatabase(User $user): bool {
|
||||
$req = new \Api\Settings\Get($user);
|
||||
$success = $req->execute();
|
||||
|
||||
@@ -58,6 +63,7 @@ class Settings {
|
||||
$this->recaptchaEnabled = $result["recaptcha_enabled"] ?? $this->recaptchaEnabled;
|
||||
$this->recaptchaPublicKey = $result["recaptcha_public_key"] ?? $this->recaptchaPublicKey;
|
||||
$this->recaptchaPrivateKey = $result["recaptcha_private_key"] ?? $this->recaptchaPrivateKey;
|
||||
$this->mailEnabled = $result["mail_enabled"] ?? $this->mailEnabled;
|
||||
|
||||
if (!isset($result["jwt_secret"])) {
|
||||
$req = new \Api\Settings\Set($user);
|
||||
@@ -81,27 +87,27 @@ class Settings {
|
||||
->addRow("recaptcha_private_key", $this->recaptchaPrivateKey, true, false);
|
||||
}
|
||||
|
||||
public function getSiteName() : string {
|
||||
public function getSiteName(): string {
|
||||
return $this->siteName;
|
||||
}
|
||||
|
||||
public function getBaseUrl() : string {
|
||||
public function getBaseUrl(): string {
|
||||
return $this->baseUrl;
|
||||
}
|
||||
|
||||
public function isRecaptchaEnabled() : bool {
|
||||
public function isRecaptchaEnabled(): bool {
|
||||
return $this->recaptchaEnabled;
|
||||
}
|
||||
|
||||
public function getRecaptchaSiteKey() : string {
|
||||
public function getRecaptchaSiteKey(): string {
|
||||
return $this->recaptchaPublicKey;
|
||||
}
|
||||
|
||||
public function getRecaptchaSecretKey() : string {
|
||||
public function getRecaptchaSecretKey(): string {
|
||||
return $this->recaptchaPrivateKey;
|
||||
}
|
||||
|
||||
public function isRegistrationAllowed() : bool {
|
||||
public function isRegistrationAllowed(): bool {
|
||||
return $this->registrationAllowed;
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ namespace Documents\Account {
|
||||
$this->loadFontawesome();
|
||||
}
|
||||
|
||||
protected function initMetas() {
|
||||
protected function initMetas(): array {
|
||||
return array(
|
||||
array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1.0'),
|
||||
array('name' => 'format-detection', 'content' => 'telephone=yes'),
|
||||
@@ -44,11 +44,11 @@ namespace Documents\Account {
|
||||
);
|
||||
}
|
||||
|
||||
protected function initRawFields() {
|
||||
protected function initRawFields(): array {
|
||||
return array();
|
||||
}
|
||||
|
||||
protected function initTitle() {
|
||||
protected function initTitle(): string {
|
||||
return "Account";
|
||||
}
|
||||
}
|
||||
@@ -59,7 +59,7 @@ namespace Documents\Account {
|
||||
parent::__construct($document);
|
||||
}
|
||||
|
||||
protected function getContent() {
|
||||
protected function getContent(): string {
|
||||
|
||||
$view = $this->getDocument()->getView();
|
||||
if ($view === null) {
|
||||
|
||||
@@ -19,8 +19,6 @@ namespace Documents {
|
||||
namespace Documents\Admin {
|
||||
|
||||
use Elements\Head;
|
||||
use Elements\Link;
|
||||
use Elements\Script;
|
||||
|
||||
class AdminHead extends Head {
|
||||
|
||||
@@ -32,7 +30,7 @@ namespace Documents\Admin {
|
||||
$this->loadFontawesome();
|
||||
}
|
||||
|
||||
protected function initMetas() {
|
||||
protected function initMetas(): array {
|
||||
return array(
|
||||
array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1.0'),
|
||||
array('name' => 'format-detection', 'content' => 'telephone=yes'),
|
||||
@@ -42,12 +40,12 @@ namespace Documents\Admin {
|
||||
);
|
||||
}
|
||||
|
||||
protected function initRawFields() {
|
||||
protected function initRawFields(): array {
|
||||
return array();
|
||||
}
|
||||
|
||||
protected function initTitle() {
|
||||
return "WebBase - Administration";
|
||||
protected function initTitle(): string {
|
||||
return $this->getSiteName() . " - Administration";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,6 @@ namespace Documents {
|
||||
|
||||
namespace Documents\Document404 {
|
||||
|
||||
use Elements\Body;
|
||||
use Elements\Head;
|
||||
use Elements\SimpleBody;
|
||||
use Views\View404;
|
||||
@@ -29,7 +28,7 @@ namespace Documents\Document404 {
|
||||
protected function initSources() {
|
||||
}
|
||||
|
||||
protected function initMetas() {
|
||||
protected function initMetas(): array {
|
||||
return array(
|
||||
array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1.0'),
|
||||
array('name' => 'format-detection', 'content' => 'telephone=yes'),
|
||||
@@ -39,11 +38,11 @@ namespace Documents\Document404 {
|
||||
);
|
||||
}
|
||||
|
||||
protected function initRawFields() {
|
||||
protected function initRawFields(): array {
|
||||
return array();
|
||||
}
|
||||
|
||||
protected function initTitle() {
|
||||
protected function initTitle(): string {
|
||||
return "WebBase - Not Found";
|
||||
}
|
||||
}
|
||||
@@ -58,7 +57,7 @@ namespace Documents\Document404 {
|
||||
http_response_code(404);
|
||||
}
|
||||
|
||||
protected function getContent() {
|
||||
protected function getContent(): string {
|
||||
return $this->load(View404::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,17 +17,18 @@ namespace Documents {
|
||||
namespace Documents\Files {
|
||||
|
||||
use Elements\Head;
|
||||
use Elements\Link;
|
||||
use Elements\Script;
|
||||
use Elements\SimpleBody;
|
||||
|
||||
class FilesHead extends Head {
|
||||
|
||||
protected function initSources() {
|
||||
$this->loadBootstrap();
|
||||
$this->addCSS(Link::BOOTSTRAP);
|
||||
$this->loadFontawesome();
|
||||
}
|
||||
|
||||
protected function initMetas() {
|
||||
protected function initMetas(): array {
|
||||
return array(
|
||||
array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1.0'),
|
||||
array('name' => 'format-detection', 'content' => 'telephone=yes'),
|
||||
@@ -38,11 +39,11 @@ namespace Documents\Files {
|
||||
);
|
||||
}
|
||||
|
||||
protected function initRawFields() {
|
||||
protected function initRawFields(): array {
|
||||
return array();
|
||||
}
|
||||
|
||||
protected function initTitle() {
|
||||
protected function initTitle(): string {
|
||||
return "File Control Panel";
|
||||
}
|
||||
}
|
||||
@@ -53,7 +54,7 @@ namespace Documents\Files {
|
||||
parent::__construct($document);
|
||||
}
|
||||
|
||||
protected function getContent() {
|
||||
protected function getContent(): string {
|
||||
$html = "<noscript>" . $this->createErrorText("Javascript is required for this site to render.") . "</noscript>";
|
||||
$html .= "<div id=\"root\"></div>";
|
||||
$html .= new Script(Script::MIME_TEXT_JAVASCRIPT, Script::FILES);
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Documents\Install {
|
||||
$this->addJS(Script::INSTALL);
|
||||
}
|
||||
|
||||
protected function initMetas() {
|
||||
protected function initMetas(): array {
|
||||
return array(
|
||||
array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1.0'),
|
||||
array('name' => 'format-detection', 'content' => 'telephone=yes'),
|
||||
@@ -51,11 +51,11 @@ namespace Documents\Install {
|
||||
);
|
||||
}
|
||||
|
||||
protected function initRawFields() {
|
||||
protected function initRawFields(): array {
|
||||
return array();
|
||||
}
|
||||
|
||||
protected function initTitle() {
|
||||
protected function initTitle(): string {
|
||||
return "WebBase - Installation";
|
||||
}
|
||||
|
||||
@@ -88,17 +88,17 @@ namespace Documents\Install {
|
||||
$this->steps = array();
|
||||
}
|
||||
|
||||
private function getParameter($name) {
|
||||
if(isset($_REQUEST[$name]) && is_string($_REQUEST[$name])) {
|
||||
private function getParameter($name): ?string {
|
||||
if (isset($_REQUEST[$name]) && is_string($_REQUEST[$name])) {
|
||||
return trim($_REQUEST[$name]);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
private function getCurrentStep() {
|
||||
private function getCurrentStep(): int {
|
||||
|
||||
if(!$this->checkRequirements()["success"]) {
|
||||
if (!$this->checkRequirements()["success"]) {
|
||||
return self::CHECKING_REQUIREMENTS;
|
||||
}
|
||||
|
||||
@@ -106,12 +106,12 @@ namespace Documents\Install {
|
||||
$config = $user->getConfiguration();
|
||||
|
||||
// Check if database configuration exists
|
||||
if(!$config->getDatabase()) {
|
||||
if (!$config->getDatabase()) {
|
||||
return self::DATABASE_CONFIGURATION;
|
||||
}
|
||||
|
||||
$sql = $user->getSQL();
|
||||
if(!$sql || !$sql->isConnected()) {
|
||||
if (!$sql || !$sql->isConnected()) {
|
||||
return self::DATABASE_CONFIGURATION;
|
||||
}
|
||||
|
||||
@@ -156,33 +156,33 @@ namespace Documents\Install {
|
||||
return $step;
|
||||
}
|
||||
|
||||
private function checkRequirements() {
|
||||
private function checkRequirements(): array {
|
||||
|
||||
$msg = $this->errorString;
|
||||
$success = true;
|
||||
$failedRequirements = array();
|
||||
|
||||
$configDir = "core/Configuration/";
|
||||
if(!is_writeable($configDir)) {
|
||||
if (!is_writeable($configDir)) {
|
||||
$failedRequirements[] = "<b>$configDir</b> is not writeable. Try running <b>chmod 700 $configDir</b>";
|
||||
$success = false;
|
||||
}
|
||||
|
||||
if (function_exists("posix_getuid")) {
|
||||
$userId = posix_getuid();
|
||||
if(fileowner($configDir) !== $userId) {
|
||||
if (fileowner($configDir) !== $userId) {
|
||||
$username = posix_getpwuid($userId)['name'];
|
||||
$failedRequirements[] = "<b>$configDir</b> is not owned by current user: $username ($userId). Try running <b>chown -R $username $configDir</b>";
|
||||
$success = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(version_compare(PHP_VERSION, '7.4', '<')) {
|
||||
if (version_compare(PHP_VERSION, '7.4', '<')) {
|
||||
$failedRequirements[] = "PHP Version <b>>= 7.4</b> is required. Got: <b>" . PHP_VERSION . "</b>";
|
||||
$success = false;
|
||||
}
|
||||
|
||||
if(!$success) {
|
||||
if (!$success) {
|
||||
$msg = "The following requirements failed the check:<br>" .
|
||||
$this->createUnorderedList($failedRequirements);
|
||||
$this->errorString = $msg;
|
||||
@@ -191,7 +191,7 @@ namespace Documents\Install {
|
||||
return array("success" => $success, "msg" => $msg);
|
||||
}
|
||||
|
||||
private function databaseConfiguration() {
|
||||
private function databaseConfiguration(): array {
|
||||
|
||||
$host = $this->getParameter("host");
|
||||
$port = $this->getParameter("port");
|
||||
@@ -204,44 +204,44 @@ namespace Documents\Install {
|
||||
$success = true;
|
||||
|
||||
$missingInputs = array();
|
||||
if(is_null($host) || empty($host)) {
|
||||
if (is_null($host) || empty($host)) {
|
||||
$success = false;
|
||||
$missingInputs[] = "Host";
|
||||
}
|
||||
|
||||
if(is_null($port) || empty($port)) {
|
||||
if (is_null($port) || empty($port)) {
|
||||
$success = false;
|
||||
$missingInputs[] = "Port";
|
||||
}
|
||||
|
||||
if(is_null($username) || empty($username)) {
|
||||
if (is_null($username) || empty($username)) {
|
||||
$success = false;
|
||||
$missingInputs[] = "Username";
|
||||
}
|
||||
|
||||
if(is_null($password)) {
|
||||
if (is_null($password)) {
|
||||
$success = false;
|
||||
$missingInputs[] = "Password";
|
||||
}
|
||||
|
||||
if(is_null($database) || empty($database)) {
|
||||
if (is_null($database) || empty($database)) {
|
||||
$success = false;
|
||||
$missingInputs[] = "Database";
|
||||
}
|
||||
|
||||
if(is_null($type) || empty($type)) {
|
||||
if (is_null($type) || empty($type)) {
|
||||
$success = false;
|
||||
$missingInputs[] = "Type";
|
||||
}
|
||||
|
||||
$supportedTypes = array("mysql", "postgres");
|
||||
if(!$success) {
|
||||
if (!$success) {
|
||||
$msg = "Please fill out the following inputs:<br>" .
|
||||
$this->createUnorderedList($missingInputs);
|
||||
} else if(!is_numeric($port) || ($port = intval($port)) < 1 || $port > 65535) {
|
||||
} else if (!is_numeric($port) || ($port = intval($port)) < 1 || $port > 65535) {
|
||||
$msg = "Port must be in range of 1-65535.";
|
||||
$success = false;
|
||||
} else if(!in_array($type, $supportedTypes)) {
|
||||
} else if (!in_array($type, $supportedTypes)) {
|
||||
$msg = "Unsupported database type. Must be one of: " . implode(", ", $supportedTypes);
|
||||
$success = false;
|
||||
} else {
|
||||
@@ -251,9 +251,9 @@ namespace Documents\Install {
|
||||
$connectionData->setProperty('type', $type);
|
||||
$sql = SQL::createConnection($connectionData);
|
||||
$success = false;
|
||||
if(is_string($sql)) {
|
||||
if (is_string($sql)) {
|
||||
$msg = "Error connecting to database: $sql";
|
||||
} else if(!$sql->isConnected()) {
|
||||
} else if (!$sql->isConnected()) {
|
||||
if (!$sql->checkRequirements()) {
|
||||
$driverName = $sql->getDriverName();
|
||||
$installLink = "https://www.php.net/manual/en/$driverName.setup.php";
|
||||
@@ -267,7 +267,7 @@ namespace Documents\Install {
|
||||
$msg = "";
|
||||
$success = true;
|
||||
$queries = CreateDatabase::createQueries($sql);
|
||||
foreach($queries as $query) {
|
||||
foreach ($queries as $query) {
|
||||
if (!($res = $query->execute())) {
|
||||
$msg = "Error creating tables: " . $sql->getLastError();
|
||||
$success = false;
|
||||
@@ -276,13 +276,13 @@ namespace Documents\Install {
|
||||
}
|
||||
|
||||
$config = $this->getDocument()->getUser()->getConfiguration();
|
||||
if(!$config->create("Database", $connectionData)) {
|
||||
if (!$config->create("Database", $connectionData)) {
|
||||
$success = false;
|
||||
$msg = "Unable to write file";
|
||||
}
|
||||
}
|
||||
|
||||
if($sql) {
|
||||
if ($sql) {
|
||||
$sql->close();
|
||||
}
|
||||
}
|
||||
@@ -290,10 +290,10 @@ namespace Documents\Install {
|
||||
return array("success" => $success, "msg" => $msg);
|
||||
}
|
||||
|
||||
private function createUser() {
|
||||
private function createUser(): array {
|
||||
|
||||
$user = $this->getDocument()->getUser();
|
||||
if($this->getParameter("prev") === "true") {
|
||||
if ($this->getParameter("prev") === "true") {
|
||||
$success = $user->getConfiguration()->delete("Database");
|
||||
$msg = $success ? "" : error_get_last();
|
||||
return array("success" => $success, "msg" => $msg);
|
||||
@@ -307,22 +307,22 @@ namespace Documents\Install {
|
||||
$success = true;
|
||||
$missingInputs = array();
|
||||
|
||||
if(is_null($username) || empty($username)) {
|
||||
if (is_null($username) || empty($username)) {
|
||||
$success = false;
|
||||
$missingInputs[] = "Username";
|
||||
}
|
||||
|
||||
if(is_null($password) || empty($password)) {
|
||||
if (is_null($password) || empty($password)) {
|
||||
$success = false;
|
||||
$missingInputs[] = "Password";
|
||||
}
|
||||
|
||||
if(is_null($confirmPassword) || empty($confirmPassword)) {
|
||||
if (is_null($confirmPassword) || empty($confirmPassword)) {
|
||||
$success = false;
|
||||
$missingInputs[] = "Confirm Password";
|
||||
}
|
||||
|
||||
if(!$success) {
|
||||
if (!$success) {
|
||||
$msg = "Please fill out the following inputs:<br>" .
|
||||
$this->createUnorderedList($missingInputs);
|
||||
} else {
|
||||
@@ -347,10 +347,10 @@ namespace Documents\Install {
|
||||
return array("msg" => $msg, "success" => $success);
|
||||
}
|
||||
|
||||
private function addMailService() {
|
||||
private function addMailService(): array {
|
||||
|
||||
$user = $this->getDocument()->getUser();
|
||||
if($this->getParameter("prev") === "true") {
|
||||
if ($this->getParameter("prev") === "true") {
|
||||
$sql = $user->getSQL();
|
||||
$success = $sql->delete("User")->execute();
|
||||
$msg = $sql->getLastError();
|
||||
@@ -359,9 +359,9 @@ namespace Documents\Install {
|
||||
|
||||
$success = true;
|
||||
$msg = $this->errorString;
|
||||
if($this->getParameter("skip") === "true") {
|
||||
if ($this->getParameter("skip") === "true") {
|
||||
$req = new \Api\Settings\Set($user);
|
||||
$success = $req->execute(array("settings" => array( "mail_enabled" => "0" )));
|
||||
$success = $req->execute(array("settings" => array("mail_enabled" => "0")));
|
||||
$msg = $req->getLastError();
|
||||
} else {
|
||||
|
||||
@@ -372,30 +372,30 @@ namespace Documents\Install {
|
||||
$success = true;
|
||||
|
||||
$missingInputs = array();
|
||||
if(is_null($address) || empty($address)) {
|
||||
if (is_null($address) || empty($address)) {
|
||||
$success = false;
|
||||
$missingInputs[] = "SMTP Address";
|
||||
}
|
||||
|
||||
if(is_null($port) || empty($port)) {
|
||||
if (is_null($port) || empty($port)) {
|
||||
$success = false;
|
||||
$missingInputs[] = "Port";
|
||||
}
|
||||
|
||||
if(is_null($username) || empty($username)) {
|
||||
if (is_null($username) || empty($username)) {
|
||||
$success = false;
|
||||
$missingInputs[] = "Username";
|
||||
}
|
||||
|
||||
if(is_null($password)) {
|
||||
if (is_null($password)) {
|
||||
$success = false;
|
||||
$missingInputs[] = "Password";
|
||||
}
|
||||
|
||||
if(!$success) {
|
||||
if (!$success) {
|
||||
$msg = "Please fill out the following inputs:<br>" .
|
||||
$this->createUnorderedList($missingInputs);
|
||||
} else if(!is_numeric($port) || ($port = intval($port)) < 1 || $port > 65535) {
|
||||
} else if (!is_numeric($port) || ($port = intval($port)) < 1 || $port > 65535) {
|
||||
$msg = "Port must be in range of 1-65535.";
|
||||
$success = false;
|
||||
} else {
|
||||
@@ -413,7 +413,7 @@ namespace Documents\Install {
|
||||
|
||||
try {
|
||||
$success = $mail->SmtpConnect();
|
||||
if(!$success) {
|
||||
if (!$success) {
|
||||
$error = empty($mail->ErrorInfo) ? "Unknown Error" : $mail->ErrorInfo;
|
||||
$msg = "Could not connect to SMTP Server: $error";
|
||||
} else {
|
||||
@@ -421,11 +421,11 @@ namespace Documents\Install {
|
||||
$msg = "";
|
||||
$mail->smtpClose();
|
||||
}
|
||||
} catch(Exception $error) {
|
||||
} catch (Exception $error) {
|
||||
$msg = "Could not connect to SMTP Server: " . $error->errorMessage();
|
||||
}
|
||||
|
||||
if($success) {
|
||||
if ($success) {
|
||||
$req = new \Api\Settings\Set($user);
|
||||
$success = $req->execute(array("settings" => array(
|
||||
"mail_enabled" => "1",
|
||||
@@ -442,9 +442,9 @@ namespace Documents\Install {
|
||||
return array("success" => $success, "msg" => $msg);
|
||||
}
|
||||
|
||||
private function performStep() {
|
||||
private function performStep(): array {
|
||||
|
||||
switch($this->currentStep) {
|
||||
switch ($this->currentStep) {
|
||||
|
||||
case self::CHECKING_REQUIREMENTS:
|
||||
return $this->checkRequirements();
|
||||
@@ -466,15 +466,15 @@ namespace Documents\Install {
|
||||
}
|
||||
}
|
||||
|
||||
private function createProgressSidebar() {
|
||||
private function createProgressSidebar(): string {
|
||||
$items = array();
|
||||
foreach($this->steps as $num => $step) {
|
||||
foreach ($this->steps as $num => $step) {
|
||||
|
||||
$title = $step["title"];
|
||||
$status = $step["status"];
|
||||
$currentStep = ($num == $this->currentStep) ? " id=\"currentStep\"" : "";
|
||||
|
||||
switch($status) {
|
||||
switch ($status) {
|
||||
case self::PENDING:
|
||||
$statusIcon = $this->createIcon("spinner");
|
||||
$statusText = "Loading…";
|
||||
@@ -514,7 +514,7 @@ namespace Documents\Install {
|
||||
return implode("", $items);
|
||||
}
|
||||
|
||||
private function createFormItem($formItem, $inline=false) {
|
||||
private function createFormItem($formItem, $inline = false): string {
|
||||
|
||||
$title = $formItem["title"];
|
||||
$name = $formItem["name"];
|
||||
@@ -526,37 +526,37 @@ namespace Documents\Install {
|
||||
"class" => "form-control"
|
||||
);
|
||||
|
||||
if(isset($formItem["required"]) && $formItem["required"]) {
|
||||
if (isset($formItem["required"]) && $formItem["required"]) {
|
||||
$attributes["required"] = "";
|
||||
}
|
||||
|
||||
if ($type !== "select") {
|
||||
$attributes["type"] = $type;
|
||||
|
||||
if(isset($formItem["value"]) && $formItem["value"]) {
|
||||
if (isset($formItem["value"]) && $formItem["value"]) {
|
||||
$attributes["value"] = $formItem["value"];
|
||||
}
|
||||
|
||||
if($type === "number") {
|
||||
if(isset($formItem["min"]) && is_numeric($formItem["min"]))
|
||||
if ($type === "number") {
|
||||
if (isset($formItem["min"]) && is_numeric($formItem["min"]))
|
||||
$attributes["min"] = $formItem["min"];
|
||||
if(isset($formItem["max"]) && is_numeric($formItem["max"]))
|
||||
if (isset($formItem["max"]) && is_numeric($formItem["max"]))
|
||||
$attributes["max"] = $formItem["max"];
|
||||
if(isset($formItem["step"]) && is_numeric($formItem["step"]))
|
||||
if (isset($formItem["step"]) && is_numeric($formItem["step"]))
|
||||
$attributes["step"] = $formItem["step"];
|
||||
}
|
||||
}
|
||||
|
||||
$replacements = array("+" => " ", "&" => "\" ", "=" => "=\"");
|
||||
$attributes = http_build_query($attributes) . "\"";
|
||||
foreach($replacements as $key => $val) {
|
||||
foreach ($replacements as $key => $val) {
|
||||
$attributes = str_replace($key, $val, $attributes);
|
||||
}
|
||||
|
||||
if ($type === "select") {
|
||||
$items = $formItem["items"] ?? array();
|
||||
$element = "<select $attributes>";
|
||||
foreach($items as $key => $val) {
|
||||
foreach ($items as $key => $val) {
|
||||
$element .= "<option value=\"$key\">$val</option>";
|
||||
}
|
||||
$element .= "</select>";
|
||||
@@ -564,7 +564,7 @@ namespace Documents\Install {
|
||||
$element = "<input $attributes>";
|
||||
}
|
||||
|
||||
if(!$inline) {
|
||||
if (!$inline) {
|
||||
return
|
||||
"<div class=\"d-block my-3\">
|
||||
<label for=\"$name\">$title</label>
|
||||
@@ -579,7 +579,7 @@ namespace Documents\Install {
|
||||
}
|
||||
}
|
||||
|
||||
private function createProgessMainview() {
|
||||
private function createProgessMainview(): string {
|
||||
|
||||
$views = array(
|
||||
self::CHECKING_REQUIREMENTS => array(
|
||||
@@ -646,7 +646,7 @@ namespace Documents\Install {
|
||||
)
|
||||
);
|
||||
|
||||
if(!isset($views[$this->currentStep])) {
|
||||
if (!isset($views[$this->currentStep])) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -657,24 +657,24 @@ namespace Documents\Install {
|
||||
|
||||
$html = "<h4 class=\"mb-3\">$title</h4><hr class=\"mb-4\">";
|
||||
|
||||
if(isset($currentView["text"])) {
|
||||
if (isset($currentView["text"])) {
|
||||
$text = $currentView["text"];
|
||||
$html .= "<div class=\"my-3\">$text</i></div>";
|
||||
}
|
||||
|
||||
if(isset($currentView["progressText"])) {
|
||||
if (isset($currentView["progressText"])) {
|
||||
$progressText = $currentView["progressText"];
|
||||
$html .= "<div id=\"progressText\" style=\"display:none\" class=\"my-3\">$progressText$spinnerIcon</i></div>";
|
||||
}
|
||||
|
||||
if(isset($currentView["form"])) {
|
||||
if (isset($currentView["form"])) {
|
||||
$html .= "<form id=\"installForm\">";
|
||||
|
||||
foreach($currentView["form"] as $formItem) {
|
||||
foreach ($currentView["form"] as $formItem) {
|
||||
|
||||
if($formItem["type"] === "row") {
|
||||
if ($formItem["type"] === "row") {
|
||||
$html .= "<div class=\"row\">";
|
||||
foreach($formItem["items"] as $item) {
|
||||
foreach ($formItem["items"] as $item) {
|
||||
$html .= $this->createFormItem($item, true);
|
||||
}
|
||||
$html .= "</div>";
|
||||
@@ -691,7 +691,7 @@ namespace Documents\Install {
|
||||
array("title" => "Go Back", "type" => "info", "id" => "btnPrev", "float" => "left", "disabled" => $prevDisabled)
|
||||
);
|
||||
|
||||
if($this->currentStep != self::FINISH_INSTALLATION) {
|
||||
if ($this->currentStep != self::FINISH_INSTALLATION) {
|
||||
if ($this->currentStep == self::CHECKING_REQUIREMENTS) {
|
||||
$buttons[] = array("title" => "Retry", "type" => "success", "id" => "btnRetry", "float" => "right");
|
||||
} else {
|
||||
@@ -701,14 +701,14 @@ namespace Documents\Install {
|
||||
$buttons[] = array("title" => "Finish", "type" => "success", "id" => "btnFinish", "float" => "right");
|
||||
}
|
||||
|
||||
if(isset($currentView["skip"])) {
|
||||
if (isset($currentView["skip"])) {
|
||||
$buttons[] = array("title" => "Skip", "type" => "secondary", "id" => "btnSkip", "float" => "right");
|
||||
}
|
||||
|
||||
$buttonsLeft = "";
|
||||
$buttonsRight = "";
|
||||
|
||||
foreach($buttons as $button) {
|
||||
foreach ($buttons as $button) {
|
||||
$title = $button["title"];
|
||||
$type = $button["type"];
|
||||
$id = $button["id"];
|
||||
@@ -716,7 +716,7 @@ namespace Documents\Install {
|
||||
$disabled = (isset($button["disabled"]) && $button["disabled"]) ? " disabled" : "";
|
||||
$button = "<button type=\"button\" id=\"$id\" class=\"btn btn-$type m-1\"$disabled>$title</button>";
|
||||
|
||||
if($float === "left") {
|
||||
if ($float === "left") {
|
||||
$buttonsLeft .= $button;
|
||||
} else {
|
||||
$buttonsRight .= $button;
|
||||
@@ -732,7 +732,7 @@ namespace Documents\Install {
|
||||
return $html;
|
||||
}
|
||||
|
||||
function getCode() {
|
||||
function getCode(): string {
|
||||
$html = parent::getCode();
|
||||
|
||||
$this->steps = array(
|
||||
@@ -761,16 +761,16 @@ namespace Documents\Install {
|
||||
$this->currentStep = $this->getCurrentStep();
|
||||
|
||||
// set status
|
||||
for($step = self::CHECKING_REQUIREMENTS; $step < $this->currentStep; $step++) {
|
||||
for ($step = self::CHECKING_REQUIREMENTS; $step < $this->currentStep; $step++) {
|
||||
$this->steps[$step]["status"] = self::SUCCESSFUL;
|
||||
}
|
||||
|
||||
if($this->currentStep == self::FINISH_INSTALLATION) {
|
||||
if ($this->currentStep == self::FINISH_INSTALLATION) {
|
||||
$this->steps[$this->currentStep]["status"] = self::SUCCESSFUL;
|
||||
}
|
||||
|
||||
// POST
|
||||
if($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
$response = $this->performStep();
|
||||
$response["step"] = $this->currentStep;
|
||||
die(json_encode($response));
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Driver\SQL\Column;
|
||||
|
||||
class BoolColumn extends Column {
|
||||
|
||||
public function __construct($name, $defaultValue=false) {
|
||||
public function __construct(string $name, bool $defaultValue = false) {
|
||||
parent::__construct($name, false, $defaultValue);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,14 +8,14 @@ class Column {
|
||||
private bool $nullable;
|
||||
private $defaultValue;
|
||||
|
||||
public function __construct($name, $nullable = false, $defaultValue = NULL) {
|
||||
public function __construct(string $name, bool $nullable = false, $defaultValue = NULL) {
|
||||
$this->name = $name;
|
||||
$this->nullable = $nullable;
|
||||
$this->defaultValue = $defaultValue;
|
||||
}
|
||||
|
||||
public function getName() { return $this->name; }
|
||||
public function notNull() { return !$this->nullable; }
|
||||
public function getName(): string { return $this->name; }
|
||||
public function notNull(): bool { return !$this->nullable; }
|
||||
public function getDefaultValue() { return $this->defaultValue; }
|
||||
|
||||
}
|
||||
@@ -4,7 +4,7 @@ namespace Driver\SQL\Column;
|
||||
|
||||
class DateTimeColumn extends Column {
|
||||
|
||||
public function __construct($name, $nullable=false, $defaultValue=NULL) {
|
||||
public function __construct(string $name, bool $nullable = false, $defaultValue = NULL) {
|
||||
parent::__construct($name, $nullable, $defaultValue);
|
||||
}
|
||||
}
|
||||
@@ -6,10 +6,10 @@ class EnumColumn extends Column {
|
||||
|
||||
private array $values;
|
||||
|
||||
public function __construct($name, $values, $nullable=false, $defaultValue=NULL) {
|
||||
public function __construct(string $name, array $values, bool $nullable = false, $defaultValue = NULL) {
|
||||
parent::__construct($name, $nullable, $defaultValue);
|
||||
$this->values = $values;
|
||||
}
|
||||
|
||||
public function getValues() { return $this->values; }
|
||||
public function getValues(): array { return $this->values; }
|
||||
}
|
||||
@@ -4,7 +4,7 @@ namespace Driver\SQL\Column;
|
||||
|
||||
class IntColumn extends Column {
|
||||
|
||||
public function __construct($name, $nullable=false, $defaultValue=NULL) {
|
||||
public function __construct(string $name, bool $nullable = false, $defaultValue = NULL) {
|
||||
parent::__construct($name, $nullable, $defaultValue);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Driver\SQL\Column;
|
||||
|
||||
class JsonColumn extends Column {
|
||||
|
||||
public function __construct($name, $nullable=false, $defaultValue=null) {
|
||||
public function __construct(string $name, bool $nullable = false, $defaultValue = null) {
|
||||
parent::__construct($name, $nullable, $defaultValue);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Driver\SQL\Column;
|
||||
|
||||
class SerialColumn extends Column {
|
||||
|
||||
public function __construct($name, $defaultValue=NULL) {
|
||||
public function __construct(string $name, $defaultValue = NULL) {
|
||||
parent::__construct($name, false, $defaultValue); # not nullable
|
||||
}
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ class StringColumn extends Column {
|
||||
|
||||
private ?int $maxSize;
|
||||
|
||||
public function __construct($name, $maxSize=null, $nullable=false, $defaultValue=null) {
|
||||
public function __construct(string $name, ?int $maxSize = null, bool $nullable = false, $defaultValue = null) {
|
||||
parent::__construct($name, $nullable, $defaultValue);
|
||||
$this->maxSize = $maxSize;
|
||||
}
|
||||
|
||||
public function getMaxSize() { return $this->maxSize; }
|
||||
public function getMaxSize(): ?int { return $this->maxSize; }
|
||||
}
|
||||
@@ -8,14 +8,14 @@ class Compare extends Condition {
|
||||
private string $column;
|
||||
private $value;
|
||||
|
||||
public function __construct($col, $val, $operator='=') {
|
||||
public function __construct(string $col, $val, string $operator = '=') {
|
||||
$this->operator = $operator;
|
||||
$this->column = $col;
|
||||
$this->value = $val;
|
||||
}
|
||||
|
||||
public function getColumn() { return $this->column; }
|
||||
public function getColumn(): string { return $this->column; }
|
||||
public function getValue() { return $this->value; }
|
||||
public function getOperator() { return $this->operator; }
|
||||
public function getOperator(): string { return $this->operator; }
|
||||
|
||||
}
|
||||
@@ -10,5 +10,5 @@ class CondAnd extends Condition {
|
||||
$this->conditions = $conditions;
|
||||
}
|
||||
|
||||
public function getConditions() { return $this->conditions; }
|
||||
public function getConditions(): array { return $this->conditions; }
|
||||
}
|
||||
@@ -12,6 +12,6 @@ class CondIn extends Condition {
|
||||
$this->expression = $expression;
|
||||
}
|
||||
|
||||
public function getColumn() { return $this->column; }
|
||||
public function getColumn(): string { return $this->column; }
|
||||
public function getExpression() { return $this->expression; }
|
||||
}
|
||||
@@ -8,7 +8,7 @@ abstract class CondKeyword extends Condition {
|
||||
private $rightExpression;
|
||||
private string $keyword;
|
||||
|
||||
public function __construct($keyword, $leftExpression, $rightExpression) {
|
||||
public function __construct(string $keyword, $leftExpression, $rightExpression) {
|
||||
$this->leftExpression = $leftExpression;
|
||||
$this->rightExpression = $rightExpression;
|
||||
$this->keyword = $keyword;
|
||||
@@ -16,5 +16,5 @@ abstract class CondKeyword extends Condition {
|
||||
|
||||
public function getLeftExp() { return $this->leftExpression; }
|
||||
public function getRightExp() { return $this->rightExpression; }
|
||||
public function getKeyword() { return $this->keyword; }
|
||||
public function getKeyword(): string { return $this->keyword; }
|
||||
}
|
||||
@@ -10,5 +10,5 @@ class CondNull extends Condition {
|
||||
$this->column = $col;
|
||||
}
|
||||
|
||||
public function getColumn() { return $this->column; }
|
||||
public function getColumn(): string { return $this->column; }
|
||||
}
|
||||
@@ -10,5 +10,5 @@ class CondOr extends Condition {
|
||||
$this->conditions = (!empty($conditions) && is_array($conditions[0])) ? $conditions[0] : $conditions;
|
||||
}
|
||||
|
||||
public function getConditions() { return $this->conditions; }
|
||||
public function getConditions(): array { return $this->conditions; }
|
||||
}
|
||||
@@ -10,5 +10,5 @@ abstract class Constraint {
|
||||
$this->columnNames = (!is_array($columnNames) ? array($columnNames) : $columnNames);
|
||||
}
|
||||
|
||||
public function getColumnNames() { return $this->columnNames; }
|
||||
public function getColumnNames(): array { return $this->columnNames; }
|
||||
}
|
||||
@@ -10,14 +10,14 @@ class ForeignKey extends Constraint {
|
||||
private string $referencedColumn;
|
||||
private ?Strategy $strategy;
|
||||
|
||||
public function __construct($name, $refTable, $refColumn, $strategy = NULL) {
|
||||
public function __construct(string $name, string $refTable, string $refColumn, ?Strategy $strategy = NULL) {
|
||||
parent::__construct($name);
|
||||
$this->referencedTable = $refTable;
|
||||
$this->referencedColumn = $refColumn;
|
||||
$this->strategy = $strategy;
|
||||
}
|
||||
|
||||
public function getReferencedTable() { return $this->referencedTable; }
|
||||
public function getReferencedColumn() { return $this->referencedColumn; }
|
||||
public function onDelete() { return $this->strategy; }
|
||||
public function getReferencedTable(): string { return $this->referencedTable; }
|
||||
public function getReferencedColumn(): string { return $this->referencedColumn; }
|
||||
public function onDelete(): ?Strategy { return $this->strategy; }
|
||||
}
|
||||
@@ -4,9 +4,10 @@ namespace Driver\SQL\Expression;
|
||||
|
||||
use Driver\SQL\Condition\Compare;
|
||||
|
||||
# TODO: change confusing class inheritance here
|
||||
class Add extends Compare {
|
||||
|
||||
public function __construct($col, $val) {
|
||||
public function __construct(string $col, $val) {
|
||||
parent::__construct($col, $val, "+");
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ class Join {
|
||||
private string $table;
|
||||
private string $columnA;
|
||||
private string $columnB;
|
||||
private $tableAlias;
|
||||
private ?string $tableAlias;
|
||||
|
||||
public function __construct($type, $table, $columnA, $columnB, $tableAlias=null) {
|
||||
public function __construct(string $type, string $table, string $columnA, string $columnB, ?string $tableAlias = null) {
|
||||
$this->type = $type;
|
||||
$this->table = $table;
|
||||
$this->columnA = $columnA;
|
||||
@@ -18,10 +18,10 @@ class Join {
|
||||
$this->tableAlias = $tableAlias;
|
||||
}
|
||||
|
||||
public function getType() { return $this->type; }
|
||||
public function getTable() { return $this->table; }
|
||||
public function getColumnA() { return $this->columnA; }
|
||||
public function getColumnB() { return $this->columnB; }
|
||||
public function getTableAlias() { return $this->tableAlias; }
|
||||
public function getType(): string { return $this->type; }
|
||||
public function getTable(): string { return $this->table; }
|
||||
public function getColumnA(): string { return $this->columnA; }
|
||||
public function getColumnB(): string { return $this->columnB; }
|
||||
public function getTableAlias(): ?string { return $this->tableAlias; }
|
||||
|
||||
}
|
||||
@@ -6,10 +6,10 @@ class Keyword {
|
||||
|
||||
private string $value;
|
||||
|
||||
public function __construct($value) {
|
||||
public function __construct(string $value) {
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
public function getValue() { return $this->value; }
|
||||
public function getValue(): string { return $this->value; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace Driver\SQL\Query;
|
||||
|
||||
use Driver\SQL\Column\Column;
|
||||
use Driver\SQL\Constraint\Constraint;
|
||||
use Driver\SQL\SQL;
|
||||
|
||||
class AlterTable extends Query {
|
||||
|
||||
private string $table;
|
||||
private string $action;
|
||||
|
||||
private ?Column $column;
|
||||
private ?Constraint $constraint;
|
||||
|
||||
public function __construct(SQL $sql, string $table) {
|
||||
parent::__construct($sql);
|
||||
$this->table = $table;
|
||||
$this->column = null;
|
||||
$this->constraint = null;
|
||||
}
|
||||
|
||||
public function add($what): AlterTable {
|
||||
if ($what instanceof Column) {
|
||||
$this->column = $what;
|
||||
} else if ($what instanceof Constraint) {
|
||||
$this->constraint = $what;
|
||||
} else {
|
||||
$this->column = new Column($what);
|
||||
}
|
||||
|
||||
$this->action = "ADD";
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function modify(Column $column): AlterTable {
|
||||
$this->column = $column;
|
||||
$this->action = "MODIFY";
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function drop($what): AlterTable {
|
||||
if ($what instanceof Column) {
|
||||
$this->column = $what;
|
||||
} else if ($what instanceof Constraint) {
|
||||
$this->constraint = $what;
|
||||
} else {
|
||||
$this->column = new Column($what);
|
||||
}
|
||||
$this->action = "DROP";
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function execute(): bool {
|
||||
return $this->sql->executeAlter($this);
|
||||
}
|
||||
|
||||
public function getAction(): string { return $this->action; }
|
||||
public function getColumn(): ?Column { return $this->column; }
|
||||
public function getConstraint(): ?Constraint { return $this->constraint; }
|
||||
public function getTable(): string { return $this->table; }
|
||||
}
|
||||
@@ -13,6 +13,8 @@ use Driver\SQL\Column\JsonColumn;
|
||||
use Driver\SQL\Constraint\PrimaryKey;
|
||||
use Driver\SQL\Constraint\Unique;
|
||||
use Driver\SQL\Constraint\ForeignKey;
|
||||
use Driver\SQL\SQL;
|
||||
use Driver\SQL\Strategy\Strategy;
|
||||
|
||||
class CreateTable extends Query {
|
||||
|
||||
@@ -21,7 +23,7 @@ class CreateTable extends Query {
|
||||
private array $constraints;
|
||||
private bool $ifNotExists;
|
||||
|
||||
public function __construct($sql, $name) {
|
||||
public function __construct(SQL $sql, string $name) {
|
||||
parent::__construct($sql);
|
||||
$this->tableName = $name;
|
||||
$this->columns = array();
|
||||
@@ -29,67 +31,67 @@ class CreateTable extends Query {
|
||||
$this->ifNotExists = false;
|
||||
}
|
||||
|
||||
public function addSerial($name) {
|
||||
public function addSerial(string $name): CreateTable {
|
||||
$this->columns[$name] = new SerialColumn($name);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addString($name, $maxSize=NULL, $nullable=false, $defaultValue=NULL) {
|
||||
public function addString(string $name, ?int $maxSize = NULL, bool $nullable = false, $defaultValue = NULL): CreateTable {
|
||||
$this->columns[$name] = new StringColumn($name, $maxSize, $nullable, $defaultValue);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addDateTime($name, $nullable=false, $defaultValue=NULL) {
|
||||
public function addDateTime(string $name, bool $nullable = false, $defaultValue = NULL): CreateTable {
|
||||
$this->columns[$name] = new DateTimeColumn($name, $nullable, $defaultValue);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addInt($name, $nullable=false, $defaultValue=NULL) {
|
||||
public function addInt(string $name, bool $nullable = false, $defaultValue = NULL): CreateTable {
|
||||
$this->columns[$name] = new IntColumn($name, $nullable, $defaultValue);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addBool($name, $defaultValue=false) {
|
||||
public function addBool(string $name, $defaultValue = false): CreateTable {
|
||||
$this->columns[$name] = new BoolColumn($name, $defaultValue);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addJson($name, $nullable=false, $defaultValue=NULL) {
|
||||
public function addJson(string $name, bool $nullable = false, $defaultValue = NULL): CreateTable {
|
||||
$this->columns[$name] = new JsonColumn($name, $nullable, $defaultValue);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addEnum($name, $values, $nullable=false, $defaultValue=NULL) {
|
||||
public function addEnum(string $name, array $values, bool $nullable = false, $defaultValue = NULL): CreateTable {
|
||||
$this->columns[$name] = new EnumColumn($name, $values, $nullable, $defaultValue);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function primaryKey(...$names) {
|
||||
public function primaryKey(...$names): CreateTable {
|
||||
$this->constraints[] = new PrimaryKey($names);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function unique(...$names) {
|
||||
public function unique(...$names): CreateTable {
|
||||
$this->constraints[] = new Unique($names);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function foreignKey($name, $refTable, $refColumn, $strategy = NULL) {
|
||||
public function foreignKey(string $name, string $refTable, string $refColumn, ?Strategy $strategy = NULL): CreateTable {
|
||||
$this->constraints[] = new ForeignKey($name, $refTable, $refColumn, $strategy);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function onlyIfNotExists() {
|
||||
public function onlyIfNotExists(): CreateTable {
|
||||
$this->ifNotExists = true;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function execute() {
|
||||
public function execute(): bool {
|
||||
return $this->sql->executeCreateTable($this);
|
||||
}
|
||||
|
||||
public function ifNotExists() { return $this->ifNotExists; }
|
||||
public function getTableName() { return $this->tableName; }
|
||||
public function getColumns() { return $this->columns; }
|
||||
public function getConstraints() { return $this->constraints; }
|
||||
public function ifNotExists(): bool { return $this->ifNotExists; }
|
||||
public function getTableName(): string { return $this->tableName; }
|
||||
public function getColumns(): array { return $this->columns; }
|
||||
public function getConstraints(): array { return $this->constraints; }
|
||||
}
|
||||
@@ -3,27 +3,28 @@
|
||||
namespace Driver\SQL\Query;
|
||||
|
||||
use Driver\SQL\Condition\CondOr;
|
||||
use Driver\SQL\SQL;
|
||||
|
||||
class Delete extends Query {
|
||||
|
||||
private string $table;
|
||||
private array $conditions;
|
||||
|
||||
public function __construct($sql, $table) {
|
||||
public function __construct(SQL $sql, string $table) {
|
||||
parent::__construct($sql);
|
||||
$this->table = $table;
|
||||
$this->conditions = array();
|
||||
}
|
||||
|
||||
public function where(...$conditions) {
|
||||
public function where(...$conditions): Delete {
|
||||
$this->conditions[] = (count($conditions) === 1 ? $conditions : new CondOr($conditions));
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function execute() {
|
||||
public function execute(): bool {
|
||||
return $this->sql->executeDelete($this);
|
||||
}
|
||||
|
||||
public function getTable() { return $this->table; }
|
||||
public function getConditions() { return $this->conditions; }
|
||||
public function getTable(): string { return $this->table; }
|
||||
public function getConditions(): array { return $this->conditions; }
|
||||
}
|
||||
@@ -14,16 +14,16 @@ class Drop extends Query {
|
||||
* @param SQL $sql
|
||||
* @param string $table
|
||||
*/
|
||||
public function __construct(\Driver\SQL\SQL $sql, string $table) {
|
||||
public function __construct(SQL $sql, string $table) {
|
||||
parent::__construct($sql);
|
||||
$this->table = $table;
|
||||
}
|
||||
|
||||
public function execute() {
|
||||
$this->sql->executeDrop($this);
|
||||
public function execute(): bool {
|
||||
return $this->sql->executeDrop($this);
|
||||
}
|
||||
|
||||
public function getTable() {
|
||||
public function getTable(): string {
|
||||
return $this->table;
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Driver\SQL\Query;
|
||||
|
||||
use Driver\SQL\SQL;
|
||||
use Driver\SQL\Strategy\Strategy;
|
||||
|
||||
class Insert extends Query {
|
||||
@@ -12,7 +13,7 @@ class Insert extends Query {
|
||||
private ?Strategy $onDuplicateKey;
|
||||
private ?string $returning;
|
||||
|
||||
public function __construct($sql, $name, $columns=array()) {
|
||||
public function __construct(SQL $sql, string $name, array $columns = array()) {
|
||||
parent::__construct($sql);
|
||||
$this->tableName = $name;
|
||||
$this->columns = $columns;
|
||||
@@ -21,28 +22,28 @@ class Insert extends Query {
|
||||
$this->returning = NULL;
|
||||
}
|
||||
|
||||
public function addRow(...$values) {
|
||||
public function addRow(...$values): Insert {
|
||||
$this->rows[] = $values;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function onDuplicateKeyStrategy($strategy) {
|
||||
public function onDuplicateKeyStrategy(Strategy $strategy): Insert {
|
||||
$this->onDuplicateKey = $strategy;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function returning($column) {
|
||||
public function returning(string $column): Insert {
|
||||
$this->returning = $column;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function execute() {
|
||||
public function execute(): bool {
|
||||
return $this->sql->executeInsert($this);
|
||||
}
|
||||
|
||||
public function getTableName() { return $this->tableName; }
|
||||
public function getColumns() { return $this->columns; }
|
||||
public function getRows() { return $this->rows; }
|
||||
public function onDuplicateKey() { return $this->onDuplicateKey; }
|
||||
public function getReturning() { return $this->returning; }
|
||||
public function getTableName(): string { return $this->tableName; }
|
||||
public function getColumns(): array { return $this->columns; }
|
||||
public function getRows(): array { return $this->rows; }
|
||||
public function onDuplicateKey(): ?Strategy { return $this->onDuplicateKey; }
|
||||
public function getReturning(): ?string { return $this->returning; }
|
||||
}
|
||||
@@ -9,16 +9,17 @@ abstract class Query {
|
||||
protected SQL $sql;
|
||||
public bool $dump;
|
||||
|
||||
public function __construct($sql) {
|
||||
public function __construct(SQL $sql) {
|
||||
$this->sql = $sql;
|
||||
$this->dump = false;
|
||||
}
|
||||
|
||||
public function dump() {
|
||||
public function dump(): Query {
|
||||
$this->dump = true;
|
||||
return $this;
|
||||
}
|
||||
|
||||
// can actually return bool|array (depending on success and query type)
|
||||
public abstract function execute();
|
||||
|
||||
}
|
||||
@@ -30,52 +30,52 @@ class Select extends Query {
|
||||
$this->sortAscending = true;
|
||||
}
|
||||
|
||||
public function from(...$tables) {
|
||||
public function from(...$tables): Select {
|
||||
$this->tables = array_merge($this->tables, $tables);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function where(...$conditions) {
|
||||
public function where(...$conditions): Select {
|
||||
$this->conditions[] = (count($conditions) === 1 ? $conditions : new CondOr($conditions));
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function innerJoin($table, $columnA, $columnB, $tableAlias=null) {
|
||||
public function innerJoin(string $table, string $columnA, string $columnB, ?string $tableAlias = null): Select {
|
||||
$this->joins[] = new Join("INNER", $table, $columnA, $columnB, $tableAlias);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function leftJoin($table, $columnA, $columnB, $tableAlias=null) {
|
||||
public function leftJoin(string $table, string $columnA, string $columnB, ?string $tableAlias = null): Select {
|
||||
$this->joins[] = new Join("LEFT", $table, $columnA, $columnB, $tableAlias);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function groupBy(...$columns) {
|
||||
public function groupBy(...$columns): Select {
|
||||
$this->groupColumns = $columns;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function orderBy(...$columns) {
|
||||
public function orderBy(...$columns): Select {
|
||||
$this->orderColumns = $columns;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function ascending() {
|
||||
public function ascending(): Select {
|
||||
$this->sortAscending = true;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function descending() {
|
||||
public function descending(): Select {
|
||||
$this->sortAscending = false;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function limit($limit) {
|
||||
public function limit(int $limit): Select {
|
||||
$this->limit = $limit;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function offset($offset) {
|
||||
public function offset(int $offset): Select {
|
||||
$this->offset = $offset;
|
||||
return $this;
|
||||
}
|
||||
@@ -84,14 +84,14 @@ class Select extends Query {
|
||||
return $this->sql->executeSelect($this);
|
||||
}
|
||||
|
||||
public function getColumns() { return $this->columns; }
|
||||
public function getTables() { return $this->tables; }
|
||||
public function getConditions() { return $this->conditions; }
|
||||
public function getJoins() { return $this->joins; }
|
||||
public function isOrderedAscending() { return $this->sortAscending; }
|
||||
public function getOrderBy() { return $this->orderColumns; }
|
||||
public function getLimit() { return $this->limit; }
|
||||
public function getOffset() { return $this->offset; }
|
||||
public function getGroupBy() { return $this->groupColumns; }
|
||||
public function getColumns(): array { return $this->columns; }
|
||||
public function getTables(): array { return $this->tables; }
|
||||
public function getConditions(): array { return $this->conditions; }
|
||||
public function getJoins(): array { return $this->joins; }
|
||||
public function isOrderedAscending(): bool { return $this->sortAscending; }
|
||||
public function getOrderBy(): array { return $this->orderColumns; }
|
||||
public function getLimit(): int { return $this->limit; }
|
||||
public function getOffset(): int { return $this->offset; }
|
||||
public function getGroupBy(): array { return $this->groupColumns; }
|
||||
|
||||
}
|
||||
@@ -2,18 +2,20 @@
|
||||
|
||||
namespace Driver\SQL\Query;
|
||||
|
||||
use Driver\SQL\SQL;
|
||||
|
||||
class Truncate extends Query {
|
||||
|
||||
private string $tableName;
|
||||
|
||||
public function __construct($sql, $name) {
|
||||
public function __construct(SQL $sql, string $name) {
|
||||
parent::__construct($sql);
|
||||
$this->tableName = $name;
|
||||
}
|
||||
|
||||
public function execute() {
|
||||
public function execute(): bool {
|
||||
return $this->sql->executeTruncate($this);
|
||||
}
|
||||
|
||||
public function getTable() { return $this->tableName; }
|
||||
public function getTable(): string { return $this->tableName; }
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace Driver\SQL\Query;
|
||||
|
||||
use Driver\SQL\Condition\CondOr;
|
||||
use Driver\SQL\SQL;
|
||||
|
||||
class Update extends Query {
|
||||
|
||||
@@ -10,19 +11,19 @@ class Update extends Query {
|
||||
private string $table;
|
||||
private array $conditions;
|
||||
|
||||
public function __construct($sql, $table) {
|
||||
public function __construct(SQL $sql, string $table) {
|
||||
parent::__construct($sql);
|
||||
$this->values = array();
|
||||
$this->table = $table;
|
||||
$this->conditions = array();
|
||||
}
|
||||
|
||||
public function where(...$conditions) {
|
||||
public function where(...$conditions): Update {
|
||||
$this->conditions[] = (count($conditions) === 1 ? $conditions : new CondOr($conditions));
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function set($key, $val) {
|
||||
public function set(string $key, $val): Update {
|
||||
$this->values[$key] = $val;
|
||||
return $this;
|
||||
}
|
||||
@@ -31,7 +32,7 @@ class Update extends Query {
|
||||
return $this->sql->executeUpdate($this);
|
||||
}
|
||||
|
||||
public function getTable() { return $this->table; }
|
||||
public function getConditions() { return $this->conditions; }
|
||||
public function getValues() { return $this->values; }
|
||||
public function getTable(): string { return $this->table; }
|
||||
public function getConditions(): array { return $this->conditions; }
|
||||
public function getValues(): array { return $this->values; }
|
||||
}
|
||||
@@ -15,6 +15,7 @@ use Driver\SQL\Constraint\Constraint;
|
||||
use \Driver\SQL\Constraint\Unique;
|
||||
use \Driver\SQL\Constraint\PrimaryKey;
|
||||
use \Driver\SQL\Constraint\ForeignKey;
|
||||
use Driver\SQL\Query\AlterTable;
|
||||
use Driver\SQL\Query\CreateTable;
|
||||
use Driver\SQL\Query\Delete;
|
||||
use Driver\SQL\Query\Drop;
|
||||
@@ -79,6 +80,10 @@ abstract class SQL {
|
||||
return new Drop($this, $table);
|
||||
}
|
||||
|
||||
public function alterTable($tableName) {
|
||||
return new AlterTable($this, $tableName);
|
||||
}
|
||||
|
||||
// ####################
|
||||
// ### ABSTRACT METHODS
|
||||
// ####################
|
||||
@@ -262,6 +267,47 @@ abstract class SQL {
|
||||
return $this->execute($query);
|
||||
}
|
||||
|
||||
public function executeAlter(AlterTable $alter): bool {
|
||||
$tableName = $this->tableName($alter->getTable());
|
||||
$action = $alter->getAction();
|
||||
$column = $alter->getColumn();
|
||||
$constraint = $alter->getConstraint();
|
||||
|
||||
$query = "ALTER TABLE $tableName $action ";
|
||||
|
||||
if ($column) {
|
||||
$query .= "COLUMN ";
|
||||
if ($action === "DROP") {
|
||||
$query .= $this->columnName($column->getName());
|
||||
} else {
|
||||
// ADD or modify
|
||||
$query .= $this->getColumnDefinition($column);
|
||||
}
|
||||
} else if ($constraint) {
|
||||
if ($action === "DROP") {
|
||||
if ($constraint instanceof PrimaryKey) {
|
||||
$query .= "PRIMARY KEY";
|
||||
} else if ($constraint instanceof ForeignKey) {
|
||||
// TODO: how can we pass the constraint name here?
|
||||
$this->lastError = "DROP CONSTRAINT foreign key is not supported yet.";
|
||||
return false;
|
||||
}
|
||||
} else if ($action === "ADD") {
|
||||
$query .= "CONSTRAINT ";
|
||||
$query .= $this->getConstraintDefinition($constraint);
|
||||
} else if ($action === "MODIFY") {
|
||||
$this->lastError = "MODIFY CONSTRAINT foreign key is not supported.";
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
$this->lastError = "ALTER TABLE requires at least a column or a constraint.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($alter->dump) { var_dump($query); }
|
||||
return $this->execute($query);
|
||||
}
|
||||
|
||||
protected function getWhereClause($conditions, &$params) {
|
||||
if (!$conditions) {
|
||||
return "";
|
||||
|
||||
@@ -12,9 +12,11 @@ class UpdateStrategy extends Strategy {
|
||||
$this->values = $values;
|
||||
}
|
||||
|
||||
public function getConflictingColumns() {
|
||||
public function getConflictingColumns(): array {
|
||||
return $this->conflictingColumns;
|
||||
}
|
||||
|
||||
public function getValues() { return $this->values; }
|
||||
public function getValues(): array {
|
||||
return $this->values;
|
||||
}
|
||||
}
|
||||
@@ -13,29 +13,38 @@ abstract class Document {
|
||||
private ?string $activeView;
|
||||
|
||||
public function __construct(User $user, $headClass, $bodyClass, ?string $view = NULL) {
|
||||
$this->user = $user;
|
||||
$this->head = new $headClass($this);
|
||||
$this->body = new $bodyClass($this);
|
||||
$this->user = $user;
|
||||
$this->databaseRequired = true;
|
||||
$this->activeView = $view;
|
||||
}
|
||||
|
||||
public function getHead() { return $this->head; }
|
||||
public function getBody() { return $this->body; }
|
||||
public function getSQL() { return $this->user->getSQL(); }
|
||||
public function getUser() { return $this->user; }
|
||||
public function getHead(): Head { return $this->head; }
|
||||
public function getBody(): Body { return $this->body; }
|
||||
public function getSQL(): ?\Driver\SQL\SQL { return $this->user->getSQL(); }
|
||||
public function getUser(): User { return $this->user; }
|
||||
|
||||
public function getView() : ?View {
|
||||
|
||||
$file = getClassPath($this->activeView);
|
||||
if(!file_exists($file) || !is_subclass_of($this->activeView, View::class)) {
|
||||
if ($this->activeView === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new $this->activeView($this);
|
||||
$view = parseClass($this->activeView);
|
||||
$file = getClassPath($view);
|
||||
if(!file_exists($file) || !is_subclass_of($view, View::class)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
function getCode() {
|
||||
return new $view($this);
|
||||
}
|
||||
|
||||
public function getRequestedView(): string {
|
||||
return $this->activeView;
|
||||
}
|
||||
|
||||
function getCode(): string {
|
||||
|
||||
if ($this->databaseRequired) {
|
||||
$sql = $this->user->getSQL();
|
||||
|
||||
@@ -11,16 +11,16 @@ class EmptyHead extends Head {
|
||||
protected function initSources() {
|
||||
}
|
||||
|
||||
protected function initMetas() {
|
||||
protected function initMetas(): array {
|
||||
return array(
|
||||
);
|
||||
}
|
||||
|
||||
protected function initRawFields() {
|
||||
protected function initRawFields(): array {
|
||||
return array();
|
||||
}
|
||||
|
||||
protected function initTitle() {
|
||||
protected function initTitle(): string {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -24,9 +24,9 @@ abstract class Head extends View {
|
||||
}
|
||||
|
||||
protected abstract function initSources();
|
||||
protected abstract function initMetas();
|
||||
protected abstract function initRawFields();
|
||||
protected abstract function initTitle();
|
||||
protected abstract function initMetas(): array;
|
||||
protected abstract function initRawFields(): array;
|
||||
protected abstract function initTitle(): string;
|
||||
|
||||
protected function init() {
|
||||
$this->keywords = array();
|
||||
@@ -38,13 +38,13 @@ abstract class Head extends View {
|
||||
public function setDescription($description) { $this->description = $description; }
|
||||
public function setKeywords($keywords) { $this->keywords = $keywords; }
|
||||
public function setTitle($title) { $this->title = $title; }
|
||||
public function getSources() { return $this->sources; }
|
||||
public function getSources(): array { return $this->sources; }
|
||||
public function addScript($type, $url, $js = '') { $this->sources[] = new Script($type, $url, $js); }
|
||||
public function addRawField($rawField) { $this->rawFields[] = $rawField; }
|
||||
public function addMeta($aMeta) { $this->metas[] = $aMeta; }
|
||||
public function addLink($rel, $href, $type = "") { $this->sources[] = new Link($rel, $href, $type); }
|
||||
public function addKeywords($keywords) { array_merge($this->keywords, $keywords); }
|
||||
public function getTitle() { return $this->title; }
|
||||
public function addKeywords($keywords) { $this->keywords = array_merge($this->keywords, $keywords); }
|
||||
public function getTitle(): string { return $this->title; }
|
||||
|
||||
public function addCSS($href, $type = Link::MIME_TEXT_CSS) { $this->sources[] = new Link(Link::STYLESHEET, $href, $type); }
|
||||
public function addStyle($style) { $this->sources[] = new Style($style); }
|
||||
@@ -68,7 +68,7 @@ abstract class Head extends View {
|
||||
$this->addJS(Script::BOOTSTRAP);
|
||||
}
|
||||
|
||||
public function getCode() {
|
||||
public function getCode(): string {
|
||||
$header = "<head>";
|
||||
|
||||
foreach($this->metas as $aMeta) {
|
||||
|
||||
@@ -22,7 +22,7 @@ class Link extends StaticView {
|
||||
$this->rel = $rel;
|
||||
}
|
||||
|
||||
function getCode() {
|
||||
function getCode(): string {
|
||||
$type = (empty($this->type) ? "" : " type=\"$this->type\"");
|
||||
return "<link rel=\"$this->rel\" href=\"$this->href\"$type/>";
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ class Script extends StaticView {
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
function getCode() {
|
||||
function getCode(): string {
|
||||
$src = (empty($this->src) ? "" : " src=\"$this->src\"");
|
||||
return "<script type=\"$this->type\"$src>$this->content</script>";
|
||||
}
|
||||
|
||||
@@ -3,14 +3,15 @@
|
||||
namespace Elements;
|
||||
|
||||
abstract class SimpleBody extends Body {
|
||||
|
||||
public function __construct($document) {
|
||||
parent::__construct($document);
|
||||
}
|
||||
|
||||
public function getCode() {
|
||||
public function getCode(): string {
|
||||
$content = $this->getContent();
|
||||
return parent::getCode() . "<body>$content</body>";
|
||||
}
|
||||
|
||||
protected abstract function getContent();
|
||||
protected abstract function getContent(): string;
|
||||
}
|
||||
@@ -10,7 +10,7 @@ class Style extends StaticView {
|
||||
$this->style = $style;
|
||||
}
|
||||
|
||||
function getCode() {
|
||||
function getCode(): string {
|
||||
return "<style>$this->style</style>";
|
||||
}
|
||||
}
|
||||
@@ -7,23 +7,25 @@ abstract class View extends StaticView {
|
||||
private Document $document;
|
||||
private bool $loadView;
|
||||
protected bool $searchable;
|
||||
protected string $reference;
|
||||
protected string $title;
|
||||
protected array $langModules;
|
||||
|
||||
public function __construct(Document $document, $loadView = true) {
|
||||
public function __construct(Document $document, bool $loadView = true) {
|
||||
$this->document = $document;
|
||||
$this->searchable = false;
|
||||
$this->reference = "";
|
||||
$this->title = "Untitled View";
|
||||
$this->langModules = array();
|
||||
$this->loadView = $loadView;
|
||||
}
|
||||
|
||||
public function getTitle() { return $this->title; }
|
||||
public function getDocument() { return $this->document; }
|
||||
public function isSearchable() { return $this->searchable; }
|
||||
public function getReference() { return $this->reference; }
|
||||
public function getTitle(): string { return $this->title; }
|
||||
public function getDocument(): Document { return $this->document; }
|
||||
public function isSearchable(): bool { return $this->searchable; }
|
||||
|
||||
public function getSiteName(): string {
|
||||
// what a chain lol
|
||||
return $this->getDocument()->getUser()->getConfiguration()->getSettings()->getSiteName();
|
||||
}
|
||||
|
||||
protected function load(string $viewClass) : string {
|
||||
try {
|
||||
@@ -50,7 +52,7 @@ abstract class View extends StaticView {
|
||||
// Virtual Methods
|
||||
public function loadView() { }
|
||||
|
||||
public function getCode() {
|
||||
public function getCode(): string {
|
||||
|
||||
// Load translations
|
||||
$this->loadLanguageModules();
|
||||
@@ -64,33 +66,37 @@ abstract class View extends StaticView {
|
||||
}
|
||||
|
||||
// UI Functions
|
||||
private function createList($items, $tag) {
|
||||
if(count($items) === 0)
|
||||
return "<$tag></$tag>";
|
||||
else
|
||||
return "<$tag><li>" . implode("</li><li>", $items) . "</li></$tag>";
|
||||
private function createList($items, $tag, $classes = ""): string {
|
||||
|
||||
$class = ($classes ? " class=\"$classes\"" : "");
|
||||
|
||||
if(count($items) === 0) {
|
||||
return "<$tag$class></$tag>";
|
||||
} else {
|
||||
return "<$tag$class><li>" . implode("</li><li>", $items) . "</li></$tag>";
|
||||
}
|
||||
}
|
||||
|
||||
public function createOrderedList($items=array()) {
|
||||
return $this->createList($items, "ol");
|
||||
public function createOrderedList($items=array(), $classes = ""): string {
|
||||
return $this->createList($items, "ol", $classes);
|
||||
}
|
||||
|
||||
public function createUnorderedList($items=array()) {
|
||||
return $this->createList($items, "ul");
|
||||
public function createUnorderedList($items=array(), $classes = ""): string {
|
||||
return $this->createList($items, "ul", $classes);
|
||||
}
|
||||
|
||||
protected function createLink($link, $title=null, $classes="") {
|
||||
protected function createLink($link, $title=null, $classes=""): string {
|
||||
if(is_null($title)) $title=$link;
|
||||
if(!empty($classes)) $classes = " class=\"$classes\"";
|
||||
return "<a href=\"$link\"$classes>$title</a>";
|
||||
}
|
||||
|
||||
protected function createExternalLink($link, $title=null) {
|
||||
protected function createExternalLink($link, $title=null): string {
|
||||
if(is_null($title)) $title=$link;
|
||||
return "<a href=\"$link\" target=\"_blank\" class=\"external\">$title</a>";
|
||||
return "<a href=\"$link\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"external\">$title</a>";
|
||||
}
|
||||
|
||||
protected function createIcon($icon, $type = "fas", $classes = "") {
|
||||
protected function createIcon($icon, $type = "fas", $classes = ""): string {
|
||||
$iconClass = "$type fa-$icon";
|
||||
|
||||
if($icon === "spinner" || $icon === "circle-notch")
|
||||
@@ -102,58 +108,54 @@ abstract class View extends StaticView {
|
||||
return "<i class=\"$iconClass\" ></i>";
|
||||
}
|
||||
|
||||
protected function createErrorText($text, $id="", $hidden=false) {
|
||||
protected function createErrorText($text, $id="", $hidden=false): string {
|
||||
return $this->createStatusText("danger", $text, $id, $hidden);
|
||||
}
|
||||
|
||||
protected function createWarningText($text, $id="", $hidden=false) {
|
||||
protected function createWarningText($text, $id="", $hidden=false): string {
|
||||
return $this->createStatusText("warning", $text, $id, $hidden);
|
||||
}
|
||||
|
||||
protected function createSuccessText($text, $id="", $hidden=false) {
|
||||
protected function createSuccessText($text, $id="", $hidden=false): string {
|
||||
return $this->createStatusText("success", $text, $id, $hidden);
|
||||
}
|
||||
|
||||
protected function createSecondaryText($text, $id="", $hidden=false) {
|
||||
protected function createSecondaryText($text, $id="", $hidden=false): string {
|
||||
return $this->createStatusText("secondary", $text, $id, $hidden);
|
||||
}
|
||||
|
||||
protected function createInfoText($text, $id="", $hidden=false) {
|
||||
protected function createInfoText($text, $id="", $hidden=false): string {
|
||||
return $this->createStatusText("info", $text, $id, $hidden);
|
||||
}
|
||||
|
||||
protected function createStatusText($type, $text, $id="", $hidden=false, $classes="") {
|
||||
protected function createStatusText($type, $text, $id="", $hidden=false, $classes=""): string {
|
||||
if(strlen($id) > 0) $id = " id=\"$id\"";
|
||||
if($hidden) $classes .= " hidden";
|
||||
if(strlen($classes) > 0) $classes = " $classes";
|
||||
return "<div class=\"alert alert-$type$hidden$classes\" role=\"alert\"$id>$text</div>";
|
||||
}
|
||||
|
||||
protected function createBadge($type, $text) {
|
||||
protected function createBadge($type, $text): string {
|
||||
$text = htmlspecialchars($text);
|
||||
return "<span class=\"badge badge-$type\">$text</span>";
|
||||
}
|
||||
|
||||
protected function createJumbotron(string $content, bool $fluid=false, $class="") {
|
||||
$jumbotronClass = "jumbotron" . ($fluid ? "-fluid" : "");
|
||||
protected function createJumbotron(string $content, bool $fluid=false, $class=""): string {
|
||||
$jumbotronClass = "jumbotron" . ($fluid ? " jumbotron-fluid" : "");
|
||||
if (!empty($class)) $jumbotronClass .= " $class";
|
||||
|
||||
return "
|
||||
<div class=\"row\">
|
||||
<div class=\"col-12\">
|
||||
<div class=\"$jumbotronClass\">
|
||||
return
|
||||
"<div class=\"$jumbotronClass\">
|
||||
$content
|
||||
</div>
|
||||
</div>
|
||||
</div>";
|
||||
}
|
||||
|
||||
public function createSimpleParagraph(string $content, string $class="") {
|
||||
public function createSimpleParagraph(string $content, string $class=""): string {
|
||||
if($class) $class = " class=\"$class\"";
|
||||
return "<p$class>$content</p>";
|
||||
}
|
||||
|
||||
public function createParagraph($title, $id, $content) {
|
||||
public function createParagraph($title, $id, $content): string {
|
||||
$id = replaceCssSelector($id);
|
||||
$iconId = urlencode("$id-icon");
|
||||
return "
|
||||
@@ -166,7 +168,7 @@ abstract class View extends StaticView {
|
||||
</div>";
|
||||
}
|
||||
|
||||
protected function createBootstrapTable($data, string $classes="") {
|
||||
protected function createBootstrapTable($data, string $classes=""): string {
|
||||
$classes = empty($classes) ? "" : " $classes";
|
||||
$code = "<div class=\"container$classes\">";
|
||||
foreach($data as $row) {
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Objects;
|
||||
|
||||
abstract class ApiObject implements \JsonSerializable {
|
||||
|
||||
public abstract function jsonSerialize();
|
||||
public abstract function jsonSerialize(): array;
|
||||
|
||||
public function __toString() { return json_encode($this); }
|
||||
|
||||
|
||||
@@ -24,14 +24,17 @@ namespace Objects {
|
||||
}
|
||||
|
||||
public function getId() { return $this->languageId; }
|
||||
public function getCode() { return $this->langCode; }
|
||||
public function getCode(): string { return $this->langCode; }
|
||||
public function getShortCode() { return substr($this->langCode, 0, 2); }
|
||||
public function getName() { return $this->langName; }
|
||||
public function getIconPath() { return "/img/icons/lang/$this->langCode.gif"; }
|
||||
public function getEntries() { return $this->entries; }
|
||||
public function getModules() { return $this->modules; }
|
||||
|
||||
public function loadModule(LanguageModule $module) {
|
||||
/**
|
||||
* @param $module LanguageModule class or object
|
||||
*/
|
||||
public function loadModule($module) {
|
||||
if(!is_object($module))
|
||||
$module = new $module;
|
||||
|
||||
@@ -40,7 +43,7 @@ namespace Objects {
|
||||
$this->modules[] = $module;
|
||||
}
|
||||
|
||||
public function translate($key) {
|
||||
public function translate(string $key): string {
|
||||
if(isset($this->entries[$key]))
|
||||
return $this->entries[$key];
|
||||
|
||||
@@ -51,7 +54,7 @@ namespace Objects {
|
||||
setcookie('lang', $this->langCode, 0, "/", "");
|
||||
}
|
||||
|
||||
public function jsonSerialize() {
|
||||
public function jsonSerialize(): array {
|
||||
return array(
|
||||
'uid' => $this->languageId,
|
||||
'code' => $this->langCode,
|
||||
|
||||
@@ -28,7 +28,7 @@ class Session extends ApiObject {
|
||||
$this->csrfToken = $csrfToken ?? generateRandomString(16);
|
||||
}
|
||||
|
||||
public static function create($user, $stayLoggedIn) {
|
||||
public static function create($user, $stayLoggedIn): ?Session {
|
||||
$session = new Session($user, null, null);
|
||||
if($session->insert($stayLoggedIn)) {
|
||||
return $session;
|
||||
@@ -69,15 +69,15 @@ class Session extends ApiObject {
|
||||
setcookie('session', $sessionCookie, $this->getExpiresTime(), "/", "", $secure);
|
||||
}
|
||||
|
||||
public function getExpiresTime() {
|
||||
public function getExpiresTime(): int {
|
||||
return ($this->stayLoggedIn == 0 ? 0 : $this->expires);
|
||||
}
|
||||
|
||||
public function getExpiresSeconds() {
|
||||
public function getExpiresSeconds(): int {
|
||||
return ($this->stayLoggedIn == 0 ? -1 : $this->expires - time());
|
||||
}
|
||||
|
||||
public function jsonSerialize() {
|
||||
public function jsonSerialize(): array {
|
||||
return array(
|
||||
'uid' => $this->sessionId,
|
||||
'user_id' => $this->user->getId(),
|
||||
@@ -89,7 +89,7 @@ class Session extends ApiObject {
|
||||
);
|
||||
}
|
||||
|
||||
public function insert($stayLoggedIn) {
|
||||
public function insert($stayLoggedIn): bool {
|
||||
$this->updateMetaData();
|
||||
$sql = $this->user->getSQL();
|
||||
|
||||
|
||||
+27
-23
@@ -3,9 +3,6 @@
|
||||
namespace Objects;
|
||||
|
||||
use Configuration\Configuration;
|
||||
use DateTime;
|
||||
use Driver\SQL\Expression\Add;
|
||||
use Driver\SQL\Strategy\UpdateStrategy;
|
||||
use Exception;
|
||||
use External\JWT;
|
||||
use Driver\SQL\SQL;
|
||||
@@ -52,19 +49,19 @@ class User extends ApiObject {
|
||||
}
|
||||
}
|
||||
|
||||
public function getId() { return $this->uid; }
|
||||
public function isLoggedIn() { return $this->loggedIn; }
|
||||
public function getUsername() { return $this->username; }
|
||||
public function getEmail() { return $this->email; }
|
||||
public function getSQL() { return $this->sql; }
|
||||
public function getLanguage() { return $this->language; }
|
||||
public function getId(): int { return $this->uid; }
|
||||
public function isLoggedIn(): bool { return $this->loggedIn; }
|
||||
public function getUsername(): string { return $this->username; }
|
||||
public function getEmail(): ?string { return $this->email; }
|
||||
public function getSQL(): ?SQL { return $this->sql; }
|
||||
public function getLanguage(): Language { return $this->language; }
|
||||
public function setLanguage(Language $language) { $this->language = $language; $language->load(); }
|
||||
public function getSession() { return $this->session; }
|
||||
public function getConfiguration() { return $this->configuration; }
|
||||
public function getGroups() { return $this->groups; }
|
||||
public function hasGroup(int $group) { return isset($this->groups[$group]); }
|
||||
public function getSession(): ?Session { return $this->session; }
|
||||
public function getConfiguration(): Configuration { return $this->configuration; }
|
||||
public function getGroups(): array { return $this->groups; }
|
||||
public function hasGroup(int $group): bool { return isset($this->groups[$group]); }
|
||||
|
||||
public function __debugInfo() {
|
||||
public function __debugInfo(): array {
|
||||
$debugInfo = array(
|
||||
'loggedIn' => $this->loggedIn,
|
||||
'language' => $this->language->getName(),
|
||||
@@ -78,7 +75,7 @@ class User extends ApiObject {
|
||||
return $debugInfo;
|
||||
}
|
||||
|
||||
public function jsonSerialize() {
|
||||
public function jsonSerialize(): array {
|
||||
if ($this->isLoggedIn()) {
|
||||
return array(
|
||||
'uid' => $this->uid,
|
||||
@@ -103,7 +100,7 @@ class User extends ApiObject {
|
||||
$this->session = null;
|
||||
}
|
||||
|
||||
public function logout() {
|
||||
public function logout(): bool {
|
||||
$success = true;
|
||||
if($this->loggedIn) {
|
||||
$success = $this->session->destroy();
|
||||
@@ -113,7 +110,7 @@ class User extends ApiObject {
|
||||
return $success;
|
||||
}
|
||||
|
||||
public function updateLanguage($lang) {
|
||||
public function updateLanguage($lang): bool {
|
||||
if($this->sql) {
|
||||
$request = new \Api\Language\Set($this);
|
||||
return $request->execute(array("langCode" => $lang));
|
||||
@@ -131,7 +128,13 @@ class User extends ApiObject {
|
||||
session_write_close();
|
||||
}
|
||||
|
||||
public function readData($userId, $sessionId, $sessionUpdate = true) {
|
||||
/**
|
||||
* @param $userId user's id
|
||||
* @param $sessionId session's id
|
||||
* @param bool $sessionUpdate update session information, including session's lifetime and browser information
|
||||
* @return bool true, if the data could be loaded
|
||||
*/
|
||||
public function readData($userId, $sessionId, $sessionUpdate = true): bool {
|
||||
|
||||
$res = $this->sql->select("User.name", "User.email",
|
||||
"Language.uid as langId", "Language.code as langCode", "Language.name as langName",
|
||||
@@ -203,10 +206,10 @@ class User extends ApiObject {
|
||||
}
|
||||
}
|
||||
|
||||
public function createSession($userId, $stayLoggedIn) {
|
||||
public function createSession($userId, $stayLoggedIn): bool {
|
||||
$this->uid = $userId;
|
||||
$this->session = Session::create($this, $stayLoggedIn);
|
||||
if($this->session) {
|
||||
if ($this->session) {
|
||||
$this->loggedIn = true;
|
||||
return true;
|
||||
}
|
||||
@@ -214,10 +217,11 @@ class User extends ApiObject {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function authorize($apiKey) {
|
||||
public function authorize($apiKey): bool {
|
||||
|
||||
if($this->loggedIn)
|
||||
if ($this->loggedIn) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$res = $this->sql->select("ApiKey.user_id as uid", "User.name", "User.email", "User.confirmed",
|
||||
"Language.uid as langId", "Language.code as langCode", "Language.name as langName")
|
||||
@@ -264,7 +268,7 @@ class User extends ApiObject {
|
||||
}
|
||||
}
|
||||
|
||||
private function isBot() {
|
||||
private function isBot(): bool {
|
||||
if (!isset($_SERVER["HTTP_USER_AGENT"]) || empty($_SERVER["HTTP_USER_AGENT"])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ abstract class AccountView extends View {
|
||||
}
|
||||
}
|
||||
|
||||
public function getCode() {
|
||||
public function getCode(): string {
|
||||
$html = parent::getCode();
|
||||
|
||||
$content = $this->getAccountContent();
|
||||
|
||||
@@ -11,7 +11,7 @@ class AdminDashboardBody extends Body {
|
||||
parent::__construct($document);
|
||||
}
|
||||
|
||||
public function getCode() {
|
||||
public function getCode(): string {
|
||||
$html = parent::getCode();
|
||||
$script = new Script(Script::MIME_TEXT_JAVASCRIPT, "/js/admin.min.js");
|
||||
$html .= "<body><div class=\"wrapper\" id=\"root\">$script</div></body>";
|
||||
|
||||
@@ -24,7 +24,7 @@ class LoginBody extends Body {
|
||||
$head->addCSS(Link::ACCOUNT);
|
||||
}
|
||||
|
||||
public function getCode() {
|
||||
public function getCode(): string {
|
||||
$html = parent::getCode();
|
||||
|
||||
$username = L("Username");
|
||||
|
||||
@@ -56,7 +56,7 @@ class LanguageFlags extends View {
|
||||
}
|
||||
}
|
||||
|
||||
public function getCode() {
|
||||
public function getCode(): string {
|
||||
return implode('', $this->languageFlags);
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ use Elements\View;
|
||||
|
||||
class View404 extends View {
|
||||
|
||||
public function getCode() {
|
||||
public function getCode(): string {
|
||||
return parent::getCode() . "<b>Not found</b>";
|
||||
}
|
||||
|
||||
|
||||
+38
-11
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
define("WEBBASE_VERSION", "1.1.0");
|
||||
define("WEBBASE_VERSION", "1.2.3");
|
||||
|
||||
function getProtocol() {
|
||||
function getProtocol(): string {
|
||||
return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https" : "http";
|
||||
}
|
||||
|
||||
@@ -26,17 +26,44 @@ function generateRandomString($length): string {
|
||||
return $randomString;
|
||||
}
|
||||
|
||||
function startsWith($haystack, $needle) {
|
||||
function startsWith($haystack, $needle, bool $ignoreCase = false): bool {
|
||||
|
||||
$length = strlen($needle);
|
||||
if ($length === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($ignoreCase) {
|
||||
$haystack = strtolower($haystack);
|
||||
$needle = strtolower($needle);
|
||||
}
|
||||
|
||||
// PHP 8.0 support
|
||||
if (function_exists("str_starts_with")) {
|
||||
return str_starts_with($haystack, $needle);
|
||||
} else {
|
||||
return (substr($haystack, 0, $length) === $needle);
|
||||
}
|
||||
}
|
||||
|
||||
function endsWith($haystack, $needle) {
|
||||
$length = strlen($needle);
|
||||
if ($length == 0)
|
||||
return true;
|
||||
function endsWith($haystack, $needle, bool $ignoreCase = false): bool {
|
||||
|
||||
$length = strlen($needle);
|
||||
if ($length === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($ignoreCase) {
|
||||
$haystack = strtolower($haystack);
|
||||
$needle = strtolower($needle);
|
||||
}
|
||||
|
||||
// PHP 8.0 support
|
||||
if (function_exists("str_ends_with")) {
|
||||
return str_ends_with($haystack, $needle);
|
||||
} else {
|
||||
return (substr($haystack, -$length) === $needle);
|
||||
}
|
||||
}
|
||||
|
||||
function intendCode($code, $escape = true) {
|
||||
@@ -83,7 +110,7 @@ function getClassPath($class, $suffix = true) {
|
||||
$path = str_replace('\\', '/', $class);
|
||||
$path = array_values(array_filter(explode("/", $path)));
|
||||
|
||||
if (strcasecmp($path[0], "api") === 0 && count($path) > 2 && strcasecmp($path[1], "Parameter") !== 0) {
|
||||
if (count($path) > 2 && strcasecmp($path[0], "api") === 0 && strcasecmp($path[1], "Parameter") !== 0) {
|
||||
$path = "Api/" . $path[1] . "API";
|
||||
} else {
|
||||
$path = implode("/", $path);
|
||||
@@ -97,7 +124,7 @@ function createError($msg) {
|
||||
return json_encode(array("success" => false, "msg" => $msg));
|
||||
}
|
||||
|
||||
function serveStatic(string $webRoot, string $file) {
|
||||
function serveStatic(string $webRoot, string $file): string {
|
||||
|
||||
$path = realpath($webRoot . "/" . $file);
|
||||
if (!startsWith($path, $webRoot . "/")) {
|
||||
@@ -112,8 +139,8 @@ function serveStatic(string $webRoot, string $file) {
|
||||
|
||||
$pathInfo = pathinfo($path);
|
||||
|
||||
// TODO: add more file extensions here
|
||||
$allowedExtension = array("html", "htm");
|
||||
// TODO: add more file extensions here, probably add them to settings?
|
||||
$allowedExtension = array("html", "htm", "pdf");
|
||||
$ext = $pathInfo["extension"] ?? "";
|
||||
if (!in_array($ext, $allowedExtension)) {
|
||||
http_response_code(406);
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
DENY FROM ALL
|
||||
Generated
+14322
-7591
File diff suppressed because it is too large.
Load diff
@@ -11,7 +11,7 @@
|
||||
"react-draft-wysiwyg": "^1.14.5",
|
||||
"react-dropzone": "^11.2.4",
|
||||
"react-router-dom": "^5.2.0",
|
||||
"react-scripts": "^3.4.4",
|
||||
"react-scripts": "^4.0.3",
|
||||
"react-tooltip": "^4.2.13"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -41,10 +41,11 @@ export function TokenList(props) {
|
||||
|
||||
function fetchTokens() {
|
||||
api.listTokens().then((res) => {
|
||||
if (res) {
|
||||
if (res.success) {
|
||||
setTokens(res.tokens);
|
||||
} else {
|
||||
pushAlert(res, "Error fetching tokens");
|
||||
setTokens([]);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -179,7 +180,7 @@ export function TokenList(props) {
|
||||
onChange={(e) => onPopupChange(e, "maxFiles")}/>
|
||||
</div>
|
||||
<div className={"form-group"}>
|
||||
<label>Max. Size per file in MB (0 = unlimited):</label>
|
||||
<label>Max. Size per file in MiB (0 = unlimited):</label>
|
||||
<input type={"number"} min={0} max={10} className={"form-control"}
|
||||
value={popup.maxSize} onChange={(e) => onPopupChange(e, "maxSize")}/>
|
||||
</div>
|
||||
@@ -256,7 +257,8 @@ export function TokenList(props) {
|
||||
});
|
||||
} else if (popup.tokenType === "upload") {
|
||||
let parentId = popup.directory === 0 ? null : popup.directory;
|
||||
api.createUploadToken(durability, parentId, popup.maxFiles, popup.maxSize, popup.extensions).then((res) => {
|
||||
let maxSize = Math.round(popup.maxSize * 1024 * 1024);
|
||||
api.createUploadToken(durability, parentId, popup.maxFiles, maxSize, popup.extensions).then((res) => {
|
||||
if (!res.success) {
|
||||
pushAlert(res, "Error creating token");
|
||||
} else {
|
||||
|
||||
@@ -141,12 +141,11 @@ if(isset($_GET["api"]) && is_string($_GET["api"])) {
|
||||
$response = serveStatic($currentDir, $target);
|
||||
break;
|
||||
case "dynamic":
|
||||
$view = parseClass($extra);
|
||||
$file = getClassPath($target);
|
||||
if(!file_exists($file) || !is_subclass_of($target, Document::class)) {
|
||||
$document = new Document404($user, $view);
|
||||
if (!file_exists($file) || !is_subclass_of($target, Document::class)) {
|
||||
$document = new Document404($user, $extra);
|
||||
} else {
|
||||
$document = new $target($user, $view);
|
||||
$document = new $target($user, $extra);
|
||||
}
|
||||
|
||||
$response = $document->getCode();
|
||||
|
||||
Vendored
+13
-13
@@ -1,23 +1,23 @@
|
||||
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1022)}([function(e,t,r){"use strict";e.exports=r(504)},function(e,t,r){e.exports=r(716)()},function(e,t,r){(function(e){e.exports=function(){"use strict";var t,n;function o(){return t.apply(null,arguments)}function a(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function i(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function c(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(s(e,t))return!1;return!0}function l(e){return void 0===e}function d(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function u(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function p(e,t){var r,n=[];for(r=0;r<e.length;++r)n.push(t(e[r],r));return n}function f(e,t){for(var r in t)s(t,r)&&(e[r]=t[r]);return s(t,"toString")&&(e.toString=t.toString),s(t,"valueOf")&&(e.valueOf=t.valueOf),e}function m(e,t,r,n){return St(e,t,r,n,!0).utc()}function h(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function g(e){if(null==e._isValid){var t=h(e),r=n.call(t.parsedDateParts,(function(e){return null!=e})),o=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&r);if(e._strict&&(o=o&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return o;e._isValid=o}return e._isValid}function b(e){var t=m(NaN);return null!=e?f(h(t),e):h(t).userInvalidated=!0,t}n=Array.prototype.some?Array.prototype.some:function(e){var t,r=Object(this),n=r.length>>>0;for(t=0;t<n;t++)if(t in r&&e.call(this,r[t],t,r))return!0;return!1};var v=o.momentProperties=[],y=!1;function _(e,t){var r,n,o;if(l(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),l(t._i)||(e._i=t._i),l(t._f)||(e._f=t._f),l(t._l)||(e._l=t._l),l(t._strict)||(e._strict=t._strict),l(t._tzm)||(e._tzm=t._tzm),l(t._isUTC)||(e._isUTC=t._isUTC),l(t._offset)||(e._offset=t._offset),l(t._pf)||(e._pf=h(t)),l(t._locale)||(e._locale=t._locale),v.length>0)for(r=0;r<v.length;r++)l(o=t[n=v[r]])||(e[n]=o);return e}function w(e){_(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===y&&(y=!0,o.updateOffset(this),y=!1)}function k(e){return e instanceof w||null!=e&&null!=e._isAMomentObject}function x(e){!1===o.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function M(e,t){var r=!0;return f((function(){if(null!=o.deprecationHandler&&o.deprecationHandler(null,e),r){var n,a,i,c=[];for(a=0;a<arguments.length;a++){if(n="","object"==typeof arguments[a]){for(i in n+="\n["+a+"] ",arguments[0])s(arguments[0],i)&&(n+=i+": "+arguments[0][i]+", ");n=n.slice(0,-2)}else n=arguments[a];c.push(n)}x(e+"\nArguments: "+Array.prototype.slice.call(c).join("")+"\n"+(new Error).stack),r=!1}return t.apply(this,arguments)}),t)}var S,E={};function L(e,t){null!=o.deprecationHandler&&o.deprecationHandler(e,t),E[e]||(x(t),E[e]=!0)}function D(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function C(e,t){var r,n=f({},e);for(r in t)s(t,r)&&(i(e[r])&&i(t[r])?(n[r]={},f(n[r],e[r]),f(n[r],t[r])):null!=t[r]?n[r]=t[r]:delete n[r]);for(r in e)s(e,r)&&!s(t,r)&&i(e[r])&&(n[r]=f({},n[r]));return n}function O(e){null!=e&&this.set(e)}function T(e,t,r){var n=""+Math.abs(e),o=t-n.length;return(e>=0?r?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+n}o.suppressDeprecationWarnings=!1,o.deprecationHandler=null,S=Object.keys?Object.keys:function(e){var t,r=[];for(t in e)s(e,t)&&r.push(t);return r};var j=/(\[[^\[]*\])|(\\)?([Line truncated
|
||||
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1022)}([function(e,t,r){"use strict";e.exports=r(505)},function(e,t,r){e.exports=r(716)()},function(e,t,r){(function(e){e.exports=function(){"use strict";var t,n;function o(){return t.apply(null,arguments)}function a(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function i(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function c(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(s(e,t))return!1;return!0}function l(e){return void 0===e}function d(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function u(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function p(e,t){var r,n=[];for(r=0;r<e.length;++r)n.push(t(e[r],r));return n}function f(e,t){for(var r in t)s(t,r)&&(e[r]=t[r]);return s(t,"toString")&&(e.toString=t.toString),s(t,"valueOf")&&(e.valueOf=t.valueOf),e}function m(e,t,r,n){return St(e,t,r,n,!0).utc()}function h(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function g(e){if(null==e._isValid){var t=h(e),r=n.call(t.parsedDateParts,(function(e){return null!=e})),o=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&r);if(e._strict&&(o=o&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return o;e._isValid=o}return e._isValid}function b(e){var t=m(NaN);return null!=e?f(h(t),e):h(t).userInvalidated=!0,t}n=Array.prototype.some?Array.prototype.some:function(e){var t,r=Object(this),n=r.length>>>0;for(t=0;t<n;t++)if(t in r&&e.call(this,r[t],t,r))return!0;return!1};var v=o.momentProperties=[],y=!1;function _(e,t){var r,n,o;if(l(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),l(t._i)||(e._i=t._i),l(t._f)||(e._f=t._f),l(t._l)||(e._l=t._l),l(t._strict)||(e._strict=t._strict),l(t._tzm)||(e._tzm=t._tzm),l(t._isUTC)||(e._isUTC=t._isUTC),l(t._offset)||(e._offset=t._offset),l(t._pf)||(e._pf=h(t)),l(t._locale)||(e._locale=t._locale),v.length>0)for(r=0;r<v.length;r++)l(o=t[n=v[r]])||(e[n]=o);return e}function w(e){_(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===y&&(y=!0,o.updateOffset(this),y=!1)}function k(e){return e instanceof w||null!=e&&null!=e._isAMomentObject}function x(e){!1===o.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function M(e,t){var r=!0;return f((function(){if(null!=o.deprecationHandler&&o.deprecationHandler(null,e),r){var n,a,i,c=[];for(a=0;a<arguments.length;a++){if(n="","object"==typeof arguments[a]){for(i in n+="\n["+a+"] ",arguments[0])s(arguments[0],i)&&(n+=i+": "+arguments[0][i]+", ");n=n.slice(0,-2)}else n=arguments[a];c.push(n)}x(e+"\nArguments: "+Array.prototype.slice.call(c).join("")+"\n"+(new Error).stack),r=!1}return t.apply(this,arguments)}),t)}var S,E={};function L(e,t){null!=o.deprecationHandler&&o.deprecationHandler(e,t),E[e]||(x(t),E[e]=!0)}function D(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function C(e,t){var r,n=f({},e);for(r in t)s(t,r)&&(i(e[r])&&i(t[r])?(n[r]={},f(n[r],e[r]),f(n[r],t[r])):null!=t[r]?n[r]=t[r]:delete n[r]);for(r in e)s(e,r)&&!s(t,r)&&i(e[r])&&(n[r]=f({},n[r]));return n}function O(e){null!=e&&this.set(e)}function T(e,t,r){var n=""+Math.abs(e),o=t-n.length;return(e>=0?r?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+n}o.suppressDeprecationWarnings=!1,o.deprecationHandler=null,S=Object.keys?Object.keys:function(e){var t,r=[];for(t in e)s(e,t)&&r.push(t);return r};var j=/(\[[^\[]*\])|(\\)?([Line truncated
|
||||
//! moment.js
|
||||
o.version="2.26.0",t=Et,o.fn=gr,o.min=function(){var e=[].slice.call(arguments,0);return Ct("isBefore",e)},o.max=function(){var e=[].slice.call(arguments,0);return Ct("isAfter",e)},o.now=function(){return Date.now?Date.now():+new Date},o.utc=m,o.unix=function(e){return Et(1e3*e)},o.months=function(e,t){return _r(e,t,"months")},o.isDate=u,o.locale=it,o.invalid=b,o.duration=Bt,o.isMoment=k,o.weekdays=function(e,t,r){return wr(e,t,r,"weekdays")},o.parseZone=function(){return Et.apply(null,arguments).parseZone()},o.localeData=ct,o.isDuration=jt,o.monthsShort=function(e,t){return _r(e,t,"monthsShort")},o.weekdaysMin=function(e,t,r){return wr(e,t,r,"weekdaysMin")},o.defineLocale=st,o.updateLocale=function(e,t){if(null!=t){var r,n,o=et;null!=tt[e]&&null!=tt[e].parentLocale?tt[e].set(C(tt[e]._config,t)):(null!=(n=at(e))&&(o=n._config),t=C(o,t),null==n&&(t.abbr=e),(r=new O(t)).parentLocale=tt[e],tt[e]=r),it(e)}else null!=tt[e]&&(null!=tt[e].parentLocale?(tt[e]=tt[e].parentLocale,e===it()&&it(e)):null!=tt[e]&&delete tt[e]);return tt[e]},o.locales=function(){return S(tt)},o.weekdaysShort=function(e,t,r){return wr(e,t,r,"weekdaysShort")},o.normalizeUnits=H,o.relativeTimeRounding=function(e){return void 0===e?qr:"function"==typeof e&&(qr=e,!0)},o.relativeTimeThreshold=function(e,t){return void 0!==Vr[e]&&(void 0===t?Vr[e]:(Vr[e]=t,"s"===e&&(Vr.ss=t-1),!0))},o.calendarFormat=function(e,t){var r=e.diff(t,"days",!0);return r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse"},o.prototype=gr,o.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},o}()}).call(this,r(199)(e))},function(e,t,r){"use strict";function n(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}r.d(t,"a",(function(){return n}))},function(e,t,r){var n=r(8),o=r(42),a=r(26),i=r(27),s=r(43),c=function(e,t,r){var l,d,u,p,f=e&c.F,m=e&c.G,h=e&c.S,g=e&c.P,b=e&c.B,v=m?n:h?n[t]||(n[t]={}):(n[t]||{}).prototype,y=m?o:o[t]||(o[t]={}),_=y.prototype||(y.prototype={});for(l in m&&(r=t),r)u=((d=!f&&v&&void 0!==v[l])?v:r)[l],p=b&&d?s(u,n):g&&"function"==typeof u?s(Function.call,u):u,v&&i(v,l,u,e&c.U),y[l]!=u&&a(y,l,p),g&&_[l]!=u&&(_[l]=u)};n.core=o,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return o}));var n=r(3);function o(e){Object(n.a)(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}},function(e,t,r){"use strict";function n(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}r.d(t,"a",(function(){return n}))},function(e,t,r){var n=r(13);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var r=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(e,t,r){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function r(e){return i(e)?e:B(e)}function n(e){return s(e)?e:U(e)}function o(e){return c(e)?e:W(e)}function a(e){return i(e)&&!l(e)?e:q(e)}function i(e){return!(!e||!e[u])}function s(e){return!(!e||!e[p])}function c(e){return!(!e||!e[f])}function l(e){return s(e)||c(e)}function d(e){return!(!e||!e[m])}t(n,r),t(o,r),t(a,r),r.isIterable=i,r.isKeyed=s,r.isIndexed=c,r.isAssociative=l,r.isOrdered=d,r.Keyed=n,r.Indexed=o,r.Set=a;var u="@@__IMMUTABLE_ITERABLE__@@",p="@@__IMMUTABLE_KEYED__@@",f="@@__IMMUTABLE_INDEXED__@@",m="@@__IMMUTABLE_ORDERED__@@",h={},g={value:!1},b={value:!1};function v(e){return e.value=!1,e}function y(e){e&&(e.value=!0)}function _(){}function w(e,t){t=t||0;for(var r=Math.max(0,e.length-t),n=new Array(r),o=0;o<r;o++)n[o]=e[o+t];return n}function k(e){return void 0===e.size&&(e.size=e.__iterate(M)),e.size}function x(e,t){if("number"!=typeof t){var r=t>>>0;if(""+r!==t||4294967295===r)return NaN;t=r}return t<0?k(e)+t:t}function M(){return!0}function S(e,t,r){return(0===e||void 0!==r&&e<=-r)&&(void 0===t||void 0!==r&&t>=r)}function E(e,t){return D(e,t,0)}function L(e,t){return D(e,t,t)}function D(e,t,r){return void 0===e?r:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var C,O,T,j="function"==typeof Symbol&&Symbol.iterator,A=j||"@@iterator";function
Line truncated
|
||||
o.version="2.26.0",t=Et,o.fn=gr,o.min=function(){var e=[].slice.call(arguments,0);return Ct("isBefore",e)},o.max=function(){var e=[].slice.call(arguments,0);return Ct("isAfter",e)},o.now=function(){return Date.now?Date.now():+new Date},o.utc=m,o.unix=function(e){return Et(1e3*e)},o.months=function(e,t){return _r(e,t,"months")},o.isDate=u,o.locale=it,o.invalid=b,o.duration=Bt,o.isMoment=k,o.weekdays=function(e,t,r){return wr(e,t,r,"weekdays")},o.parseZone=function(){return Et.apply(null,arguments).parseZone()},o.localeData=ct,o.isDuration=jt,o.monthsShort=function(e,t){return _r(e,t,"monthsShort")},o.weekdaysMin=function(e,t,r){return wr(e,t,r,"weekdaysMin")},o.defineLocale=st,o.updateLocale=function(e,t){if(null!=t){var r,n,o=et;null!=tt[e]&&null!=tt[e].parentLocale?tt[e].set(C(tt[e]._config,t)):(null!=(n=at(e))&&(o=n._config),t=C(o,t),null==n&&(t.abbr=e),(r=new O(t)).parentLocale=tt[e],tt[e]=r),it(e)}else null!=tt[e]&&(null!=tt[e].parentLocale?(tt[e]=tt[e].parentLocale,e===it()&&it(e)):null!=tt[e]&&delete tt[e]);return tt[e]},o.locales=function(){return S(tt)},o.weekdaysShort=function(e,t,r){return wr(e,t,r,"weekdaysShort")},o.normalizeUnits=H,o.relativeTimeRounding=function(e){return void 0===e?qr:"function"==typeof e&&(qr=e,!0)},o.relativeTimeThreshold=function(e,t){return void 0!==Vr[e]&&(void 0===t?Vr[e]:(Vr[e]=t,"s"===e&&(Vr.ss=t-1),!0))},o.calendarFormat=function(e,t){var r=e.diff(t,"days",!0);return r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse"},o.prototype=gr,o.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},o}()}).call(this,r(199)(e))},function(e,t,r){"use strict";function n(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}r.d(t,"a",(function(){return n}))},function(e,t,r){var n=r(8),o=r(43),a=r(27),i=r(28),s=r(44),c=function(e,t,r){var l,d,u,p,f=e&c.F,m=e&c.G,h=e&c.S,g=e&c.P,b=e&c.B,v=m?n:h?n[t]||(n[t]={}):(n[t]||{}).prototype,y=m?o:o[t]||(o[t]={}),_=y.prototype||(y.prototype={});for(l in m&&(r=t),r)u=((d=!f&&v&&void 0!==v[l])?v:r)[l],p=b&&d?s(u,n):g&&"function"==typeof u?s(Function.call,u):u,v&&i(v,l,u,e&c.U),y[l]!=u&&a(y,l,p),g&&_[l]!=u&&(_[l]=u)};n.core=o,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return o}));var n=r(3);function o(e){Object(n.a)(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}},function(e,t,r){"use strict";function n(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}r.d(t,"a",(function(){return n}))},function(e,t,r){var n=r(13);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var r=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(e,t,r){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function r(e){return i(e)?e:B(e)}function n(e){return s(e)?e:U(e)}function o(e){return c(e)?e:W(e)}function a(e){return i(e)&&!l(e)?e:q(e)}function i(e){return!(!e||!e[u])}function s(e){return!(!e||!e[p])}function c(e){return!(!e||!e[f])}function l(e){return s(e)||c(e)}function d(e){return!(!e||!e[m])}t(n,r),t(o,r),t(a,r),r.isIterable=i,r.isKeyed=s,r.isIndexed=c,r.isAssociative=l,r.isOrdered=d,r.Keyed=n,r.Indexed=o,r.Set=a;var u="@@__IMMUTABLE_ITERABLE__@@",p="@@__IMMUTABLE_KEYED__@@",f="@@__IMMUTABLE_INDEXED__@@",m="@@__IMMUTABLE_ORDERED__@@",h={},g={value:!1},b={value:!1};function v(e){return e.value=!1,e}function y(e){e&&(e.value=!0)}function _(){}function w(e,t){t=t||0;for(var r=Math.max(0,e.length-t),n=new Array(r),o=0;o<r;o++)n[o]=e[o+t];return n}function k(e){return void 0===e.size&&(e.size=e.__iterate(M)),e.size}function x(e,t){if("number"!=typeof t){var r=t>>>0;if(""+r!==t||4294967295===r)return NaN;t=r}return t<0?k(e)+t:t}function M(){return!0}function S(e,t,r){return(0===e||void 0!==r&&e<=-r)&&(void 0===t||void 0!==r&&t>=r)}function E(e,t){return D(e,t,0)}function L(e,t){return D(e,t,t)}function D(e,t,r){return void 0===e?r:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var C,O,T,j="function"==typeof Symbol&&Symbol.iterator,A=j||"@@iterator";function
Line truncated
|
||||
/*
|
||||
object-assign
|
||||
(c) Sindre Sorhus
|
||||
@license MIT
|
||||
*/var n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,s,c=i(e),l=1;l<arguments.length;l++){for(var d in r=Object(arguments[l]))o.call(r,d)&&(c[d]=r[d]);if(n){s=n(r);for(var u=0;u<s.length;u++)a.call(r,s[u])&&(c[s[u]]=r[s[u]])}}return c}},function(e,t){var r=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=r)},function(e,t,r){var n=r(22);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,o){return e.call(t,r,n,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t){var r=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t,r){"use strict";var n=r(10);e.exports=function(e,t){return!!e&&n((function(){t?e.call(null,(function(){}),1):e.call(null)}))}},function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return i}));var n=r(5),o=r(6),a=r(3);function i(e,t){Object(a.a)(1,arguments);var r=t||{},i=r.locale,s=i&&i.options&&i.options.weekStartsOn,c=null==s?0:Object(o.a)(s),l=null==r.weekStartsOn?c:Object(o.a)(r.weekStartsOn);if(!(l>=0&&l<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=Object(n.default)(e),u=d.getDay(),p=(u<l?7:0)+u-l;return d.setDate(d.getDate()-p),d.setHours(0,0,0,0),d}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(6),o=r(5),a=r(3);function i(e,t){Object(a.a)(1,arguments);var r=t||{},i=r.locale,s=i&&i.options&&i.options.weekStartsOn,c=null==s?0:Object(n.a)(s),l=null==r.weekStartsOn?c:Object(n.a)(r.weekStartsOn);if(!(l>=0&&l<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=Object(o.default)(e),u=d.getUTCDay(),p=(u<l?7:0)+u-l;return d.setUTCDate(d.getUTCDate()-p),d.setUTCHours(0,0,0,0),d}},function(e,t,r){var n=r(13);e.exports=function(e,t){if(!n(e))return e;var r,o;if(t&&"function"==typeof(r=e.toString)&&!n(o=r.call(e)))return o;if("function"==typeof(r=e.valueOf)&&!n(o=r.call(e)))return o;if(!t&&"function"==typeof(r=e.toString)&&!n(o=r.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,r){var n=r(4),o=r(42),a=r(10);e.exports=function(e,t){var r=(o.Object||{})[e]||Object[e],i={};i[e]=t(r),n(n.S+n.F*a((function(){r(1)})),"Object",i)}},function(e,t,r){var n=r(43),o=r(111),a=r(21),i=r(16),s=r(190);e.exports=function(e,t){var r=1==e,c=2==e,l=3==e,d=4==e,u=6==e,p=5==e||u,f=t||s;return function(t,s,m){for(var h,g,b=a(t),v=o(b),y=n(s,m,3),_=i(v.length),w=0,k=r?f(t,_):c?f(t,0):void 0;_>w;w++)if((p||w in v)&&(g=y(h=v[w],w,b),e))if(r)k[w]=g;else if(g)switch(e){case 3:return!0;case 5:return h;case 6:return w;case 2:k.push(h)}else if(d)return!1;return u?-1:l||d?d:k}}},function(e,t,r){"use strict";var n={},o=Math.pow(2,24);e.exports=function(){for(var e;void 0===e||n.hasOwnProperty(e)||!isNaN(+e);)e=Math.floor(Math.random()*o).toString(32);return n[e]=!0,e}},function(e,t,r){"use strict";t.__esModule=!0;var n,o=r(816),a=(n=o)&&n.__esModule?n:{default:n};t.default=a.default||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));function n(e){return e.getTime()%6e4}function o(e){var t=new Date(e.getTime()),r=Math.ceil(t.getTimezoneOffset());return t.setSeconds(0,0),6e4*r+(r>0?(6e4+n(t))%6e4:n(t))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(5),o=r(3);function a(e){Object(o.a)(1,arguments);var t=1,r=Object(n.default)(e),a=r.getUTCDay(),i=(a<t?7:0)+a-t;return r.setUTCDate(r.getUTCDate()-i),r.setUTCHours(0,0,0,0),r}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return i})),r.d(t,"c",(function(){return s}));var n=["D","DD"],o=["YY","YYYY"];function a(e){return-1!==n.indexOf(e)}function i(e){return-1!==o.indexOf(e)}function s(e){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` for formatting years; see: https://git.io/fxCyr");if("YY"===e)throw new RangeError("Use `yy` instead of `YY` for formatting years;Line truncated
|
||||
*/var n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,s,c=i(e),l=1;l<arguments.length;l++){for(var d in r=Object(arguments[l]))o.call(r,d)&&(c[d]=r[d]);if(n){s=n(r);for(var u=0;u<s.length;u++)a.call(r,s[u])&&(c[s[u]]=r[s[u]])}}return c}},function(e,t){var r=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=r)},function(e,t,r){var n=r(22);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,o){return e.call(t,r,n,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t){var r=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t,r){"use strict";var n=r(10);e.exports=function(e,t){return!!e&&n((function(){t?e.call(null,(function(){}),1):e.call(null)}))}},function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return i}));var n=r(5),o=r(6),a=r(3);function i(e,t){Object(a.a)(1,arguments);var r=t||{},i=r.locale,s=i&&i.options&&i.options.weekStartsOn,c=null==s?0:Object(o.a)(s),l=null==r.weekStartsOn?c:Object(o.a)(r.weekStartsOn);if(!(l>=0&&l<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=Object(n.default)(e),u=d.getDay(),p=(u<l?7:0)+u-l;return d.setDate(d.getDate()-p),d.setHours(0,0,0,0),d}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(6),o=r(5),a=r(3);function i(e,t){Object(a.a)(1,arguments);var r=t||{},i=r.locale,s=i&&i.options&&i.options.weekStartsOn,c=null==s?0:Object(n.a)(s),l=null==r.weekStartsOn?c:Object(n.a)(r.weekStartsOn);if(!(l>=0&&l<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=Object(o.default)(e),u=d.getUTCDay(),p=(u<l?7:0)+u-l;return d.setUTCDate(d.getUTCDate()-p),d.setUTCHours(0,0,0,0),d}},function(e,t,r){var n=r(13);e.exports=function(e,t){if(!n(e))return e;var r,o;if(t&&"function"==typeof(r=e.toString)&&!n(o=r.call(e)))return o;if("function"==typeof(r=e.valueOf)&&!n(o=r.call(e)))return o;if(!t&&"function"==typeof(r=e.toString)&&!n(o=r.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,r){var n=r(4),o=r(43),a=r(10);e.exports=function(e,t){var r=(o.Object||{})[e]||Object[e],i={};i[e]=t(r),n(n.S+n.F*a((function(){r(1)})),"Object",i)}},function(e,t,r){var n=r(44),o=r(111),a=r(21),i=r(16),s=r(190);e.exports=function(e,t){var r=1==e,c=2==e,l=3==e,d=4==e,u=6==e,p=5==e||u,f=t||s;return function(t,s,m){for(var h,g,b=a(t),v=o(b),y=n(s,m,3),_=i(v.length),w=0,k=r?f(t,_):c?f(t,0):void 0;_>w;w++)if((p||w in v)&&(g=y(h=v[w],w,b),e))if(r)k[w]=g;else if(g)switch(e){case 3:return!0;case 5:return h;case 6:return w;case 2:k.push(h)}else if(d)return!1;return u?-1:l||d?d:k}}},function(e,t,r){"use strict";var n={},o=Math.pow(2,24);e.exports=function(){for(var e;void 0===e||n.hasOwnProperty(e)||!isNaN(+e);)e=Math.floor(Math.random()*o).toString(32);return n[e]=!0,e}},function(e,t,r){"use strict";t.__esModule=!0;var n,o=r(816),a=(n=o)&&n.__esModule?n:{default:n};t.default=a.default||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));function n(e){return e.getTime()%6e4}function o(e){var t=new Date(e.getTime()),r=Math.ceil(t.getTimezoneOffset());return t.setSeconds(0,0),6e4*r+(r>0?(6e4+n(t))%6e4:n(t))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(5),o=r(3);function a(e){Object(o.a)(1,arguments);var t=1,r=Object(n.default)(e),a=r.getUTCDay(),i=(a<t?7:0)+a-t;return r.setUTCDate(r.getUTCDate()-i),r.setUTCHours(0,0,0,0),r}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return i})),r.d(t,"c",(function(){return s}));var n=["D","DD"],o=["YY","YYYY"];function a(e){return-1!==n.indexOf(e)}function i(e){return-1!==o.indexOf(e)}function s(e){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` for formatting years; see: https://git.io/fxCyr");if("YY"===e)throw new RangeError("Use `yy` instead of `YY` for formatting years;Line truncated
|
||||
/*!
|
||||
* Chart.js v2.9.3
|
||||
* https://www.chartjs.org
|
||||
* (c) 2019 Chart.js Contributors
|
||||
* Released under the MIT License
|
||||
*/
|
||||
e.exports=function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var t={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},r=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[t[n]]=n);var o=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var a in o)if(o.hasOwnProperty(a)){if(!("channels"in o[a]))throw new Error("missing channels property: "+a);if(!("labels"in o[a]))throw new Error("missing channel labels property: "+a);if(o[a].labels.length!==o[a].channels)throw new Error("channel and label counts mismatch: "+a);var i=o[a].channels,s=o[a].labels;delete o[a].channels,delete o[a].labels,Object.defineProperty(o[a],"channels",{value:i}),Object.defineProperty(o[a],"labels",{value:s})}o.rgb.hsl=function(e){var t,r,n=e[0]/255,o=e[1]/255,a=e[2]/255,i=Math.min(n,o,a),s=Math.max(n,o,a),c=s-i;return s===i?t=0:n===s?t=(o-a)/c:o===s?t=2+(a-n)/c:a===s&&(t=4+(n-o)/c),(t=Math.min(60*t,360))<0&&(t+=360),r=(i+s)/2,[t,100*(s===i?0:r<=.5?c/(s+i):c/(2-s-i)),100*r]},o.rgb.hsv=function(e){var t,r,n,o,a,i=e[0]/255,s=e[1]/255,c=e[2]/255,l=Math.max(i,s,c),d=l-Math.min(i,s,c),u=function(e){return(l-e)Line truncated
|
||||
e.exports=function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var t={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},r=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[t[n]]=n);var o=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var a in o)if(o.hasOwnProperty(a)){if(!("channels"in o[a]))throw new Error("missing channels property: "+a);if(!("labels"in o[a]))throw new Error("missing channel labels property: "+a);if(o[a].labels.length!==o[a].channels)throw new Error("channel and label counts mismatch: "+a);var i=o[a].channels,s=o[a].labels;delete o[a].channels,delete o[a].labels,Object.defineProperty(o[a],"channels",{value:i}),Object.defineProperty(o[a],"labels",{value:s})}o.rgb.hsl=function(e){var t,r,n=e[0]/255,o=e[1]/255,a=e[2]/255,i=Math.min(n,o,a),s=Math.max(n,o,a),c=s-i;return s===i?t=0:n===s?t=(o-a)/c:o===s?t=2+(a-n)/c:a===s&&(t=4+(n-o)/c),(t=Math.min(60*t,360))<0&&(t+=360),r=(i+s)/2,[t,100*(s===i?0:r<=.5?c/(s+i):c/(2-s-i)),100*r]},o.rgb.hsv=function(e){var t,r,n,o,a,i=e[0]/255,s=e[1]/255,c=e[2]/255,l=Math.max(i,s,c),d=l-Math.min(i,s,c),u=function(e){return(l-e)Line truncated
|
||||
/*!
|
||||
Copyright (c) 2017 Jed Watson.
|
||||
Licensed under the MIT License (MIT), see
|
||||
http://jedwatson.github.io/classnames
|
||||
*/!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)&&n.length){var i=o.apply(null,n);i&&e.push(i)}else if("object"===a)for(var s in n)r.call(n,s)&&n[s]&&e.push(s)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},function(e,t,r){"use strict";function n(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){o(e,t,r[t])}))}return e}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=r(120),i=r(36),s=r(85),c=r(37),l=r(153),d=r(154),u=r(53),p=r(447),f=r(69),m=r(9),h=r(449),g=m.List,b=m.Record,v=m.Repeat,y=m.Map,_=m.OrderedMap,w=b({entityMap:null,blockMap:null,selectionBefore:null,selectionAfter:null}),k=f("draft_tree_data_support")?c:s,x=function(e){var t,r;function o(){return e.apply(this,arguments)||this}r=e,(t=o).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var s=o.prototype;return s.getEntityMap=function(){return l},s.getBlockMap=function(){return this.get("blockMap")},s.getSelectionBefore=function(){return this.get("selectionBefore")},s.getSelectionAfter=function(){return this.get("selectionAfter")},s.getBlockForKey=function(e){return this.getBlockMap().get(e)},s.getKeyBefore=function(e){return this.getBlockMap().reverse().keySeq().skipUntil((function(t){return t===e})).skip(1).first()},s.getKeyAfter=function(e){return this.getBlockMap().keySeq().skipUntil((function(t){return t===e})).skip(1).first()},s.getBlockAfter=function(e){return this.getBlockMap().skipUntil((function(t,r){return r===e})).skip(1).first()},s.getBlockBefore=function(e){return this.getBlockMap().reverse().skipUntil((function(t,r){return r===e})).skip(1).first()},s.getBlocksAsArray=function(){return this.getBlockMap().toArray()},s.getFirstBlock=function(){return this.getBlockMap().first()},s.getLastBlock=function(){return this.getBlockMap().last()},s.getPlainText=function(e){return this.getBlockMap().map((function(e){return e?e.getText():""})).join(e||"\n")},s.getLastCreatedEntityKey=function(){return l.__getLastCreatedEntityKey()},s.hasText=function(){var e=this.getBlockMap();return e.size>1||escape(e.first().getText()).replace(/%u200B/g,"").length>0},s.createEntity=function(e,t,r){return l.__create(e,t,r),this},s.mergeEntityData=function(e,t){return l.__mergeData(e,t),this},s.replaceEntityData=function(e,t){return l.__replaceData(e,t),this},s.addEntity=function(e){return l.__add(e),this},s.getEntity=function(e){return l.__get(e)},s.getAllEntities=function(){return l.__getAll()},s.loadWithEntities=function(e){return l.__loadWithEntities(e)},o.createFromBlockArray=function(e,t){var r=Array.isArray(e)?e:e.contentBlocks,n=a.createFromArray(r),i=n.isEmpty()?new d:d.createEmpty(n.first().getKey());return new o({blockMap:n,entityMap:t||l,selectionBefore:i,selectionAfter:i})},o.createFromText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/\r\n?|\n/g,r=e.split(t),n=r.map((function(e){return e=h(e),new k({key:u(),text:e,type:"unstyled",characterList:g(v(i.EMPTY,e.length))})}));return o.createFromBlockArray(n)},o.fromJS=function(e){return new o(n({},e,{blockMap:_(e.blockMap).map(o.createContentBlockFromJS),selectionBefore:new d(e.selectionBefore),selectionAfter:new d(e.selectionAfter)}))},o.createContentBlockFromJS=function(e){var t=e.characterList;return new k(n({},e,{data:y(e.data),characterList:null!=t?g((Array.isArray(t)?t:p(t)).map((function(e){return i.fromJS(e)}))):void 0}))},o}(w);e.exports=x},function(e,t,r){"use strict";var n=r(155),o=r(11),a="־׀׃׆-א-ת-ׯװ-ײ׳-״-߀-߉ߊ-ߪߴ-ߵߺ-߿ࠀ-ࠕࠚࠤࠨ-࠰-࠾ࡀ-ࡘ-࡞-࢟יִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﭏ",i="؈؋؍؛؝؞-؟ؠ-ؿـف-ي٭ٮ-ٯٱ-ۓ۔ەۥ-ۦۮ-ۯۺ-ۼ۽-۾ۿ܀-܍ܐܒ-ܯ-ݍ-ޥޱ-ࢠ-ࢲࢳ-ࣣﭐ-ﮱ﮲-﯁﯂-ﯓ-ﴽ﵀-﵏ﵐ-ﶏ-ﶒ-ﷇ-﷏ﷰ-ﷻ﷼﷾-﷿ﹰ-ﹴﹶ-ﻼ-",s=new RegExp("["+"A-Za-zªµºÀ-ÖØ-öø-ƺƻƼ-ƿǀ-ǃDŽ-ʓʔʕ-ʯʰ-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͷͺͻ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҂Ҋ-ԯԱ-Ֆՙ՚-՟ա-և։ःऄ-हऻऽा-ीॉ-ौॎ-ॏॐक़-ॡ।-॥०-९॰ॱॲ-ঀং-ঃঅ-ঌএ-ঐও-নপ-রলশ-হঽা-ীে-ৈো-ৌৎৗড়-ঢ়য়-ৡ০-৯ৰ-ৱ৴-৹৺ਃਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਾ-ੀਖ਼-ੜਫ਼੦-੯ੲ-ੴઃઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽા-ીૉો-ૌૐૠ-ૡ૦-૯૰ଂ-ଃଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽାୀେ-ୈୋ-ୌୗଡ଼-ଢ଼ୟ-ୡ୦-୯Line truncated
|
||||
*/!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)&&n.length){var i=o.apply(null,n);i&&e.push(i)}else if("object"===a)for(var s in n)r.call(n,s)&&n[s]&&e.push(s)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},function(e,t,r){"use strict";function n(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){o(e,t,r[t])}))}return e}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=r(120),i=r(36),s=r(86),c=r(37),l=r(153),d=r(154),u=r(54),p=r(449),f=r(70),m=r(9),h=r(451),g=m.List,b=m.Record,v=m.Repeat,y=m.Map,_=m.OrderedMap,w=b({entityMap:null,blockMap:null,selectionBefore:null,selectionAfter:null}),k=f("draft_tree_data_support")?c:s,x=function(e){var t,r;function o(){return e.apply(this,arguments)||this}r=e,(t=o).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var s=o.prototype;return s.getEntityMap=function(){return l},s.getBlockMap=function(){return this.get("blockMap")},s.getSelectionBefore=function(){return this.get("selectionBefore")},s.getSelectionAfter=function(){return this.get("selectionAfter")},s.getBlockForKey=function(e){return this.getBlockMap().get(e)},s.getKeyBefore=function(e){return this.getBlockMap().reverse().keySeq().skipUntil((function(t){return t===e})).skip(1).first()},s.getKeyAfter=function(e){return this.getBlockMap().keySeq().skipUntil((function(t){return t===e})).skip(1).first()},s.getBlockAfter=function(e){return this.getBlockMap().skipUntil((function(t,r){return r===e})).skip(1).first()},s.getBlockBefore=function(e){return this.getBlockMap().reverse().skipUntil((function(t,r){return r===e})).skip(1).first()},s.getBlocksAsArray=function(){return this.getBlockMap().toArray()},s.getFirstBlock=function(){return this.getBlockMap().first()},s.getLastBlock=function(){return this.getBlockMap().last()},s.getPlainText=function(e){return this.getBlockMap().map((function(e){return e?e.getText():""})).join(e||"\n")},s.getLastCreatedEntityKey=function(){return l.__getLastCreatedEntityKey()},s.hasText=function(){var e=this.getBlockMap();return e.size>1||escape(e.first().getText()).replace(/%u200B/g,"").length>0},s.createEntity=function(e,t,r){return l.__create(e,t,r),this},s.mergeEntityData=function(e,t){return l.__mergeData(e,t),this},s.replaceEntityData=function(e,t){return l.__replaceData(e,t),this},s.addEntity=function(e){return l.__add(e),this},s.getEntity=function(e){return l.__get(e)},s.getAllEntities=function(){return l.__getAll()},s.loadWithEntities=function(e){return l.__loadWithEntities(e)},o.createFromBlockArray=function(e,t){var r=Array.isArray(e)?e:e.contentBlocks,n=a.createFromArray(r),i=n.isEmpty()?new d:d.createEmpty(n.first().getKey());return new o({blockMap:n,entityMap:t||l,selectionBefore:i,selectionAfter:i})},o.createFromText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/\r\n?|\n/g,r=e.split(t),n=r.map((function(e){return e=h(e),new k({key:u(),text:e,type:"unstyled",characterList:g(v(i.EMPTY,e.length))})}));return o.createFromBlockArray(n)},o.fromJS=function(e){return new o(n({},e,{blockMap:_(e.blockMap).map(o.createContentBlockFromJS),selectionBefore:new d(e.selectionBefore),selectionAfter:new d(e.selectionAfter)}))},o.createContentBlockFromJS=function(e){var t=e.characterList;return new k(n({},e,{data:y(e.data),characterList:null!=t?g((Array.isArray(t)?t:p(t)).map((function(e){return i.fromJS(e)}))):void 0}))},o}(w);e.exports=x},function(e,t,r){"use strict";var n=r(155),o=r(11),a="־׀׃׆-א-ת-ׯװ-ײ׳-״-߀-߉ߊ-ߪߴ-ߵߺ-߿ࠀ-ࠕࠚࠤࠨ-࠰-࠾ࡀ-ࡘ-࡞-࢟יִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﭏ",i="؈؋؍؛؝؞-؟ؠ-ؿـف-ي٭ٮ-ٯٱ-ۓ۔ەۥ-ۦۮ-ۯۺ-ۼ۽-۾ۿ܀-܍ܐܒ-ܯ-ݍ-ޥޱ-ࢠ-ࢲࢳ-ࣣﭐ-ﮱ﮲-﯁﯂-ﯓ-ﴽ﵀-﵏ﵐ-ﶏ-ﶒ-ﷇ-﷏ﷰ-ﷻ﷼﷾-﷿ﹰ-ﹴﹶ-ﻼ-",s=new RegExp("["+"A-Za-zªµºÀ-ÖØ-öø-ƺƻƼ-ƿǀ-ǃDŽ-ʓʔʕ-ʯʰ-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͷͺͻ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҂Ҋ-ԯԱ-Ֆՙ՚-՟ա-և։ःऄ-हऻऽा-ीॉ-ौॎ-ॏॐक़-ॡ।-॥०-९॰ॱॲ-ঀং-ঃঅ-ঌএ-ঐও-নপ-রলশ-হঽা-ীে-ৈো-ৌৎৗড়-ঢ়য়-ৡ০-৯ৰ-ৱ৴-৹৺ਃਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਾ-ੀਖ਼-ੜਫ਼੦-੯ੲ-ੴઃઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽા-ીૉો-ૌૐૠ-ૡ૦-૯૰ଂ-ଃଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽାୀେ-ୈୋ-ୌୗଡ଼-ଢ଼ୟ-ୡ୦-୯Line truncated
|
||||
/**!
|
||||
* @fileOverview Kickass library to create and place poppers near their reference elements.
|
||||
* @version 1.16.1
|
||||
@@ -42,7 +42,7 @@ e.exports=function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
var r="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof navigator,n=function(){for(var e=["Edge","Trident","Firefox"],t=0;t<e.length;t+=1)if(r&&navigator.userAgent.indexOf(e[t])>=0)return 1;return 0}();var o=r&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),n))}};function a(e){return e&&"[object Function]"==={}.toString.call(e)}function i(e,t){if(1!==e.nodeType)return[];var r=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?r[t]:r}function s(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function c(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=i(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/(auto|scroll|overlay)/.test(r+o+n)?e:c(s(e))}function l(e){return e&&e.referenceNode?e.referenceNode:e}var d=r&&!(!window.MSInputMethodContext||!document.documentMode),u=r&&/MSIE 10/.test(navigator.userAgent);function p(e){return 11===e?d:10===e?u:d||u}function f(e){if(!e)return document.documentElement;for(var t=p(10)?document.body:null,r=e.offsetParent||null;r===t&&e.nextElementSibling;)r=(e=e.nextElementSibling).offsetParent;var n=r&&r.nodeName;return n&&"BODY"!==n&&"HTML"!==n?-1!==["TH","TD","TABLE"].indexOf(r.nodeName)&&"static"===i(r,"position")?f(r):r:e?e.ownerDocument.documentElement:document.documentElement}function m(e){return null!==e.parentNode?m(e.parentNode):e}function h(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var r=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,n=r?e:t,o=r?t:e,a=document.createRange();a.setStart(n,0),a.setEnd(o,0);var i,s,c=a.commonAncestorContainer;if(e!==c&&t!==c||n.contains(o))return"BODY"===(s=(i=c).nodeName)||"HTML"!==s&&f(i.firstElementChild)!==i?f(c):c;var l=m(e);return l.host?h(l.host,t):h(e,m(t).host)}function g(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",r="top"===t?"scrollTop":"scrollLeft",n=e.nodeName;if("BODY"===n||"HTML"===n){var o=e.ownerDocument.documentElement,a=e.ownerDocument.scrollingElement||o;return a[r]}return e[r]}function b(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=g(t,"top"),o=g(t,"left"),a=r?-1:1;return e.top+=n*a,e.bottom+=n*a,e.left+=o*a,e.right+=o*a,e}function v(e,t){var r="x"===t?"Left":"Top",n="Left"===r?"Right":"Bottom";return parseFloat(e["border"+r+"Width"])+parseFloat(e["border"+n+"Width"])}function y(e,t,r,n){return Math.max(t["offset"+e],t["scroll"+e],r["client"+e],r["offset"+e],r["scroll"+e],p(10)?parseInt(r["offset"+e])+parseInt(n["margin"+("Height"===e?"Top":"Left")])+parseInt(n["margin"+("Height"===e?"Bottom":"Right")]):0)}function _(e){var t=e.body,r=e.documentElement,n=p(10)&&getComputedStyle(r);return{height:y("Height",t,r,n),width:y("Width",t,r,n)}}var w=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},k=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),x=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},M=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};function S(e){return M({},e,{right:e.left+e.width,bottom:e.top+e.height})}function E(e){var t={};try{if(p(10)){t=e.getBoundingClientRect();var r=g(e,"top"),n=g(e,"left");t.top+=r,t.left+=n,t.bottom+=r,t.right+=n}else t=e.getBoundingClientRect()}catch(e){}var o={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},a="HTML"===e.nodeName?_(e.ownerDocument):{},s=a.width||e.clientWidth||o.width,c=a.height||e.clientHeight||o.height,l=e.offsetWidth-s,d=e.offsetHeight-c;if(l||d){var u=i(e);l-=v(u,"x"),d-=v(u,"y"),o.width-=l,o.height-=d}return S(o)}function L(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=p(10),o="HTML"===t.nodeName,a=E(e),s=E(t),l=c(e),d=i(t),u=parseFloat(d.borderTopWidth),f=parseFloat(d.borderLeftWidth);r&&o&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var m=S({top:a.top-s.top-u,left:a.left-s.left-f,width:a.width,height:a.height});if(m.marginTop=0,m.marginLeft=0,!n&&o){var h=parseFloat(d.marginTop),g=parseFloat(d.marginLeft);m.top-=u-h,m.bottom-=u-h,m.left-=f-g,m.right-=f-g,m.marginTop=h,m.marginLeft=g}return(n&&!r?t.contains(l):t===l&&"BODY"!==l.nodeName)&&(m=b(m,t)),m}function D(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.ownerDocument.documentElement,n=L(e,r),o=Math.max(r.clientWidth,window.innerWidth||0),a=Math.max(r.clientHeight,window.innerHeight||0),i=t?0:g(r),s=t?0:g(r,"left"),c={top:i-n.top+n.marginTop,left:s-Line truncated
|
||||
var r="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof navigator,n=function(){for(var e=["Edge","Trident","Firefox"],t=0;t<e.length;t+=1)if(r&&navigator.userAgent.indexOf(e[t])>=0)return 1;return 0}();var o=r&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),n))}};function a(e){return e&&"[object Function]"==={}.toString.call(e)}function i(e,t){if(1!==e.nodeType)return[];var r=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?r[t]:r}function s(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function c(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=i(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/(auto|scroll|overlay)/.test(r+o+n)?e:c(s(e))}function l(e){return e&&e.referenceNode?e.referenceNode:e}var d=r&&!(!window.MSInputMethodContext||!document.documentMode),u=r&&/MSIE 10/.test(navigator.userAgent);function p(e){return 11===e?d:10===e?u:d||u}function f(e){if(!e)return document.documentElement;for(var t=p(10)?document.body:null,r=e.offsetParent||null;r===t&&e.nextElementSibling;)r=(e=e.nextElementSibling).offsetParent;var n=r&&r.nodeName;return n&&"BODY"!==n&&"HTML"!==n?-1!==["TH","TD","TABLE"].indexOf(r.nodeName)&&"static"===i(r,"position")?f(r):r:e?e.ownerDocument.documentElement:document.documentElement}function m(e){return null!==e.parentNode?m(e.parentNode):e}function h(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var r=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,n=r?e:t,o=r?t:e,a=document.createRange();a.setStart(n,0),a.setEnd(o,0);var i,s,c=a.commonAncestorContainer;if(e!==c&&t!==c||n.contains(o))return"BODY"===(s=(i=c).nodeName)||"HTML"!==s&&f(i.firstElementChild)!==i?f(c):c;var l=m(e);return l.host?h(l.host,t):h(e,m(t).host)}function g(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",r="top"===t?"scrollTop":"scrollLeft",n=e.nodeName;if("BODY"===n||"HTML"===n){var o=e.ownerDocument.documentElement,a=e.ownerDocument.scrollingElement||o;return a[r]}return e[r]}function b(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=g(t,"top"),o=g(t,"left"),a=r?-1:1;return e.top+=n*a,e.bottom+=n*a,e.left+=o*a,e.right+=o*a,e}function v(e,t){var r="x"===t?"Left":"Top",n="Left"===r?"Right":"Bottom";return parseFloat(e["border"+r+"Width"])+parseFloat(e["border"+n+"Width"])}function y(e,t,r,n){return Math.max(t["offset"+e],t["scroll"+e],r["client"+e],r["offset"+e],r["scroll"+e],p(10)?parseInt(r["offset"+e])+parseInt(n["margin"+("Height"===e?"Top":"Left")])+parseInt(n["margin"+("Height"===e?"Bottom":"Right")]):0)}function _(e){var t=e.body,r=e.documentElement,n=p(10)&&getComputedStyle(r);return{height:y("Height",t,r,n),width:y("Width",t,r,n)}}var w=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},k=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),x=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},M=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};function S(e){return M({},e,{right:e.left+e.width,bottom:e.top+e.height})}function E(e){var t={};try{if(p(10)){t=e.getBoundingClientRect();var r=g(e,"top"),n=g(e,"left");t.top+=r,t.left+=n,t.bottom+=r,t.right+=n}else t=e.getBoundingClientRect()}catch(e){}var o={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},a="HTML"===e.nodeName?_(e.ownerDocument):{},s=a.width||e.clientWidth||o.width,c=a.height||e.clientHeight||o.height,l=e.offsetWidth-s,d=e.offsetHeight-c;if(l||d){var u=i(e);l-=v(u,"x"),d-=v(u,"y"),o.width-=l,o.height-=d}return S(o)}function L(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=p(10),o="HTML"===t.nodeName,a=E(e),s=E(t),l=c(e),d=i(t),u=parseFloat(d.borderTopWidth),f=parseFloat(d.borderLeftWidth);r&&o&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var m=S({top:a.top-s.top-u,left:a.left-s.left-f,width:a.width,height:a.height});if(m.marginTop=0,m.marginLeft=0,!n&&o){var h=parseFloat(d.marginTop),g=parseFloat(d.marginLeft);m.top-=u-h,m.bottom-=u-h,m.left-=f-g,m.right-=f-g,m.marginTop=h,m.marginLeft=g}return(n&&!r?t.contains(l):t===l&&"BODY"!==l.nodeName)&&(m=b(m,t)),m}function D(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.ownerDocument.documentElement,n=L(e,r),o=Math.max(r.clientWidth,window.innerWidth||0),a=Math.max(r.clientHeight,window.innerHeight||0),i=t?0:g(r),s=t?0:g(r,"left"),c={top:i-n.top+n.marginTop,left:s-Line truncated
|
||||
//! moment.js locale configuration
|
||||
e.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(e){return/^nm$/i.test(e)},meridiem:function(e,t,r){return e<12?r?"vm":"VM":r?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",ss:"%d sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(r(2))},function(e,t,r){!function(e){"use strict";
|
||||
//! moment.js locale configuration
|
||||
@@ -306,12 +306,12 @@ e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月
|
||||
//! moment.js locale configuration
|
||||
e.defineLocale("zh-mo",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"D/M/YYYY",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,r){var n=100*e+t;return n<600?"凌晨":n<900?"早上":n<1130?"上午":n<1230?"中午":n<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(r(2))},function(e,t,r){!function(e){"use strict";
|
||||
//! moment.js locale configuration
|
||||
e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,r){var n=100*e+t;return n<600?"凌晨":n<900?"早上":n<1130?"上午":n<1230?"中午":n<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(r(2))},function(e,t,r){"use strict";e.exports=r(719)},function(e,t){var r,n,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var c,l=[],d=!1,u=-1;function p(){d&&c&&(d=!1,c.length?l=c.concat(l):u=-1,l.length&&f())}function f(){if(!d){var e=s(p);d=!0;for(var t=l.length;t;){for(c=l,l=[];++u<t;)c&&c[u].run();u=-1,t=l.length}c=null,d=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function m(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 r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new m(e,t)),1!==l.length||d||s(f)},m.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,r){var n=r(141),o=r(726),a=r(727),i=r(728),s=r(729),c=r(730);function l(e){var t=this.__data__=new n(e);this.size=t.size}l.prototype.clear=o,l.prototype.delete=a,l.prototype.get=i,l.prototype.has=s,l.prototype.set=c,e.exports=l},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,r){var n=r(115),o=r(202);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,r){(function(t){var r="object"==typeof t&&t&&t.Object===Object&&t;e.exports=r}).call(this,r(23))},function(e,t){var r=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return r.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,r){var n=r(749),o=r(752),a=r(753);e.exports=function(e,t,r,i,s,c){var l=1&r,d=e.length,u=t.length;if(d!=u&&!(l&&u>d))return!1;var p=c.get(e);if(p&&c.get(t))return p==t;var f=-1,m=!0,h=2&r?new n:void 0;for(c.set(e,t),c.set(t,e);++f<d;){var g=e[f],b=t[f];if(i)var v=l?i(b,g,f,t,e,c):i(g,b,f,e,t,c);if(void 0!==v){if(v)continue;m=!1;break}if(h){if(!o(t,(function(e,t){if(!a(h,t)&&(g===e||s(g,e,r,i,c)))return h.push(t)}))){m=!1;break}}else if(g!==b&&!s(g,b,r,i,c)){m=!1;break}}return c.delete(e),c.delete(t),m}},function(e,t,r){var n=r(767),o=r(116),a=Object.prototype,i=a.hasOwnProperty,s=a.propertyIsEnumerable,c=n(function(){return arguments}())?n:function(e){return o(e)&&i.call(e,"callee")&&!s.call(e,"callee")};e.exports=c},function(e,t,r){(function(e){var n=r(60),o=r(768),a=t&&!t.nodeType&&t,i=a&&"object"==typeof e&&e&&!e.nodeType&&e,s=i&&i.exports===a?n.Buffer:void 0,c=(s?s.isBuffer:void 0)||o;e.exports=c}).call(this,r(199Line truncated
|
||||
e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,r){var n=100*e+t;return n<600?"凌晨":n<900?"早上":n<1130?"上午":n<1230?"中午":n<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(r(2))},function(e,t,r){"use strict";e.exports=r(719)},function(e,t){var r,n,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var c,l=[],d=!1,u=-1;function p(){d&&c&&(d=!1,c.length?l=c.concat(l):u=-1,l.length&&f())}function f(){if(!d){var e=s(p);d=!0;for(var t=l.length;t;){for(c=l,l=[];++u<t;)c&&c[u].run();u=-1,t=l.length}c=null,d=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function m(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 r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new m(e,t)),1!==l.length||d||s(f)},m.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,r){var n=r(141),o=r(726),a=r(727),i=r(728),s=r(729),c=r(730);function l(e){var t=this.__data__=new n(e);this.size=t.size}l.prototype.clear=o,l.prototype.delete=a,l.prototype.get=i,l.prototype.has=s,l.prototype.set=c,e.exports=l},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,r){var n=r(115),o=r(202);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,r){(function(t){var r="object"==typeof t&&t&&t.Object===Object&&t;e.exports=r}).call(this,r(26))},function(e,t){var r=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return r.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,r){var n=r(749),o=r(752),a=r(753);e.exports=function(e,t,r,i,s,c){var l=1&r,d=e.length,u=t.length;if(d!=u&&!(l&&u>d))return!1;var p=c.get(e),f=c.get(t);if(p&&f)return p==t&&f==e;var m=-1,h=!0,g=2&r?new n:void 0;for(c.set(e,t),c.set(t,e);++m<d;){var b=e[m],v=t[m];if(i)var y=l?i(v,b,m,t,e,c):i(b,v,m,e,t,c);if(void 0!==y){if(y)continue;h=!1;break}if(g){if(!o(t,(function(e,t){if(!a(g,t)&&(b===e||s(b,e,r,i,c)))return g.push(t)}))){h=!1;break}}else if(b!==v&&!s(b,v,r,i,c)){h=!1;break}}return c.delete(e),c.delete(t),h}},function(e,t,r){var n=r(767),o=r(116),a=Object.prototype,i=a.hasOwnProperty,s=a.propertyIsEnumerable,c=n(function(){return arguments}())?n:function(e){return o(e)&&i.call(e,"callee")&&!s.call(e,"callee")};e.exports=c},function(e,t,r){(function(e){var n=r(61),o=r(768),a=t&&!t.nodeType&&t,i=a&&"object"==typeof e&&e&&!e.nodeType&&e,s=i&&i.exports===a?n.Buffer:void 0,c=(s?s.isBuffer:void 0)||o;e.exports=c}).call(Line truncated
|
||||
/*!
|
||||
Copyright (c) 2017 Jed Watson.
|
||||
Licensed under the MIT License (MIT), see
|
||||
http://jedwatson.github.io/classnames
|
||||
*/!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"==a||"number"==a)e.push(n);else if(Array.isArray(n)&&n.length){var i=o.apply(null,n);i&&e.push(i)}else if("object"==a)for(var s in n)r.call(n,s)&&n[s]&&e.push(s)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},function(e,r){e.exports=t},function(e,t,r){function n(e){if(s[e])return s[e].exports;var t=s[e]={i:e,l:!1,exports:{}};return i[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}var o,a,i,s;window,e.exports=(o=r(3),a=r(5),s={},n.m=i=[function(e,t){e.exports=o},function(e,t){e.exports=a},function(e,t,r){e.exports=r(3)},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r(1);function a(e){var t=e.getSelection(),r=e.getCurrentContent(),n=t.getStartKey(),o=t.getEndKey(),a=r.getBlockMap();return a.toSeq().skipUntil((function(e,t){return t===n})).takeUntil((function(e,t){return t===o})).concat([[o,a.get(o)]])}function i(e){return a(e).toList()}function s(e){if(e)return i(e).get(0)}function c(e){if(e){var t=s(e),r=e.getCurrentContent().getBlockMap().toSeq().toList(),n=0;if(r.forEach((function(e,r){e.get("key")===t.get("key")&&(n=r-1)})),-1<n)return r.get(n)}}function l(e){return e?e.getCurrentContent().getBlockMap().toList():new o.List}function d(e){var t=i(e);if(!t.some((function(e){return e.type!==t.get(0).type})))return t.get(0).type}function u(e){var t=n.RichUtils.tryToRemoveBlockStyle(e);return t?n.EditorState.push(e,t,"change-block-type"):e}function p(e){var t="",r=e.getSelection(),n=r.getAnchorOffset(),o=r.getFocusOffset(),a=i(e);if(0<a.size){if(r.getIsBackward()){var s=n;n=o,o=s}for(var c=0;c<a.size;c+=1){var l=0===c?n:0,d=c===a.size-1?o:a.get(c).getText().length;t+=a.get(c).getText().slice(l,d)}}return t}function f(e){var t=e.getCurrentContent(),r=e.getSelection(),o=n.Modifier.removeRange(t,r,"forward"),a=o.getSelectionAfter(),i=o.getBlockForKey(a.getStartKey());return o=n.Modifier.insertText(o,a,"\n",i.getInlineStyleAt(a.getStartOffset()),null),n.EditorState.push(e,o,"insert-fragment")}function m(e){var t=n.Modifier.splitBlock(e.getCurrentContent(),e.getSelection());return u(n.EditorState.push(e,t,"split-block"))}function h(e){var t=e.getCurrentContent().getBlockMap().toList(),r=e.getSelection().merge({anchorKey:t.first().get("key"),anchorOffset:0,focusKey:t.last().get("key"),focusOffset:t.last().getLength()}),o=n.Modifier.removeRange(e.getCurrentContent(),r,"forward");return n.EditorState.push(e,o,"remove-range")}function g(e,t){var r=n.Modifier.setBlockData(e.getCurrentContent(),e.getSelection(),t);return n.EditorState.push(e,r,"change-block-data")}function b(e){var t=new o.Map({}),r=i(e);if(r&&0<r.size)for(var n=function(e){var n=r.get(e).getData();if(!n||0===n.size)return t=t.clear(),"break";if(0===e)t=n;else if(t.forEach((function(e,r){n.get(r)&&n.get(r)===e||(t=t.delete(r))})),0===t.size)return t=t.clear(),"break"},a=0;a<r.size&&"break"!==n(a);a+=1);return t}var v=Object(o.Map)({code:{element:"pre"}}),y=n.DefaultDraftBlockRenderMap.merge(v);function _(e){if(e){var t=e.getType();return"unordered-list-item"===t||"ordered-list-item"===t}return!1}function w(e,t,r){var o,i=e.getSelection();o=i.getIsBackward()?i.getFocusKey():i.getAnchorKey();var s=e.getCurrentContent(),c=s.getBlockForKey(o),l=c.getType();if("unordered-list-item"!==l&&"ordered-list-item"!==l)return e;var d=s.getBlockBefore(o);if(!d)return e;if(d.getType()!==l)return e;var u=c.getDepth();if(1===t&&u===r)return e;var p,f,m,h,g,b,v,y=Math.min(d.getDepth()+1,r),_=(f=t,m=y,h=(p=e).getSelection(),b=(g=p.getCurrentContent()).getBlockMap(),v=a(p).map((function(e){var t=e.getDepth()+f;return t=Math.max(0,Math.min(t,m)),e.set("depth",t)})),b=b.merge(v),g.merge({blockMap:b,selectionBefore:h,selectionAfter:h}));return n.EditorState.push(e,_,"adjust-depth")}function k(e,t){var r;return 13===(r=t).which&&(r.getModifierState("Shift")||r.getModifierState("Alt")||r.getModifierState("Control"))?e.getSelection().isCollapsed()?n.RichUtils.insertSoftNewline(e):f(e):function(e){var t=e.getSelection();if(t.isCollapsed()){var r=e.getCurrentContent(),n=t.getStartKey(),o=r.getBlockForKey(n);if(!_(o)&&"unstyled"!==o.getType()&&o.getLength()===t.getStartOffset())return m(e);if(_(o)&&0===o.getLength()){var a=o.getDepth();if(0===a)return u(e);if(0<a)return w(e,-1,a)}}}(e)}function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function M(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function S(e){return(S="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)}functiLine truncated
|
||||
*/!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"==a||"number"==a)e.push(n);else if(Array.isArray(n)&&n.length){var i=o.apply(null,n);i&&e.push(i)}else if("object"==a)for(var s in n)r.call(n,s)&&n[s]&&e.push(s)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},function(e,r){e.exports=t},function(e,t,r){function n(e){if(s[e])return s[e].exports;var t=s[e]={i:e,l:!1,exports:{}};return i[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}var o,a,i,s;window,e.exports=(o=r(3),a=r(5),s={},n.m=i=[function(e,t){e.exports=o},function(e,t){e.exports=a},function(e,t,r){e.exports=r(3)},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r(1);function a(e){var t=e.getSelection(),r=e.getCurrentContent(),n=t.getStartKey(),o=t.getEndKey(),a=r.getBlockMap();return a.toSeq().skipUntil((function(e,t){return t===n})).takeUntil((function(e,t){return t===o})).concat([[o,a.get(o)]])}function i(e){return a(e).toList()}function s(e){if(e)return i(e).get(0)}function c(e){if(e){var t=s(e),r=e.getCurrentContent().getBlockMap().toSeq().toList(),n=0;if(r.forEach((function(e,r){e.get("key")===t.get("key")&&(n=r-1)})),-1<n)return r.get(n)}}function l(e){return e?e.getCurrentContent().getBlockMap().toList():new o.List}function d(e){var t=i(e);if(!t.some((function(e){return e.type!==t.get(0).type})))return t.get(0).type}function u(e){var t=n.RichUtils.tryToRemoveBlockStyle(e);return t?n.EditorState.push(e,t,"change-block-type"):e}function p(e){var t="",r=e.getSelection(),n=r.getAnchorOffset(),o=r.getFocusOffset(),a=i(e);if(0<a.size){if(r.getIsBackward()){var s=n;n=o,o=s}for(var c=0;c<a.size;c+=1){var l=0===c?n:0,d=c===a.size-1?o:a.get(c).getText().length;t+=a.get(c).getText().slice(l,d)}}return t}function f(e){var t=e.getCurrentContent(),r=e.getSelection(),o=n.Modifier.removeRange(t,r,"forward"),a=o.getSelectionAfter(),i=o.getBlockForKey(a.getStartKey());return o=n.Modifier.insertText(o,a,"\n",i.getInlineStyleAt(a.getStartOffset()),null),n.EditorState.push(e,o,"insert-fragment")}function m(e){var t=n.Modifier.splitBlock(e.getCurrentContent(),e.getSelection());return u(n.EditorState.push(e,t,"split-block"))}function h(e){var t=e.getCurrentContent().getBlockMap().toList(),r=e.getSelection().merge({anchorKey:t.first().get("key"),anchorOffset:0,focusKey:t.last().get("key"),focusOffset:t.last().getLength()}),o=n.Modifier.removeRange(e.getCurrentContent(),r,"forward");return n.EditorState.push(e,o,"remove-range")}function g(e,t){var r=n.Modifier.setBlockData(e.getCurrentContent(),e.getSelection(),t);return n.EditorState.push(e,r,"change-block-data")}function b(e){var t=new o.Map({}),r=i(e);if(r&&0<r.size)for(var n=function(e){var n=r.get(e).getData();if(!n||0===n.size)return t=t.clear(),"break";if(0===e)t=n;else if(t.forEach((function(e,r){n.get(r)&&n.get(r)===e||(t=t.delete(r))})),0===t.size)return t=t.clear(),"break"},a=0;a<r.size&&"break"!==n(a);a+=1);return t}var v=Object(o.Map)({code:{element:"pre"}}),y=n.DefaultDraftBlockRenderMap.merge(v);function _(e){if(e){var t=e.getType();return"unordered-list-item"===t||"ordered-list-item"===t}return!1}function w(e,t,r){var o,i=e.getSelection();o=i.getIsBackward()?i.getFocusKey():i.getAnchorKey();var s=e.getCurrentContent(),c=s.getBlockForKey(o),l=c.getType();if("unordered-list-item"!==l&&"ordered-list-item"!==l)return e;var d=s.getBlockBefore(o);if(!d)return e;if(d.getType()!==l)return e;var u=c.getDepth();if(1===t&&u===r)return e;var p,f,m,h,g,b,v,y=Math.min(d.getDepth()+1,r),_=(f=t,m=y,h=(p=e).getSelection(),b=(g=p.getCurrentContent()).getBlockMap(),v=a(p).map((function(e){var t=e.getDepth()+f;return t=Math.max(0,Math.min(t,m)),e.set("depth",t)})),b=b.merge(v),g.merge({blockMap:b,selectionBefore:h,selectionAfter:h}));return n.EditorState.push(e,_,"adjust-depth")}function k(e,t){var r;return 13===(r=t).which&&(r.getModifierState("Shift")||r.getModifierState("Alt")||r.getModifierState("Control"))?e.getSelection().isCollapsed()?n.RichUtils.insertSoftNewline(e):f(e):function(e){var t=e.getSelection();if(t.isCollapsed()){var r=e.getCurrentContent(),n=t.getStartKey(),o=r.getBlockForKey(n);if(!_(o)&&"unstyled"!==o.getType()&&o.getLength()===t.getStartOffset())return m(e);if(_(o)&&0===o.getLength()){var a=o.getDepth();if(0===a)return u(e);if(0<a)return w(e,-1,a)}}}(e)}function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function M(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function S(e){return(S="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)}functiLine truncated
|
||||
/** @license React v16.13.1
|
||||
* react.production.min.js
|
||||
*
|
||||
@@ -319,7 +319,7 @@ e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var n=r(41),o="function"==typeof Symbol&&Symbol.for,a=o?Symbol.for("react.element"):60103,i=o?Symbol.for("react.portal"):60106,s=o?Symbol.for("react.fragment"):60107,c=o?Symbol.for("react.strict_mode"):60108,l=o?Symbol.for("react.profiler"):60114,d=o?Symbol.for("react.provider"):60109,u=o?Symbol.for("react.context"):60110,p=o?Symbol.for("react.forward_ref"):60112,f=o?Symbol.for("react.suspense"):60113,m=o?Symbol.for("react.memo"):60115,h=o?Symbol.for("react.lazy"):60116,g="function"==typeof Symbol&&Symbol.iterator;function b(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y={};function _(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||v}function w(){}function k(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||v}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(b(85));this.updater.enqueueSetState(this,e,t,"setState")},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},w.prototype=_.prototype;var x=k.prototype=new w;x.constructor=k,n(x,_.prototype),x.isPureReactComponent=!0;var M={current:null},S=Object.prototype.hasOwnProperty,E={key:!0,ref:!0,__self:!0,__source:!0};function L(e,t,r){var n,o={},i=null,s=null;if(null!=t)for(n in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(i=""+t.key),t)S.call(t,n)&&!E.hasOwnProperty(n)&&(o[n]=t[n]);var c=arguments.length-2;if(1===c)o.children=r;else if(1<c){for(var l=Array(c),d=0;d<c;d++)l[d]=arguments[d+2];o.children=l}if(e&&e.defaultProps)for(n in c=e.defaultProps)void 0===o[n]&&(o[n]=c[n]);return{$$typeof:a,type:e,key:i,ref:s,props:o,_owner:M.current}}function D(e){return"object"==typeof e&&null!==e&&e.$$typeof===a}var C=/\/+/g,O=[];function T(e,t,r,n){if(O.length){var o=O.pop();return o.result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o}return{result:e,keyPrefix:t,func:r,context:n,count:0}}function j(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>O.length&&O.push(e)}function A(e,t,r){return null==e?0:function e(t,r,n,o){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var c=!1;if(null===t)c=!0;else switch(s){case"string":case"number":c=!0;break;case"object":switch(t.$$typeof){case a:case i:c=!0}}if(c)return n(o,t,""===r?"."+N(t,0):r),1;if(c=0,r=""===r?".":r+":",Array.isArray(t))for(var l=0;l<t.length;l++){var d=r+N(s=t[l],l);c+=e(s,d,n,o)}else if(null===t||"object"!=typeof t?d=null:d="function"==typeof(d=g&&t[g]||t["@@iterator"])?d:null,"function"==typeof d)for(t=d.call(t),l=0;!(s=t.next()).done;)c+=e(s=s.value,d=r+N(s,l++),n,o);else if("object"===s)throw n=""+t,Error(b(31,"[object Object]"===n?"object with keys {"+Object.keys(t).join(", ")+"}":n,""));return c}(e,"",t,r)}function N(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))}(e.key):t.toString(36)}function P(e,t){e.func.call(e.context,t,e.count++)}function I(e,t,r){var n=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?Y(e,n,r,(function(e){return e})):null!=e&&(D(e)&&(e=function(e,t){return{$$typeof:a,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,o+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(C,"$&/")+"/")+r)),n.push(e))}function Y(e,t,r,n,o){var a="";null!=r&&(a=(""+r).replace(C,"$&/")+"/"),A(e,I,t=T(t,a,n,o)),j(t)}var z={current:null};function F(){var e=z.current;if(null===e)throw Error(b(321));return e}var R={ReactCurrentDispatcher:z,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:M,IsSomeRendererActing:{current:!1},assign:n};t.Children={map:function(e,t,r){if(null==e)return e;var n=[];return Y(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;A(e,P,t=T(null,null,t,r)),j(t)},count:function(e){return A(e,(function(){return null}),null)},toArray:function(e){var t=[];return Y(e,t,null,(function(e){return e})),t},only:function(e){if(!D(e))throw Error(b(143));return e}},t.Component=_,t.Fragment=s,t.Profiler=l,t.PureComponent=k,t.StrictMode=c,t.Suspense=f,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=R,t.cloneElement=function(e,t,r){if(null==e)throw Error(b(267,e));var o=n({},e.props),i=e.key,s=e.ref,c=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,c=M.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(d in t)S.call(t,d)&&!E.hasOwnProperty(d)&&(o[d]=void 0===t[d]&&void 0!==l?l[d]:t[d])}var d=arguments.length-2;if(1===d)o.children=r;else if(1<d){l=Array(d);for(var u=0;u<d;u++)l[u]=arguments[u+2];o.children=l}return{$$typeof:a,tyLine truncated
|
||||
*/var n=r(42),o="function"==typeof Symbol&&Symbol.for,a=o?Symbol.for("react.element"):60103,i=o?Symbol.for("react.portal"):60106,s=o?Symbol.for("react.fragment"):60107,c=o?Symbol.for("react.strict_mode"):60108,l=o?Symbol.for("react.profiler"):60114,d=o?Symbol.for("react.provider"):60109,u=o?Symbol.for("react.context"):60110,p=o?Symbol.for("react.forward_ref"):60112,f=o?Symbol.for("react.suspense"):60113,m=o?Symbol.for("react.memo"):60115,h=o?Symbol.for("react.lazy"):60116,g="function"==typeof Symbol&&Symbol.iterator;function b(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y={};function _(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||v}function w(){}function k(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||v}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(b(85));this.updater.enqueueSetState(this,e,t,"setState")},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},w.prototype=_.prototype;var x=k.prototype=new w;x.constructor=k,n(x,_.prototype),x.isPureReactComponent=!0;var M={current:null},S=Object.prototype.hasOwnProperty,E={key:!0,ref:!0,__self:!0,__source:!0};function L(e,t,r){var n,o={},i=null,s=null;if(null!=t)for(n in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(i=""+t.key),t)S.call(t,n)&&!E.hasOwnProperty(n)&&(o[n]=t[n]);var c=arguments.length-2;if(1===c)o.children=r;else if(1<c){for(var l=Array(c),d=0;d<c;d++)l[d]=arguments[d+2];o.children=l}if(e&&e.defaultProps)for(n in c=e.defaultProps)void 0===o[n]&&(o[n]=c[n]);return{$$typeof:a,type:e,key:i,ref:s,props:o,_owner:M.current}}function D(e){return"object"==typeof e&&null!==e&&e.$$typeof===a}var C=/\/+/g,O=[];function T(e,t,r,n){if(O.length){var o=O.pop();return o.result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o}return{result:e,keyPrefix:t,func:r,context:n,count:0}}function j(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>O.length&&O.push(e)}function A(e,t,r){return null==e?0:function e(t,r,n,o){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var c=!1;if(null===t)c=!0;else switch(s){case"string":case"number":c=!0;break;case"object":switch(t.$$typeof){case a:case i:c=!0}}if(c)return n(o,t,""===r?"."+N(t,0):r),1;if(c=0,r=""===r?".":r+":",Array.isArray(t))for(var l=0;l<t.length;l++){var d=r+N(s=t[l],l);c+=e(s,d,n,o)}else if(null===t||"object"!=typeof t?d=null:d="function"==typeof(d=g&&t[g]||t["@@iterator"])?d:null,"function"==typeof d)for(t=d.call(t),l=0;!(s=t.next()).done;)c+=e(s=s.value,d=r+N(s,l++),n,o);else if("object"===s)throw n=""+t,Error(b(31,"[object Object]"===n?"object with keys {"+Object.keys(t).join(", ")+"}":n,""));return c}(e,"",t,r)}function N(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))}(e.key):t.toString(36)}function P(e,t){e.func.call(e.context,t,e.count++)}function I(e,t,r){var n=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?Y(e,n,r,(function(e){return e})):null!=e&&(D(e)&&(e=function(e,t){return{$$typeof:a,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,o+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(C,"$&/")+"/")+r)),n.push(e))}function Y(e,t,r,n,o){var a="";null!=r&&(a=(""+r).replace(C,"$&/")+"/"),A(e,I,t=T(t,a,n,o)),j(t)}var z={current:null};function F(){var e=z.current;if(null===e)throw Error(b(321));return e}var R={ReactCurrentDispatcher:z,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:M,IsSomeRendererActing:{current:!1},assign:n};t.Children={map:function(e,t,r){if(null==e)return e;var n=[];return Y(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;A(e,P,t=T(null,null,t,r)),j(t)},count:function(e){return A(e,(function(){return null}),null)},toArray:function(e){var t=[];return Y(e,t,null,(function(e){return e})),t},only:function(e){if(!D(e))throw Error(b(143));return e}},t.Component=_,t.Fragment=s,t.Profiler=l,t.PureComponent=k,t.StrictMode=c,t.Suspense=f,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=R,t.cloneElement=function(e,t,r){if(null==e)throw Error(b(267,e));var o=n({},e.props),i=e.key,s=e.ref,c=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,c=M.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(d in t)S.call(t,d)&&!E.hasOwnProperty(d)&&(o[d]=void 0===t[d]&&void 0!==l?l[d]:t[d])}var d=arguments.length-2;if(1===d)o.children=r;else if(1<d){l=Array(d);for(var u=0;u<d;u++)l[u]=arguments[u+2];o.children=l}return{$$typeof:a,tyLine truncated
|
||||
/** @license React v16.13.1
|
||||
* react-dom.production.min.js
|
||||
*
|
||||
@@ -327,7 +327,7 @@ e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var n=r(0),o=r(41),a=r(506);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!n)throw Error(i(227));function s(e,t,r,n,o,a,i,s,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(r,l)}catch(e){this.onError(e)}}var c=!1,l=null,d=!1,u=null,p={onError:function(e){c=!0,l=e}};function f(e,t,r,n,o,a,i,d,u){c=!1,l=null,s.apply(p,arguments)}var m=null,h=null,g=null;function b(e,t,r){var n=e.type||"unknown-event";e.currentTarget=g(r),function(e,t,r,n,o,a,s,p,m){if(f.apply(this,arguments),c){if(!c)throw Error(i(198));var h=l;c=!1,l=null,d||(d=!0,u=h)}}(n,t,void 0,e),e.currentTarget=null}var v=null,y={};function _(){if(v)for(var e in y){var t=y[e],r=v.indexOf(e);if(!(-1<r))throw Error(i(96,e));if(!k[r]){if(!t.extractEvents)throw Error(i(97,e));for(var n in k[r]=t,r=t.eventTypes){var o=void 0,a=r[n],s=t,c=n;if(x.hasOwnProperty(c))throw Error(i(99,c));x[c]=a;var l=a.phasedRegistrationNames;if(l){for(o in l)l.hasOwnProperty(o)&&w(l[o],s,c);o=!0}else a.registrationName?(w(a.registrationName,s,c),o=!0):o=!1;if(!o)throw Error(i(98,n,e))}}}}function w(e,t,r){if(M[e])throw Error(i(100,e));M[e]=t,S[e]=t.eventTypes[r].dependencies}var k=[],x={},M={},S={};function E(e){var t,r=!1;for(t in e)if(e.hasOwnProperty(t)){var n=e[t];if(!y.hasOwnProperty(t)||y[t]!==n){if(y[t])throw Error(i(102,t));y[t]=n,r=!0}}r&&_()}var L=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),D=null,C=null,O=null;function T(e){if(e=h(e)){if("function"!=typeof D)throw Error(i(280));var t=e.stateNode;t&&(t=m(t),D(e.stateNode,e.type,t))}}function j(e){C?O?O.push(e):O=[e]:C=e}function A(){if(C){var e=C,t=O;if(O=C=null,T(e),t)for(e=0;e<t.length;e++)T(t[e])}}function N(e,t){return e(t)}function P(e,t,r,n,o){return e(t,r,n,o)}function I(){}var Y=N,z=!1,F=!1;function R(){null===C&&null===O||(I(),A())}function H(e,t,r){if(F)return e(t,r);F=!0;try{return Y(e,t,r)}finally{F=!1,R()}}var B=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,U=Object.prototype.hasOwnProperty,W={},q={};function V(e,t,r,n,o,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a}var K={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){K[e]=new V(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];K[t]=new V(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){K[e]=new V(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){K[e]=new V(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){K[e]=new V(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){K[e]=new V(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){K[e]=new V(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){K[e]=new V(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){K[e]=new V(e,5,!1,e.toLowerCase(),null,!1)}));var G=/[\-:]([a-z])/g;function Q(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-raLine truncated
|
||||
*/var n=r(0),o=r(42),a=r(507);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!n)throw Error(i(227));function s(e,t,r,n,o,a,i,s,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(r,l)}catch(e){this.onError(e)}}var c=!1,l=null,d=!1,u=null,p={onError:function(e){c=!0,l=e}};function f(e,t,r,n,o,a,i,d,u){c=!1,l=null,s.apply(p,arguments)}var m=null,h=null,g=null;function b(e,t,r){var n=e.type||"unknown-event";e.currentTarget=g(r),function(e,t,r,n,o,a,s,p,m){if(f.apply(this,arguments),c){if(!c)throw Error(i(198));var h=l;c=!1,l=null,d||(d=!0,u=h)}}(n,t,void 0,e),e.currentTarget=null}var v=null,y={};function _(){if(v)for(var e in y){var t=y[e],r=v.indexOf(e);if(!(-1<r))throw Error(i(96,e));if(!k[r]){if(!t.extractEvents)throw Error(i(97,e));for(var n in k[r]=t,r=t.eventTypes){var o=void 0,a=r[n],s=t,c=n;if(x.hasOwnProperty(c))throw Error(i(99,c));x[c]=a;var l=a.phasedRegistrationNames;if(l){for(o in l)l.hasOwnProperty(o)&&w(l[o],s,c);o=!0}else a.registrationName?(w(a.registrationName,s,c),o=!0):o=!1;if(!o)throw Error(i(98,n,e))}}}}function w(e,t,r){if(M[e])throw Error(i(100,e));M[e]=t,S[e]=t.eventTypes[r].dependencies}var k=[],x={},M={},S={};function E(e){var t,r=!1;for(t in e)if(e.hasOwnProperty(t)){var n=e[t];if(!y.hasOwnProperty(t)||y[t]!==n){if(y[t])throw Error(i(102,t));y[t]=n,r=!0}}r&&_()}var L=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),D=null,C=null,O=null;function T(e){if(e=h(e)){if("function"!=typeof D)throw Error(i(280));var t=e.stateNode;t&&(t=m(t),D(e.stateNode,e.type,t))}}function j(e){C?O?O.push(e):O=[e]:C=e}function A(){if(C){var e=C,t=O;if(O=C=null,T(e),t)for(e=0;e<t.length;e++)T(t[e])}}function N(e,t){return e(t)}function P(e,t,r,n,o){return e(t,r,n,o)}function I(){}var Y=N,z=!1,F=!1;function R(){null===C&&null===O||(I(),A())}function H(e,t,r){if(F)return e(t,r);F=!0;try{return Y(e,t,r)}finally{F=!1,R()}}var B=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,U=Object.prototype.hasOwnProperty,W={},q={};function V(e,t,r,n,o,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a}var K={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){K[e]=new V(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];K[t]=new V(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){K[e]=new V(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){K[e]=new V(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){K[e]=new V(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){K[e]=new V(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){K[e]=new V(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){K[e]=new V(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){K[e]=new V(e,5,!1,e.toLowerCase(),null,!1)}));var G=/[\-:]([a-z])/g;function Q(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-raLine truncated
|
||||
/** @license React v0.19.1
|
||||
* scheduler.production.min.js
|
||||
*
|
||||
@@ -335,7 +335,7 @@ e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var n,o,a,i,s;if("undefined"==typeof window||"function"!=typeof MessageChannel){var c=null,l=null,d=function(){if(null!==c)try{var e=t.unstable_now();c(!0,e),c=null}catch(e){throw setTimeout(d,0),e}},u=Date.now();t.unstable_now=function(){return Date.now()-u},n=function(e){null!==c?setTimeout(n,0,e):(c=e,setTimeout(d,0))},o=function(e,t){l=setTimeout(e,t)},a=function(){clearTimeout(l)},i=function(){return!1},s=t.unstable_forceFrameRate=function(){}}else{var p=window.performance,f=window.Date,m=window.setTimeout,h=window.clearTimeout;if("undefined"!=typeof console){var g=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof g&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof p&&"function"==typeof p.now)t.unstable_now=function(){return p.now()};else{var b=f.now();t.unstable_now=function(){return f.now()-b}}var v=!1,y=null,_=-1,w=5,k=0;i=function(){return t.unstable_now()>=k},s=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):w=0<e?Math.floor(1e3/e):5};var x=new MessageChannel,M=x.port2;x.port1.onmessage=function(){if(null!==y){var e=t.unstable_now();k=e+w;try{y(!0,e)?M.postMessage(null):(v=!1,y=null)}catch(e){throw M.postMessage(null),e}}else v=!1},n=function(e){y=e,v||(v=!0,M.postMessage(null))},o=function(e,r){_=m((function(){e(t.unstable_now())}),r)},a=function(){h(_),_=-1}}function S(e,t){var r=e.length;e.push(t);e:for(;;){var n=r-1>>>1,o=e[n];if(!(void 0!==o&&0<D(o,t)))break e;e[n]=t,e[r]=o,r=n}}function E(e){return void 0===(e=e[0])?null:e}function L(e){var t=e[0];if(void 0!==t){var r=e.pop();if(r!==t){e[0]=r;e:for(var n=0,o=e.length;n<o;){var a=2*(n+1)-1,i=e[a],s=a+1,c=e[s];if(void 0!==i&&0>D(i,r))void 0!==c&&0>D(c,i)?(e[n]=c,e[s]=r,n=s):(e[n]=i,e[a]=r,n=a);else{if(!(void 0!==c&&0>D(c,r)))break e;e[n]=c,e[s]=r,n=s}}}return t}return null}function D(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}var C=[],O=[],T=1,j=null,A=3,N=!1,P=!1,I=!1;function Y(e){for(var t=E(O);null!==t;){if(null===t.callback)L(O);else{if(!(t.startTime<=e))break;L(O),t.sortIndex=t.expirationTime,S(C,t)}t=E(O)}}function z(e){if(I=!1,Y(e),!P)if(null!==E(C))P=!0,n(F);else{var t=E(O);null!==t&&o(z,t.startTime-e)}}function F(e,r){P=!1,I&&(I=!1,a()),N=!0;var n=A;try{for(Y(r),j=E(C);null!==j&&(!(j.expirationTime>r)||e&&!i());){var s=j.callback;if(null!==s){j.callback=null,A=j.priorityLevel;var c=s(j.expirationTime<=r);r=t.unstable_now(),"function"==typeof c?j.callback=c:j===E(C)&&L(C),Y(r)}else L(C);j=E(C)}if(null!==j)var l=!0;else{var d=E(O);null!==d&&o(z,d.startTime-r),l=!1}return l}finally{j=null,A=n,N=!1}}function R(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var H=s;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){P||N||(P=!0,n(F))},t.unstable_getCurrentPriorityLevel=function(){return A},t.unstable_getFirstCallbackNode=function(){return E(C)},t.unstable_next=function(e){switch(A){case 1:case 2:case 3:var t=3;break;default:t=A}var r=A;A=t;try{return e()}finally{A=r}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=H,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=A;A=e;try{return t()}finally{A=r}},t.unstable_scheduleCallback=function(e,r,i){var s=t.unstable_now();if("object"==typeof i&&null!==i){var c=i.delay;c="number"==typeof c&&0<c?s+c:s,i="number"==typeof i.timeout?i.timeout:R(e)}else i=R(e),c=s;return e={id:T++,callback:r,priorityLevel:e,startTime:c,expirationTime:i=c+i,sortIndex:-1},c>s?(e.sortIndex=c,S(O,e),null===E(C)&&e===E(O)&&(I?a():I=!0,o(z,c-s))):(e.sortIndex=i,S(C,e),P||N||(P=!0,n(F))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();Y(e);var r=E(C);return r!==j&&null!==j&&null!==r&&null!==r.callback&&r.startTime<=e&&r.expirationTime<j.expirationTime||i()},t.unstable_wrapCallback=function(e){var t=A;return function(){var r=A;A=t;try{return e.apply(this,arguments)}finally{A=r}}}},function(e,t,r){var n=r(509);"string"==typeof n&&(n=[[e.i,n,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};r(94)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,r){(t=r(93)(!1)).push([e.i,"/*!\n * AdminLTE v3.0.6-pre\n * Author: Colorlib\n * Website: AdminLTE.io <http://adminlte.io>\n * License: Open source - MIT <http://opensource.org/licenses/MIT>\n *//*!\n * Bootstrap v4.4.1 (https://getbootst
Line truncated
|
||||
*/var n,o,a,i,s;if("undefined"==typeof window||"function"!=typeof MessageChannel){var c=null,l=null,d=function(){if(null!==c)try{var e=t.unstable_now();c(!0,e),c=null}catch(e){throw setTimeout(d,0),e}},u=Date.now();t.unstable_now=function(){return Date.now()-u},n=function(e){null!==c?setTimeout(n,0,e):(c=e,setTimeout(d,0))},o=function(e,t){l=setTimeout(e,t)},a=function(){clearTimeout(l)},i=function(){return!1},s=t.unstable_forceFrameRate=function(){}}else{var p=window.performance,f=window.Date,m=window.setTimeout,h=window.clearTimeout;if("undefined"!=typeof console){var g=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof g&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof p&&"function"==typeof p.now)t.unstable_now=function(){return p.now()};else{var b=f.now();t.unstable_now=function(){return f.now()-b}}var v=!1,y=null,_=-1,w=5,k=0;i=function(){return t.unstable_now()>=k},s=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):w=0<e?Math.floor(1e3/e):5};var x=new MessageChannel,M=x.port2;x.port1.onmessage=function(){if(null!==y){var e=t.unstable_now();k=e+w;try{y(!0,e)?M.postMessage(null):(v=!1,y=null)}catch(e){throw M.postMessage(null),e}}else v=!1},n=function(e){y=e,v||(v=!0,M.postMessage(null))},o=function(e,r){_=m((function(){e(t.unstable_now())}),r)},a=function(){h(_),_=-1}}function S(e,t){var r=e.length;e.push(t);e:for(;;){var n=r-1>>>1,o=e[n];if(!(void 0!==o&&0<D(o,t)))break e;e[n]=t,e[r]=o,r=n}}function E(e){return void 0===(e=e[0])?null:e}function L(e){var t=e[0];if(void 0!==t){var r=e.pop();if(r!==t){e[0]=r;e:for(var n=0,o=e.length;n<o;){var a=2*(n+1)-1,i=e[a],s=a+1,c=e[s];if(void 0!==i&&0>D(i,r))void 0!==c&&0>D(c,i)?(e[n]=c,e[s]=r,n=s):(e[n]=i,e[a]=r,n=a);else{if(!(void 0!==c&&0>D(c,r)))break e;e[n]=c,e[s]=r,n=s}}}return t}return null}function D(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}var C=[],O=[],T=1,j=null,A=3,N=!1,P=!1,I=!1;function Y(e){for(var t=E(O);null!==t;){if(null===t.callback)L(O);else{if(!(t.startTime<=e))break;L(O),t.sortIndex=t.expirationTime,S(C,t)}t=E(O)}}function z(e){if(I=!1,Y(e),!P)if(null!==E(C))P=!0,n(F);else{var t=E(O);null!==t&&o(z,t.startTime-e)}}function F(e,r){P=!1,I&&(I=!1,a()),N=!0;var n=A;try{for(Y(r),j=E(C);null!==j&&(!(j.expirationTime>r)||e&&!i());){var s=j.callback;if(null!==s){j.callback=null,A=j.priorityLevel;var c=s(j.expirationTime<=r);r=t.unstable_now(),"function"==typeof c?j.callback=c:j===E(C)&&L(C),Y(r)}else L(C);j=E(C)}if(null!==j)var l=!0;else{var d=E(O);null!==d&&o(z,d.startTime-r),l=!1}return l}finally{j=null,A=n,N=!1}}function R(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var H=s;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){P||N||(P=!0,n(F))},t.unstable_getCurrentPriorityLevel=function(){return A},t.unstable_getFirstCallbackNode=function(){return E(C)},t.unstable_next=function(e){switch(A){case 1:case 2:case 3:var t=3;break;default:t=A}var r=A;A=t;try{return e()}finally{A=r}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=H,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=A;A=e;try{return t()}finally{A=r}},t.unstable_scheduleCallback=function(e,r,i){var s=t.unstable_now();if("object"==typeof i&&null!==i){var c=i.delay;c="number"==typeof c&&0<c?s+c:s,i="number"==typeof i.timeout?i.timeout:R(e)}else i=R(e),c=s;return e={id:T++,callback:r,priorityLevel:e,startTime:c,expirationTime:i=c+i,sortIndex:-1},c>s?(e.sortIndex=c,S(O,e),null===E(C)&&e===E(O)&&(I?a():I=!0,o(z,c-s))):(e.sortIndex=i,S(C,e),P||N||(P=!0,n(F))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();Y(e);var r=E(C);return r!==j&&null!==j&&null!==r&&null!==r.callback&&r.startTime<=e&&r.expirationTime<j.expirationTime||i()},t.unstable_wrapCallback=function(e){var t=A;return function(){var r=A;A=t;try{return e.apply(this,arguments)}finally{A=r}}}},function(e,t,r){var n=r(94),o=r(510);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var a={insert:"head",singleton:!1};n(o,a);e.exports=o.locals||{}},function(e,t,r){"use strict";r.r(t);var n=r(38),o=r.n(n)()(!1);o.push([e.i,"/*!\n * AdminLTE v3.0.6-pre\n * Author: Colorlib\n * Website: AdminLTE.io <http://adminlte.io>\n * License: Open source - MIT <http://opensource.org/licenses/MIT>\n *//
Line truncated
|
||||
/** @license React v16.13.1
|
||||
* react-is.production.min.js
|
||||
*
|
||||
@@ -343,7 +343,7 @@ e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var n="function"==typeof Symbol&&Symbol.for,o=n?Symbol.for("react.element"):60103,a=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,c=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,d=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,p=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,m=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,b=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,_=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function k(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case u:case p:case i:case c:case s:case m:return e;default:switch(e=e&&e.$$typeof){case d:case f:case b:case g:case l:return e;default:return t}}case a:return t}}}function x(e){return k(e)===p}t.AsyncMode=u,t.ConcurrentMode=p,t.ContextConsumer=d,t.ContextProvider=l,t.Element=o,t.ForwardRef=f,t.Fragment=i,t.Lazy=b,t.Memo=g,t.Portal=a,t.Profiler=c,t.StrictMode=s,t.Suspense=m,t.isAsyncMode=function(e){return x(e)||k(e)===u},t.isConcurrentMode=x,t.isContextConsumer=function(e){return k(e)===d},t.isContextProvider=function(e){return k(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return k(e)===f},t.isFragment=function(e){return k(e)===i},t.isLazy=function(e){return k(e)===b},t.isMemo=function(e){return k(e)===g},t.isPortal=function(e){return k(e)===a},t.isProfiler=function(e){return k(e)===c},t.isStrictMode=function(e){return k(e)===s},t.isSuspense=function(e){return k(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===p||e===c||e===s||e===m||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===b||e.$$typeof===g||e.$$typeof===l||e.$$typeof===d||e.$$typeof===f||e.$$typeof===y||e.$$typeof===_||e.$$typeof===w||e.$$typeof===v)},t.typeOf=k},function(e,t,r){var n=r(414),o=r(419),a=r(754),i=r(758),s=r(776),c=r(61),l=r(421),d=r(423),u="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,f,m,h){var g=c(e),b=c(t),v=g?"[object Array]":s(e),y=b?"[object Array]":s(t),_=(v="[object Arguments]"==v?u:v)==u,w=(y="[object Arguments]"==y?u:y)==u,k=v==y;if(k&&l(e)){if(!l(t))return!1;g=!0,_=!1}if(k&&!_)return h||(h=new n),g||d(e)?o(e,t,r,f,m,h):a(e,t,v,r,f,m,h);if(!(1&r)){var x=_&&p.call(e,"__wrapped__"),M=w&&p.call(t,"__wrapped__");if(x||M){var S=x?e.value():e,E=M?t.value():t;return h||(h=new n),m(S,E,r,f,h)}}return!!k&&(h||(h=new n),i(e,t,r,f,m,h))}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,r){var n=r(142),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0)&&(r==t.length-1?t.pop():o.call(t,r,1),--this.size,!0)}},function(e,t,r){var n=r(142);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},function(e,t,r){var n=r(142);e.exports=function(e){return n(this.__data__,e)>-1}},function(e,t,r){var n=r(142);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},function(e,t,r){var n=r(141);e.exports=function(){this.__data__=new n,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,r){var n=r(141),o=r(201),a=r(203);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var i=r.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(i)}return r.set(e,t),this.size=r.size,this}},function(e,t,r){var n=r(416),o=r(734),a=r(202),i=r(418),s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,d=c.toString,u=l.hasOwnProperty,p=RegExp("^"+d.call(u).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||o(e))&&(n(e)?p:s).test(i(e))}},function(e,t,r){var n=r(143),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=a.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var o=i.call(e);return n&&(t?e[s]=r:delete e[s]),o}},function(e,t){var r=Object.prototype.toString;e.exports=function(e){return r.call(e)}},function(e,t,r){var n,o=r(735),a=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!a&&a in e}},function(e,t,r){var n=r(60)["__core-js_shared__"];e.exports=n},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,r){var n=r(738),o=r(141),a=r(201);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||o),string:new n}}},funcLine truncated
|
||||
*/var n="function"==typeof Symbol&&Symbol.for,o=n?Symbol.for("react.element"):60103,a=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,c=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,d=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,p=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,m=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,b=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,_=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function k(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case u:case p:case i:case c:case s:case m:return e;default:switch(e=e&&e.$$typeof){case d:case f:case b:case g:case l:return e;default:return t}}case a:return t}}}function x(e){return k(e)===p}t.AsyncMode=u,t.ConcurrentMode=p,t.ContextConsumer=d,t.ContextProvider=l,t.Element=o,t.ForwardRef=f,t.Fragment=i,t.Lazy=b,t.Memo=g,t.Portal=a,t.Profiler=c,t.StrictMode=s,t.Suspense=m,t.isAsyncMode=function(e){return x(e)||k(e)===u},t.isConcurrentMode=x,t.isContextConsumer=function(e){return k(e)===d},t.isContextProvider=function(e){return k(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return k(e)===f},t.isFragment=function(e){return k(e)===i},t.isLazy=function(e){return k(e)===b},t.isMemo=function(e){return k(e)===g},t.isPortal=function(e){return k(e)===a},t.isProfiler=function(e){return k(e)===c},t.isStrictMode=function(e){return k(e)===s},t.isSuspense=function(e){return k(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===p||e===c||e===s||e===m||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===b||e.$$typeof===g||e.$$typeof===l||e.$$typeof===d||e.$$typeof===f||e.$$typeof===y||e.$$typeof===_||e.$$typeof===w||e.$$typeof===v)},t.typeOf=k},function(e,t,r){var n=r(416),o=r(421),a=r(754),i=r(758),s=r(776),c=r(62),l=r(423),d=r(425),u="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,f,m,h){var g=c(e),b=c(t),v=g?"[object Array]":s(e),y=b?"[object Array]":s(t),_=(v="[object Arguments]"==v?u:v)==u,w=(y="[object Arguments]"==y?u:y)==u,k=v==y;if(k&&l(e)){if(!l(t))return!1;g=!0,_=!1}if(k&&!_)return h||(h=new n),g||d(e)?o(e,t,r,f,m,h):a(e,t,v,r,f,m,h);if(!(1&r)){var x=_&&p.call(e,"__wrapped__"),M=w&&p.call(t,"__wrapped__");if(x||M){var S=x?e.value():e,E=M?t.value():t;return h||(h=new n),m(S,E,r,f,h)}}return!!k&&(h||(h=new n),i(e,t,r,f,m,h))}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,r){var n=r(142),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0)&&(r==t.length-1?t.pop():o.call(t,r,1),--this.size,!0)}},function(e,t,r){var n=r(142);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},function(e,t,r){var n=r(142);e.exports=function(e){return n(this.__data__,e)>-1}},function(e,t,r){var n=r(142);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},function(e,t,r){var n=r(141);e.exports=function(){this.__data__=new n,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,r){var n=r(141),o=r(201),a=r(203);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var i=r.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(i)}return r.set(e,t),this.size=r.size,this}},function(e,t,r){var n=r(418),o=r(734),a=r(202),i=r(420),s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,d=c.toString,u=l.hasOwnProperty,p=RegExp("^"+d.call(u).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||o(e))&&(n(e)?p:s).test(i(e))}},function(e,t,r){var n=r(143),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=a.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var o=i.call(e);return n&&(t?e[s]=r:delete e[s]),o}},function(e,t){var r=Object.prototype.toString;e.exports=function(e){return r.call(e)}},function(e,t,r){var n,o=r(735),a=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!a&&a in e}},function(e,t,r){var n=r(61)["__core-js_shared__"];e.exports=n},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,r){var n=r(738),o=r(141),a=r(201);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||o),string:new n}}},funcLine truncated
|
||||
/*!
|
||||
* UAParser.js v0.7.21
|
||||
* Lightweight JavaScript-based User-Agent string parser
|
||||
@@ -351,4 +351,4 @@ e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月
|
||||
*
|
||||
* Copyright © 2012-2019 Faisal Salman <f@faisalman.com>
|
||||
* Licensed under MIT License
|
||||
*/!function(o,a){"use strict";var i="model",s="name",c="type",l="vendor",d="version",u="mobile",p="tablet",f="smarttv",m={extend:function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},h={rgx:function(e,t){for(var r,n,o,a,i,s,c=0;c<t.length&&!i;){var l=t[c],d=t[c+1];for(r=n=0;r<l.length&&!i;)if(i=l[r++].exec(e))for(o=0;o<d.length;o++)s=i[++n],"object"==typeof(a=d[o])&&a.length>0?2==a.length?"function"==typeof a[1]?this[a[0]]=a[1].call(this,s):this[a[0]]=a[1]:3==a.length?"function"!=typeof a[1]||a[1].exec&&a[1].test?this[a[0]]=s?s.replace(a[1],a[2]):void 0:this[a[0]]=s?a[1].call(this,s,a[2]):void 0:4==a.length&&(this[a[0]]=s?a[3].call(this,s.replace(a[1],a[2])):void 0):this[a]=s||void 0;c+=2}},str:function(e,t){for(var r in t)if("object"==typeof t[r]&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(m.has(t[r][n],e))return"?"===r?void 0:r}else if(m.has(t[r],e))return"?"===r?void 0:r;return e}},g={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},b={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[s,d],[/(opios)[\/\s]+([\w\.]+)/i],[[s,"Opera Mini"],d],[/\s(opr)\/([\w\.]+)/i],[[s,"Opera"],d],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(bidubrowser|baidubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i],[s,d],[/(konqueror)\/([\w\.]+)/i],[[s,"Konqueror"],d],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[s,"IE"],d],[/(edge|edgios|edga|edg)\/((\d+)?[\w\.]+)/i],[[s,"Edge"],d],[/(yabrowser)\/([\w\.]+)/i],[[s,"Yandex"],d],[/(Avast)\/([\w\.]+)/i],[[s,"Avast Secure Browser"],d],[/(AVG)\/([\w\.]+)/i],[[s,"AVG Secure Browser"],d],[/(puffin)\/([\w\.]+)/i],[[s,"Puffin"],d],[/(focus)\/([\w\.]+)/i],[[s,"Firefox Focus"],d],[/(opt)\/([\w\.]+)/i],[[s,"Opera Touch"],d],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[s,"UCBrowser"],d],[/(comodo_dragon)\/([\w\.]+)/i],[[s,/_/g," "],d],[/(windowswechat qbcore)\/([\w\.]+)/i],[[s,"WeChat(Win) Desktop"],d],[/(micromessenger)\/([\w\.]+)/i],[[s,"WeChat"],d],[/(brave)\/([\w\.]+)/i],[[s,"Brave"],d],[/(qqbrowserlite)\/([\w\.]+)/i],[s,d],[/(QQ)\/([\d\.]+)/i],[s,d],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[s,d],[/(baiduboxapp)[\/\s]?([\w\.]+)/i],[s,d],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[s,d],[/(MetaSr)[\/\s]?([\w\.]+)/i],[s],[/(LBBROWSER)/i],[s],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[d,[s,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[d,[s,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/android.+(line)\/([\w\.]+)\/iab/i],[s,d],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[d,[s,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[s,/(.+)/,"$1 WebView"],d],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[s,/(.+(?:g|us))(.+)/,"$1 $2"],d],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[d,[s,"Android Browser"]],[/(sailfishbrowser)\/([\w\.]+)/i],[[s,"Sailfish Browser"],d],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[s,d],[/(dolfin)\/([\w\.]+)/i],[[s,"Dolphin"],d],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[s,"360 Browser"]],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[s,"Chrome"],d],[/(coast)\/([\w\.]+)/i],[[s,"Opera Coast"],d],[/fxios\/([\w\.-]+)/i],[d,[s,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[d,[s,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[d,s],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[s,"GSA"],d],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[s,[d,h.str,g.browser.oldsafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[s,d],[/(navigator|netscape)\/([\w\.-]+)/i],[[s,"Netscape"],d],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(moLine truncated
|
||||
*/!function(o,a){"use strict";var i="model",s="name",c="type",l="vendor",d="version",u="mobile",p="tablet",f="smarttv",m={extend:function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},h={rgx:function(e,t){for(var r,n,o,a,i,s,c=0;c<t.length&&!i;){var l=t[c],d=t[c+1];for(r=n=0;r<l.length&&!i;)if(i=l[r++].exec(e))for(o=0;o<d.length;o++)s=i[++n],"object"==typeof(a=d[o])&&a.length>0?2==a.length?"function"==typeof a[1]?this[a[0]]=a[1].call(this,s):this[a[0]]=a[1]:3==a.length?"function"!=typeof a[1]||a[1].exec&&a[1].test?this[a[0]]=s?s.replace(a[1],a[2]):void 0:this[a[0]]=s?a[1].call(this,s,a[2]):void 0:4==a.length&&(this[a[0]]=s?a[3].call(this,s.replace(a[1],a[2])):void 0):this[a]=s||void 0;c+=2}},str:function(e,t){for(var r in t)if("object"==typeof t[r]&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(m.has(t[r][n],e))return"?"===r?void 0:r}else if(m.has(t[r],e))return"?"===r?void 0:r;return e}},g={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},b={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[s,d],[/(opios)[\/\s]+([\w\.]+)/i],[[s,"Opera Mini"],d],[/\s(opr)\/([\w\.]+)/i],[[s,"Opera"],d],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(bidubrowser|baidubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i],[s,d],[/(konqueror)\/([\w\.]+)/i],[[s,"Konqueror"],d],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[s,"IE"],d],[/(edge|edgios|edga|edg)\/((\d+)?[\w\.]+)/i],[[s,"Edge"],d],[/(yabrowser)\/([\w\.]+)/i],[[s,"Yandex"],d],[/(Avast)\/([\w\.]+)/i],[[s,"Avast Secure Browser"],d],[/(AVG)\/([\w\.]+)/i],[[s,"AVG Secure Browser"],d],[/(puffin)\/([\w\.]+)/i],[[s,"Puffin"],d],[/(focus)\/([\w\.]+)/i],[[s,"Firefox Focus"],d],[/(opt)\/([\w\.]+)/i],[[s,"Opera Touch"],d],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[s,"UCBrowser"],d],[/(comodo_dragon)\/([\w\.]+)/i],[[s,/_/g," "],d],[/(windowswechat qbcore)\/([\w\.]+)/i],[[s,"WeChat(Win) Desktop"],d],[/(micromessenger)\/([\w\.]+)/i],[[s,"WeChat"],d],[/(brave)\/([\w\.]+)/i],[[s,"Brave"],d],[/(qqbrowserlite)\/([\w\.]+)/i],[s,d],[/(QQ)\/([\d\.]+)/i],[s,d],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[s,d],[/(baiduboxapp)[\/\s]?([\w\.]+)/i],[s,d],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[s,d],[/(MetaSr)[\/\s]?([\w\.]+)/i],[s],[/(LBBROWSER)/i],[s],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[d,[s,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[d,[s,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/android.+(line)\/([\w\.]+)\/iab/i],[s,d],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[d,[s,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[s,/(.+)/,"$1 WebView"],d],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[s,/(.+(?:g|us))(.+)/,"$1 $2"],d],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[d,[s,"Android Browser"]],[/(sailfishbrowser)\/([\w\.]+)/i],[[s,"Sailfish Browser"],d],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[s,d],[/(dolfin)\/([\w\.]+)/i],[[s,"Dolphin"],d],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[s,"360 Browser"]],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[s,"Chrome"],d],[/(coast)\/([\w\.]+)/i],[[s,"Opera Coast"],d],[/fxios\/([\w\.-]+)/i],[d,[s,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[d,[s,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[d,s],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[s,"GSA"],d],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[s,[d,h.str,g.browser.oldsafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[s,d],[/(navigator|netscape)\/([\w\.-]+)/i],[[s,"Netscape"],d],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(moLine truncated
|
||||
Vendored
+6
-6
@@ -1,11 +1,11 @@
|
||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.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 a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));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=514)}([function(e,t,n){"use strict";e.exports=n(281)},function(e,t,n){(function(e){e.exports=function(){"use strict";var t,r;function a(){return t.apply(null,arguments)}function i(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function o(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function u(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(s(e,t))return!1;return!0}function l(e){return void 0===e}function d(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function c(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function f(e,t){var n,r=[];for(n=0;n<e.length;++n)r.push(t(e[n],n));return r}function m(e,t){for(var n in t)s(t,n)&&(e[n]=t[n]);return s(t,"toString")&&(e.toString=t.toString),s(t,"valueOf")&&(e.valueOf=t.valueOf),e}function _(e,t,n,r){return Yt(e,t,n,r,!0).utc()}function h(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function p(e){if(null==e._isValid){var t=h(e),n=r.call(t.parsedDateParts,(function(e){return null!=e})),a=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(a=a&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return a;e._isValid=a}return e._isValid}function y(e){var t=_(NaN);return null!=e?m(h(t),e):h(t).userInvalidated=!0,t}r=Array.prototype.some?Array.prototype.some:function(e){var t,n=Object(this),r=n.length>>>0;for(t=0;t<r;t++)if(t in n&&e.call(this,n[t],t,n))return!0;return!1};var v=a.momentProperties=[],g=!1;function M(e,t){var n,r,a;if(l(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),l(t._i)||(e._i=t._i),l(t._f)||(e._f=t._f),l(t._l)||(e._l=t._l),l(t._strict)||(e._strict=t._strict),l(t._tzm)||(e._tzm=t._tzm),l(t._isUTC)||(e._isUTC=t._isUTC),l(t._offset)||(e._offset=t._offset),l(t._pf)||(e._pf=h(t)),l(t._locale)||(e._locale=t._locale),v.length>0)for(n=0;n<v.length;n++)l(a=t[r=v[n]])||(e[r]=a);return e}function L(e){M(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===g&&(g=!0,a.updateOffset(this),g=!1)}function b(e){return e instanceof L||null!=e&&null!=e._isAMomentObject}function k(e){!1===a.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function w(e,t){var n=!0;return m((function(){if(null!=a.deprecationHandler&&a.deprecationHandler(null,e),n){var r,i,o,u=[];for(i=0;i<arguments.length;i++){if(r="","object"==typeof arguments[i]){for(o in r+="\n["+i+"] ",arguments[0])s(arguments[0],o)&&(r+=o+": "+arguments[0][o]+", ");r=r.slice(0,-2)}else r=arguments[i];u.push(r)}k(e+"\nArguments: "+Array.prototype.slice.call(u).join("")+"\n"+(new Error).stack),n=!1}return t.apply(this,arguments)}),t)}var Y,T={};function D(e,t){null!=a.deprecationHandler&&a.deprecationHandler(e,t),T[e]||(k(t),T[e]=!0)}function S(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function x(e,t){var n,r=m({},e);for(n in t)s(t,n)&&(o(e[n])&&o(t[n])?(r[n]={},m(r[n],e[n]),m(r[n],t[n])):null!=t[n]?r[n]=t[n]:delete r[n]);for(n in e)s(e,n)&&!s(t,n)&&o(e[n])&&(r[n]=m({},r[n]));return r}function E(e){null!=e&&this.set(e)}function j(e,t,n){var r=""+Math.abs(e),a=t-r.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+r}a.suppressDeprecationWarnings=!1,a.deprecationHandler=null,Y=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)s(e,t)&&n.push(t);return n};var O=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?Line truncated
|
||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.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 a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));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=513)}([function(e,t,n){"use strict";e.exports=n(282)},function(e,t,n){(function(e){e.exports=function(){"use strict";var t,r;function a(){return t.apply(null,arguments)}function i(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function o(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function u(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(s(e,t))return!1;return!0}function l(e){return void 0===e}function d(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function c(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function f(e,t){var n,r=[];for(n=0;n<e.length;++n)r.push(t(e[n],n));return r}function m(e,t){for(var n in t)s(t,n)&&(e[n]=t[n]);return s(t,"toString")&&(e.toString=t.toString),s(t,"valueOf")&&(e.valueOf=t.valueOf),e}function _(e,t,n,r){return Yt(e,t,n,r,!0).utc()}function h(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function p(e){if(null==e._isValid){var t=h(e),n=r.call(t.parsedDateParts,(function(e){return null!=e})),a=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(a=a&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return a;e._isValid=a}return e._isValid}function y(e){var t=_(NaN);return null!=e?m(h(t),e):h(t).userInvalidated=!0,t}r=Array.prototype.some?Array.prototype.some:function(e){var t,n=Object(this),r=n.length>>>0;for(t=0;t<r;t++)if(t in n&&e.call(this,n[t],t,n))return!0;return!1};var v=a.momentProperties=[],g=!1;function M(e,t){var n,r,a;if(l(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),l(t._i)||(e._i=t._i),l(t._f)||(e._f=t._f),l(t._l)||(e._l=t._l),l(t._strict)||(e._strict=t._strict),l(t._tzm)||(e._tzm=t._tzm),l(t._isUTC)||(e._isUTC=t._isUTC),l(t._offset)||(e._offset=t._offset),l(t._pf)||(e._pf=h(t)),l(t._locale)||(e._locale=t._locale),v.length>0)for(n=0;n<v.length;n++)l(a=t[r=v[n]])||(e[r]=a);return e}function L(e){M(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===g&&(g=!0,a.updateOffset(this),g=!1)}function b(e){return e instanceof L||null!=e&&null!=e._isAMomentObject}function k(e){!1===a.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function w(e,t){var n=!0;return m((function(){if(null!=a.deprecationHandler&&a.deprecationHandler(null,e),n){var r,i,o,u=[];for(i=0;i<arguments.length;i++){if(r="","object"==typeof arguments[i]){for(o in r+="\n["+i+"] ",arguments[0])s(arguments[0],o)&&(r+=o+": "+arguments[0][o]+", ");r=r.slice(0,-2)}else r=arguments[i];u.push(r)}k(e+"\nArguments: "+Array.prototype.slice.call(u).join("")+"\n"+(new Error).stack),n=!1}return t.apply(this,arguments)}),t)}var Y,T={};function D(e,t){null!=a.deprecationHandler&&a.deprecationHandler(e,t),T[e]||(k(t),T[e]=!0)}function S(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function x(e,t){var n,r=m({},e);for(n in t)s(t,n)&&(o(e[n])&&o(t[n])?(r[n]={},m(r[n],e[n]),m(r[n],t[n])):null!=t[n]?r[n]=t[n]:delete r[n]);for(n in e)s(e,n)&&!s(t,n)&&o(e[n])&&(r[n]=m({},r[n]));return r}function E(e){null!=e&&this.set(e)}function j(e,t,n){var r=""+Math.abs(e),a=t-r.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+r}a.suppressDeprecationWarnings=!1,a.deprecationHandler=null,Y=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)s(e,t)&&n.push(t);return n};var O=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?Line truncated
|
||||
//! moment.js
|
||||
a.version="2.29.1",t=Tt,a.fn=yn,a.min=function(){var e=[].slice.call(arguments,0);return xt("isBefore",e)},a.max=function(){var e=[].slice.call(arguments,0);return xt("isAfter",e)},a.now=function(){return Date.now?Date.now():+new Date},a.utc=_,a.unix=function(e){return Tt(1e3*e)},a.months=function(e,t){return Ln(e,t,"months")},a.isDate=c,a.locale=ot,a.invalid=y,a.duration=It,a.isMoment=b,a.weekdays=function(e,t,n){return bn(e,t,n,"weekdays")},a.parseZone=function(){return Tt.apply(null,arguments).parseZone()},a.localeData=ut,a.isDuration=Ot,a.monthsShort=function(e,t){return Ln(e,t,"monthsShort")},a.weekdaysMin=function(e,t,n){return bn(e,t,n,"weekdaysMin")},a.defineLocale=st,a.updateLocale=function(e,t){if(null!=t){var n,r,a=et;null!=tt[e]&&null!=tt[e].parentLocale?tt[e].set(x(tt[e]._config,t)):(null!=(r=it(e))&&(a=r._config),t=x(a,t),null==r&&(t.abbr=e),(n=new E(t)).parentLocale=tt[e],tt[e]=n),ot(e)}else null!=tt[e]&&(null!=tt[e].parentLocale?(tt[e]=tt[e].parentLocale,e===ot()&&ot(e)):null!=tt[e]&&delete tt[e]);return tt[e]},a.locales=function(){return Y(tt)},a.weekdaysShort=function(e,t,n){return bn(e,t,n,"weekdaysShort")},a.normalizeUnits=z,a.relativeTimeRounding=function(e){return void 0===e?Vn:"function"==typeof e&&(Vn=e,!0)},a.relativeTimeThreshold=function(e,t){return void 0!==Gn[e]&&(void 0===t?Gn[e]:(Gn[e]=t,"s"===e&&(Gn.ss=t-1),!0))},a.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},a.prototype=yn,a.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},a}()}).call(this,n(512)(e))},function(e,t,n){var r=n(5),a=n(22),i=n(14),o=n(15),s=n(23),u=function(e,t,n){var l,d,c,f,m=e&u.F,_=e&u.G,h=e&u.S,p=e&u.P,y=e&u.B,v=_?r:h?r[t]||(r[t]={}):(r[t]||{}).prototype,g=_?a:a[t]||(a[t]={}),M=g.prototype||(g.prototype={});for(l in _&&(n=t),n)c=((d=!m&&v&&void 0!==v[l])?v:n)[l],f=y&&d?s(c,r):p&&"function"==typeof c?s(Function.call,c):c,v&&o(v,l,c,e&u.U),g[l]!=c&&i(g,l,f),p&&M[l]!=c&&(M[l]=c)};r.core=a,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){e.exports=n(510)()},function(e,t,n){var r=n(7);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(52)("wks"),a=n(37),i=n(5).Symbol,o="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=o&&i[e]||(o?i:a)("Symbol."+e))}).store=r},function(e,t,n){var r=n(25),a=Math.min;e.exports=function(e){return e>0?a(r(e),9007199254740991):0}},function(e,t,n){e.exports=!n(6)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t,n){var r=n(4),a=n(100),i=n(27),o=Object.defineProperty;t.f=n(10)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),a)try{return o(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(28);e.exports=function(e){return Object(r(e))}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(11),a=n(36);e.exports=n(10)?function(e,t,n){return r.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(5),a=n(14),i=n(18),o=n(37)("src"),s=n(288),u=(""+s).split("toString");n(22).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var l="function"==typeof n;l&&(i(n,"name")||a(n,"name",t)),e[t]!==n&&(l&&(i(n,o)||a(n,o,e[t]?""+e[t]:u.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:a(e,t,n):(delete e[t],a(e,t,n)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[o]||s.call(this)}))},function(e,t,n){var r=n(2),a=n(6),i=n(28),o=/"/g,s=function(e,t,n,r){var a=String(i(e)),s="<"+t;return""!==n&&(s+=" "+n+'="'+String(r).replace(o,""")+'"'),s+">"+a+"</"+t+">"};e.exports=function(e,t){var n={};n[e]=t(s),r(r.P+r.F*a((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3})),"String",n)}},function(e,t,n){"use strict";var r=n(136),a=Object.prototype.toString;function i(e){return"[object Array]"===a.call(e)}function o(e){return void 0===e}function s(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==a.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"[object Function]"===a.call(e)}function d(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(Line truncated
|
||||
a.version="2.29.1",t=Tt,a.fn=yn,a.min=function(){var e=[].slice.call(arguments,0);return xt("isBefore",e)},a.max=function(){var e=[].slice.call(arguments,0);return xt("isAfter",e)},a.now=function(){return Date.now?Date.now():+new Date},a.utc=_,a.unix=function(e){return Tt(1e3*e)},a.months=function(e,t){return Ln(e,t,"months")},a.isDate=c,a.locale=ot,a.invalid=y,a.duration=It,a.isMoment=b,a.weekdays=function(e,t,n){return bn(e,t,n,"weekdays")},a.parseZone=function(){return Tt.apply(null,arguments).parseZone()},a.localeData=ut,a.isDuration=Ot,a.monthsShort=function(e,t){return Ln(e,t,"monthsShort")},a.weekdaysMin=function(e,t,n){return bn(e,t,n,"weekdaysMin")},a.defineLocale=st,a.updateLocale=function(e,t){if(null!=t){var n,r,a=et;null!=tt[e]&&null!=tt[e].parentLocale?tt[e].set(x(tt[e]._config,t)):(null!=(r=it(e))&&(a=r._config),t=x(a,t),null==r&&(t.abbr=e),(n=new E(t)).parentLocale=tt[e],tt[e]=n),ot(e)}else null!=tt[e]&&(null!=tt[e].parentLocale?(tt[e]=tt[e].parentLocale,e===ot()&&ot(e)):null!=tt[e]&&delete tt[e]);return tt[e]},a.locales=function(){return Y(tt)},a.weekdaysShort=function(e,t,n){return bn(e,t,n,"weekdaysShort")},a.normalizeUnits=z,a.relativeTimeRounding=function(e){return void 0===e?Vn:"function"==typeof e&&(Vn=e,!0)},a.relativeTimeThreshold=function(e,t){return void 0!==Gn[e]&&(void 0===t?Gn[e]:(Gn[e]=t,"s"===e&&(Gn.ss=t-1),!0))},a.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},a.prototype=yn,a.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},a}()}).call(this,n(511)(e))},function(e,t,n){var r=n(5),a=n(22),i=n(14),o=n(15),s=n(23),u=function(e,t,n){var l,d,c,f,m=e&u.F,_=e&u.G,h=e&u.S,p=e&u.P,y=e&u.B,v=_?r:h?r[t]||(r[t]={}):(r[t]||{}).prototype,g=_?a:a[t]||(a[t]={}),M=g.prototype||(g.prototype={});for(l in _&&(n=t),n)c=((d=!m&&v&&void 0!==v[l])?v:n)[l],f=y&&d?s(c,r):p&&"function"==typeof c?s(Function.call,c):c,v&&o(v,l,c,e&u.U),g[l]!=c&&i(g,l,f),p&&M[l]!=c&&(M[l]=c)};r.core=a,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){e.exports=n(509)()},function(e,t,n){var r=n(7);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(52)("wks"),a=n(37),i=n(5).Symbol,o="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=o&&i[e]||(o?i:a)("Symbol."+e))}).store=r},function(e,t,n){var r=n(25),a=Math.min;e.exports=function(e){return e>0?a(r(e),9007199254740991):0}},function(e,t,n){e.exports=!n(6)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t,n){var r=n(4),a=n(100),i=n(27),o=Object.defineProperty;t.f=n(10)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),a)try{return o(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(28);e.exports=function(e){return Object(r(e))}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(11),a=n(36);e.exports=n(10)?function(e,t,n){return r.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(5),a=n(14),i=n(18),o=n(37)("src"),s=n(289),u=(""+s).split("toString");n(22).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var l="function"==typeof n;l&&(i(n,"name")||a(n,"name",t)),e[t]!==n&&(l&&(i(n,o)||a(n,o,e[t]?""+e[t]:u.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:a(e,t,n):(delete e[t],a(e,t,n)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[o]||s.call(this)}))},function(e,t,n){var r=n(2),a=n(6),i=n(28),o=/"/g,s=function(e,t,n,r){var a=String(i(e)),s="<"+t;return""!==n&&(s+=" "+n+'="'+String(r).replace(o,""")+'"'),s+">"+a+"</"+t+">"};e.exports=function(e,t){var n={};n[e]=t(s),r(r.P+r.F*a((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3})),"String",n)}},function(e,t,n){"use strict";var r=n(136),a=Object.prototype.toString;function i(e){return"[object Array]"===a.call(e)}function o(e){return void 0===e}function s(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==a.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"[object Function]"===a.call(e)}function d(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(Line truncated
|
||||
/*
|
||||
object-assign
|
||||
(c) Sindre Sorhus
|
||||
@license MIT
|
||||
*/var r=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,u=o(e),l=1;l<arguments.length;l++){for(var d in n=Object(arguments[l]))a.call(n,d)&&(u[d]=n[d]);if(r){s=r(n);for(var c=0;c<s.length;c++)i.call(n,s[c])&&(u[s[c]]=n[s[c]])}}return u}},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){e.exports=!n(10)&&!n(6)((function(){return 7!=Object.defineProperty(n(71)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){t.f=n(8)},function(e,t,n){var r=n(18),a=n(19),i=n(57)(!1),o=n(73)("IE_PROTO");e.exports=function(e,t){var n,s=a(e),u=0,l=[];for(n in s)n!=o&&r(s,n)&&l.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~i(l,n)||l.push(n));return l}},function(e,t,n){var r=n(11),a=n(4),i=n(38);e.exports=n(10)?Object.defineProperties:function(e,t){a(e);for(var n,o=i(t),s=o.length,u=0;s>u;)r.f(e,n=o[u++],t[n]);return e}},function(e,t,n){var r=n(19),a=n(41).f,i={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return o&&"[object Window]"==i.call(e)?function(e){try{return a(e)}catch(e){return o.slice()}}(e):a(r(e))}},function(e,t,n){"use strict";var r=n(10),a=n(38),i=n(58),o=n(54),s=n(12),u=n(53),l=Object.assign;e.exports=!l||n(6)((function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=l({},e)[n]||Object.keys(l({},t)).join("")!=r}))?function(e,t){for(var n=s(e),l=arguments.length,d=1,c=i.f,f=o.f;l>d;)for(var m,_=u(arguments[d++]),h=c?a(_).concat(c(_)):a(_),p=h.length,y=0;p>y;)m=h[y++],r&&!f.call(_,m)||(n[m]=_[m]);return n}:l},function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},function(e,t,n){"use strict";var r=n(13),a=n(7),i=n(108),o=[].slice,s={},u=function(e,t,n){if(!(t in s)){for(var r=[],a=0;a<t;a++)r[a]="a["+a+"]";s[t]=Function("F,a","return new F("+r.join(",")+")")}return s[t](e,n)};e.exports=Function.bind||function(e){var t=r(this),n=o.call(arguments,1),s=function(){var r=n.concat(o.call(arguments));return this instanceof s?u(t,r.length,r):i(t,r,e)};return a(t.prototype)&&(s.prototype=t.prototype),s}},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(5).parseInt,a=n(49).trim,i=n(77),o=/^[-+]?0[xX]/;e.exports=8!==r(i+"08")||22!==r(i+"0x16")?function(e,t){var n=a(String(e),3);return r(n,t>>>0||(o.test(n)?16:10))}:r},function(e,t,n){var r=n(5).parseFloat,a=n(49).trim;e.exports=1/r(n(77)+"-0")!=-1/0?function(e){var t=a(String(e),3),n=r(t);return 0===n&&"-"==t.charAt(0)?-0:n}:r},function(e,t,n){var r=n(24);e.exports=function(e,t){if("number"!=typeof e&&"Number"!=r(e))throw TypeError(t);return+e}},function(e,t,n){var r=n(7),a=Math.floor;e.exports=function(e){return!r(e)&&isFinite(e)&&a(e)===e}},function(e,t){e.exports=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:Math.log(1+e)}},function(e,t,n){var r=n(80),a=Math.pow,i=a(2,-52),o=a(2,-23),s=a(2,127)*(2-o),u=a(2,-126);e.exports=Math.fround||function(e){var t,n,a=Math.abs(e),l=r(e);return a<u?l*(a/u/o+1/i-1/i)*u*o:(n=(t=(1+o/i)*a)-(t-a))>s||n!=n?l*(1/0):l*n}},function(e,t,n){var r=n(4);e.exports=function(e,t,n,a){try{return a?t(r(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&r(i.call(e)),t}}},function(e,t,n){var r=n(13),a=n(12),i=n(53),o=n(9);e.exports=function(e,t,n,s,u){r(t);var l=a(e),d=i(l),c=o(l.length),f=u?c-1:0,m=u?-1:1;if(n<2)for(;;){if(f in d){s=d[f],f+=m;break}if(f+=m,u?f<0:c<=f)throw TypeError("Reduce of empty array with no initial value")}for(;u?f>=0:c>f;f+=m)f in d&&(s=t(s,d[f],f,l));return s}},function(e,t,n){"use strict";var r=n(12),a=n(39),i=n(9);e.exports=[].copyWithin||function(e,t){var n=r(this),o=i(n.length),s=a(e,o),u=a(t,o),l=arguments.length>2?arguments[2]:void 0,d=Math.min((void 0===l?o:a(l,o))-u,o-s),c=1;for(u<s&&s<u+d&&(c=-1,u+=d-1,s+=d-1);d-- >0;)u in n?n[s]=n[u]:delete n[s],s+=c,u+=c;return n}},function(e,t){e.exports=function(e,t){return{value:t,done:!Line truncated
|
||||
*/var r=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,u=o(e),l=1;l<arguments.length;l++){for(var d in n=Object(arguments[l]))a.call(n,d)&&(u[d]=n[d]);if(r){s=r(n);for(var c=0;c<s.length;c++)i.call(n,s[c])&&(u[s[c]]=n[s[c]])}}return u}},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){e.exports=!n(10)&&!n(6)((function(){return 7!=Object.defineProperty(n(71)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){t.f=n(8)},function(e,t,n){var r=n(18),a=n(19),i=n(57)(!1),o=n(73)("IE_PROTO");e.exports=function(e,t){var n,s=a(e),u=0,l=[];for(n in s)n!=o&&r(s,n)&&l.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~i(l,n)||l.push(n));return l}},function(e,t,n){var r=n(11),a=n(4),i=n(38);e.exports=n(10)?Object.defineProperties:function(e,t){a(e);for(var n,o=i(t),s=o.length,u=0;s>u;)r.f(e,n=o[u++],t[n]);return e}},function(e,t,n){var r=n(19),a=n(41).f,i={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return o&&"[object Window]"==i.call(e)?function(e){try{return a(e)}catch(e){return o.slice()}}(e):a(r(e))}},function(e,t,n){"use strict";var r=n(10),a=n(38),i=n(58),o=n(54),s=n(12),u=n(53),l=Object.assign;e.exports=!l||n(6)((function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=l({},e)[n]||Object.keys(l({},t)).join("")!=r}))?function(e,t){for(var n=s(e),l=arguments.length,d=1,c=i.f,f=o.f;l>d;)for(var m,_=u(arguments[d++]),h=c?a(_).concat(c(_)):a(_),p=h.length,y=0;p>y;)m=h[y++],r&&!f.call(_,m)||(n[m]=_[m]);return n}:l},function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},function(e,t,n){"use strict";var r=n(13),a=n(7),i=n(108),o=[].slice,s={},u=function(e,t,n){if(!(t in s)){for(var r=[],a=0;a<t;a++)r[a]="a["+a+"]";s[t]=Function("F,a","return new F("+r.join(",")+")")}return s[t](e,n)};e.exports=Function.bind||function(e){var t=r(this),n=o.call(arguments,1),s=function(){var r=n.concat(o.call(arguments));return this instanceof s?u(t,r.length,r):i(t,r,e)};return a(t.prototype)&&(s.prototype=t.prototype),s}},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(5).parseInt,a=n(49).trim,i=n(77),o=/^[-+]?0[xX]/;e.exports=8!==r(i+"08")||22!==r(i+"0x16")?function(e,t){var n=a(String(e),3);return r(n,t>>>0||(o.test(n)?16:10))}:r},function(e,t,n){var r=n(5).parseFloat,a=n(49).trim;e.exports=1/r(n(77)+"-0")!=-1/0?function(e){var t=a(String(e),3),n=r(t);return 0===n&&"-"==t.charAt(0)?-0:n}:r},function(e,t,n){var r=n(24);e.exports=function(e,t){if("number"!=typeof e&&"Number"!=r(e))throw TypeError(t);return+e}},function(e,t,n){var r=n(7),a=Math.floor;e.exports=function(e){return!r(e)&&isFinite(e)&&a(e)===e}},function(e,t){e.exports=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:Math.log(1+e)}},function(e,t,n){var r=n(80),a=Math.pow,i=a(2,-52),o=a(2,-23),s=a(2,127)*(2-o),u=a(2,-126);e.exports=Math.fround||function(e){var t,n,a=Math.abs(e),l=r(e);return a<u?l*(a/u/o+1/i-1/i)*u*o:(n=(t=(1+o/i)*a)-(t-a))>s||n!=n?l*(1/0):l*n}},function(e,t,n){var r=n(4);e.exports=function(e,t,n,a){try{return a?t(r(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&r(i.call(e)),t}}},function(e,t,n){var r=n(13),a=n(12),i=n(53),o=n(9);e.exports=function(e,t,n,s,u){r(t);var l=a(e),d=i(l),c=o(l.length),f=u?c-1:0,m=u?-1:1;if(n<2)for(;;){if(f in d){s=d[f],f+=m;break}if(f+=m,u?f<0:c<=f)throw TypeError("Reduce of empty array with no initial value")}for(;u?f>=0:c>f;f+=m)f in d&&(s=t(s,d[f],f,l));return s}},function(e,t,n){"use strict";var r=n(12),a=n(39),i=n(9);e.exports=[].copyWithin||function(e,t){var n=r(this),o=i(n.length),s=a(e,o),u=a(t,o),l=arguments.length>2?arguments[2]:void 0,d=Math.min((void 0===l?o:a(l,o))-u,o-s),c=1;for(u<s&&s<u+d&&(c=-1,u+=d-1,s+=d-1);d-- >0;)u in n?n[s]=n[u]:delete n[s],s+=c,u+=c;return n}},function(e,t){e.exports=function(e,t){return{value:t,done:!Line truncated
|
||||
//! moment.js locale configuration
|
||||
e.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(e){return/^nm$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"vm":"VM":n?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",ss:"%d sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n(1))},function(e,t,n){!function(e){"use strict";
|
||||
//! moment.js locale configuration
|
||||
@@ -275,7 +275,7 @@ e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月
|
||||
//! moment.js locale configuration
|
||||
e.defineLocale("zh-mo",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"D/M/YYYY",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var r=100*e+t;return r<600?"凌晨":r<900?"早上":r<1130?"上午":r<1230?"中午":r<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n(1))},function(e,t,n){!function(e){"use strict";
|
||||
//! moment.js locale configuration
|
||||
e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var r=100*e+t;return r<600?"凌晨":r<900?"早上":r<1130?"上午":r<1230?"中午":r<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n(1))},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=n(282)},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",a=(e.type||"").toLowerCase(),i=a.replace(/\/.*$/,"");return n.some((function(e){var t=e.trim().toLowerCase();return"."===t.charAt(0)?r.toLowerCase().endsWith(t):t.endsWith("/*")?i===t.replace(/\/.*$/,""):a===t}))}return!0}},function(e,t,n){"use strict";
|
||||
e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var r=100*e+t;return r<600?"凌晨":r<900?"早上":r<1130?"上午":r<1230?"中午":r<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n(1))},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=n(283)},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var a=(o=r,s=btoa(unescape(encodeURIComponent(JSON.stringify(o)))),u="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(u," */")),i=r.sources.map((function(e){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(e," */")}));return[n].concat(i).concat([a]).join("\n")}var o,s,u;return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var a={};if(r)for(var i=0;i<this.length;i++){var o=this[i][0];null!=o&&(a[o]=!0)}for(var s=0;s<e.length;s++){var u=[].concat(e[s]);r&&a[u[0]]||(n&&(u[2]?u[2]="".concat(n," and ").concat(u[2]):u[2]=n),t.push(u))}},t}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",a=(e.type||"").toLowerCase(),i=a.replace(/\/.*$/,"");return n.some((function(e){var t=e.trim().toLowerCase();return"."===t.charAt(0)?r.toLowerCase().endsWith(t):t.endsWith("/*")?i===t.replace(/\/.*$/,""):a===t}))}return!0}},function(e,t,n){"use strict";
|
||||
/** @license React v16.14.0
|
||||
* react.production.min.js
|
||||
*
|
||||
@@ -291,7 +291,7 @@ e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var r=n(0),a=n(98),i=n(283);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!r)throw Error(o(227));function s(e,t,n,r,a,i,o,s,u){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this.onError(e)}}var u=!1,l=null,d=!1,c=null,f={onError:function(e){u=!0,l=e}};function m(e,t,n,r,a,i,o,d,c){u=!1,l=null,s.apply(f,arguments)}var _=null,h=null,p=null;function y(e,t,n){var r=e.type||"unknown-event";e.currentTarget=p(n),function(e,t,n,r,a,i,s,f,_){if(m.apply(this,arguments),u){if(!u)throw Error(o(198));var h=l;u=!1,l=null,d||(d=!0,c=h)}}(r,t,void 0,e),e.currentTarget=null}var v=null,g={};function M(){if(v)for(var e in g){var t=g[e],n=v.indexOf(e);if(!(-1<n))throw Error(o(96,e));if(!b[n]){if(!t.extractEvents)throw Error(o(97,e));for(var r in b[n]=t,n=t.eventTypes){var a=void 0,i=n[r],s=t,u=r;if(k.hasOwnProperty(u))throw Error(o(99,u));k[u]=i;var l=i.phasedRegistrationNames;if(l){for(a in l)l.hasOwnProperty(a)&&L(l[a],s,u);a=!0}else i.registrationName?(L(i.registrationName,s,u),a=!0):a=!1;if(!a)throw Error(o(98,r,e))}}}}function L(e,t,n){if(w[e])throw Error(o(100,e));w[e]=t,Y[e]=t.eventTypes[n].dependencies}var b=[],k={},w={},Y={};function T(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var r=e[t];if(!g.hasOwnProperty(t)||g[t]!==r){if(g[t])throw Error(o(102,t));g[t]=r,n=!0}}n&&M()}var D=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),S=null,x=null,E=null;function j(e){if(e=h(e)){if("function"!=typeof S)throw Error(o(280));var t=e.stateNode;t&&(t=_(t),S(e.stateNode,e.type,t))}}function O(e){x?E?E.push(e):E=[e]:x=e}function H(){if(x){var e=x,t=E;if(E=x=null,j(e),t)for(e=0;e<t.length;e++)j(t[e])}}function P(e,t){return e(t)}function A(e,t,n,r,a){return e(t,n,r,a)}function F(){}var C=P,N=!1,W=!1;function R(){null===x&&null===E||(F(),H())}function z(e,t,n){if(W)return e(t,n);W=!0;try{return C(e,t,n)}finally{W=!1,R()}}var I=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,U=Object.prototype.hasOwnProperty,J={},B={};function V(e,t,n,r,a,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i}var G={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){G[e]=new V(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];G[t]=new V(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){G[e]=new V(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){G[e]=new V(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){G[e]=new V(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){G[e]=new V(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){G[e]=new V(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){G[e]=new V(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){G[e]=new V(e,5,!1,e.toLowerCase(),null,!1)}));var $=/[\-:]([a-z])/g;function q(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-raLine truncated
|
||||
*/var r=n(0),a=n(98),i=n(284);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!r)throw Error(o(227));function s(e,t,n,r,a,i,o,s,u){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this.onError(e)}}var u=!1,l=null,d=!1,c=null,f={onError:function(e){u=!0,l=e}};function m(e,t,n,r,a,i,o,d,c){u=!1,l=null,s.apply(f,arguments)}var _=null,h=null,p=null;function y(e,t,n){var r=e.type||"unknown-event";e.currentTarget=p(n),function(e,t,n,r,a,i,s,f,_){if(m.apply(this,arguments),u){if(!u)throw Error(o(198));var h=l;u=!1,l=null,d||(d=!0,c=h)}}(r,t,void 0,e),e.currentTarget=null}var v=null,g={};function M(){if(v)for(var e in g){var t=g[e],n=v.indexOf(e);if(!(-1<n))throw Error(o(96,e));if(!b[n]){if(!t.extractEvents)throw Error(o(97,e));for(var r in b[n]=t,n=t.eventTypes){var a=void 0,i=n[r],s=t,u=r;if(k.hasOwnProperty(u))throw Error(o(99,u));k[u]=i;var l=i.phasedRegistrationNames;if(l){for(a in l)l.hasOwnProperty(a)&&L(l[a],s,u);a=!0}else i.registrationName?(L(i.registrationName,s,u),a=!0):a=!1;if(!a)throw Error(o(98,r,e))}}}}function L(e,t,n){if(w[e])throw Error(o(100,e));w[e]=t,Y[e]=t.eventTypes[n].dependencies}var b=[],k={},w={},Y={};function T(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var r=e[t];if(!g.hasOwnProperty(t)||g[t]!==r){if(g[t])throw Error(o(102,t));g[t]=r,n=!0}}n&&M()}var D=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),S=null,x=null,E=null;function j(e){if(e=h(e)){if("function"!=typeof S)throw Error(o(280));var t=e.stateNode;t&&(t=_(t),S(e.stateNode,e.type,t))}}function O(e){x?E?E.push(e):E=[e]:x=e}function H(){if(x){var e=x,t=E;if(E=x=null,j(e),t)for(e=0;e<t.length;e++)j(t[e])}}function P(e,t){return e(t)}function A(e,t,n,r,a){return e(t,n,r,a)}function F(){}var C=P,N=!1,W=!1;function R(){null===x&&null===E||(F(),H())}function z(e,t,n){if(W)return e(t,n);W=!0;try{return C(e,t,n)}finally{W=!1,R()}}var I=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,U=Object.prototype.hasOwnProperty,J={},B={};function V(e,t,n,r,a,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i}var G={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){G[e]=new V(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];G[t]=new V(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){G[e]=new V(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){G[e]=new V(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){G[e]=new V(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){G[e]=new V(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){G[e]=new V(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){G[e]=new V(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){G[e]=new V(e,5,!1,e.toLowerCase(),null,!1)}));var $=/[\-:]([a-z])/g;function q(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-raLine truncated
|
||||
/** @license React v0.19.1
|
||||
* scheduler.production.min.js
|
||||
*
|
||||
@@ -299,4 +299,4 @@ e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var r,a,i,o,s;if("undefined"==typeof window||"function"!=typeof MessageChannel){var u=null,l=null,d=function(){if(null!==u)try{var e=t.unstable_now();u(!0,e),u=null}catch(e){throw setTimeout(d,0),e}},c=Date.now();t.unstable_now=function(){return Date.now()-c},r=function(e){null!==u?setTimeout(r,0,e):(u=e,setTimeout(d,0))},a=function(e,t){l=setTimeout(e,t)},i=function(){clearTimeout(l)},o=function(){return!1},s=t.unstable_forceFrameRate=function(){}}else{var f=window.performance,m=window.Date,_=window.setTimeout,h=window.clearTimeout;if("undefined"!=typeof console){var p=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof p&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof f&&"function"==typeof f.now)t.unstable_now=function(){return f.now()};else{var y=m.now();t.unstable_now=function(){return m.now()-y}}var v=!1,g=null,M=-1,L=5,b=0;o=function(){return t.unstable_now()>=b},s=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):L=0<e?Math.floor(1e3/e):5};var k=new MessageChannel,w=k.port2;k.port1.onmessage=function(){if(null!==g){var e=t.unstable_now();b=e+L;try{g(!0,e)?w.postMessage(null):(v=!1,g=null)}catch(e){throw w.postMessage(null),e}}else v=!1},r=function(e){g=e,v||(v=!0,w.postMessage(null))},a=function(e,n){M=_((function(){e(t.unstable_now())}),n)},i=function(){h(M),M=-1}}function Y(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,a=e[r];if(!(void 0!==a&&0<S(a,t)))break e;e[r]=t,e[n]=a,n=r}}function T(e){return void 0===(e=e[0])?null:e}function D(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length;r<a;){var i=2*(r+1)-1,o=e[i],s=i+1,u=e[s];if(void 0!==o&&0>S(o,n))void 0!==u&&0>S(u,o)?(e[r]=u,e[s]=n,r=s):(e[r]=o,e[i]=n,r=i);else{if(!(void 0!==u&&0>S(u,n)))break e;e[r]=u,e[s]=n,r=s}}}return t}return null}function S(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var x=[],E=[],j=1,O=null,H=3,P=!1,A=!1,F=!1;function C(e){for(var t=T(E);null!==t;){if(null===t.callback)D(E);else{if(!(t.startTime<=e))break;D(E),t.sortIndex=t.expirationTime,Y(x,t)}t=T(E)}}function N(e){if(F=!1,C(e),!A)if(null!==T(x))A=!0,r(W);else{var t=T(E);null!==t&&a(N,t.startTime-e)}}function W(e,n){A=!1,F&&(F=!1,i()),P=!0;var r=H;try{for(C(n),O=T(x);null!==O&&(!(O.expirationTime>n)||e&&!o());){var s=O.callback;if(null!==s){O.callback=null,H=O.priorityLevel;var u=s(O.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?O.callback=u:O===T(x)&&D(x),C(n)}else D(x);O=T(x)}if(null!==O)var l=!0;else{var d=T(E);null!==d&&a(N,d.startTime-n),l=!1}return l}finally{O=null,H=r,P=!1}}function R(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var z=s;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){A||P||(A=!0,r(W))},t.unstable_getCurrentPriorityLevel=function(){return H},t.unstable_getFirstCallbackNode=function(){return T(x)},t.unstable_next=function(e){switch(H){case 1:case 2:case 3:var t=3;break;default:t=H}var n=H;H=t;try{return e()}finally{H=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=z,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=H;H=e;try{return t()}finally{H=n}},t.unstable_scheduleCallback=function(e,n,o){var s=t.unstable_now();if("object"==typeof o&&null!==o){var u=o.delay;u="number"==typeof u&&0<u?s+u:s,o="number"==typeof o.timeout?o.timeout:R(e)}else o=R(e),u=s;return e={id:j++,callback:n,priorityLevel:e,startTime:u,expirationTime:o=u+o,sortIndex:-1},u>s?(e.sortIndex=u,Y(E,e),null===T(x)&&e===T(E)&&(F?i():F=!0,a(N,u-s))):(e.sortIndex=o,Y(x,e),A||P||(A=!0,r(W))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();C(e);var n=T(x);return n!==O&&null!==O&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime<O.expirationTime||o()},t.unstable_wrapCallback=function(e){var t=H;return function(){var n=H;H=t;try{return e.apply(this,arguments)}finally{H=n}}}},function(e,t,n){"use strict";(function(e){if(n(286),n(483),n(484),e._babelPolyfill)throw new Error("only one instance of babel-polyfill is allowed");e._babelPolyfill=!0;function t(e,t,n){e[t]||Object.defineProperty(e,t,{writable:!0,configurable:!0,value:n})}t(String.prototype,"padLeft","".padStart),t(String.prototype,"padRight","".padEnd),"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,
Line truncated
|
||||
*/var r,a,i,o,s;if("undefined"==typeof window||"function"!=typeof MessageChannel){var u=null,l=null,d=function(){if(null!==u)try{var e=t.unstable_now();u(!0,e),u=null}catch(e){throw setTimeout(d,0),e}},c=Date.now();t.unstable_now=function(){return Date.now()-c},r=function(e){null!==u?setTimeout(r,0,e):(u=e,setTimeout(d,0))},a=function(e,t){l=setTimeout(e,t)},i=function(){clearTimeout(l)},o=function(){return!1},s=t.unstable_forceFrameRate=function(){}}else{var f=window.performance,m=window.Date,_=window.setTimeout,h=window.clearTimeout;if("undefined"!=typeof console){var p=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof p&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof f&&"function"==typeof f.now)t.unstable_now=function(){return f.now()};else{var y=m.now();t.unstable_now=function(){return m.now()-y}}var v=!1,g=null,M=-1,L=5,b=0;o=function(){return t.unstable_now()>=b},s=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):L=0<e?Math.floor(1e3/e):5};var k=new MessageChannel,w=k.port2;k.port1.onmessage=function(){if(null!==g){var e=t.unstable_now();b=e+L;try{g(!0,e)?w.postMessage(null):(v=!1,g=null)}catch(e){throw w.postMessage(null),e}}else v=!1},r=function(e){g=e,v||(v=!0,w.postMessage(null))},a=function(e,n){M=_((function(){e(t.unstable_now())}),n)},i=function(){h(M),M=-1}}function Y(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,a=e[r];if(!(void 0!==a&&0<S(a,t)))break e;e[r]=t,e[n]=a,n=r}}function T(e){return void 0===(e=e[0])?null:e}function D(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length;r<a;){var i=2*(r+1)-1,o=e[i],s=i+1,u=e[s];if(void 0!==o&&0>S(o,n))void 0!==u&&0>S(u,o)?(e[r]=u,e[s]=n,r=s):(e[r]=o,e[i]=n,r=i);else{if(!(void 0!==u&&0>S(u,n)))break e;e[r]=u,e[s]=n,r=s}}}return t}return null}function S(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var x=[],E=[],j=1,O=null,H=3,P=!1,A=!1,F=!1;function C(e){for(var t=T(E);null!==t;){if(null===t.callback)D(E);else{if(!(t.startTime<=e))break;D(E),t.sortIndex=t.expirationTime,Y(x,t)}t=T(E)}}function N(e){if(F=!1,C(e),!A)if(null!==T(x))A=!0,r(W);else{var t=T(E);null!==t&&a(N,t.startTime-e)}}function W(e,n){A=!1,F&&(F=!1,i()),P=!0;var r=H;try{for(C(n),O=T(x);null!==O&&(!(O.expirationTime>n)||e&&!o());){var s=O.callback;if(null!==s){O.callback=null,H=O.priorityLevel;var u=s(O.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?O.callback=u:O===T(x)&&D(x),C(n)}else D(x);O=T(x)}if(null!==O)var l=!0;else{var d=T(E);null!==d&&a(N,d.startTime-n),l=!1}return l}finally{O=null,H=r,P=!1}}function R(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var z=s;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){A||P||(A=!0,r(W))},t.unstable_getCurrentPriorityLevel=function(){return H},t.unstable_getFirstCallbackNode=function(){return T(x)},t.unstable_next=function(e){switch(H){case 1:case 2:case 3:var t=3;break;default:t=H}var n=H;H=t;try{return e()}finally{H=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=z,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=H;H=e;try{return t()}finally{H=n}},t.unstable_scheduleCallback=function(e,n,o){var s=t.unstable_now();if("object"==typeof o&&null!==o){var u=o.delay;u="number"==typeof u&&0<u?s+u:s,o="number"==typeof o.timeout?o.timeout:R(e)}else o=R(e),u=s;return e={id:j++,callback:n,priorityLevel:e,startTime:u,expirationTime:o=u+o,sortIndex:-1},u>s?(e.sortIndex=u,Y(E,e),null===T(x)&&e===T(E)&&(F?i():F=!0,a(N,u-s))):(e.sortIndex=o,Y(x,e),A||P||(A=!0,r(W))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();C(e);var n=T(x);return n!==O&&null!==O&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime<O.expirationTime||o()},t.unstable_wrapCallback=function(e){var t=H;return function(){var n=H;H=t;try{return e.apply(this,arguments)}finally{H=n}}}},function(e,t,n){"use strict";(function(e){if(n(287),n(484),n(485),e._babelPolyfill)throw new Error("only one instance of babel-polyfill is allowed");e._babelPolyfill=!0;function t(e,t,n){e[t]||Object.defineProperty(e,t,{writable:!0,configurable:!0,value:n})}t(String.prototype,"padLeft","".padStart),t(String.prototype,"padRight","".padEnd),"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,
Line truncated
|
||||
Reference in new issue
Block a user