chore(release): 0.2.0 v0.2.0
authorxangelo <me@xangelo.ca>
Thu, 27 Jul 2023 16:48:31 +0000 (12:48 -0400)
committerxangelo <me@xangelo.ca>
Thu, 27 Jul 2023 16:48:31 +0000 (12:48 -0400)
21 files changed:
CHANGELOG.md
migrations/20230721190026_travelling.ts [new file with mode: 0644]
migrations/20230725191733_path-distance.ts [new file with mode: 0644]
migrations/20230726161427_travel-fight.ts [new file with mode: 0644]
package-lock.json
package.json
public/assets/bundle.js
public/index.html
seeds/cities.ts
src/client/index.ts
src/events/healer/server.ts
src/events/travel/client.ts
src/events/travel/server.ts
src/events/travel/shared.ts
src/server/api.ts
src/server/map.ts
src/server/monster.ts
src/shared/fight.ts
src/shared/map.ts
src/shared/monsters.ts
src/shared/travel.ts [new file with mode: 0644]

index 1df60ec14d51385e735533e1032837f9071bf53e..392c24034a25f99efc26a22f190619d9c1aa0d67 100644 (file)
@@ -2,6 +2,30 @@
 
 All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
 
 
 All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
 
+## [0.2.0](https://git.xangelo.ca/?p=risinglegends.git;a=commitdiff;h=v0.2.0;hp=v0.1.1;ds=sidebyside) (2023-07-27)
+
+
+### ⚠ BREAKING CHANGES
+
+* travelling between towns!
+
+### Features
+
+* paths now define a distance between them 53b5ae7
+* return to town button if killed while travelling 9325533
+* travelling between towns! 621c35b
+* when you die your travel plan is discarded 6f21c21
+
+
+### Bug Fixes
+
+* back to town button after healing 7f29b2f
+* disable switching tabs in a fight ea7eafe
+* display stat vals without sign or coloring bf702a6
+* display the image from the destination city at 50% progress 084353a
+* replace city background if you die while travelling 8a15f77
+* travel now takes X steps c4f9b81
+
 ### [0.1.1](https://git.xangelo.ca/?p=risinglegends.git;a=commitdiff;h=v0.1.1;hp=v0.1.0;ds=sidebyside) (2023-07-13)
 
 
 ### [0.1.1](https://git.xangelo.ca/?p=risinglegends.git;a=commitdiff;h=v0.1.1;hp=v0.1.0;ds=sidebyside) (2023-07-13)
 
 
diff --git a/migrations/20230721190026_travelling.ts b/migrations/20230721190026_travelling.ts
new file mode 100644 (file)
index 0000000..f0f84f8
--- /dev/null
@@ -0,0 +1,18 @@
+import { Knex } from "knex";
+
+
+export async function up(knex: Knex): Promise<void> {
+  return knex.schema.createTable('travel', function(table) {
+    table.string('player_id').primary();
+    table.integer('source_id').notNullable();
+    table.integer('destination_id').notNullable();
+    table.integer('total_distance').notNullable();
+    table.integer('current_position').notNullable().defaultTo(0);
+  })
+}
+
+
+export async function down(knex: Knex): Promise<void> {
+  return knex.schema.dropTable('travel');
+}
+
diff --git a/migrations/20230725191733_path-distance.ts b/migrations/20230725191733_path-distance.ts
new file mode 100644 (file)
index 0000000..cc30bb8
--- /dev/null
@@ -0,0 +1,16 @@
+import { Knex } from "knex";
+
+
+export async function up(knex: Knex): Promise<void> {
+  return knex.schema.alterTable('paths', function(table) {
+    table.integer('distance').notNullable().defaultTo(20);
+  });
+}
+
+
+export async function down(knex: Knex): Promise<void> {
+  return knex.schema.alterTable('paths', function(table) {
+    table.dropColumn('distance');
+  });
+}
+
diff --git a/migrations/20230726161427_travel-fight.ts b/migrations/20230726161427_travel-fight.ts
new file mode 100644 (file)
index 0000000..99cfeb7
--- /dev/null
@@ -0,0 +1,16 @@
+import { Knex } from "knex";
+
+
+export async function up(knex: Knex): Promise<void> {
+  return knex.schema.alterTable('fight', function(table) {
+    table.string('fight_trigger').defaultTo('explore');
+  });
+}
+
+
+export async function down(knex: Knex): Promise<void> {
+  return knex.schema.alterTable('fight', function(table) {
+    table.dropColumn('fight_trigger');
+  });
+}
+
index d799766319379dffda21954ade53cd7e685d2e25..f1b066f02d78fad5e90c030605dbe55abe4c099d 100644 (file)
@@ -1,19 +1,19 @@
 {
 {
-  "name": "control-up-takehome",
+  "name": "rising-legends",
+  "version": "0.2.0",
   "lockfileVersion": 2,
   "requires": true,
   "packages": {
     "": {
   "lockfileVersion": 2,
   "requires": true,
   "packages": {
     "": {
-      "name": "control-up-takehome",
+      "name": "rising-legends",
+      "version": "0.2.0",
       "dependencies": {
         "@honeycombio/opentelemetry-node": "^0.4.0",
         "@opentelemetry/auto-instrumentations-node": "^0.37.0",
       "dependencies": {
         "@honeycombio/opentelemetry-node": "^0.4.0",
         "@opentelemetry/auto-instrumentations-node": "^0.37.0",
-        "@prisma/client": "^4.11.0",
         "@sinclair/typebox": "^0.25.24",
         "@types/jquery": "^3.5.16",
         "@types/lodash": "^4.14.195",
         "@types/uuid": "^9.0.1",
         "@sinclair/typebox": "^0.25.24",
         "@types/jquery": "^3.5.16",
         "@types/lodash": "^4.14.195",
         "@types/uuid": "^9.0.1",
-        "@widgetbot/embed-api": "^1.2.9",
         "airtable": "^0.12.1",
         "bcrypt": "^5.1.0",
         "body-parser": "^1.20.2",
         "airtable": "^0.12.1",
         "bcrypt": "^5.1.0",
         "body-parser": "^1.20.2",
         "@types/express": "^4.17.17",
         "husky": "^8.0.0",
         "nodemon": "^2.0.20",
         "@types/express": "^4.17.17",
         "husky": "^8.0.0",
         "nodemon": "^2.0.20",
-        "prisma": "^4.11.0",
         "standard-version": "^9.5.0",
         "ts-loader": "^9.4.3",
         "ts-node": "^10.9.1",
         "tsconfig-paths": "^3.14.2",
         "tsconfig-paths-webpack-plugin": "^4.0.1",
         "typescript": "^4.9.5"
         "standard-version": "^9.5.0",
         "ts-loader": "^9.4.3",
         "ts-node": "^10.9.1",
         "tsconfig-paths": "^3.14.2",
         "tsconfig-paths-webpack-plugin": "^4.0.1",
         "typescript": "^4.9.5"
-      },
-      "version": "0.1.1"
+      }
     },
     "node_modules/@babel/code-frame": {
       "version": "7.22.5",
     },
     "node_modules/@babel/code-frame": {
       "version": "7.22.5",
         "node": ">=14"
       }
     },
         "node": ">=14"
       }
     },
-    "node_modules/@prisma/client": {
-      "version": "4.12.0",
-      "resolved": "https://registry.npmjs.org/@prisma/client/-/client-4.12.0.tgz",
-      "integrity": "sha512-j9/ighfWwux97J2dS15nqhl60tYoH8V0IuSsgZDb6bCFcQD3fXbXmxjYC8GHhIgOk3lB7Pq+8CwElz2MiDpsSg==",
-      "hasInstallScript": true,
-      "dependencies": {
-        "@prisma/engines-version": "4.12.0-67.659ef412370fa3b41cd7bf6e94587c1dfb7f67e7"
-      },
-      "engines": {
-        "node": ">=14.17"
-      },
-      "peerDependencies": {
-        "prisma": "*"
-      },
-      "peerDependenciesMeta": {
-        "prisma": {
-          "optional": true
-        }
-      }
-    },
-    "node_modules/@prisma/engines": {
-      "version": "4.12.0",
-      "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-4.12.0.tgz",
-      "integrity": "sha512-0alKtnxhNB5hYU+ymESBlGI4b9XrGGSdv7Ud+8TE/fBNOEhIud0XQsAR+TrvUZgS4na5czubiMsODw0TUrgkIA==",
-      "devOptional": true,
-      "hasInstallScript": true
-    },
-    "node_modules/@prisma/engines-version": {
-      "version": "4.12.0-67.659ef412370fa3b41cd7bf6e94587c1dfb7f67e7",
-      "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.12.0-67.659ef412370fa3b41cd7bf6e94587c1dfb7f67e7.tgz",
-      "integrity": "sha512-JIHNj5jlXb9mcaJwakM0vpgRYJIAurxTUqM0iX0tfEQA5XLZ9ONkIckkhuAKdAzocZ+80GYg7QSsfpjg7OxbOA=="
-    },
     "node_modules/@protobufjs/aspromise": {
       "version": "1.1.2",
       "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
     "node_modules/@protobufjs/aspromise": {
       "version": "1.1.2",
       "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
         }
       }
     },
         }
       }
     },
-    "node_modules/@widgetbot/embed-api": {
-      "version": "1.2.9",
-      "resolved": "https://registry.npmjs.org/@widgetbot/embed-api/-/embed-api-1.2.9.tgz",
-      "integrity": "sha512-do6kfNLAc6zRgWXBjg6H/wXOeBmSCXAcy3e1tvoN6YXPncKNO5atTrMLlysU68XMuw6QOaIjRQKCIDHCf3dEQg==",
-      "dependencies": {
-        "post-robot": "^8.0.28"
-      }
-    },
     "node_modules/@xtuc/ieee754": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz",
     "node_modules/@xtuc/ieee754": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz",
       "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
       "dev": true
     },
       "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
       "dev": true
     },
-    "node_modules/cross-domain-safe-weakmap": {
-      "version": "1.0.29",
-      "resolved": "https://registry.npmjs.org/cross-domain-safe-weakmap/-/cross-domain-safe-weakmap-1.0.29.tgz",
-      "integrity": "sha512-VLoUgf2SXnf3+na8NfeUFV59TRZkIJqCIATaMdbhccgtnTlSnHXkyTRwokngEGYdQXx8JbHT9GDYitgR2sdjuA==",
-      "dependencies": {
-        "cross-domain-utils": "^2.0.0"
-      }
-    },
-    "node_modules/cross-domain-utils": {
-      "version": "2.0.38",
-      "resolved": "https://registry.npmjs.org/cross-domain-utils/-/cross-domain-utils-2.0.38.tgz",
-      "integrity": "sha512-zZfi3+2EIR9l4chrEiXI2xFleyacsJf8YMLR1eJ0Veb5FTMXeJ3DpxDjZkto2FhL/g717WSELqbptNSo85UJDw==",
-      "dependencies": {
-        "zalgo-promise": "^1.0.11"
-      }
-    },
     "node_modules/cross-spawn": {
       "version": "7.0.3",
       "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
     "node_modules/cross-spawn": {
       "version": "7.0.3",
       "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
         "node": ">=8"
       }
     },
         "node": ">=8"
       }
     },
-    "node_modules/post-robot": {
-      "version": "8.0.31",
-      "resolved": "https://registry.npmjs.org/post-robot/-/post-robot-8.0.31.tgz",
-      "integrity": "sha512-nUhtKgtmcgyuPm4RnIhUB3gsDYJBHOgFry3TvOxhIHpgfwYY/T69d4oB90tw4YUllFZUUwqLEv1Wgyg6eOoJ7A==",
-      "dependencies": {
-        "cross-domain-safe-weakmap": "^1.0.1",
-        "cross-domain-utils": "^2.0.0",
-        "zalgo-promise": "^1.0.3"
-      }
-    },
     "node_modules/postgres-array": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz",
     "node_modules/postgres-array": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz",
         "node": ">=0.10.0"
       }
     },
         "node": ">=0.10.0"
       }
     },
-    "node_modules/prisma": {
-      "version": "4.12.0",
-      "resolved": "https://registry.npmjs.org/prisma/-/prisma-4.12.0.tgz",
-      "integrity": "sha512-xqVper4mbwl32BWzLpdznHAYvYDWQQWK2tBfXjdUD397XaveRyAP7SkBZ6kFlIg8kKayF4hvuaVtYwXd9BodAg==",
-      "devOptional": true,
-      "hasInstallScript": true,
-      "dependencies": {
-        "@prisma/engines": "4.12.0"
-      },
-      "bin": {
-        "prisma": "build/index.js",
-        "prisma2": "build/index.js"
-      },
-      "engines": {
-        "node": ">=14.17"
-      }
-    },
     "node_modules/process": {
       "version": "0.10.1",
       "resolved": "https://registry.npmjs.org/process/-/process-0.10.1.tgz",
     "node_modules/process": {
       "version": "0.10.1",
       "resolved": "https://registry.npmjs.org/process/-/process-0.10.1.tgz",
       "funding": {
         "url": "https://github.com/sponsors/sindresorhus"
       }
       "funding": {
         "url": "https://github.com/sponsors/sindresorhus"
       }
-    },
-    "node_modules/zalgo-promise": {
-      "version": "1.0.48",
-      "resolved": "https://registry.npmjs.org/zalgo-promise/-/zalgo-promise-1.0.48.tgz",
-      "integrity": "sha512-LLHANmdm53+MucY9aOFIggzYtUdkSBFxUsy4glTTQYNyK6B3uCPWTbfiGvSrEvLojw0mSzyFJ1/RRLv+QMNdzQ=="
     }
   },
   "dependencies": {
     }
   },
   "dependencies": {
       "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.10.1.tgz",
       "integrity": "sha512-qiAueuCoN+1YEuHNXnsct9bkbroZBPd7QwQgd56YURG0LBRVHwE/lF6FOprfUvp1n1tu0O6+E3s6x+dmUndXFQ=="
     },
       "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.10.1.tgz",
       "integrity": "sha512-qiAueuCoN+1YEuHNXnsct9bkbroZBPd7QwQgd56YURG0LBRVHwE/lF6FOprfUvp1n1tu0O6+E3s6x+dmUndXFQ=="
     },
-    "@prisma/client": {
-      "version": "4.12.0",
-      "resolved": "https://registry.npmjs.org/@prisma/client/-/client-4.12.0.tgz",
-      "integrity": "sha512-j9/ighfWwux97J2dS15nqhl60tYoH8V0IuSsgZDb6bCFcQD3fXbXmxjYC8GHhIgOk3lB7Pq+8CwElz2MiDpsSg==",
-      "requires": {
-        "@prisma/engines-version": "4.12.0-67.659ef412370fa3b41cd7bf6e94587c1dfb7f67e7"
-      }
-    },
-    "@prisma/engines": {
-      "version": "4.12.0",
-      "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-4.12.0.tgz",
-      "integrity": "sha512-0alKtnxhNB5hYU+ymESBlGI4b9XrGGSdv7Ud+8TE/fBNOEhIud0XQsAR+TrvUZgS4na5czubiMsODw0TUrgkIA==",
-      "devOptional": true
-    },
-    "@prisma/engines-version": {
-      "version": "4.12.0-67.659ef412370fa3b41cd7bf6e94587c1dfb7f67e7",
-      "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.12.0-67.659ef412370fa3b41cd7bf6e94587c1dfb7f67e7.tgz",
-      "integrity": "sha512-JIHNj5jlXb9mcaJwakM0vpgRYJIAurxTUqM0iX0tfEQA5XLZ9ONkIckkhuAKdAzocZ+80GYg7QSsfpjg7OxbOA=="
-    },
     "@protobufjs/aspromise": {
       "version": "1.1.2",
       "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
     "@protobufjs/aspromise": {
       "version": "1.1.2",
       "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
       "integrity": "sha512-0xRgjgDLdz6G7+vvDLlaRpFatJaJ69uTalZLRSMX5B3VUrDmXcrVA3+6fXXQgmYz7bY9AAgs348XQdmtLsK41A==",
       "requires": {}
     },
       "integrity": "sha512-0xRgjgDLdz6G7+vvDLlaRpFatJaJ69uTalZLRSMX5B3VUrDmXcrVA3+6fXXQgmYz7bY9AAgs348XQdmtLsK41A==",
       "requires": {}
     },
-    "@widgetbot/embed-api": {
-      "version": "1.2.9",
-      "resolved": "https://registry.npmjs.org/@widgetbot/embed-api/-/embed-api-1.2.9.tgz",
-      "integrity": "sha512-do6kfNLAc6zRgWXBjg6H/wXOeBmSCXAcy3e1tvoN6YXPncKNO5atTrMLlysU68XMuw6QOaIjRQKCIDHCf3dEQg==",
-      "requires": {
-        "post-robot": "^8.0.28"
-      }
-    },
     "@xtuc/ieee754": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz",
     "@xtuc/ieee754": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz",
       "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
       "dev": true
     },
       "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
       "dev": true
     },
-    "cross-domain-safe-weakmap": {
-      "version": "1.0.29",
-      "resolved": "https://registry.npmjs.org/cross-domain-safe-weakmap/-/cross-domain-safe-weakmap-1.0.29.tgz",
-      "integrity": "sha512-VLoUgf2SXnf3+na8NfeUFV59TRZkIJqCIATaMdbhccgtnTlSnHXkyTRwokngEGYdQXx8JbHT9GDYitgR2sdjuA==",
-      "requires": {
-        "cross-domain-utils": "^2.0.0"
-      }
-    },
-    "cross-domain-utils": {
-      "version": "2.0.38",
-      "resolved": "https://registry.npmjs.org/cross-domain-utils/-/cross-domain-utils-2.0.38.tgz",
-      "integrity": "sha512-zZfi3+2EIR9l4chrEiXI2xFleyacsJf8YMLR1eJ0Veb5FTMXeJ3DpxDjZkto2FhL/g717WSELqbptNSo85UJDw==",
-      "requires": {
-        "zalgo-promise": "^1.0.11"
-      }
-    },
     "cross-spawn": {
       "version": "7.0.3",
       "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
     "cross-spawn": {
       "version": "7.0.3",
       "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
         "find-up": "^4.0.0"
       }
     },
         "find-up": "^4.0.0"
       }
     },
-    "post-robot": {
-      "version": "8.0.31",
-      "resolved": "https://registry.npmjs.org/post-robot/-/post-robot-8.0.31.tgz",
-      "integrity": "sha512-nUhtKgtmcgyuPm4RnIhUB3gsDYJBHOgFry3TvOxhIHpgfwYY/T69d4oB90tw4YUllFZUUwqLEv1Wgyg6eOoJ7A==",
-      "requires": {
-        "cross-domain-safe-weakmap": "^1.0.1",
-        "cross-domain-utils": "^2.0.0",
-        "zalgo-promise": "^1.0.3"
-      }
-    },
     "postgres-array": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz",
     "postgres-array": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz",
         "xtend": "^4.0.0"
       }
     },
         "xtend": "^4.0.0"
       }
     },
-    "prisma": {
-      "version": "4.12.0",
-      "resolved": "https://registry.npmjs.org/prisma/-/prisma-4.12.0.tgz",
-      "integrity": "sha512-xqVper4mbwl32BWzLpdznHAYvYDWQQWK2tBfXjdUD397XaveRyAP7SkBZ6kFlIg8kKayF4hvuaVtYwXd9BodAg==",
-      "devOptional": true,
-      "requires": {
-        "@prisma/engines": "4.12.0"
-      }
-    },
     "process": {
       "version": "0.10.1",
       "resolved": "https://registry.npmjs.org/process/-/process-0.10.1.tgz",
     "process": {
       "version": "0.10.1",
       "resolved": "https://registry.npmjs.org/process/-/process-0.10.1.tgz",
       "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
       "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
       "dev": true
       "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
       "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
       "dev": true
-    },
-    "zalgo-promise": {
-      "version": "1.0.48",
-      "resolved": "https://registry.npmjs.org/zalgo-promise/-/zalgo-promise-1.0.48.tgz",
-      "integrity": "sha512-LLHANmdm53+MucY9aOFIggzYtUdkSBFxUsy4glTTQYNyK6B3uCPWTbfiGvSrEvLojw0mSzyFJ1/RRLv+QMNdzQ=="
     }
     }
-  },
-  "version": "0.1.1"
+  }
 }
 }
index e60af56980ff5153e59ab618cc3d78d8e54632c3..9086be89073b5e84a3c71a8c1b3f2019275583d8 100644 (file)
@@ -1,7 +1,7 @@
 {
   "name": "rising-legends",
   "private": true,
 {
   "name": "rising-legends",
   "private": true,
-  "version": "0.1.1",
+  "version": "0.2.0",
   "scripts": {
     "up": "npx prisma migrate dev --name \"init\"",
     "start": "pm2 start dist/server/api.js",
   "scripts": {
     "up": "npx prisma migrate dev --name \"init\"",
     "start": "pm2 start dist/server/api.js",
     "@types/bcrypt": "^5.0.0",
     "@types/body-parser": "^1.19.2",
     "@types/express": "^4.17.17",
     "@types/bcrypt": "^5.0.0",
     "@types/body-parser": "^1.19.2",
     "@types/express": "^4.17.17",
+    "@types/jquery": "^3.5.16",
+    "@types/lodash": "^4.14.195",
     "husky": "^8.0.0",
     "husky": "^8.0.0",
+    "jquery": "^3.7.0",
     "nodemon": "^2.0.20",
     "nodemon": "^2.0.20",
-    "prisma": "^4.11.0",
     "standard-version": "^9.5.0",
     "ts-loader": "^9.4.3",
     "ts-node": "^10.9.1",
     "standard-version": "^9.5.0",
     "ts-loader": "^9.4.3",
     "ts-node": "^10.9.1",
   "dependencies": {
     "@honeycombio/opentelemetry-node": "^0.4.0",
     "@opentelemetry/auto-instrumentations-node": "^0.37.0",
   "dependencies": {
     "@honeycombio/opentelemetry-node": "^0.4.0",
     "@opentelemetry/auto-instrumentations-node": "^0.37.0",
-    "@prisma/client": "^4.11.0",
     "@sinclair/typebox": "^0.25.24",
     "@sinclair/typebox": "^0.25.24",
-    "@types/jquery": "^3.5.16",
-    "@types/lodash": "^4.14.195",
     "@types/uuid": "^9.0.1",
     "@types/uuid": "^9.0.1",
-    "@widgetbot/embed-api": "^1.2.9",
     "airtable": "^0.12.1",
     "bcrypt": "^5.1.0",
     "body-parser": "^1.20.2",
     "airtable": "^0.12.1",
     "bcrypt": "^5.1.0",
     "body-parser": "^1.20.2",
@@ -51,7 +49,6 @@
     "dotenv": "^16.0.3",
     "express": "^4.18.2",
     "ioredis": "^5.3.2",
     "dotenv": "^16.0.3",
     "express": "^4.18.2",
     "ioredis": "^5.3.2",
-    "jquery": "^3.7.0",
     "knex": "^2.4.2",
     "lodash": "^4.17.21",
     "pg": "^8.11.0",
     "knex": "^2.4.2",
     "lodash": "^4.17.21",
     "pg": "^8.11.0",
index a7a54bf2f66b58afab588e7284bfbb626dde4881..1938cfac2ce1c69b960b0b2d7dd8c5163d917dd4 100644 (file)
@@ -1,2 +1,2 @@
 /*! For license information please see bundle.js.LICENSE.txt */
 /*! For license information please see bundle.js.LICENSE.txt */
-(()=>{var t={4802:(t,e,n)=>{e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(r++,"%c"===t&&(i=r))})),e.splice(i,0,n)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),t},e.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=n(804)(e);const{formatters:r}=t.exports;r.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},804:(t,e,n)=>{t.exports=function(t){function e(t){let n,i,o,s=null;function a(...t){if(!a.enabled)return;const r=a,i=Number(new Date),o=i-(n||i);r.diff=o,r.prev=n,r.curr=i,n=i,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let s=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";s++;const o=e.formatters[i];if("function"==typeof o){const e=t[s];n=o.call(r,e),t.splice(s,1),s--}return n})),e.formatArgs.call(r,t),(r.log||e.log).apply(r,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=r,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==e.namespaces&&(i=e.namespaces,o=e.enabled(t)),o),set:t=>{s=t}}),"function"==typeof e.init&&e.init(a),a}function r(t,n){const r=e(this.namespace+(void 0===n?":":n)+t);return r.log=this.log,r}function i(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){const t=[...e.names.map(i),...e.skips.map(i).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let n;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const r=("string"==typeof t?t:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(t=r[n].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.slice(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1},e.humanize=n(810),e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((n=>{e[n]=t[n]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let n=0;for(let e=0;e<t.length;e++)n=(n<<5)-n+t.charCodeAt(e),n|=0;return e.colors[Math.abs(n)%e.colors.length]},e.enable(e.load()),e}},810:t=>{var e=1e3,n=60*e,r=60*n,i=24*r;function o(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"s":"")}t.exports=function(t,s){s=s||{};var a,u,c=typeof t;if("string"===c&&t.length>0)return function(t){if(!((t=String(t)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*r;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(t);if("number"===c&&isFinite(t))return s.long?(a=t,(u=Math.abs(a))>=i?o(a,u,i,"day"):u>=r?o(a,u,r,"hour"):u>=n?o(a,u,n,"minute"):u>=e?o(a,u,e,"second"):a+" ms"):function(t){var o=Math.abs(t);return o>=i?Math.round(t/i)+"d":o>=r?Math.round(t/r)+"h":o>=n?Math.round(t/n)+"m":o>=e?Math.round(t/e)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},6486:function(t,e,n){var r;t=n.nmd(t),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",u=32,c=128,l=1/0,f=9007199254740991,h=NaN,d=4294967295,p=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",u],["partialRight",64],["rearg",256]],g="[object Arguments]",v="[object Array]",y="[object Boolean]",m="[object Date]",_="[object Error]",b="[object Function]",C="[object GeneratorFunction]",w="[object Map]",k="[object Number]",E="[object Object]",A="[object Promise]",S="[object RegExp]",x="[object Set]",O="[object String]",F="[object Symbol]",T="[object WeakMap]",j="[object ArrayBuffer]",P="[object DataView]",R="[object Float32Array]",$="[object Float64Array]",M="[object Int8Array]",L="[object Int16Array]",N="[object Int32Array]",D="[object Uint8Array]",I="[object Uint8ClampedArray]",B="[object Uint16Array]",q="[object Uint32Array]",U=/\b__p \+= '';/g,H=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,z=/&(?:amp|lt|gt|quot|#39);/g,V=/[&<>"']/g,K=RegExp(z.source),Y=RegExp(V.source),G=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,nt=RegExp(et.source),rt=/^\s+/,it=/\s/,ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,st=/\{\n\/\* \[wrapped with (.+)\] \*/,at=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ct=/[()=,{}\[\]\/\s]/,lt=/\\(\\)?/g,ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ht=/\w*$/,dt=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,gt=/^\[object .+?Constructor\]$/,vt=/^0o[0-7]+$/i,yt=/^(?:0|[1-9]\d*)$/,mt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_t=/($^)/,bt=/['\n\r\u2028\u2029\\]/g,Ct="\\ud800-\\udfff",wt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",kt="\\u2700-\\u27bf",Et="a-z\\xdf-\\xf6\\xf8-\\xff",At="A-Z\\xc0-\\xd6\\xd8-\\xde",St="\\ufe0e\\ufe0f",xt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ot="["+Ct+"]",Ft="["+xt+"]",Tt="["+wt+"]",jt="\\d+",Pt="["+kt+"]",Rt="["+Et+"]",$t="[^"+Ct+xt+jt+kt+Et+At+"]",Mt="\\ud83c[\\udffb-\\udfff]",Lt="[^"+Ct+"]",Nt="(?:\\ud83c[\\udde6-\\uddff]){2}",Dt="[\\ud800-\\udbff][\\udc00-\\udfff]",It="["+At+"]",Bt="\\u200d",qt="(?:"+Rt+"|"+$t+")",Ut="(?:"+It+"|"+$t+")",Ht="(?:['’](?:d|ll|m|re|s|t|ve))?",Wt="(?:['’](?:D|LL|M|RE|S|T|VE))?",zt="(?:"+Tt+"|"+Mt+")?",Vt="["+St+"]?",Kt=Vt+zt+"(?:"+Bt+"(?:"+[Lt,Nt,Dt].join("|")+")"+Vt+zt+")*",Yt="(?:"+[Pt,Nt,Dt].join("|")+")"+Kt,Gt="(?:"+[Lt+Tt+"?",Tt,Nt,Dt,Ot].join("|")+")",Jt=RegExp("['’]","g"),Xt=RegExp(Tt,"g"),Zt=RegExp(Mt+"(?="+Mt+")|"+Gt+Kt,"g"),Qt=RegExp([It+"?"+Rt+"+"+Ht+"(?="+[Ft,It,"$"].join("|")+")",Ut+"+"+Wt+"(?="+[Ft,It+qt,"$"].join("|")+")",It+"?"+qt+"+"+Ht,It+"+"+Wt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",jt,Yt].join("|"),"g"),te=RegExp("["+Bt+Ct+wt+St+"]"),ee=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],re=-1,ie={};ie[R]=ie[$]=ie[M]=ie[L]=ie[N]=ie[D]=ie[I]=ie[B]=ie[q]=!0,ie[g]=ie[v]=ie[j]=ie[y]=ie[P]=ie[m]=ie[_]=ie[b]=ie[w]=ie[k]=ie[E]=ie[S]=ie[x]=ie[O]=ie[T]=!1;var oe={};oe[g]=oe[v]=oe[j]=oe[P]=oe[y]=oe[m]=oe[R]=oe[$]=oe[M]=oe[L]=oe[N]=oe[w]=oe[k]=oe[E]=oe[S]=oe[x]=oe[O]=oe[F]=oe[D]=oe[I]=oe[B]=oe[q]=!0,oe[_]=oe[b]=oe[T]=!1;var se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ae=parseFloat,ue=parseInt,ce="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,le="object"==typeof self&&self&&self.Object===Object&&self,fe=ce||le||Function("return this")(),he=e&&!e.nodeType&&e,de=he&&t&&!t.nodeType&&t,pe=de&&de.exports===he,ge=pe&&ce.process,ve=function(){try{return de&&de.require&&de.require("util").types||ge&&ge.binding&&ge.binding("util")}catch(t){}}(),ye=ve&&ve.isArrayBuffer,me=ve&&ve.isDate,_e=ve&&ve.isMap,be=ve&&ve.isRegExp,Ce=ve&&ve.isSet,we=ve&&ve.isTypedArray;function ke(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ee(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var s=t[i];e(r,s,n(s),t)}return r}function Ae(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Se(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function xe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Oe(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}function Fe(t,e){return!(null==t||!t.length)&&Ie(t,e,0)>-1}function Te(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function je(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function Pe(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function Re(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function $e(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function Me(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Le=He("length");function Ne(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function De(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function Ie(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):De(t,qe,n)}function Be(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}function qe(t){return t!=t}function Ue(t,e){var n=null==t?0:t.length;return n?Ve(t,e)/n:h}function He(t){return function(e){return null==e?i:e[t]}}function We(t){return function(e){return null==t?i:t[e]}}function ze(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}function Ve(t,e){for(var n,r=-1,o=t.length;++r<o;){var s=e(t[r]);s!==i&&(n=n===i?s:n+s)}return n}function Ke(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Ye(t){return t?t.slice(0,hn(t)+1).replace(rt,""):t}function Ge(t){return function(e){return t(e)}}function Je(t,e){return je(e,(function(e){return t[e]}))}function Xe(t,e){return t.has(e)}function Ze(t,e){for(var n=-1,r=t.length;++n<r&&Ie(e,t[n],0)>-1;);return n}function Qe(t,e){for(var n=t.length;n--&&Ie(e,t[n],0)>-1;);return n}var tn=We({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),en=We({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function nn(t){return"\\"+se[t]}function rn(t){return te.test(t)}function on(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function sn(t,e){return function(n){return t(e(n))}}function an(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var s=t[n];s!==e&&s!==a||(t[n]=a,o[i++]=n)}return o}function un(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function cn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function ln(t){return rn(t)?function(t){for(var e=Zt.lastIndex=0;Zt.test(t);)++e;return e}(t):Le(t)}function fn(t){return rn(t)?function(t){return t.match(Zt)||[]}(t):function(t){return t.split("")}(t)}function hn(t){for(var e=t.length;e--&&it.test(t.charAt(e)););return e}var dn=We({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),pn=function t(e){var n,r=(e=null==e?fe:pn.defaults(fe.Object(),e,pn.pick(fe,ne))).Array,it=e.Date,Ct=e.Error,wt=e.Function,kt=e.Math,Et=e.Object,At=e.RegExp,St=e.String,xt=e.TypeError,Ot=r.prototype,Ft=wt.prototype,Tt=Et.prototype,jt=e["__core-js_shared__"],Pt=Ft.toString,Rt=Tt.hasOwnProperty,$t=0,Mt=(n=/[^.]+$/.exec(jt&&jt.keys&&jt.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Lt=Tt.toString,Nt=Pt.call(Et),Dt=fe._,It=At("^"+Pt.call(Rt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Bt=pe?e.Buffer:i,qt=e.Symbol,Ut=e.Uint8Array,Ht=Bt?Bt.allocUnsafe:i,Wt=sn(Et.getPrototypeOf,Et),zt=Et.create,Vt=Tt.propertyIsEnumerable,Kt=Ot.splice,Yt=qt?qt.isConcatSpreadable:i,Gt=qt?qt.iterator:i,Zt=qt?qt.toStringTag:i,te=function(){try{var t=uo(Et,"defineProperty");return t({},"",{}),t}catch(t){}}(),se=e.clearTimeout!==fe.clearTimeout&&e.clearTimeout,ce=it&&it.now!==fe.Date.now&&it.now,le=e.setTimeout!==fe.setTimeout&&e.setTimeout,he=kt.ceil,de=kt.floor,ge=Et.getOwnPropertySymbols,ve=Bt?Bt.isBuffer:i,Le=e.isFinite,We=Ot.join,gn=sn(Et.keys,Et),vn=kt.max,yn=kt.min,mn=it.now,_n=e.parseInt,bn=kt.random,Cn=Ot.reverse,wn=uo(e,"DataView"),kn=uo(e,"Map"),En=uo(e,"Promise"),An=uo(e,"Set"),Sn=uo(e,"WeakMap"),xn=uo(Et,"create"),On=Sn&&new Sn,Fn={},Tn=No(wn),jn=No(kn),Pn=No(En),Rn=No(An),$n=No(Sn),Mn=qt?qt.prototype:i,Ln=Mn?Mn.valueOf:i,Nn=Mn?Mn.toString:i;function Dn(t){if(ta(t)&&!Hs(t)&&!(t instanceof Un)){if(t instanceof qn)return t;if(Rt.call(t,"__wrapped__"))return Do(t)}return new qn(t)}var In=function(){function t(){}return function(e){if(!Qs(e))return{};if(zt)return zt(e);t.prototype=e;var n=new t;return t.prototype=i,n}}();function Bn(){}function qn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=i}function Un(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Hn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Wn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function zn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Vn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new zn;++e<n;)this.add(t[e])}function Kn(t){var e=this.__data__=new Wn(t);this.size=e.size}function Yn(t,e){var n=Hs(t),r=!n&&Us(t),i=!n&&!r&&Ks(t),o=!n&&!r&&!i&&ua(t),s=n||r||i||o,a=s?Ke(t.length,St):[],u=a.length;for(var c in t)!e&&!Rt.call(t,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||vo(c,u))||a.push(c);return a}function Gn(t){var e=t.length;return e?t[zr(0,e-1)]:i}function Jn(t,e){return Po(Si(t),or(e,0,t.length))}function Xn(t){return Po(Si(t))}function Zn(t,e,n){(n!==i&&!Is(t[e],n)||n===i&&!(e in t))&&rr(t,e,n)}function Qn(t,e,n){var r=t[e];Rt.call(t,e)&&Is(r,n)&&(n!==i||e in t)||rr(t,e,n)}function tr(t,e){for(var n=t.length;n--;)if(Is(t[n][0],e))return n;return-1}function er(t,e,n,r){return lr(t,(function(t,i,o){e(r,t,n(t),o)})),r}function nr(t,e){return t&&xi(e,Ta(e),t)}function rr(t,e,n){"__proto__"==e&&te?te(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ir(t,e){for(var n=-1,o=e.length,s=r(o),a=null==t;++n<o;)s[n]=a?i:Aa(t,e[n]);return s}function or(t,e,n){return t==t&&(n!==i&&(t=t<=n?t:n),e!==i&&(t=t>=e?t:e)),t}function sr(t,e,n,r,o,s){var a,u=1&e,c=2&e,l=4&e;if(n&&(a=o?n(t,r,o,s):n(t)),a!==i)return a;if(!Qs(t))return t;var f=Hs(t);if(f){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Rt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!u)return Si(t,a)}else{var h=fo(t),d=h==b||h==C;if(Ks(t))return bi(t,u);if(h==E||h==g||d&&!o){if(a=c||d?{}:po(t),!u)return c?function(t,e){return xi(t,lo(t),e)}(t,function(t,e){return t&&xi(e,ja(e),t)}(a,t)):function(t,e){return xi(t,co(t),e)}(t,nr(a,t))}else{if(!oe[h])return o?t:{};a=function(t,e,n){var r,i=t.constructor;switch(e){case j:return Ci(t);case y:case m:return new i(+t);case P:return function(t,e){var n=e?Ci(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case R:case $:case M:case L:case N:case D:case I:case B:case q:return wi(t,n);case w:return new i;case k:case O:return new i(t);case S:return function(t){var e=new t.constructor(t.source,ht.exec(t));return e.lastIndex=t.lastIndex,e}(t);case x:return new i;case F:return r=t,Ln?Et(Ln.call(r)):{}}}(t,h,u)}}s||(s=new Kn);var p=s.get(t);if(p)return p;s.set(t,a),oa(t)?t.forEach((function(r){a.add(sr(r,e,n,r,t,s))})):ea(t)&&t.forEach((function(r,i){a.set(i,sr(r,e,n,i,t,s))}));var v=f?i:(l?c?eo:to:c?ja:Ta)(t);return Ae(v||t,(function(r,i){v&&(r=t[i=r]),Qn(a,i,sr(r,e,n,i,t,s))})),a}function ar(t,e,n){var r=n.length;if(null==t)return!r;for(t=Et(t);r--;){var o=n[r],s=e[o],a=t[o];if(a===i&&!(o in t)||!s(a))return!1}return!0}function ur(t,e,n){if("function"!=typeof t)throw new xt(o);return Oo((function(){t.apply(i,n)}),e)}function cr(t,e,n,r){var i=-1,o=Fe,s=!0,a=t.length,u=[],c=e.length;if(!a)return u;n&&(e=je(e,Ge(n))),r?(o=Te,s=!1):e.length>=200&&(o=Xe,s=!1,e=new Vn(e));t:for(;++i<a;){var l=t[i],f=null==n?l:n(l);if(l=r||0!==l?l:0,s&&f==f){for(var h=c;h--;)if(e[h]===f)continue t;u.push(l)}else o(e,f,r)||u.push(l)}return u}Dn.templateSettings={escape:G,evaluate:J,interpolate:X,variable:"",imports:{_:Dn}},Dn.prototype=Bn.prototype,Dn.prototype.constructor=Dn,qn.prototype=In(Bn.prototype),qn.prototype.constructor=qn,Un.prototype=In(Bn.prototype),Un.prototype.constructor=Un,Hn.prototype.clear=function(){this.__data__=xn?xn(null):{},this.size=0},Hn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Hn.prototype.get=function(t){var e=this.__data__;if(xn){var n=e[t];return n===s?i:n}return Rt.call(e,t)?e[t]:i},Hn.prototype.has=function(t){var e=this.__data__;return xn?e[t]!==i:Rt.call(e,t)},Hn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=xn&&e===i?s:e,this},Wn.prototype.clear=function(){this.__data__=[],this.size=0},Wn.prototype.delete=function(t){var e=this.__data__,n=tr(e,t);return!(n<0||(n==e.length-1?e.pop():Kt.call(e,n,1),--this.size,0))},Wn.prototype.get=function(t){var e=this.__data__,n=tr(e,t);return n<0?i:e[n][1]},Wn.prototype.has=function(t){return tr(this.__data__,t)>-1},Wn.prototype.set=function(t,e){var n=this.__data__,r=tr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},zn.prototype.clear=function(){this.size=0,this.__data__={hash:new Hn,map:new(kn||Wn),string:new Hn}},zn.prototype.delete=function(t){var e=so(this,t).delete(t);return this.size-=e?1:0,e},zn.prototype.get=function(t){return so(this,t).get(t)},zn.prototype.has=function(t){return so(this,t).has(t)},zn.prototype.set=function(t,e){var n=so(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Vn.prototype.add=Vn.prototype.push=function(t){return this.__data__.set(t,s),this},Vn.prototype.has=function(t){return this.__data__.has(t)},Kn.prototype.clear=function(){this.__data__=new Wn,this.size=0},Kn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Kn.prototype.get=function(t){return this.__data__.get(t)},Kn.prototype.has=function(t){return this.__data__.has(t)},Kn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Wn){var r=n.__data__;if(!kn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new zn(r)}return n.set(t,e),this.size=n.size,this};var lr=Ti(mr),fr=Ti(_r,!0);function hr(t,e){var n=!0;return lr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function dr(t,e,n){for(var r=-1,o=t.length;++r<o;){var s=t[r],a=e(s);if(null!=a&&(u===i?a==a&&!aa(a):n(a,u)))var u=a,c=s}return c}function pr(t,e){var n=[];return lr(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function gr(t,e,n,r,i){var o=-1,s=t.length;for(n||(n=go),i||(i=[]);++o<s;){var a=t[o];e>0&&n(a)?e>1?gr(a,e-1,n,r,i):Pe(i,a):r||(i[i.length]=a)}return i}var vr=ji(),yr=ji(!0);function mr(t,e){return t&&vr(t,e,Ta)}function _r(t,e){return t&&yr(t,e,Ta)}function br(t,e){return Oe(e,(function(e){return Js(t[e])}))}function Cr(t,e){for(var n=0,r=(e=vi(e,t)).length;null!=t&&n<r;)t=t[Lo(e[n++])];return n&&n==r?t:i}function wr(t,e,n){var r=e(t);return Hs(t)?r:Pe(r,n(t))}function kr(t){return null==t?t===i?"[object Undefined]":"[object Null]":Zt&&Zt in Et(t)?function(t){var e=Rt.call(t,Zt),n=t[Zt];try{t[Zt]=i;var r=!0}catch(t){}var o=Lt.call(t);return r&&(e?t[Zt]=n:delete t[Zt]),o}(t):function(t){return Lt.call(t)}(t)}function Er(t,e){return t>e}function Ar(t,e){return null!=t&&Rt.call(t,e)}function Sr(t,e){return null!=t&&e in Et(t)}function xr(t,e,n){for(var o=n?Te:Fe,s=t[0].length,a=t.length,u=a,c=r(a),l=1/0,f=[];u--;){var h=t[u];u&&e&&(h=je(h,Ge(e))),l=yn(h.length,l),c[u]=!n&&(e||s>=120&&h.length>=120)?new Vn(u&&h):i}h=t[0];var d=-1,p=c[0];t:for(;++d<s&&f.length<l;){var g=h[d],v=e?e(g):g;if(g=n||0!==g?g:0,!(p?Xe(p,v):o(f,v,n))){for(u=a;--u;){var y=c[u];if(!(y?Xe(y,v):o(t[u],v,n)))continue t}p&&p.push(v),f.push(g)}}return f}function Or(t,e,n){var r=null==(t=Ao(t,e=vi(e,t)))?t:t[Lo(Go(e))];return null==r?i:ke(r,t,n)}function Fr(t){return ta(t)&&kr(t)==g}function Tr(t,e,n,r,o){return t===e||(null==t||null==e||!ta(t)&&!ta(e)?t!=t&&e!=e:function(t,e,n,r,o,s){var a=Hs(t),u=Hs(e),c=a?v:fo(t),l=u?v:fo(e),f=(c=c==g?E:c)==E,h=(l=l==g?E:l)==E,d=c==l;if(d&&Ks(t)){if(!Ks(e))return!1;a=!0,f=!1}if(d&&!f)return s||(s=new Kn),a||ua(t)?Zi(t,e,n,r,o,s):function(t,e,n,r,i,o,s){switch(n){case P:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case j:return!(t.byteLength!=e.byteLength||!o(new Ut(t),new Ut(e)));case y:case m:case k:return Is(+t,+e);case _:return t.name==e.name&&t.message==e.message;case S:case O:return t==e+"";case w:var a=on;case x:var u=1&r;if(a||(a=un),t.size!=e.size&&!u)return!1;var c=s.get(t);if(c)return c==e;r|=2,s.set(t,e);var l=Zi(a(t),a(e),r,i,o,s);return s.delete(t),l;case F:if(Ln)return Ln.call(t)==Ln.call(e)}return!1}(t,e,c,n,r,o,s);if(!(1&n)){var p=f&&Rt.call(t,"__wrapped__"),b=h&&Rt.call(e,"__wrapped__");if(p||b){var C=p?t.value():t,A=b?e.value():e;return s||(s=new Kn),o(C,A,n,r,s)}}return!!d&&(s||(s=new Kn),function(t,e,n,r,o,s){var a=1&n,u=to(t),c=u.length;if(c!=to(e).length&&!a)return!1;for(var l=c;l--;){var f=u[l];if(!(a?f in e:Rt.call(e,f)))return!1}var h=s.get(t),d=s.get(e);if(h&&d)return h==e&&d==t;var p=!0;s.set(t,e),s.set(e,t);for(var g=a;++l<c;){var v=t[f=u[l]],y=e[f];if(r)var m=a?r(y,v,f,e,t,s):r(v,y,f,t,e,s);if(!(m===i?v===y||o(v,y,n,r,s):m)){p=!1;break}g||(g="constructor"==f)}if(p&&!g){var _=t.constructor,b=e.constructor;_==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof b&&b instanceof b||(p=!1)}return s.delete(t),s.delete(e),p}(t,e,n,r,o,s))}(t,e,n,r,Tr,o))}function jr(t,e,n,r){var o=n.length,s=o,a=!r;if(null==t)return!s;for(t=Et(t);o--;){var u=n[o];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<s;){var c=(u=n[o])[0],l=t[c],f=u[1];if(a&&u[2]){if(l===i&&!(c in t))return!1}else{var h=new Kn;if(r)var d=r(l,f,c,t,e,h);if(!(d===i?Tr(f,l,3,r,h):d))return!1}}return!0}function Pr(t){return!(!Qs(t)||(e=t,Mt&&Mt in e))&&(Js(t)?It:gt).test(No(t));var e}function Rr(t){return"function"==typeof t?t:null==t?nu:"object"==typeof t?Hs(t)?Dr(t[0],t[1]):Nr(t):fu(t)}function $r(t){if(!Co(t))return gn(t);var e=[];for(var n in Et(t))Rt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Mr(t,e){return t<e}function Lr(t,e){var n=-1,i=zs(t)?r(t.length):[];return lr(t,(function(t,r,o){i[++n]=e(t,r,o)})),i}function Nr(t){var e=ao(t);return 1==e.length&&e[0][2]?ko(e[0][0],e[0][1]):function(n){return n===t||jr(n,t,e)}}function Dr(t,e){return mo(t)&&wo(e)?ko(Lo(t),e):function(n){var r=Aa(n,t);return r===i&&r===e?Sa(n,t):Tr(e,r,3)}}function Ir(t,e,n,r,o){t!==e&&vr(e,(function(s,a){if(o||(o=new Kn),Qs(s))!function(t,e,n,r,o,s,a){var u=So(t,n),c=So(e,n),l=a.get(c);if(l)Zn(t,n,l);else{var f=s?s(u,c,n+"",t,e,a):i,h=f===i;if(h){var d=Hs(c),p=!d&&Ks(c),g=!d&&!p&&ua(c);f=c,d||p||g?Hs(u)?f=u:Vs(u)?f=Si(u):p?(h=!1,f=bi(c,!0)):g?(h=!1,f=wi(c,!0)):f=[]:ra(c)||Us(c)?(f=u,Us(u)?f=va(u):Qs(u)&&!Js(u)||(f=po(c))):h=!1}h&&(a.set(c,f),o(f,c,r,s,a),a.delete(c)),Zn(t,n,f)}}(t,e,a,n,Ir,r,o);else{var u=r?r(So(t,a),s,a+"",t,e,o):i;u===i&&(u=s),Zn(t,a,u)}}),ja)}function Br(t,e){var n=t.length;if(n)return vo(e+=e<0?n:0,n)?t[e]:i}function qr(t,e,n){e=e.length?je(e,(function(t){return Hs(t)?function(e){return Cr(e,1===t.length?t[0]:t)}:t})):[nu];var r=-1;e=je(e,Ge(oo()));var i=Lr(t,(function(t,n,i){var o=je(e,(function(e){return e(t)}));return{criteria:o,index:++r,value:t}}));return function(t,e){var r=t.length;for(t.sort((function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,s=i.length,a=n.length;++r<s;){var u=ki(i[r],o[r]);if(u)return r>=a?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}));r--;)t[r]=t[r].value;return t}(i)}function Ur(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var s=e[r],a=Cr(t,s);n(a,s)&&Jr(o,vi(s,t),a)}return o}function Hr(t,e,n,r){var i=r?Be:Ie,o=-1,s=e.length,a=t;for(t===e&&(e=Si(e)),n&&(a=je(t,Ge(n)));++o<s;)for(var u=0,c=e[o],l=n?n(c):c;(u=i(a,l,u,r))>-1;)a!==t&&Kt.call(a,u,1),Kt.call(t,u,1);return t}function Wr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;vo(i)?Kt.call(t,i,1):ui(t,i)}}return t}function zr(t,e){return t+de(bn()*(e-t+1))}function Vr(t,e){var n="";if(!t||e<1||e>f)return n;do{e%2&&(n+=t),(e=de(e/2))&&(t+=t)}while(e);return n}function Kr(t,e){return Fo(Eo(t,e,nu),t+"")}function Yr(t){return Gn(Ia(t))}function Gr(t,e){var n=Ia(t);return Po(n,or(e,0,n.length))}function Jr(t,e,n,r){if(!Qs(t))return t;for(var o=-1,s=(e=vi(e,t)).length,a=s-1,u=t;null!=u&&++o<s;){var c=Lo(e[o]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return t;if(o!=a){var f=u[c];(l=r?r(f,c,u):i)===i&&(l=Qs(f)?f:vo(e[o+1])?[]:{})}Qn(u,c,l),u=u[c]}return t}var Xr=On?function(t,e){return On.set(t,e),t}:nu,Zr=te?function(t,e){return te(t,"toString",{configurable:!0,enumerable:!1,value:Qa(e),writable:!0})}:nu;function Qr(t){return Po(Ia(t))}function ti(t,e,n){var i=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var s=r(o);++i<o;)s[i]=t[i+e];return s}function ei(t,e){var n;return lr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function ni(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var o=r+i>>>1,s=t[o];null!==s&&!aa(s)&&(n?s<=e:s<e)?r=o+1:i=o}return i}return ri(t,e,nu,n)}function ri(t,e,n,r){var o=0,s=null==t?0:t.length;if(0===s)return 0;for(var a=(e=n(e))!=e,u=null===e,c=aa(e),l=e===i;o<s;){var f=de((o+s)/2),h=n(t[f]),d=h!==i,p=null===h,g=h==h,v=aa(h);if(a)var y=r||g;else y=l?g&&(r||d):u?g&&d&&(r||!p):c?g&&d&&!p&&(r||!v):!p&&!v&&(r?h<=e:h<e);y?o=f+1:s=f}return yn(s,4294967294)}function ii(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var s=t[n],a=e?e(s):s;if(!n||!Is(a,u)){var u=a;o[i++]=0===s?0:s}}return o}function oi(t){return"number"==typeof t?t:aa(t)?h:+t}function si(t){if("string"==typeof t)return t;if(Hs(t))return je(t,si)+"";if(aa(t))return Nn?Nn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ai(t,e,n){var r=-1,i=Fe,o=t.length,s=!0,a=[],u=a;if(n)s=!1,i=Te;else if(o>=200){var c=e?null:Vi(t);if(c)return un(c);s=!1,i=Xe,u=new Vn}else u=e?[]:a;t:for(;++r<o;){var l=t[r],f=e?e(l):l;if(l=n||0!==l?l:0,s&&f==f){for(var h=u.length;h--;)if(u[h]===f)continue t;e&&u.push(f),a.push(l)}else i(u,f,n)||(u!==a&&u.push(f),a.push(l))}return a}function ui(t,e){return null==(t=Ao(t,e=vi(e,t)))||delete t[Lo(Go(e))]}function ci(t,e,n,r){return Jr(t,e,n(Cr(t,e)),r)}function li(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?ti(t,r?0:o,r?o+1:i):ti(t,r?o+1:0,r?i:o)}function fi(t,e){var n=t;return n instanceof Un&&(n=n.value()),Re(e,(function(t,e){return e.func.apply(e.thisArg,Pe([t],e.args))}),n)}function hi(t,e,n){var i=t.length;if(i<2)return i?ai(t[0]):[];for(var o=-1,s=r(i);++o<i;)for(var a=t[o],u=-1;++u<i;)u!=o&&(s[o]=cr(s[o]||a,t[u],e,n));return ai(gr(s,1),e,n)}function di(t,e,n){for(var r=-1,o=t.length,s=e.length,a={};++r<o;){var u=r<s?e[r]:i;n(a,t[r],u)}return a}function pi(t){return Vs(t)?t:[]}function gi(t){return"function"==typeof t?t:nu}function vi(t,e){return Hs(t)?t:mo(t,e)?[t]:Mo(ya(t))}var yi=Kr;function mi(t,e,n){var r=t.length;return n=n===i?r:n,!e&&n>=r?t:ti(t,e,n)}var _i=se||function(t){return fe.clearTimeout(t)};function bi(t,e){if(e)return t.slice();var n=t.length,r=Ht?Ht(n):new t.constructor(n);return t.copy(r),r}function Ci(t){var e=new t.constructor(t.byteLength);return new Ut(e).set(new Ut(t)),e}function wi(t,e){var n=e?Ci(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function ki(t,e){if(t!==e){var n=t!==i,r=null===t,o=t==t,s=aa(t),a=e!==i,u=null===e,c=e==e,l=aa(e);if(!u&&!l&&!s&&t>e||s&&a&&c&&!u&&!l||r&&a&&c||!n&&c||!o)return 1;if(!r&&!s&&!l&&t<e||l&&n&&o&&!r&&!s||u&&n&&o||!a&&o||!c)return-1}return 0}function Ei(t,e,n,i){for(var o=-1,s=t.length,a=n.length,u=-1,c=e.length,l=vn(s-a,0),f=r(c+l),h=!i;++u<c;)f[u]=e[u];for(;++o<a;)(h||o<s)&&(f[n[o]]=t[o]);for(;l--;)f[u++]=t[o++];return f}function Ai(t,e,n,i){for(var o=-1,s=t.length,a=-1,u=n.length,c=-1,l=e.length,f=vn(s-u,0),h=r(f+l),d=!i;++o<f;)h[o]=t[o];for(var p=o;++c<l;)h[p+c]=e[c];for(;++a<u;)(d||o<s)&&(h[p+n[a]]=t[o++]);return h}function Si(t,e){var n=-1,i=t.length;for(e||(e=r(i));++n<i;)e[n]=t[n];return e}function xi(t,e,n,r){var o=!n;n||(n={});for(var s=-1,a=e.length;++s<a;){var u=e[s],c=r?r(n[u],t[u],u,n,t):i;c===i&&(c=t[u]),o?rr(n,u,c):Qn(n,u,c)}return n}function Oi(t,e){return function(n,r){var i=Hs(n)?Ee:er,o=e?e():{};return i(n,t,oo(r,2),o)}}function Fi(t){return Kr((function(e,n){var r=-1,o=n.length,s=o>1?n[o-1]:i,a=o>2?n[2]:i;for(s=t.length>3&&"function"==typeof s?(o--,s):i,a&&yo(n[0],n[1],a)&&(s=o<3?i:s,o=1),e=Et(e);++r<o;){var u=n[r];u&&t(e,u,r,s)}return e}))}function Ti(t,e){return function(n,r){if(null==n)return n;if(!zs(n))return t(n,r);for(var i=n.length,o=e?i:-1,s=Et(n);(e?o--:++o<i)&&!1!==r(s[o],o,s););return n}}function ji(t){return function(e,n,r){for(var i=-1,o=Et(e),s=r(e),a=s.length;a--;){var u=s[t?a:++i];if(!1===n(o[u],u,o))break}return e}}function Pi(t){return function(e){var n=rn(e=ya(e))?fn(e):i,r=n?n[0]:e.charAt(0),o=n?mi(n,1).join(""):e.slice(1);return r[t]()+o}}function Ri(t){return function(e){return Re(Ja(Ua(e).replace(Jt,"")),t,"")}}function $i(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=In(t.prototype),r=t.apply(n,e);return Qs(r)?r:n}}function Mi(t){return function(e,n,r){var o=Et(e);if(!zs(e)){var s=oo(n,3);e=Ta(e),n=function(t){return s(o[t],t,o)}}var a=t(e,n,r);return a>-1?o[s?e[a]:a]:i}}function Li(t){return Qi((function(e){var n=e.length,r=n,s=qn.prototype.thru;for(t&&e.reverse();r--;){var a=e[r];if("function"!=typeof a)throw new xt(o);if(s&&!u&&"wrapper"==ro(a))var u=new qn([],!0)}for(r=u?r:n;++r<n;){var c=ro(a=e[r]),l="wrapper"==c?no(a):i;u=l&&_o(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?u[ro(l[0])].apply(u,l[3]):1==a.length&&_o(a)?u[c]():u.thru(a)}return function(){var t=arguments,r=t[0];if(u&&1==t.length&&Hs(r))return u.plant(r).value();for(var i=0,o=n?e[i].apply(this,t):r;++i<n;)o=e[i].call(this,o);return o}}))}function Ni(t,e,n,o,s,a,u,l,f,h){var d=e&c,p=1&e,g=2&e,v=24&e,y=512&e,m=g?i:$i(t);return function c(){for(var _=arguments.length,b=r(_),C=_;C--;)b[C]=arguments[C];if(v)var w=io(c),k=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(b,w);if(o&&(b=Ei(b,o,s,v)),a&&(b=Ai(b,a,u,v)),_-=k,v&&_<h){var E=an(b,w);return Wi(t,e,Ni,c.placeholder,n,b,E,l,f,h-_)}var A=p?n:this,S=g?A[t]:t;return _=b.length,l?b=function(t,e){for(var n=t.length,r=yn(e.length,n),o=Si(t);r--;){var s=e[r];t[r]=vo(s,n)?o[s]:i}return t}(b,l):y&&_>1&&b.reverse(),d&&f<_&&(b.length=f),this&&this!==fe&&this instanceof c&&(S=m||$i(S)),S.apply(A,b)}}function Di(t,e){return function(n,r){return function(t,e,n,r){return mr(t,(function(t,i,o){e(r,n(t),i,o)})),r}(n,t,e(r),{})}}function Ii(t,e){return function(n,r){var o;if(n===i&&r===i)return e;if(n!==i&&(o=n),r!==i){if(o===i)return r;"string"==typeof n||"string"==typeof r?(n=si(n),r=si(r)):(n=oi(n),r=oi(r)),o=t(n,r)}return o}}function Bi(t){return Qi((function(e){return e=je(e,Ge(oo())),Kr((function(n){var r=this;return t(e,(function(t){return ke(t,r,n)}))}))}))}function qi(t,e){var n=(e=e===i?" ":si(e)).length;if(n<2)return n?Vr(e,t):e;var r=Vr(e,he(t/ln(e)));return rn(e)?mi(fn(r),0,t).join(""):r.slice(0,t)}function Ui(t){return function(e,n,o){return o&&"number"!=typeof o&&yo(e,n,o)&&(n=o=i),e=ha(e),n===i?(n=e,e=0):n=ha(n),function(t,e,n,i){for(var o=-1,s=vn(he((e-t)/(n||1)),0),a=r(s);s--;)a[i?s:++o]=t,t+=n;return a}(e,n,o=o===i?e<n?1:-1:ha(o),t)}}function Hi(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=ga(e),n=ga(n)),t(e,n)}}function Wi(t,e,n,r,o,s,a,c,l,f){var h=8&e;e|=h?u:64,4&(e&=~(h?64:u))||(e&=-4);var d=[t,e,o,h?s:i,h?a:i,h?i:s,h?i:a,c,l,f],p=n.apply(i,d);return _o(t)&&xo(p,d),p.placeholder=r,To(p,t,e)}function zi(t){var e=kt[t];return function(t,n){if(t=ga(t),(n=null==n?0:yn(da(n),292))&&Le(t)){var r=(ya(t)+"e").split("e");return+((r=(ya(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Vi=An&&1/un(new An([,-0]))[1]==l?function(t){return new An(t)}:au;function Ki(t){return function(e){var n=fo(e);return n==w?on(e):n==x?cn(e):function(t,e){return je(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Yi(t,e,n,s,l,f,h,d){var p=2&e;if(!p&&"function"!=typeof t)throw new xt(o);var g=s?s.length:0;if(g||(e&=-97,s=l=i),h=h===i?h:vn(da(h),0),d=d===i?d:da(d),g-=l?l.length:0,64&e){var v=s,y=l;s=l=i}var m=p?i:no(t),_=[t,e,n,s,l,v,y,f,h,d];if(m&&function(t,e){var n=t[1],r=e[1],i=n|r,o=i<131,s=r==c&&8==n||r==c&&256==n&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!o&&!s)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var u=e[3];if(u){var l=t[3];t[3]=l?Ei(l,u,e[4]):u,t[4]=l?an(t[3],a):e[4]}(u=e[5])&&(l=t[5],t[5]=l?Ai(l,u,e[6]):u,t[6]=l?an(t[5],a):e[6]),(u=e[7])&&(t[7]=u),r&c&&(t[8]=null==t[8]?e[8]:yn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i}(_,m),t=_[0],e=_[1],n=_[2],s=_[3],l=_[4],!(d=_[9]=_[9]===i?p?0:t.length:vn(_[9]-g,0))&&24&e&&(e&=-25),e&&1!=e)b=8==e||16==e?function(t,e,n){var o=$i(t);return function s(){for(var a=arguments.length,u=r(a),c=a,l=io(s);c--;)u[c]=arguments[c];var f=a<3&&u[0]!==l&&u[a-1]!==l?[]:an(u,l);return(a-=f.length)<n?Wi(t,e,Ni,s.placeholder,i,u,f,i,i,n-a):ke(this&&this!==fe&&this instanceof s?o:t,this,u)}}(t,e,d):e!=u&&33!=e||l.length?Ni.apply(i,_):function(t,e,n,i){var o=1&e,s=$i(t);return function e(){for(var a=-1,u=arguments.length,c=-1,l=i.length,f=r(l+u),h=this&&this!==fe&&this instanceof e?s:t;++c<l;)f[c]=i[c];for(;u--;)f[c++]=arguments[++a];return ke(h,o?n:this,f)}}(t,e,n,s);else var b=function(t,e,n){var r=1&e,i=$i(t);return function e(){return(this&&this!==fe&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,n);return To((m?Xr:xo)(b,_),t,e)}function Gi(t,e,n,r){return t===i||Is(t,Tt[n])&&!Rt.call(r,n)?e:t}function Ji(t,e,n,r,o,s){return Qs(t)&&Qs(e)&&(s.set(e,t),Ir(t,e,i,Ji,s),s.delete(e)),t}function Xi(t){return ra(t)?i:t}function Zi(t,e,n,r,o,s){var a=1&n,u=t.length,c=e.length;if(u!=c&&!(a&&c>u))return!1;var l=s.get(t),f=s.get(e);if(l&&f)return l==e&&f==t;var h=-1,d=!0,p=2&n?new Vn:i;for(s.set(t,e),s.set(e,t);++h<u;){var g=t[h],v=e[h];if(r)var y=a?r(v,g,h,e,t,s):r(g,v,h,t,e,s);if(y!==i){if(y)continue;d=!1;break}if(p){if(!Me(e,(function(t,e){if(!Xe(p,e)&&(g===t||o(g,t,n,r,s)))return p.push(e)}))){d=!1;break}}else if(g!==v&&!o(g,v,n,r,s)){d=!1;break}}return s.delete(t),s.delete(e),d}function Qi(t){return Fo(Eo(t,i,Wo),t+"")}function to(t){return wr(t,Ta,co)}function eo(t){return wr(t,ja,lo)}var no=On?function(t){return On.get(t)}:au;function ro(t){for(var e=t.name+"",n=Fn[e],r=Rt.call(Fn,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function io(t){return(Rt.call(Dn,"placeholder")?Dn:t).placeholder}function oo(){var t=Dn.iteratee||ru;return t=t===ru?Rr:t,arguments.length?t(arguments[0],arguments[1]):t}function so(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function ao(t){for(var e=Ta(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,wo(i)]}return e}function uo(t,e){var n=function(t,e){return null==t?i:t[e]}(t,e);return Pr(n)?n:i}var co=ge?function(t){return null==t?[]:(t=Et(t),Oe(ge(t),(function(e){return Vt.call(t,e)})))}:pu,lo=ge?function(t){for(var e=[];t;)Pe(e,co(t)),t=Wt(t);return e}:pu,fo=kr;function ho(t,e,n){for(var r=-1,i=(e=vi(e,t)).length,o=!1;++r<i;){var s=Lo(e[r]);if(!(o=null!=t&&n(t,s)))break;t=t[s]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&Zs(i)&&vo(s,i)&&(Hs(t)||Us(t))}function po(t){return"function"!=typeof t.constructor||Co(t)?{}:In(Wt(t))}function go(t){return Hs(t)||Us(t)||!!(Yt&&t&&t[Yt])}function vo(t,e){var n=typeof t;return!!(e=null==e?f:e)&&("number"==n||"symbol"!=n&&yt.test(t))&&t>-1&&t%1==0&&t<e}function yo(t,e,n){if(!Qs(n))return!1;var r=typeof e;return!!("number"==r?zs(n)&&vo(e,n.length):"string"==r&&e in n)&&Is(n[e],t)}function mo(t,e){if(Hs(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!aa(t))||Q.test(t)||!Z.test(t)||null!=e&&t in Et(e)}function _o(t){var e=ro(t),n=Dn[e];if("function"!=typeof n||!(e in Un.prototype))return!1;if(t===n)return!0;var r=no(n);return!!r&&t===r[0]}(wn&&fo(new wn(new ArrayBuffer(1)))!=P||kn&&fo(new kn)!=w||En&&fo(En.resolve())!=A||An&&fo(new An)!=x||Sn&&fo(new Sn)!=T)&&(fo=function(t){var e=kr(t),n=e==E?t.constructor:i,r=n?No(n):"";if(r)switch(r){case Tn:return P;case jn:return w;case Pn:return A;case Rn:return x;case $n:return T}return e});var bo=jt?Js:gu;function Co(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Tt)}function wo(t){return t==t&&!Qs(t)}function ko(t,e){return function(n){return null!=n&&n[t]===e&&(e!==i||t in Et(n))}}function Eo(t,e,n){return e=vn(e===i?t.length-1:e,0),function(){for(var i=arguments,o=-1,s=vn(i.length-e,0),a=r(s);++o<s;)a[o]=i[e+o];o=-1;for(var u=r(e+1);++o<e;)u[o]=i[o];return u[e]=n(a),ke(t,this,u)}}function Ao(t,e){return e.length<2?t:Cr(t,ti(e,0,-1))}function So(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var xo=jo(Xr),Oo=le||function(t,e){return fe.setTimeout(t,e)},Fo=jo(Zr);function To(t,e,n){var r=e+"";return Fo(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(ot,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Ae(p,(function(n){var r="_."+n[0];e&n[1]&&!Fe(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(st);return e?e[1].split(at):[]}(r),n)))}function jo(t){var e=0,n=0;return function(){var r=mn(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(i,arguments)}}function Po(t,e){var n=-1,r=t.length,o=r-1;for(e=e===i?r:e;++n<e;){var s=zr(n,o),a=t[s];t[s]=t[n],t[n]=a}return t.length=e,t}var Ro,$o,Mo=(Ro=Rs((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(tt,(function(t,n,r,i){e.push(r?i.replace(lt,"$1"):n||t)})),e}),(function(t){return 500===$o.size&&$o.clear(),t})),$o=Ro.cache,Ro);function Lo(t){if("string"==typeof t||aa(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function No(t){if(null!=t){try{return Pt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Do(t){if(t instanceof Un)return t.clone();var e=new qn(t.__wrapped__,t.__chain__);return e.__actions__=Si(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Io=Kr((function(t,e){return Vs(t)?cr(t,gr(e,1,Vs,!0)):[]})),Bo=Kr((function(t,e){var n=Go(e);return Vs(n)&&(n=i),Vs(t)?cr(t,gr(e,1,Vs,!0),oo(n,2)):[]})),qo=Kr((function(t,e){var n=Go(e);return Vs(n)&&(n=i),Vs(t)?cr(t,gr(e,1,Vs,!0),i,n):[]}));function Uo(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:da(n);return i<0&&(i=vn(r+i,0)),De(t,oo(e,3),i)}function Ho(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r-1;return n!==i&&(o=da(n),o=n<0?vn(r+o,0):yn(o,r-1)),De(t,oo(e,3),o,!0)}function Wo(t){return null!=t&&t.length?gr(t,1):[]}function zo(t){return t&&t.length?t[0]:i}var Vo=Kr((function(t){var e=je(t,pi);return e.length&&e[0]===t[0]?xr(e):[]})),Ko=Kr((function(t){var e=Go(t),n=je(t,pi);return e===Go(n)?e=i:n.pop(),n.length&&n[0]===t[0]?xr(n,oo(e,2)):[]})),Yo=Kr((function(t){var e=Go(t),n=je(t,pi);return(e="function"==typeof e?e:i)&&n.pop(),n.length&&n[0]===t[0]?xr(n,i,e):[]}));function Go(t){var e=null==t?0:t.length;return e?t[e-1]:i}var Jo=Kr(Xo);function Xo(t,e){return t&&t.length&&e&&e.length?Hr(t,e):t}var Zo=Qi((function(t,e){var n=null==t?0:t.length,r=ir(t,e);return Wr(t,je(e,(function(t){return vo(t,n)?+t:t})).sort(ki)),r}));function Qo(t){return null==t?t:Cn.call(t)}var ts=Kr((function(t){return ai(gr(t,1,Vs,!0))})),es=Kr((function(t){var e=Go(t);return Vs(e)&&(e=i),ai(gr(t,1,Vs,!0),oo(e,2))})),ns=Kr((function(t){var e=Go(t);return e="function"==typeof e?e:i,ai(gr(t,1,Vs,!0),i,e)}));function rs(t){if(!t||!t.length)return[];var e=0;return t=Oe(t,(function(t){if(Vs(t))return e=vn(t.length,e),!0})),Ke(e,(function(e){return je(t,He(e))}))}function is(t,e){if(!t||!t.length)return[];var n=rs(t);return null==e?n:je(n,(function(t){return ke(e,i,t)}))}var os=Kr((function(t,e){return Vs(t)?cr(t,e):[]})),ss=Kr((function(t){return hi(Oe(t,Vs))})),as=Kr((function(t){var e=Go(t);return Vs(e)&&(e=i),hi(Oe(t,Vs),oo(e,2))})),us=Kr((function(t){var e=Go(t);return e="function"==typeof e?e:i,hi(Oe(t,Vs),i,e)})),cs=Kr(rs),ls=Kr((function(t){var e=t.length,n=e>1?t[e-1]:i;return n="function"==typeof n?(t.pop(),n):i,is(t,n)}));function fs(t){var e=Dn(t);return e.__chain__=!0,e}function hs(t,e){return e(t)}var ds=Qi((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,o=function(e){return ir(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Un&&vo(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:hs,args:[o],thisArg:i}),new qn(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(i),t}))):this.thru(o)})),ps=Oi((function(t,e,n){Rt.call(t,n)?++t[n]:rr(t,n,1)})),gs=Mi(Uo),vs=Mi(Ho);function ys(t,e){return(Hs(t)?Ae:lr)(t,oo(e,3))}function ms(t,e){return(Hs(t)?Se:fr)(t,oo(e,3))}var _s=Oi((function(t,e,n){Rt.call(t,n)?t[n].push(e):rr(t,n,[e])})),bs=Kr((function(t,e,n){var i=-1,o="function"==typeof e,s=zs(t)?r(t.length):[];return lr(t,(function(t){s[++i]=o?ke(e,t,n):Or(t,e,n)})),s})),Cs=Oi((function(t,e,n){rr(t,n,e)}));function ws(t,e){return(Hs(t)?je:Lr)(t,oo(e,3))}var ks=Oi((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Es=Kr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&yo(t,e[0],e[1])?e=[]:n>2&&yo(e[0],e[1],e[2])&&(e=[e[0]]),qr(t,gr(e,1),[])})),As=ce||function(){return fe.Date.now()};function Ss(t,e,n){return e=n?i:e,e=t&&null==e?t.length:e,Yi(t,c,i,i,i,i,e)}function xs(t,e){var n;if("function"!=typeof e)throw new xt(o);return t=da(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=i),n}}var Os=Kr((function(t,e,n){var r=1;if(n.length){var i=an(n,io(Os));r|=u}return Yi(t,r,e,n,i)})),Fs=Kr((function(t,e,n){var r=3;if(n.length){var i=an(n,io(Fs));r|=u}return Yi(e,r,t,n,i)}));function Ts(t,e,n){var r,s,a,u,c,l,f=0,h=!1,d=!1,p=!0;if("function"!=typeof t)throw new xt(o);function g(e){var n=r,o=s;return r=s=i,f=e,u=t.apply(o,n)}function v(t){var n=t-l;return l===i||n>=e||n<0||d&&t-f>=a}function y(){var t=As();if(v(t))return m(t);c=Oo(y,function(t){var n=e-(t-l);return d?yn(n,a-(t-f)):n}(t))}function m(t){return c=i,p&&r?g(t):(r=s=i,u)}function _(){var t=As(),n=v(t);if(r=arguments,s=this,l=t,n){if(c===i)return function(t){return f=t,c=Oo(y,e),h?g(t):u}(l);if(d)return _i(c),c=Oo(y,e),g(l)}return c===i&&(c=Oo(y,e)),u}return e=ga(e)||0,Qs(n)&&(h=!!n.leading,a=(d="maxWait"in n)?vn(ga(n.maxWait)||0,e):a,p="trailing"in n?!!n.trailing:p),_.cancel=function(){c!==i&&_i(c),f=0,r=l=s=c=i},_.flush=function(){return c===i?u:m(As())},_}var js=Kr((function(t,e){return ur(t,1,e)})),Ps=Kr((function(t,e,n){return ur(t,ga(e)||0,n)}));function Rs(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new xt(o);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Rs.Cache||zn),n}function $s(t){if("function"!=typeof t)throw new xt(o);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Rs.Cache=zn;var Ms=yi((function(t,e){var n=(e=1==e.length&&Hs(e[0])?je(e[0],Ge(oo())):je(gr(e,1),Ge(oo()))).length;return Kr((function(r){for(var i=-1,o=yn(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return ke(t,this,r)}))})),Ls=Kr((function(t,e){var n=an(e,io(Ls));return Yi(t,u,i,e,n)})),Ns=Kr((function(t,e){var n=an(e,io(Ns));return Yi(t,64,i,e,n)})),Ds=Qi((function(t,e){return Yi(t,256,i,i,i,e)}));function Is(t,e){return t===e||t!=t&&e!=e}var Bs=Hi(Er),qs=Hi((function(t,e){return t>=e})),Us=Fr(function(){return arguments}())?Fr:function(t){return ta(t)&&Rt.call(t,"callee")&&!Vt.call(t,"callee")},Hs=r.isArray,Ws=ye?Ge(ye):function(t){return ta(t)&&kr(t)==j};function zs(t){return null!=t&&Zs(t.length)&&!Js(t)}function Vs(t){return ta(t)&&zs(t)}var Ks=ve||gu,Ys=me?Ge(me):function(t){return ta(t)&&kr(t)==m};function Gs(t){if(!ta(t))return!1;var e=kr(t);return e==_||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ra(t)}function Js(t){if(!Qs(t))return!1;var e=kr(t);return e==b||e==C||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Xs(t){return"number"==typeof t&&t==da(t)}function Zs(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=f}function Qs(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ta(t){return null!=t&&"object"==typeof t}var ea=_e?Ge(_e):function(t){return ta(t)&&fo(t)==w};function na(t){return"number"==typeof t||ta(t)&&kr(t)==k}function ra(t){if(!ta(t)||kr(t)!=E)return!1;var e=Wt(t);if(null===e)return!0;var n=Rt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Pt.call(n)==Nt}var ia=be?Ge(be):function(t){return ta(t)&&kr(t)==S},oa=Ce?Ge(Ce):function(t){return ta(t)&&fo(t)==x};function sa(t){return"string"==typeof t||!Hs(t)&&ta(t)&&kr(t)==O}function aa(t){return"symbol"==typeof t||ta(t)&&kr(t)==F}var ua=we?Ge(we):function(t){return ta(t)&&Zs(t.length)&&!!ie[kr(t)]},ca=Hi(Mr),la=Hi((function(t,e){return t<=e}));function fa(t){if(!t)return[];if(zs(t))return sa(t)?fn(t):Si(t);if(Gt&&t[Gt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Gt]());var e=fo(t);return(e==w?on:e==x?un:Ia)(t)}function ha(t){return t?(t=ga(t))===l||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function da(t){var e=ha(t),n=e%1;return e==e?n?e-n:e:0}function pa(t){return t?or(da(t),0,d):0}function ga(t){if("number"==typeof t)return t;if(aa(t))return h;if(Qs(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Qs(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ye(t);var n=pt.test(t);return n||vt.test(t)?ue(t.slice(2),n?2:8):dt.test(t)?h:+t}function va(t){return xi(t,ja(t))}function ya(t){return null==t?"":si(t)}var ma=Fi((function(t,e){if(Co(e)||zs(e))xi(e,Ta(e),t);else for(var n in e)Rt.call(e,n)&&Qn(t,n,e[n])})),_a=Fi((function(t,e){xi(e,ja(e),t)})),ba=Fi((function(t,e,n,r){xi(e,ja(e),t,r)})),Ca=Fi((function(t,e,n,r){xi(e,Ta(e),t,r)})),wa=Qi(ir),ka=Kr((function(t,e){t=Et(t);var n=-1,r=e.length,o=r>2?e[2]:i;for(o&&yo(e[0],e[1],o)&&(r=1);++n<r;)for(var s=e[n],a=ja(s),u=-1,c=a.length;++u<c;){var l=a[u],f=t[l];(f===i||Is(f,Tt[l])&&!Rt.call(t,l))&&(t[l]=s[l])}return t})),Ea=Kr((function(t){return t.push(i,Ji),ke(Ra,i,t)}));function Aa(t,e,n){var r=null==t?i:Cr(t,e);return r===i?n:r}function Sa(t,e){return null!=t&&ho(t,e,Sr)}var xa=Di((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Lt.call(e)),t[e]=n}),Qa(nu)),Oa=Di((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Lt.call(e)),Rt.call(t,e)?t[e].push(n):t[e]=[n]}),oo),Fa=Kr(Or);function Ta(t){return zs(t)?Yn(t):$r(t)}function ja(t){return zs(t)?Yn(t,!0):function(t){if(!Qs(t))return function(t){var e=[];if(null!=t)for(var n in Et(t))e.push(n);return e}(t);var e=Co(t),n=[];for(var r in t)("constructor"!=r||!e&&Rt.call(t,r))&&n.push(r);return n}(t)}var Pa=Fi((function(t,e,n){Ir(t,e,n)})),Ra=Fi((function(t,e,n,r){Ir(t,e,n,r)})),$a=Qi((function(t,e){var n={};if(null==t)return n;var r=!1;e=je(e,(function(e){return e=vi(e,t),r||(r=e.length>1),e})),xi(t,eo(t),n),r&&(n=sr(n,7,Xi));for(var i=e.length;i--;)ui(n,e[i]);return n})),Ma=Qi((function(t,e){return null==t?{}:function(t,e){return Ur(t,e,(function(e,n){return Sa(t,n)}))}(t,e)}));function La(t,e){if(null==t)return{};var n=je(eo(t),(function(t){return[t]}));return e=oo(e),Ur(t,n,(function(t,n){return e(t,n[0])}))}var Na=Ki(Ta),Da=Ki(ja);function Ia(t){return null==t?[]:Je(t,Ta(t))}var Ba=Ri((function(t,e,n){return e=e.toLowerCase(),t+(n?qa(e):e)}));function qa(t){return Ga(ya(t).toLowerCase())}function Ua(t){return(t=ya(t))&&t.replace(mt,tn).replace(Xt,"")}var Ha=Ri((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Wa=Ri((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),za=Pi("toLowerCase"),Va=Ri((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Ka=Ri((function(t,e,n){return t+(n?" ":"")+Ga(e)})),Ya=Ri((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Ga=Pi("toUpperCase");function Ja(t,e,n){return t=ya(t),(e=n?i:e)===i?function(t){return ee.test(t)}(t)?function(t){return t.match(Qt)||[]}(t):function(t){return t.match(ut)||[]}(t):t.match(e)||[]}var Xa=Kr((function(t,e){try{return ke(t,i,e)}catch(t){return Gs(t)?t:new Ct(t)}})),Za=Qi((function(t,e){return Ae(e,(function(e){e=Lo(e),rr(t,e,Os(t[e],t))})),t}));function Qa(t){return function(){return t}}var tu=Li(),eu=Li(!0);function nu(t){return t}function ru(t){return Rr("function"==typeof t?t:sr(t,1))}var iu=Kr((function(t,e){return function(n){return Or(n,t,e)}})),ou=Kr((function(t,e){return function(n){return Or(t,n,e)}}));function su(t,e,n){var r=Ta(e),i=br(e,r);null!=n||Qs(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=br(e,Ta(e)));var o=!(Qs(n)&&"chain"in n&&!n.chain),s=Js(t);return Ae(i,(function(n){var r=e[n];t[n]=r,s&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=Si(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Pe([this.value()],arguments))})})),t}function au(){}var uu=Bi(je),cu=Bi(xe),lu=Bi(Me);function fu(t){return mo(t)?He(Lo(t)):function(t){return function(e){return Cr(e,t)}}(t)}var hu=Ui(),du=Ui(!0);function pu(){return[]}function gu(){return!1}var vu,yu=Ii((function(t,e){return t+e}),0),mu=zi("ceil"),_u=Ii((function(t,e){return t/e}),1),bu=zi("floor"),Cu=Ii((function(t,e){return t*e}),1),wu=zi("round"),ku=Ii((function(t,e){return t-e}),0);return Dn.after=function(t,e){if("function"!=typeof e)throw new xt(o);return t=da(t),function(){if(--t<1)return e.apply(this,arguments)}},Dn.ary=Ss,Dn.assign=ma,Dn.assignIn=_a,Dn.assignInWith=ba,Dn.assignWith=Ca,Dn.at=wa,Dn.before=xs,Dn.bind=Os,Dn.bindAll=Za,Dn.bindKey=Fs,Dn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Hs(t)?t:[t]},Dn.chain=fs,Dn.chunk=function(t,e,n){e=(n?yo(t,e,n):e===i)?1:vn(da(e),0);var o=null==t?0:t.length;if(!o||e<1)return[];for(var s=0,a=0,u=r(he(o/e));s<o;)u[a++]=ti(t,s,s+=e);return u},Dn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},Dn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=r(t-1),n=arguments[0],i=t;i--;)e[i-1]=arguments[i];return Pe(Hs(n)?Si(n):[n],gr(e,1))},Dn.cond=function(t){var e=null==t?0:t.length,n=oo();return t=e?je(t,(function(t){if("function"!=typeof t[1])throw new xt(o);return[n(t[0]),t[1]]})):[],Kr((function(n){for(var r=-1;++r<e;){var i=t[r];if(ke(i[0],this,n))return ke(i[1],this,n)}}))},Dn.conforms=function(t){return function(t){var e=Ta(t);return function(n){return ar(n,t,e)}}(sr(t,1))},Dn.constant=Qa,Dn.countBy=ps,Dn.create=function(t,e){var n=In(t);return null==e?n:nr(n,e)},Dn.curry=function t(e,n,r){var o=Yi(e,8,i,i,i,i,i,n=r?i:n);return o.placeholder=t.placeholder,o},Dn.curryRight=function t(e,n,r){var o=Yi(e,16,i,i,i,i,i,n=r?i:n);return o.placeholder=t.placeholder,o},Dn.debounce=Ts,Dn.defaults=ka,Dn.defaultsDeep=Ea,Dn.defer=js,Dn.delay=Ps,Dn.difference=Io,Dn.differenceBy=Bo,Dn.differenceWith=qo,Dn.drop=function(t,e,n){var r=null==t?0:t.length;return r?ti(t,(e=n||e===i?1:da(e))<0?0:e,r):[]},Dn.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?ti(t,0,(e=r-(e=n||e===i?1:da(e)))<0?0:e):[]},Dn.dropRightWhile=function(t,e){return t&&t.length?li(t,oo(e,3),!0,!0):[]},Dn.dropWhile=function(t,e){return t&&t.length?li(t,oo(e,3),!0):[]},Dn.fill=function(t,e,n,r){var o=null==t?0:t.length;return o?(n&&"number"!=typeof n&&yo(t,e,n)&&(n=0,r=o),function(t,e,n,r){var o=t.length;for((n=da(n))<0&&(n=-n>o?0:o+n),(r=r===i||r>o?o:da(r))<0&&(r+=o),r=n>r?0:pa(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},Dn.filter=function(t,e){return(Hs(t)?Oe:pr)(t,oo(e,3))},Dn.flatMap=function(t,e){return gr(ws(t,e),1)},Dn.flatMapDeep=function(t,e){return gr(ws(t,e),l)},Dn.flatMapDepth=function(t,e,n){return n=n===i?1:da(n),gr(ws(t,e),n)},Dn.flatten=Wo,Dn.flattenDeep=function(t){return null!=t&&t.length?gr(t,l):[]},Dn.flattenDepth=function(t,e){return null!=t&&t.length?gr(t,e=e===i?1:da(e)):[]},Dn.flip=function(t){return Yi(t,512)},Dn.flow=tu,Dn.flowRight=eu,Dn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},Dn.functions=function(t){return null==t?[]:br(t,Ta(t))},Dn.functionsIn=function(t){return null==t?[]:br(t,ja(t))},Dn.groupBy=_s,Dn.initial=function(t){return null!=t&&t.length?ti(t,0,-1):[]},Dn.intersection=Vo,Dn.intersectionBy=Ko,Dn.intersectionWith=Yo,Dn.invert=xa,Dn.invertBy=Oa,Dn.invokeMap=bs,Dn.iteratee=ru,Dn.keyBy=Cs,Dn.keys=Ta,Dn.keysIn=ja,Dn.map=ws,Dn.mapKeys=function(t,e){var n={};return e=oo(e,3),mr(t,(function(t,r,i){rr(n,e(t,r,i),t)})),n},Dn.mapValues=function(t,e){var n={};return e=oo(e,3),mr(t,(function(t,r,i){rr(n,r,e(t,r,i))})),n},Dn.matches=function(t){return Nr(sr(t,1))},Dn.matchesProperty=function(t,e){return Dr(t,sr(e,1))},Dn.memoize=Rs,Dn.merge=Pa,Dn.mergeWith=Ra,Dn.method=iu,Dn.methodOf=ou,Dn.mixin=su,Dn.negate=$s,Dn.nthArg=function(t){return t=da(t),Kr((function(e){return Br(e,t)}))},Dn.omit=$a,Dn.omitBy=function(t,e){return La(t,$s(oo(e)))},Dn.once=function(t){return xs(2,t)},Dn.orderBy=function(t,e,n,r){return null==t?[]:(Hs(e)||(e=null==e?[]:[e]),Hs(n=r?i:n)||(n=null==n?[]:[n]),qr(t,e,n))},Dn.over=uu,Dn.overArgs=Ms,Dn.overEvery=cu,Dn.overSome=lu,Dn.partial=Ls,Dn.partialRight=Ns,Dn.partition=ks,Dn.pick=Ma,Dn.pickBy=La,Dn.property=fu,Dn.propertyOf=function(t){return function(e){return null==t?i:Cr(t,e)}},Dn.pull=Jo,Dn.pullAll=Xo,Dn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Hr(t,e,oo(n,2)):t},Dn.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?Hr(t,e,i,n):t},Dn.pullAt=Zo,Dn.range=hu,Dn.rangeRight=du,Dn.rearg=Ds,Dn.reject=function(t,e){return(Hs(t)?Oe:pr)(t,$s(oo(e,3)))},Dn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=oo(e,3);++r<o;){var s=t[r];e(s,r,t)&&(n.push(s),i.push(r))}return Wr(t,i),n},Dn.rest=function(t,e){if("function"!=typeof t)throw new xt(o);return Kr(t,e=e===i?e:da(e))},Dn.reverse=Qo,Dn.sampleSize=function(t,e,n){return e=(n?yo(t,e,n):e===i)?1:da(e),(Hs(t)?Jn:Gr)(t,e)},Dn.set=function(t,e,n){return null==t?t:Jr(t,e,n)},Dn.setWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:Jr(t,e,n,r)},Dn.shuffle=function(t){return(Hs(t)?Xn:Qr)(t)},Dn.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&yo(t,e,n)?(e=0,n=r):(e=null==e?0:da(e),n=n===i?r:da(n)),ti(t,e,n)):[]},Dn.sortBy=Es,Dn.sortedUniq=function(t){return t&&t.length?ii(t):[]},Dn.sortedUniqBy=function(t,e){return t&&t.length?ii(t,oo(e,2)):[]},Dn.split=function(t,e,n){return n&&"number"!=typeof n&&yo(t,e,n)&&(e=n=i),(n=n===i?d:n>>>0)?(t=ya(t))&&("string"==typeof e||null!=e&&!ia(e))&&!(e=si(e))&&rn(t)?mi(fn(t),0,n):t.split(e,n):[]},Dn.spread=function(t,e){if("function"!=typeof t)throw new xt(o);return e=null==e?0:vn(da(e),0),Kr((function(n){var r=n[e],i=mi(n,0,e);return r&&Pe(i,r),ke(t,this,i)}))},Dn.tail=function(t){var e=null==t?0:t.length;return e?ti(t,1,e):[]},Dn.take=function(t,e,n){return t&&t.length?ti(t,0,(e=n||e===i?1:da(e))<0?0:e):[]},Dn.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?ti(t,(e=r-(e=n||e===i?1:da(e)))<0?0:e,r):[]},Dn.takeRightWhile=function(t,e){return t&&t.length?li(t,oo(e,3),!1,!0):[]},Dn.takeWhile=function(t,e){return t&&t.length?li(t,oo(e,3)):[]},Dn.tap=function(t,e){return e(t),t},Dn.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new xt(o);return Qs(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Ts(t,e,{leading:r,maxWait:e,trailing:i})},Dn.thru=hs,Dn.toArray=fa,Dn.toPairs=Na,Dn.toPairsIn=Da,Dn.toPath=function(t){return Hs(t)?je(t,Lo):aa(t)?[t]:Si(Mo(ya(t)))},Dn.toPlainObject=va,Dn.transform=function(t,e,n){var r=Hs(t),i=r||Ks(t)||ua(t);if(e=oo(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:Qs(t)&&Js(o)?In(Wt(t)):{}}return(i?Ae:mr)(t,(function(t,r,i){return e(n,t,r,i)})),n},Dn.unary=function(t){return Ss(t,1)},Dn.union=ts,Dn.unionBy=es,Dn.unionWith=ns,Dn.uniq=function(t){return t&&t.length?ai(t):[]},Dn.uniqBy=function(t,e){return t&&t.length?ai(t,oo(e,2)):[]},Dn.uniqWith=function(t,e){return e="function"==typeof e?e:i,t&&t.length?ai(t,i,e):[]},Dn.unset=function(t,e){return null==t||ui(t,e)},Dn.unzip=rs,Dn.unzipWith=is,Dn.update=function(t,e,n){return null==t?t:ci(t,e,gi(n))},Dn.updateWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:ci(t,e,gi(n),r)},Dn.values=Ia,Dn.valuesIn=function(t){return null==t?[]:Je(t,ja(t))},Dn.without=os,Dn.words=Ja,Dn.wrap=function(t,e){return Ls(gi(e),t)},Dn.xor=ss,Dn.xorBy=as,Dn.xorWith=us,Dn.zip=cs,Dn.zipObject=function(t,e){return di(t||[],e||[],Qn)},Dn.zipObjectDeep=function(t,e){return di(t||[],e||[],Jr)},Dn.zipWith=ls,Dn.entries=Na,Dn.entriesIn=Da,Dn.extend=_a,Dn.extendWith=ba,su(Dn,Dn),Dn.add=yu,Dn.attempt=Xa,Dn.camelCase=Ba,Dn.capitalize=qa,Dn.ceil=mu,Dn.clamp=function(t,e,n){return n===i&&(n=e,e=i),n!==i&&(n=(n=ga(n))==n?n:0),e!==i&&(e=(e=ga(e))==e?e:0),or(ga(t),e,n)},Dn.clone=function(t){return sr(t,4)},Dn.cloneDeep=function(t){return sr(t,5)},Dn.cloneDeepWith=function(t,e){return sr(t,5,e="function"==typeof e?e:i)},Dn.cloneWith=function(t,e){return sr(t,4,e="function"==typeof e?e:i)},Dn.conformsTo=function(t,e){return null==e||ar(t,e,Ta(e))},Dn.deburr=Ua,Dn.defaultTo=function(t,e){return null==t||t!=t?e:t},Dn.divide=_u,Dn.endsWith=function(t,e,n){t=ya(t),e=si(e);var r=t.length,o=n=n===i?r:or(da(n),0,r);return(n-=e.length)>=0&&t.slice(n,o)==e},Dn.eq=Is,Dn.escape=function(t){return(t=ya(t))&&Y.test(t)?t.replace(V,en):t},Dn.escapeRegExp=function(t){return(t=ya(t))&&nt.test(t)?t.replace(et,"\\$&"):t},Dn.every=function(t,e,n){var r=Hs(t)?xe:hr;return n&&yo(t,e,n)&&(e=i),r(t,oo(e,3))},Dn.find=gs,Dn.findIndex=Uo,Dn.findKey=function(t,e){return Ne(t,oo(e,3),mr)},Dn.findLast=vs,Dn.findLastIndex=Ho,Dn.findLastKey=function(t,e){return Ne(t,oo(e,3),_r)},Dn.floor=bu,Dn.forEach=ys,Dn.forEachRight=ms,Dn.forIn=function(t,e){return null==t?t:vr(t,oo(e,3),ja)},Dn.forInRight=function(t,e){return null==t?t:yr(t,oo(e,3),ja)},Dn.forOwn=function(t,e){return t&&mr(t,oo(e,3))},Dn.forOwnRight=function(t,e){return t&&_r(t,oo(e,3))},Dn.get=Aa,Dn.gt=Bs,Dn.gte=qs,Dn.has=function(t,e){return null!=t&&ho(t,e,Ar)},Dn.hasIn=Sa,Dn.head=zo,Dn.identity=nu,Dn.includes=function(t,e,n,r){t=zs(t)?t:Ia(t),n=n&&!r?da(n):0;var i=t.length;return n<0&&(n=vn(i+n,0)),sa(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Ie(t,e,n)>-1},Dn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:da(n);return i<0&&(i=vn(r+i,0)),Ie(t,e,i)},Dn.inRange=function(t,e,n){return e=ha(e),n===i?(n=e,e=0):n=ha(n),function(t,e,n){return t>=yn(e,n)&&t<vn(e,n)}(t=ga(t),e,n)},Dn.invoke=Fa,Dn.isArguments=Us,Dn.isArray=Hs,Dn.isArrayBuffer=Ws,Dn.isArrayLike=zs,Dn.isArrayLikeObject=Vs,Dn.isBoolean=function(t){return!0===t||!1===t||ta(t)&&kr(t)==y},Dn.isBuffer=Ks,Dn.isDate=Ys,Dn.isElement=function(t){return ta(t)&&1===t.nodeType&&!ra(t)},Dn.isEmpty=function(t){if(null==t)return!0;if(zs(t)&&(Hs(t)||"string"==typeof t||"function"==typeof t.splice||Ks(t)||ua(t)||Us(t)))return!t.length;var e=fo(t);if(e==w||e==x)return!t.size;if(Co(t))return!$r(t).length;for(var n in t)if(Rt.call(t,n))return!1;return!0},Dn.isEqual=function(t,e){return Tr(t,e)},Dn.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:i)?n(t,e):i;return r===i?Tr(t,e,i,n):!!r},Dn.isError=Gs,Dn.isFinite=function(t){return"number"==typeof t&&Le(t)},Dn.isFunction=Js,Dn.isInteger=Xs,Dn.isLength=Zs,Dn.isMap=ea,Dn.isMatch=function(t,e){return t===e||jr(t,e,ao(e))},Dn.isMatchWith=function(t,e,n){return n="function"==typeof n?n:i,jr(t,e,ao(e),n)},Dn.isNaN=function(t){return na(t)&&t!=+t},Dn.isNative=function(t){if(bo(t))throw new Ct("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Pr(t)},Dn.isNil=function(t){return null==t},Dn.isNull=function(t){return null===t},Dn.isNumber=na,Dn.isObject=Qs,Dn.isObjectLike=ta,Dn.isPlainObject=ra,Dn.isRegExp=ia,Dn.isSafeInteger=function(t){return Xs(t)&&t>=-9007199254740991&&t<=f},Dn.isSet=oa,Dn.isString=sa,Dn.isSymbol=aa,Dn.isTypedArray=ua,Dn.isUndefined=function(t){return t===i},Dn.isWeakMap=function(t){return ta(t)&&fo(t)==T},Dn.isWeakSet=function(t){return ta(t)&&"[object WeakSet]"==kr(t)},Dn.join=function(t,e){return null==t?"":We.call(t,e)},Dn.kebabCase=Ha,Dn.last=Go,Dn.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=da(n))<0?vn(r+o,0):yn(o,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):De(t,qe,o,!0)},Dn.lowerCase=Wa,Dn.lowerFirst=za,Dn.lt=ca,Dn.lte=la,Dn.max=function(t){return t&&t.length?dr(t,nu,Er):i},Dn.maxBy=function(t,e){return t&&t.length?dr(t,oo(e,2),Er):i},Dn.mean=function(t){return Ue(t,nu)},Dn.meanBy=function(t,e){return Ue(t,oo(e,2))},Dn.min=function(t){return t&&t.length?dr(t,nu,Mr):i},Dn.minBy=function(t,e){return t&&t.length?dr(t,oo(e,2),Mr):i},Dn.stubArray=pu,Dn.stubFalse=gu,Dn.stubObject=function(){return{}},Dn.stubString=function(){return""},Dn.stubTrue=function(){return!0},Dn.multiply=Cu,Dn.nth=function(t,e){return t&&t.length?Br(t,da(e)):i},Dn.noConflict=function(){return fe._===this&&(fe._=Dt),this},Dn.noop=au,Dn.now=As,Dn.pad=function(t,e,n){t=ya(t);var r=(e=da(e))?ln(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return qi(de(i),n)+t+qi(he(i),n)},Dn.padEnd=function(t,e,n){t=ya(t);var r=(e=da(e))?ln(t):0;return e&&r<e?t+qi(e-r,n):t},Dn.padStart=function(t,e,n){t=ya(t);var r=(e=da(e))?ln(t):0;return e&&r<e?qi(e-r,n)+t:t},Dn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),_n(ya(t).replace(rt,""),e||0)},Dn.random=function(t,e,n){if(n&&"boolean"!=typeof n&&yo(t,e,n)&&(e=n=i),n===i&&("boolean"==typeof e?(n=e,e=i):"boolean"==typeof t&&(n=t,t=i)),t===i&&e===i?(t=0,e=1):(t=ha(t),e===i?(e=t,t=0):e=ha(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var o=bn();return yn(t+o*(e-t+ae("1e-"+((o+"").length-1))),e)}return zr(t,e)},Dn.reduce=function(t,e,n){var r=Hs(t)?Re:ze,i=arguments.length<3;return r(t,oo(e,4),n,i,lr)},Dn.reduceRight=function(t,e,n){var r=Hs(t)?$e:ze,i=arguments.length<3;return r(t,oo(e,4),n,i,fr)},Dn.repeat=function(t,e,n){return e=(n?yo(t,e,n):e===i)?1:da(e),Vr(ya(t),e)},Dn.replace=function(){var t=arguments,e=ya(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Dn.result=function(t,e,n){var r=-1,o=(e=vi(e,t)).length;for(o||(o=1,t=i);++r<o;){var s=null==t?i:t[Lo(e[r])];s===i&&(r=o,s=n),t=Js(s)?s.call(t):s}return t},Dn.round=wu,Dn.runInContext=t,Dn.sample=function(t){return(Hs(t)?Gn:Yr)(t)},Dn.size=function(t){if(null==t)return 0;if(zs(t))return sa(t)?ln(t):t.length;var e=fo(t);return e==w||e==x?t.size:$r(t).length},Dn.snakeCase=Va,Dn.some=function(t,e,n){var r=Hs(t)?Me:ei;return n&&yo(t,e,n)&&(e=i),r(t,oo(e,3))},Dn.sortedIndex=function(t,e){return ni(t,e)},Dn.sortedIndexBy=function(t,e,n){return ri(t,e,oo(n,2))},Dn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=ni(t,e);if(r<n&&Is(t[r],e))return r}return-1},Dn.sortedLastIndex=function(t,e){return ni(t,e,!0)},Dn.sortedLastIndexBy=function(t,e,n){return ri(t,e,oo(n,2),!0)},Dn.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=ni(t,e,!0)-1;if(Is(t[n],e))return n}return-1},Dn.startCase=Ka,Dn.startsWith=function(t,e,n){return t=ya(t),n=null==n?0:or(da(n),0,t.length),e=si(e),t.slice(n,n+e.length)==e},Dn.subtract=ku,Dn.sum=function(t){return t&&t.length?Ve(t,nu):0},Dn.sumBy=function(t,e){return t&&t.length?Ve(t,oo(e,2)):0},Dn.template=function(t,e,n){var r=Dn.templateSettings;n&&yo(t,e,n)&&(e=i),t=ya(t),e=ba({},e,r,Gi);var o,s,a=ba({},e.imports,r.imports,Gi),u=Ta(a),c=Je(a,u),l=0,f=e.interpolate||_t,h="__p += '",d=At((e.escape||_t).source+"|"+f.source+"|"+(f===X?ft:_t).source+"|"+(e.evaluate||_t).source+"|$","g"),p="//# sourceURL="+(Rt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++re+"]")+"\n";t.replace(d,(function(e,n,r,i,a,u){return r||(r=i),h+=t.slice(l,u).replace(bt,nn),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),a&&(s=!0,h+="';\n"+a+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=u+e.length,e})),h+="';\n";var g=Rt.call(e,"variable")&&e.variable;if(g){if(ct.test(g))throw new Ct("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(s?h.replace(U,""):h).replace(H,"$1").replace(W,"$1;"),h="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var v=Xa((function(){return wt(u,p+"return "+h).apply(i,c)}));if(v.source=h,Gs(v))throw v;return v},Dn.times=function(t,e){if((t=da(t))<1||t>f)return[];var n=d,r=yn(t,d);e=oo(e),t-=d;for(var i=Ke(r,e);++n<t;)e(n);return i},Dn.toFinite=ha,Dn.toInteger=da,Dn.toLength=pa,Dn.toLower=function(t){return ya(t).toLowerCase()},Dn.toNumber=ga,Dn.toSafeInteger=function(t){return t?or(da(t),-9007199254740991,f):0===t?t:0},Dn.toString=ya,Dn.toUpper=function(t){return ya(t).toUpperCase()},Dn.trim=function(t,e,n){if((t=ya(t))&&(n||e===i))return Ye(t);if(!t||!(e=si(e)))return t;var r=fn(t),o=fn(e);return mi(r,Ze(r,o),Qe(r,o)+1).join("")},Dn.trimEnd=function(t,e,n){if((t=ya(t))&&(n||e===i))return t.slice(0,hn(t)+1);if(!t||!(e=si(e)))return t;var r=fn(t);return mi(r,0,Qe(r,fn(e))+1).join("")},Dn.trimStart=function(t,e,n){if((t=ya(t))&&(n||e===i))return t.replace(rt,"");if(!t||!(e=si(e)))return t;var r=fn(t);return mi(r,Ze(r,fn(e))).join("")},Dn.truncate=function(t,e){var n=30,r="...";if(Qs(e)){var o="separator"in e?e.separator:o;n="length"in e?da(e.length):n,r="omission"in e?si(e.omission):r}var s=(t=ya(t)).length;if(rn(t)){var a=fn(t);s=a.length}if(n>=s)return t;var u=n-ln(r);if(u<1)return r;var c=a?mi(a,0,u).join(""):t.slice(0,u);if(o===i)return c+r;if(a&&(u+=c.length-u),ia(o)){if(t.slice(u).search(o)){var l,f=c;for(o.global||(o=At(o.source,ya(ht.exec(o))+"g")),o.lastIndex=0;l=o.exec(f);)var h=l.index;c=c.slice(0,h===i?u:h)}}else if(t.indexOf(si(o),u)!=u){var d=c.lastIndexOf(o);d>-1&&(c=c.slice(0,d))}return c+r},Dn.unescape=function(t){return(t=ya(t))&&K.test(t)?t.replace(z,dn):t},Dn.uniqueId=function(t){var e=++$t;return ya(t)+e},Dn.upperCase=Ya,Dn.upperFirst=Ga,Dn.each=ys,Dn.eachRight=ms,Dn.first=zo,su(Dn,(vu={},mr(Dn,(function(t,e){Rt.call(Dn.prototype,e)||(vu[e]=t)})),vu),{chain:!1}),Dn.VERSION="4.17.21",Ae(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Dn[t].placeholder=Dn})),Ae(["drop","take"],(function(t,e){Un.prototype[t]=function(n){n=n===i?1:vn(da(n),0);var r=this.__filtered__&&!e?new Un(this):this.clone();return r.__filtered__?r.__takeCount__=yn(n,r.__takeCount__):r.__views__.push({size:yn(n,d),type:t+(r.__dir__<0?"Right":"")}),r},Un.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Ae(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Un.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:oo(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Ae(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Un.prototype[t]=function(){return this[n](1).value()[0]}})),Ae(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Un.prototype[t]=function(){return this.__filtered__?new Un(this):this[n](1)}})),Un.prototype.compact=function(){return this.filter(nu)},Un.prototype.find=function(t){return this.filter(t).head()},Un.prototype.findLast=function(t){return this.reverse().find(t)},Un.prototype.invokeMap=Kr((function(t,e){return"function"==typeof t?new Un(this):this.map((function(n){return Or(n,t,e)}))})),Un.prototype.reject=function(t){return this.filter($s(oo(t)))},Un.prototype.slice=function(t,e){t=da(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Un(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==i&&(n=(e=da(e))<0?n.dropRight(-e):n.take(e-t)),n)},Un.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Un.prototype.toArray=function(){return this.take(d)},mr(Un.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),o=Dn[r?"take"+("last"==e?"Right":""):e],s=r||/^find/.test(e);o&&(Dn.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,u=e instanceof Un,c=a[0],l=u||Hs(e),f=function(t){var e=o.apply(Dn,Pe([t],a));return r&&h?e[0]:e};l&&n&&"function"==typeof c&&1!=c.length&&(u=l=!1);var h=this.__chain__,d=!!this.__actions__.length,p=s&&!h,g=u&&!d;if(!s&&l){e=g?e:new Un(this);var v=t.apply(e,a);return v.__actions__.push({func:hs,args:[f],thisArg:i}),new qn(v,h)}return p&&g?t.apply(this,a):(v=this.thru(f),p?r?v.value()[0]:v.value():v)})})),Ae(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Ot[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Dn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Hs(i)?i:[],t)}return this[n]((function(n){return e.apply(Hs(n)?n:[],t)}))}})),mr(Un.prototype,(function(t,e){var n=Dn[e];if(n){var r=n.name+"";Rt.call(Fn,r)||(Fn[r]=[]),Fn[r].push({name:e,func:n})}})),Fn[Ni(i,2).name]=[{name:"wrapper",func:i}],Un.prototype.clone=function(){var t=new Un(this.__wrapped__);return t.__actions__=Si(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Si(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Si(this.__views__),t},Un.prototype.reverse=function(){if(this.__filtered__){var t=new Un(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Un.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Hs(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],s=o.size;switch(o.type){case"drop":t+=s;break;case"dropRight":e-=s;break;case"take":e=yn(e,t+s);break;case"takeRight":t=vn(t,e-s)}}return{start:t,end:e}}(0,i,this.__views__),s=o.start,a=o.end,u=a-s,c=r?a:s-1,l=this.__iteratees__,f=l.length,h=0,d=yn(u,this.__takeCount__);if(!n||!r&&i==u&&d==u)return fi(t,this.__actions__);var p=[];t:for(;u--&&h<d;){for(var g=-1,v=t[c+=e];++g<f;){var y=l[g],m=y.iteratee,_=y.type,b=m(v);if(2==_)v=b;else if(!b){if(1==_)continue t;break t}}p[h++]=v}return p},Dn.prototype.at=ds,Dn.prototype.chain=function(){return fs(this)},Dn.prototype.commit=function(){return new qn(this.value(),this.__chain__)},Dn.prototype.next=function(){this.__values__===i&&(this.__values__=fa(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?i:this.__values__[this.__index__++]}},Dn.prototype.plant=function(t){for(var e,n=this;n instanceof Bn;){var r=Do(n);r.__index__=0,r.__values__=i,e?o.__wrapped__=r:e=r;var o=r;n=n.__wrapped__}return o.__wrapped__=t,e},Dn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Un){var e=t;return this.__actions__.length&&(e=new Un(this)),(e=e.reverse()).__actions__.push({func:hs,args:[Qo],thisArg:i}),new qn(e,this.__chain__)}return this.thru(Qo)},Dn.prototype.toJSON=Dn.prototype.valueOf=Dn.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Dn.prototype.first=Dn.prototype.head,Gt&&(Dn.prototype[Gt]=function(){return this}),Dn}();fe._=pn,(r=function(){return pn}.call(e,n,e,t))===i||(t.exports=r)}.call(this)},3669:(t,e,n)=>{e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(r++,"%c"===t&&(i=r))})),e.splice(i,0,n)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),t},e.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=n(9231)(e);const{formatters:r}=t.exports;r.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},9231:(t,e,n)=>{t.exports=function(t){function e(t){let n,i,o,s=null;function a(...t){if(!a.enabled)return;const r=a,i=Number(new Date),o=i-(n||i);r.diff=o,r.prev=n,r.curr=i,n=i,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let s=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";s++;const o=e.formatters[i];if("function"==typeof o){const e=t[s];n=o.call(r,e),t.splice(s,1),s--}return n})),e.formatArgs.call(r,t),(r.log||e.log).apply(r,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=r,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==e.namespaces&&(i=e.namespaces,o=e.enabled(t)),o),set:t=>{s=t}}),"function"==typeof e.init&&e.init(a),a}function r(t,n){const r=e(this.namespace+(void 0===n?":":n)+t);return r.log=this.log,r}function i(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){const t=[...e.names.map(i),...e.skips.map(i).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let n;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const r=("string"==typeof t?t:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(t=r[n].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.slice(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1},e.humanize=n(4241),e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((n=>{e[n]=t[n]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let n=0;for(let e=0;e<t.length;e++)n=(n<<5)-n+t.charCodeAt(e),n|=0;return e.colors[Math.abs(n)%e.colors.length]},e.enable(e.load()),e}},4241:t=>{var e=1e3,n=60*e,r=60*n,i=24*r;function o(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"s":"")}t.exports=function(t,s){s=s||{};var a,u,c=typeof t;if("string"===c&&t.length>0)return function(t){if(!((t=String(t)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*r;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(t);if("number"===c&&isFinite(t))return s.long?(a=t,(u=Math.abs(a))>=i?o(a,u,i,"day"):u>=r?o(a,u,r,"hour"):u>=n?o(a,u,n,"minute"):u>=e?o(a,u,e,"second"):a+" ms"):function(t){var o=Math.abs(t);return o>=i?Math.round(t/i)+"d":o>=r?Math.round(t/r)+"h":o>=n?Math.round(t/n)+"m":o>=e?Math.round(t/e)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},1618:(t,e,n)=>{e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(r++,"%c"===t&&(i=r))})),e.splice(i,0,n)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),t},e.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=n(5224)(e);const{formatters:r}=t.exports;r.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},5224:(t,e,n)=>{t.exports=function(t){function e(t){let n,i,o,s=null;function a(...t){if(!a.enabled)return;const r=a,i=Number(new Date),o=i-(n||i);r.diff=o,r.prev=n,r.curr=i,n=i,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let s=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";s++;const o=e.formatters[i];if("function"==typeof o){const e=t[s];n=o.call(r,e),t.splice(s,1),s--}return n})),e.formatArgs.call(r,t),(r.log||e.log).apply(r,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=r,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==e.namespaces&&(i=e.namespaces,o=e.enabled(t)),o),set:t=>{s=t}}),"function"==typeof e.init&&e.init(a),a}function r(t,n){const r=e(this.namespace+(void 0===n?":":n)+t);return r.log=this.log,r}function i(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){const t=[...e.names.map(i),...e.skips.map(i).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let n;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const r=("string"==typeof t?t:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(t=r[n].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.slice(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1},e.humanize=n(8896),e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((n=>{e[n]=t[n]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let n=0;for(let e=0;e<t.length;e++)n=(n<<5)-n+t.charCodeAt(e),n|=0;return e.colors[Math.abs(n)%e.colors.length]},e.enable(e.load()),e}},8896:t=>{var e=1e3,n=60*e,r=60*n,i=24*r;function o(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"s":"")}t.exports=function(t,s){s=s||{};var a,u,c=typeof t;if("string"===c&&t.length>0)return function(t){if(!((t=String(t)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*r;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(t);if("number"===c&&isFinite(t))return s.long?(a=t,(u=Math.abs(a))>=i?o(a,u,i,"day"):u>=r?o(a,u,r,"hour"):u>=n?o(a,u,n,"minute"):u>=e?o(a,u,e,"second"):a+" ms"):function(t){var o=Math.abs(t);return o>=i?Math.round(t/i)+"d":o>=r?Math.round(t/r)+"h":o>=n?Math.round(t/n)+"m":o>=e?Math.round(t/e)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},9336:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.configureChat=void 0;const i=r(n(3336));let o;function s(t){(0,i.default)("#chat-messages").html(t.map((t=>`<div class="chat-message" title="${new Date(parseInt(t.sentAt))}" id="${t.id}">\n    <span class="from">${t.from}</span>\n    <span class="message">${t.msg}</span>\n    </div>`)).join("\n")),(0,i.default)("#chat-messages").scrollTop((0,i.default)("#chat-messages")[0].scrollHeight)}function a(t){(0,i.default)("#chat-messages").append(`<div class="chat-message" title="${new Date(parseInt(t.sentAt))}" id="${t.id}">\n                             <span class="from">${t.from}</span>\n                             <span class="message">${t.msg}</span>\n                             </div>`),(0,i.default)("#chat-messages").scrollTop((0,i.default)("#chat-messages")[0].scrollHeight)}e.configureChat=function(t){o=t,o.on("chathistory",s),o.on("chat",a),(0,i.default)("#chat-form").on("submit",(t=>{t.preventDefault(),t.stopPropagation();const e=(0,i.default)("#message").val().toString();e.length>0&&(o.emit("chat",e),(0,i.default)("#message").val(""))})),console.log("Chat Configured")}},3253:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CustomEventManager=void 0,e.CustomEventManager=class{constructor(){this.events={}}on(t,e){this.events[t]||(this.events[t]=[]),this.events[t].push(e)}emit(t,e=[]){this.events[t]&&this.events[t].forEach((t=>t.apply(null,e)))}}},5862:function(t,e){"use strict";var n=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};function r(){return localStorage.getItem("authToken")}Object.defineProperty(e,"__esModule",{value:!0}),e.http=e.authToken=void 0,e.authToken=r,e.http={get:t=>n(void 0,void 0,void 0,(function*(){return(yield fetch(t,{headers:{"x-authtoken":r()}})).json()})),post:(t,e)=>n(void 0,void 0,void 0,(function*(){return(yield fetch(t,{method:"post",body:JSON.stringify(e),headers:{"x-authtoken":r(),"content-type":"application/json"}})).json()}))}},2174:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e},s=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const u=n(7046),c=a(n(3336)),l=n(4738),f=n(5862),h=n(3253),d=n(7429),p=n(6486),g=n(9502),v=n(9336),y=n(1916),m=o(n(7355)),_=new(n(8182).TimeManager),b=new Map,C=new h.CustomEventManager,w=(0,u.io)({extraHeaders:{"x-authtoken":(0,f.authToken)()}});function k(){const t=_.gradientName(),e=(0,c.default)("body");e.removeClass(Array.from(e[0].classList)).addClass(t),_.isNight()&&e.addClass("night")}function E(t){return`<img src="/assets/img/${t}.png" class="icon">`}function A(t,e,n,r=!0){let i=0;e>0&&(i=Math.floor(t/e*100));const o=r?`${i}% - `:"";return`<div class="progress-bar" style="background: linear-gradient(to right, ${n}, ${n} ${i}%, transparent ${i}%, transparent)" title="${o}${t}/${e}">${o}${t}/${e}</div>`}function S(t,e,n,r){let i=0;e>0&&(i=Math.floor(t/e*100)),(0,c.default)(`#${n}`).css("background",`linear-gradient(to right, ${r}, ${r} ${i}%, transparent ${i}%, transparent)`).attr("title",`${i}% - ${t}/${e}`).html(`${t}/${e} - ${i}%`)}function x(){const t=b.get("player");(0,c.default)("#username").html(`${t.username}, level ${t.level} ${t.profession}`),S(t.hp,(0,l.maxHp)(t.constitution,t.level),"hp-bar","#ff7070"),S(t.exp,(0,l.expToLevel)(t.level+1),"exp-bar","#5997f9"),["strength","constitution","dexterity","intelligence","hp","exp"].forEach((e=>{(0,c.default)(`.${e}`).html(t[e])})),(0,c.default)(".maxHp").html((0,l.maxHp)(t.constitution,t.level).toString()),(0,c.default)(".expToLevel").html((0,l.expToLevel)(t.level+1).toString()),(0,c.default)(".gold").html(t.gold.toLocaleString()),"session"===t.account_type&&(0,c.default)("#signup-prompt").html('<p>Hey there! It looks like you\'re using a SESSION account. This allows you to play with away, but the account is tied to your current device, and will be lost if you ever clear your cookies.</p><p>\n          <form id="signup">\n            <div class="form-group">\n              <label>Username:</label>\n              <input type="text" name="username">\n            </div>\n            <div class="form-group">\n              <label>Password:</label>\n              <input type="password" name="password">\n            </div>\n            <button type="submit" class="success">Create your Account</button>\n            <button type="button" id="login">Login To Existing Account</button>\n          </form></p>').removeClass("hidden"),(0,c.default)("#extra-inventory-info").html(O())}function O(){const t=b.get("player");let e='<table id="stat-breakdown">';return l.StatDef.forEach((n=>{e+=`<tr>\n      <th>${n.display}</th>\n      <td class="${n.id}">\n        ${t[n.id]}\n        ${t.stat_points?function(t){return`<button class="increase-stat emit-event" data-event="spend-stat-point" data-args="${t.id}">+</button>`}(n):""}\n      </td>\n    </tr>`})),e+=`<tr><th>Stat Points</th><td class="stat_points">${t.stat_points}</td></tr>`,e+="</table>",e}function F(t){return t.map((t=>function(t,e){return`<div class="store-list">\n    <div>\n      <img src="https://via.placeholder.com/64x64">\n    </div>\n    <div class="details">\n      <div class="name">${t.name}</div>\n      <div class="requirements">\n      ${t.requirements.level?T("LVL",t.requirements.level):""}\n      ${t.requirements.strength?T("STR",t.requirements.strength):""}\n      ${t.requirements.constitution?T("CON",t.requirements.constitution):""}\n      ${t.requirements.dexterity?T("DEX",t.requirements.dexterity):""}\n      ${t.requirements.intelligence?T("INT",t.requirements.intelligence):""}\n      ${T("PRF",t.profession)}\n      </div>\n      <div class="stat-mods">\n      ${t.boosts.strength?j("STR",t.boosts.strength):""}\n      ${t.boosts.constitution?j("CON",t.boosts.constitution):""}\n      ${t.boosts.dexterity?j("DEX",t.boosts.dexterity):""}\n      ${t.boosts.intelligence?j("INT",t.boosts.intelligence):""}\n      ${t.boosts.damage?j("DMG",t.boosts.damage):""}\n      ${t.boosts.damage_mitigation?j("MIT",t.boosts.damage_mitigation)+"%":""}\n      ${["WEAPON","SPELL"].includes(t.type)?"":A(t.currentAp,t.maxAp,"#7be67b")}\n      </div>\n      ${t.hasOwnProperty("id")?`<div>${t.cost.toLocaleString()}G</div>`:""}\n    </div>\n    <div class="store-actions">\n      ${(t=>t.is_equipped?`<button type="button" class="unequip-item error" data-id="${t.item_id}">Unequip</button>`:"ANY_HAND"===t.equipment_slot?`<button type="button" class="equip-item" data-id="${t.item_id}" data-slot="LEFT_HAND">Equip L</button>\n          <button type="button" class="equip-item" data-id="${t.item_id}" data-slot="RIGHT_HAND">Equip R</button>`:"LEFT_HAND"===t.equipment_slot?`<button type="button" class="equip-item" data-id="${t.item_id}" data-slot="${t.equipment_slot}">Equip Left</button>`:"RIGHT_HAND"===t.equipment_slot?`<button type="button" class="equip-item" data-id="${t.item_id}" data-slot="${t.equipment_slot}">Equip Right</button>`:(t.equipment_slot,`<button type="button" class="equip-item" data-id="${t.item_id}" data-slot="${t.equipment_slot}">Equip</button>`))(t)}\n    </div>\n    </div>`}(t))).join("\n")}function T(t,e,n){let r="";return n&&(r=n>=e?"success":"error"),`<span class="requirement-title">${t}</span>: <span class="requirement-value ${r}">${e.toLocaleString()}</span>`}function j(t,e){let n="";return"number"==typeof e&&(n=e>0?"+":"-"),`<span class="requirement-title">${t}</span>: <span class="requirement-value ${"number"==typeof e&&e>0?"success":"error"}">${n}${e}</span>`}function P(t){const e=Math.floor(t.hp/t.maxHp*100);return`<div id="fight-container">\n    <div id="defender-info">\n      <div class="avatar-container">\n        <img id="avatar" src="https://via.placeholder.com/64x64">\n      </div>\n      <div id="defender-stat-bars">\n        <div id="defender-name">${t.name}</div>\n        <div class="progress-bar" id="defender-hp-bar" style="background: linear-gradient(to right, red, red ${e}%, transparent ${e}%, transparent)" title="${e}% - ${t.hp}/${t.maxHp}">${e}% - ${t.hp} / ${t.maxHp}</div>\n      </div>\n    </div>\n    <div id="fight-actions">\n      <select id="fight-target">\n        <option value="head">Head</option>\n        <option value="body">Body</option>\n        <option value="arms">Arms</option>\n        <option value="legs">Legs</option>\n      </select>\n      <button type="button" class="fight-action" data-action="attack">Attack</button>\n      <button type="button" class="fight-action" data-action="cast">Cast</button>\n      <button type="button" class="fight-action" data-action="flee">Flee</button>\n    </div>\n    <div id="fight-results"></div>\n  </div>`}(0,v.configureChat)(w),k(),setInterval(k,6e4),w.on("connect",(()=>{console.log(`Connected: ${w.id}`)})),w.on("ready",(()=>{console.log("Server connection verified"),w.emit("inventory")})),w.on("server-stats",(t=>{(0,c.default)("#server-stats").html(`${t.onlinePlayers} players online`)})),(0,p.each)(m,(t=>{console.log(`Binding Event ${t.eventName}`),t instanceof y.SocketEvent?w.on(t.eventName,t.handler.bind(null,{cache:b,socket:w,events:C})):console.log("Skipped binding",t)})),w.on("calc:ap",(t=>{var e,n,r,i,o,s,a,u;const{ap:l}=t,f=`\n  <div>\n    ${E("helm")}\n    ${A((null===(e=l.HEAD)||void 0===e?void 0:e.currentAp)||0,(null===(n=l.HEAD)||void 0===n?void 0:n.maxAp)||0,"#7be67b")}\n  </div>\n  <div>\n    ${E("arms")}\n    ${A((null===(r=l.ARMS)||void 0===r?void 0:r.currentAp)||0,(null===(i=l.ARMS)||void 0===i?void 0:i.maxAp)||0,"#7be67b")}\n  </div>\n  <div>\n    ${E("chest")}\n    ${A((null===(o=l.CHEST)||void 0===o?void 0:o.currentAp)||0,(null===(s=l.CHEST)||void 0===s?void 0:s.maxAp)||0,"#7be67b")}\n  </div>\n  <div>\n    ${E("legs")}\n    ${A((null===(a=l.LEGS)||void 0===a?void 0:a.currentAp)||0,(null===(u=l.LEGS)||void 0===u?void 0:u.maxAp)||0,"#7be67b")}\n  </div>\n  `;(0,c.default)("#ap-bar").html(f)})),C.on("tab:skills",(()=>{(0,c.default)("#skills").html(""),w.emit("skills")})),w.on("skills",(t=>{let e=`<table id="skill-list">\n  ${t.skills.map((t=>{const e=g.Skills.get(t.id),n=t.exp/e.expToLevel(t.level+1);return`\n    <tr>\n    <td class="skill-level">${t.level.toLocaleString()}</td>\n    <td class="skill-description" title="Total Exp: ${t.exp.toLocaleString()}/${e.expToLevel(t.level+1).toLocaleString()}">\n      <span class="skill-exp">${(100*n).toPrecision(2)}% to next level</span>\n      <b>${e.display}</b>\n      <p>${e.description}</p>\n    </td>\n    </tr>\n    `})).join("\n")}\n  </table>`;(0,c.default)("#skills").html(e)})),C.on("alert",(t=>{let e=(0,d.v4)();(0,c.default)("#alerts").append(`<div class="alert ${t.type}" id="alert-${e}">${t.text}</div>`),setTimeout((()=>{(0,c.default)(`#alert-${e}`).remove()}),3e3)})),w.on("alert",(t=>{C.emit("alert",[t])})),w.on("init",(t=>{(0,c.default)("#version").html(`v${t.version}`)})),w.on("authToken",(t=>{console.log(`recv auth token ${t}`),localStorage.setItem("authToken",t)})),w.on("player",(t=>{b.set("player",t),x()})),(0,c.default)("nav a").on("click",(t=>{t.preventDefault(),t.stopPropagation(),(0,c.default)(`#${(0,c.default)(t.target).data("container")}`).find(".tab").removeClass("active"),(0,c.default)(`#${(0,c.default)(t.target).data("section")}`).addClass("active"),"Settings"!==t.target.innerHTML&&((0,c.default)(t.target).closest("nav").find("a").removeClass("active"),(0,c.default)(t.target).addClass("active")),C.emit(`tab:${(0,c.default)(t.target).data("section")}`)})),C.on("tab:inventory",(()=>{w.emit("inventory")})),(0,c.default)("body").on("click","nav.filter",(t=>{t.preventDefault(),t.stopPropagation();const e=(0,c.default)(t.target),n=e.data("filter");(0,c.default)(".filter-result").removeClass("active").addClass("hidden"),(0,c.default)(`#filter_${n}`).addClass("active").removeClass("hidden"),e.closest("nav").find("a").removeClass("active"),e.addClass("active"),b.set("active-inventory-section",n)})),w.on("inventory",(t=>{b.get("player");const e=b.get("active-inventory-section")||"ARMOUR",n={ARMOUR:[],WEAPON:[],SPELL:[]};t.inventory.forEach((t=>{n[t.type].push(t)}));const r=`\n  <div id="inventory-page">\n    <div id="character-summary">\n    ${function(t){const e="https://via.placeholder.com/64x64",n=t.filter((t=>t.is_equipped)).reduce(((t,e)=>(t[e.equipment_slot]=e,t)),{});return`\n  <table id="character-equipment-placement">\n  <tr>\n    <td>\n    </td>\n    <td style="background-image: url('${e}');" title="${n.HEAD?n.HEAD.name:"Empty"}">\n    ${n.HEAD?n.HEAD.name:"HEAD"}\n    </td>\n    <td style="background-image: url('${e}');" title="${n.ARMS?n.ARMS.name:"Empty"}">\n    ${n.ARMS?n.ARMS.name:"ARMS"}\n    </td>\n  </tr>\n  <tr>\n    <td style="background-image: url('${e}');" title="${n.LEFT_HAND?n.LEFT_HAND.name:n.TWO_HANDED?n.TWO_HANDED.name:""}">\n    ${n.LEFT_HAND?n.LEFT_HAND.name:n.TWO_HANDED?n.TWO_HANDED.name:"L_HAND"}\n    </td>\n    <td style="background-image: url('${e}');" title="${n.CHEST?n.CHEST.name:""}">\n    ${n.CHEST?n.CHEST.name:"CHEST"}\n    </td>\n    <td style="background-image: url('${e}');" title="${n.RIGHT_HAND?n.RIGHT_HAND.name:n.TWO_HANDED?n.TWO_HANDED.name:""}">\n    ${n.RIGHT_HAND?n.RIGHT_HAND.name:n.TWO_HANDED?n.TWO_HANDED.name:"R_HAND"}\n    </td>\n  </tr>\n  <tr>\n    <td>\n    </td>\n    <td style="background-image: url('${e}');" title="${n.LEGS?n.LEGS.name:""}">\n    ${n.LEGS?n.LEGS.name:"LEGS"}\n    </td>\n    <td>\n    </td>\n  </tr>\n  </table>\n  `}(t.inventory)}\n      <div id="extra-inventory-info">\n        ${O()}\n      </div>\n    </div>\n    <div id="inventory-section">\n      <nav class="filter">\n        <a href="#" data-filter="ARMOUR" class="${"ARMOUR"===e?"active":""}">Armour</a>\n        <a href="#" data-filter="WEAPON" class="${"WEAPON"===e?"active":""}">Weapons</a>\n        <a href="#" data-filter="SPELL" class="${"SPELL"===e?"active":""}">Spells</a>\n      </nav>\n      <div class="inventory-listing">\n        <div class="filter-result ${"ARMOUR"===e?"active":"hidden"}" id="filter_ARMOUR">\n          ${F(n.ARMOUR)}\n        </div>\n        <div class="filter-result ${"WEAPON"===e?"active":"hidden"}" id="filter_WEAPON">\n          ${F(n.WEAPON)}\n        </div>\n        <div class="filter-result ${"SPELL"===e?"active":"hidden"}" id="filter_SPELL">\n          ${F(n.SPELL)}\n        </div>\n      </div>\n    </div>\n  </div>\n  `;(0,c.default)("#inventory").html(r)})),(0,c.default)("body").on("click",".equip-item",(t=>{t.preventDefault(),t.stopPropagation();const e=(0,c.default)(t.target),n=e.data("id"),r=e.data("slot");w.emit("equip",{id:n,slot:r})})),(0,c.default)("body").on("click",".unequip-item",(t=>{t.preventDefault(),t.stopPropagation(),w.emit("unequip",{id:(0,c.default)(t.target).data("id")})})),C.on("renderMap",(function(t){return s(this,void 0,void 0,(function*(){if(!t||b.has("currentMapHTML"))return void(0,c.default)("#map").html(b.get("currentMapHTML"));t||console.error("oh no.. this got triggered without any city data"),(0,c.default)("#explore").css({"background-image":`linear-gradient(to left top, rgba(255,255,255,0) 0%,rgb(255,255,255) 100%), linear-gradient(to left, rgba(255, 255, 255, 0) 0%, rgb(255, 255, 255) 100%), url("/assets/img/map/${t.city.id}.jpeg")`});const e={SERVICES:[],STORES:[],EXPLORE:[]};t.locations.forEach((t=>{e[t.type].push(`<a href="#" class="city-emit-event" data-event="${t.event_name}" data-args="${t.id}">${t.name}</a>`)}));let n=`<h1>${t.city.name}</h1>\n  <div class="city-details">`;e.SERVICES.length&&(n+=`<div><h3>Services</h3>${e.SERVICES.join("<br>")}</div>`),e.STORES.length&&(n+=`<div><h3>Stores</h3>${e.STORES.join("<br>")}</div>`),e.EXPLORE.length&&(n+=`<div><h3>Explore</h3>${e.EXPLORE.join("<br>")}</div>`),n+=`\n    <div>\n      <h3>Travel</h3>\n      ${t.paths.map((t=>`<a href="#" class="city-emit-event" data-event="city:travel" data-args="${t.ending_city}">${t.ending_city_name}</a>`)).join("<br>")}\n    </div>\n  </div>\n  `,b.set("currentMapHTML",n),(0,c.default)("#map").html(n)}))})),w.on("city:stores",(t=>{let e=`<div class="shop-inventory-listing">\n  ${t.map((t=>function(t,e){const n=b.get("player");return`<div class="store-list">\n    <div>\n      <img src="https://via.placeholder.com/64x64">\n    </div>\n    <div class="details">\n      <div class="name">${t.name}${"TWO_HANDED"===t.equipment_slot?" (2H)":""}</div>\n      <div class="requirements">\n      ${t.requirements.level?T("LVL",t.requirements.level,n.level):""}\n      ${t.requirements.strength?T("STR",t.requirements.strength,n.strength):""}\n      ${t.requirements.constitution?T("CON",t.requirements.constitution,n.constitution):""}\n      ${t.requirements.dexterity?T("DEX",t.requirements.dexterity,n.dexterity):""}\n      ${t.requirements.intelligence?T("INT",t.requirements.intelligence,n.intelligence):""}\n      ${T("PRF",t.profession)}\n      </div>\n      <div class="stat-mods">\n      ${t.boosts.strength?j("STR",t.boosts.strength):""}\n      ${t.boosts.constitution?j("CON",t.boosts.constitution):""}\n      ${t.boosts.dexterity?j("DEX",t.boosts.dexterity):""}\n      ${t.boosts.intelligence?j("INT",t.boosts.intelligence):""}\n      ${t.boosts.damage?j(t.affectedSkills.includes("restoration_magic")?"HP":"DMG",t.boosts.damage):""}\n      ${t.boosts.damage_mitigation?j("MIT",t.boosts.damage_mitigation)+"%":""}\n      ${["WEAPON","SPELL"].includes(t.type)?"":j("AP",t.maxAp)}\n      </div>\n      ${t.hasOwnProperty("id")?`<div>${t.cost.toLocaleString()}G</div>`:""}\n    </div>\n    <div class="store-actions">\n      ${r=t,`<button type="button" class="purchase-item" data-id="${r.id}" data-type="${r.type}" data-equipment-slot="${r.equipment_slot}" data-cost="${r.cost}">Buy</button>`}\n    </div>\n    </div>`;var r}(t))).join("\n")}\n  </div>\n  `;(0,c.default)("#map").html(e)})),(0,c.default)("body").on("click",".purchase-item",(t=>{t.preventDefault(),t.stopPropagation();const e=b.get("player"),n=parseInt((0,c.default)(t.target).data("cost")),r=(0,c.default)(t.target).data("id");e.gold<n?C.emit("alert",[{type:"error",text:"You don't have enough gold!"}]):((0,c.default)(t.target).data("type"),w.emit("purchase",{id:r}))})),(0,c.default)("body").on("click",".emit-event",(t=>{const e=(0,c.default)(t.target),n=e.data("event"),r=e.data("args");console.log(`Sending event ${n}`,{args:r}),w.emit(n,{args:r})})),(0,c.default)("body").on("click",".city-emit-event",(t=>{const e=(0,c.default)(t.target),n=e.data("event"),r=e.data("args");console.log(`Sending event ${n}`,{args:r}),w.emit(n,{args:r})})),w.on("explore:fights",(t=>{const e=b.get("last-selected-monster");if(t.length){let n=`<form id="fight-selector"><select id="monster-selector">\n    ${t.map((t=>`<option value="${t.id}" ${e==t.id?"selected":""}>${t.name}</option>`)).join("\n")}\n    </select> <button type="submit">Fight</button></option>`;(0,c.default)("#map").html(n)}})),C.on("tab:explore",(()=>s(void 0,void 0,void 0,(function*(){const t=yield f.http.get("/fight");if(t)(0,c.default)("#map").html(P(t));else{let t;b.has("currentMapHTML")||(t=yield f.http.get(`/city/${b.get("player").city_id}`)),C.emit("renderMap",[t])}})))),w.on("updatePlayer",(t=>{b.set("player",t),x()})),w.on("fight-over",(t=>{const{roundData:e,monsters:n}=t;b.set("player",e.player),x(),(0,c.default)("#map").html(P(e.monster));let r=e.roundDetails.map((t=>`<div>${t}</div>`));if("player"===e.winner&&(r.push(`<div>You defeated the ${e.monster.name}!</div>`),e.rewards.gold&&r.push(`<div>You gained ${e.rewards.gold} gold`),e.rewards.exp&&r.push(`<div>You gained ${e.rewards.exp} exp`),e.rewards.levelIncrease&&r.push(`<div>You gained a level! ${e.player.level}`)),n.length){const t=b.get("last-selected-monster");r.unshift(`<h2>Fight Again</h2><form id="fight-selector"><select id="monster-selector">\n      ${n.map((e=>`<option value="${e.id}" ${t==e.id?"selected":""}>${e.name}</option>`)).join("\n")}\n      </select> <button type="submit">Fight</button></option>\n    </select></form><hr>`)}(0,c.default)("#fight-results").html(r.join("\n")),(0,c.default)("#fight-actions").html("")})),w.on("fight-round",(t=>{(0,c.default)(".fight-action").prop("disabled",!1),b.set("player",t.player),x(),(0,c.default)("#map").html(P(t.monster)),(0,c.default)("#fight-results").html(t.roundDetails.map((t=>`<div>${t}</div>`)).join("\n"))})),(0,c.default)("body").on("submit","#fight-selector",(t=>s(void 0,void 0,void 0,(function*(){if(t.preventDefault(),t.stopPropagation(),b.get("player").hp<=0)return void C.emit("alert",[{type:"error",text:"You don't have enough HP to go looking for a fight"}]);const e=(0,c.default)("#monster-selector option:selected").val();b.set("last-selected-monster",e);try{const t=yield f.http.post("/fight",{monsterId:e});(0,c.default)("#map").html(P(t))}catch(t){C.emit("alert",[{type:"error",text:"Sorry, you can't start that fight"}])}})))),(0,c.default)("body").on("click",".fight-action",(t=>{t.preventDefault(),t.stopPropagation();const e=(0,c.default)(t.target).data("action"),n=(0,c.default)("#fight-target option:selected").val();(0,c.default)(".fight-action").prop("disabled",!0),w.emit("fight",{action:e,target:n})})),(0,c.default)("body").on("submit","#signup",(t=>s(void 0,void 0,void 0,(function*(){t.preventDefault(),t.stopPropagation();const e={};(0,c.default)(t.target).serializeArray().forEach((t=>e[t.name]=t.value));const n=yield f.http.post("/signup",e);n.error?C.emit("alert",[{type:"error",text:n.error}]):(b.set("player",n.player),x(),(0,c.default)("#signup-prompt").remove())})))),(0,c.default)("body").on("click","#login",(t=>s(void 0,void 0,void 0,(function*(){t.preventDefault(),t.stopPropagation();const e={};if((0,c.default)(t.target).closest("form").serializeArray().forEach((t=>e[t.name]=t.value)),e.username&&e.password){const t=yield f.http.post("/login",e);t.error?C.emit("alert",[{type:"error",text:t.error}]):(localStorage.setItem("authToken",t.player.id),window.location.reload())}})))),(0,c.default)("body").on("click","#logout",(t=>s(void 0,void 0,void 0,(function*(){t.preventDefault(),t.stopPropagation();let e=!1;const n=b.get("player");e=!/^Player[\d]+$/.test(n.username)||!!confirm("Are you sure? You will not be able to retrieve this character unless you set up an email/password"),e&&(w.emit("logout"),localStorage.clear(),window.location.reload())}))))},1916:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SocketEvent=void 0,e.SocketEvent=class{constructor(t,e){this.eventName=t,this.handler=e}}},7355:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(5127),e),i(n(6041),e),i(n(9261),e)},9261:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.displayHealerDetauls=void 0;const i=n(1916),o=r(n(3336));e.displayHealerDetauls=new i.SocketEvent("city:service:healer",((t,e)=>{(0,o.default)("#map").html(e.text)}))},5127:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.professionChangeRogue=e.professionChangeMage=e.professionChangeWarrior=e.professionRecruiter=void 0;const i=n(1916),o=r(n(3336)),s=n(9554);function a(t,e){(0,o.default)("#map").html(e.text)}e.professionRecruiter=new i.SocketEvent(s.EVENT_NAME,a),e.professionChangeWarrior=new i.SocketEvent(`${s.EVENT_NAME}:warrior`,a),e.professionChangeMage=new i.SocketEvent(`${s.EVENT_NAME}:mage`,a),e.professionChangeRogue=new i.SocketEvent(`${s.EVENT_NAME}:rogue`,a)},9554:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EVENT_NAME=void 0,e.EVENT_NAME="city:services:profession_recruitor_windcross"},6041:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.travel=void 0;const r=n(1916);e.travel=new r.SocketEvent("city:travel",((t,e)=>{t.cache.delete("currentMapHTML"),t.events.emit("renderMap",[e])}))},4738:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StatDef=e.expToLevel=e.maxHp=void 0;const r=n(1407);e.maxHp=function(t,e){return Math.ceil(1.3*(t+e))},e.expToLevel=function(t){return t<10?10*t-10:13*t},e.StatDef=new Map,e.StatDef.set(r.Stat.strength,{id:r.Stat.strength,display:"Strength",abbrv:"STR"}),e.StatDef.set(r.Stat.constitution,{id:r.Stat.constitution,display:"Constitution",abbrv:"CON"}),e.StatDef.set(r.Stat.dexterity,{id:r.Stat.dexterity,display:"Dexterity",abbrv:"DEX"}),e.StatDef.set(r.Stat.intelligence,{id:r.Stat.intelligence,display:"Intelligence",abbrv:"INT"})},9502:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Skills=void 0,e.Skills=new Map,e.Skills.set("bladed",{id:"bladed",display:"Bladed Weapon Mastery",description:"Improves Bladed Weapon damage",effect:t=>t.level/100,expToLevel:t=>1e3*t}),e.Skills.set("blunt",{id:"blunt",display:"Blunt Weapons Mastery",description:"Improves Blunt Weapon damage",effect:t=>t.level/100,expToLevel:t=>1e3*t}),e.Skills.set("destruction_magic",{id:"destruction_magic",display:"Destruction Magic Mastery",description:"Improves Destruction Magic damage",effect:t=>t.level/100,expToLevel:t=>1e3*t}),e.Skills.set("restoration_magic",{id:"restoration_magic",display:"Restoration Magic Mastery",description:"Improves effectiveness of Restoration Magic",effect:t=>t.level/100,expToLevel:t=>1e3*t}),e.Skills.set("one_handed_mastery",{id:"one_handed_mastery",display:"One Handed Weapon Mastery",description:"Improves effectiveness when fighting using one-handed weapons",effect:t=>t.level/100,expToLevel:t=>1e3*t}),e.Skills.set("two_handed_mastery",{id:"two_handed_mastery",display:"Two Handed Weapon Mastery",description:"Improves effectiveness when fighting using two-handed weapons",effect:t=>t.level/100,expToLevel:t=>1e3*t})},1407:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.Stat=void 0,(n=e.Stat||(e.Stat={})).strength="strength",n.constitution="constitution",n.dexterity="dexterity",n.intelligence="intelligence"},8182:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TimeManager=void 0,e.TimeManager=class{constructor(t=60){this.dayLength=t,this.scaleFactor=30,this.dayLengthAsMS=60*t*1e3}dayScaleFactor(){return this.dayLength/30}getTimePeriod(){return this.isDawn()?"dawn":this.isMorning()?"morning":this.isAfternoon()?"afternoon":this.isEvening()?"evening":this.isNight()?"night":void 0}now(){return Math.floor((new Date).getMinutes()/this.dayScaleFactor())}gradientName(){const t=this.now();return`sky-gradient-${t<10?"0":""}${t}`}isNight(){const t=this.now();return t>=0&&t<=5||t>=26&&t<=29}isDawn(){const t=this.now();return t>=6&&t<=10}isMorning(){const t=this.now();return t>=11&&t<=15}isAfternoon(){const t=this.now();return t>=16&&t<=20}isEvening(){const t=this.now();return t>=21&&t<=25}}},7429:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NIL",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"v1",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"v3",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"v4",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"v5",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"validate",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return u.default}});var r=h(n(3990)),i=h(n(8237)),o=h(n(5355)),s=h(n(3764)),a=h(n(6314)),u=h(n(8464)),c=h(n(6435)),l=h(n(4008)),f=h(n(8222));function h(t){return t&&t.__esModule?t:{default:t}}},4163:(t,e)=>{"use strict";function n(t){return 14+(t+64>>>9<<4)+1}function r(t,e){const n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function i(t,e,n,i,o,s){return r((a=r(r(e,t),r(i,s)))<<(u=o)|a>>>32-u,n);var a,u}function o(t,e,n,r,o,s,a){return i(e&n|~e&r,t,e,o,s,a)}function s(t,e,n,r,o,s,a){return i(e&r|n&~r,t,e,o,s,a)}function a(t,e,n,r,o,s,a){return i(e^n^r,t,e,o,s,a)}function u(t,e,n,r,o,s,a){return i(n^(e|~r),t,e,o,s,a)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=function(t){if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n)}return function(t){const e=[],n=32*t.length,r="0123456789abcdef";for(let i=0;i<n;i+=8){const n=t[i>>5]>>>i%32&255,o=parseInt(r.charAt(n>>>4&15)+r.charAt(15&n),16);e.push(o)}return e}(function(t,e){t[e>>5]|=128<<e%32,t[n(e)-1]=e;let i=1732584193,c=-271733879,l=-1732584194,f=271733878;for(let e=0;e<t.length;e+=16){const n=i,h=c,d=l,p=f;i=o(i,c,l,f,t[e],7,-680876936),f=o(f,i,c,l,t[e+1],12,-389564586),l=o(l,f,i,c,t[e+2],17,606105819),c=o(c,l,f,i,t[e+3],22,-1044525330),i=o(i,c,l,f,t[e+4],7,-176418897),f=o(f,i,c,l,t[e+5],12,1200080426),l=o(l,f,i,c,t[e+6],17,-1473231341),c=o(c,l,f,i,t[e+7],22,-45705983),i=o(i,c,l,f,t[e+8],7,1770035416),f=o(f,i,c,l,t[e+9],12,-1958414417),l=o(l,f,i,c,t[e+10],17,-42063),c=o(c,l,f,i,t[e+11],22,-1990404162),i=o(i,c,l,f,t[e+12],7,1804603682),f=o(f,i,c,l,t[e+13],12,-40341101),l=o(l,f,i,c,t[e+14],17,-1502002290),c=o(c,l,f,i,t[e+15],22,1236535329),i=s(i,c,l,f,t[e+1],5,-165796510),f=s(f,i,c,l,t[e+6],9,-1069501632),l=s(l,f,i,c,t[e+11],14,643717713),c=s(c,l,f,i,t[e],20,-373897302),i=s(i,c,l,f,t[e+5],5,-701558691),f=s(f,i,c,l,t[e+10],9,38016083),l=s(l,f,i,c,t[e+15],14,-660478335),c=s(c,l,f,i,t[e+4],20,-405537848),i=s(i,c,l,f,t[e+9],5,568446438),f=s(f,i,c,l,t[e+14],9,-1019803690),l=s(l,f,i,c,t[e+3],14,-187363961),c=s(c,l,f,i,t[e+8],20,1163531501),i=s(i,c,l,f,t[e+13],5,-1444681467),f=s(f,i,c,l,t[e+2],9,-51403784),l=s(l,f,i,c,t[e+7],14,1735328473),c=s(c,l,f,i,t[e+12],20,-1926607734),i=a(i,c,l,f,t[e+5],4,-378558),f=a(f,i,c,l,t[e+8],11,-2022574463),l=a(l,f,i,c,t[e+11],16,1839030562),c=a(c,l,f,i,t[e+14],23,-35309556),i=a(i,c,l,f,t[e+1],4,-1530992060),f=a(f,i,c,l,t[e+4],11,1272893353),l=a(l,f,i,c,t[e+7],16,-155497632),c=a(c,l,f,i,t[e+10],23,-1094730640),i=a(i,c,l,f,t[e+13],4,681279174),f=a(f,i,c,l,t[e],11,-358537222),l=a(l,f,i,c,t[e+3],16,-722521979),c=a(c,l,f,i,t[e+6],23,76029189),i=a(i,c,l,f,t[e+9],4,-640364487),f=a(f,i,c,l,t[e+12],11,-421815835),l=a(l,f,i,c,t[e+15],16,530742520),c=a(c,l,f,i,t[e+2],23,-995338651),i=u(i,c,l,f,t[e],6,-198630844),f=u(f,i,c,l,t[e+7],10,1126891415),l=u(l,f,i,c,t[e+14],15,-1416354905),c=u(c,l,f,i,t[e+5],21,-57434055),i=u(i,c,l,f,t[e+12],6,1700485571),f=u(f,i,c,l,t[e+3],10,-1894986606),l=u(l,f,i,c,t[e+10],15,-1051523),c=u(c,l,f,i,t[e+1],21,-2054922799),i=u(i,c,l,f,t[e+8],6,1873313359),f=u(f,i,c,l,t[e+15],10,-30611744),l=u(l,f,i,c,t[e+6],15,-1560198380),c=u(c,l,f,i,t[e+13],21,1309151649),i=u(i,c,l,f,t[e+4],6,-145523070),f=u(f,i,c,l,t[e+11],10,-1120210379),l=u(l,f,i,c,t[e+2],15,718787259),c=u(c,l,f,i,t[e+9],21,-343485551),i=r(i,n),c=r(c,h),l=r(l,d),f=r(f,p)}return[i,c,l,f]}(function(t){if(0===t.length)return[];const e=8*t.length,r=new Uint32Array(n(e));for(let n=0;n<e;n+=8)r[n>>5]|=(255&t[n/8])<<n%32;return r}(t),8*t.length))}},4790:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};e.default=n},6314:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default="00000000-0000-0000-0000-000000000000"},8222:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(6435))&&r.__esModule?r:{default:r};e.default=function(t){if(!(0,i.default)(t))throw TypeError("Invalid UUID");let e;const n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n}},58:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},3319:(t,e)=>{"use strict";let n;Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(r)};const r=new Uint8Array(16)},3757:(t,e)=>{"use strict";function n(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:case 3:return e^n^r;case 2:return e&n^e&r^n&r}}function r(t,e){return t<<e|t>>>32-e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=function(t){const e=[1518500249,1859775393,2400959708,3395469782],i=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);const o=t.length/4+2,s=Math.ceil(o/16),a=new Array(s);for(let e=0;e<s;++e){const n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=t[64*e+4*r]<<24|t[64*e+4*r+1]<<16|t[64*e+4*r+2]<<8|t[64*e+4*r+3];a[e]=n}a[s-1][14]=8*(t.length-1)/Math.pow(2,32),a[s-1][14]=Math.floor(a[s-1][14]),a[s-1][15]=8*(t.length-1)&4294967295;for(let t=0;t<s;++t){const o=new Uint32Array(80);for(let e=0;e<16;++e)o[e]=a[t][e];for(let t=16;t<80;++t)o[t]=r(o[t-3]^o[t-8]^o[t-14]^o[t-16],1);let s=i[0],u=i[1],c=i[2],l=i[3],f=i[4];for(let t=0;t<80;++t){const i=Math.floor(t/20),a=r(s,5)+n(i,u,c,l)+f+e[i]+o[t]>>>0;f=l,l=c,c=r(u,30)>>>0,u=s,s=a}i[0]=i[0]+s>>>0,i[1]=i[1]+u>>>0,i[2]=i[2]+c>>>0,i[3]=i[3]+l>>>0,i[4]=i[4]+f>>>0}return[i[0]>>24&255,i[0]>>16&255,i[0]>>8&255,255&i[0],i[1]>>24&255,i[1]>>16&255,i[1]>>8&255,255&i[1],i[2]>>24&255,i[2]>>16&255,i[2]>>8&255,255&i[2],i[3]>>24&255,i[3]>>16&255,i[3]>>8&255,255&i[3],i[4]>>24&255,i[4]>>16&255,i[4]>>8&255,255&i[4]]}},4008:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.unsafeStringify=s;var r,i=(r=n(6435))&&r.__esModule?r:{default:r};const o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));function s(t,e=0){return(o[t[e+0]]+o[t[e+1]]+o[t[e+2]]+o[t[e+3]]+"-"+o[t[e+4]]+o[t[e+5]]+"-"+o[t[e+6]]+o[t[e+7]]+"-"+o[t[e+8]]+o[t[e+9]]+"-"+o[t[e+10]]+o[t[e+11]]+o[t[e+12]]+o[t[e+13]]+o[t[e+14]]+o[t[e+15]]).toLowerCase()}e.default=function(t,e=0){const n=s(t,e);if(!(0,i.default)(n))throw TypeError("Stringified UUID is invalid");return n}},3990:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(3319))&&r.__esModule?r:{default:r},o=n(4008);let s,a,u=0,c=0;e.default=function(t,e,n){let r=e&&n||0;const l=e||new Array(16);let f=(t=t||{}).node||s,h=void 0!==t.clockseq?t.clockseq:a;if(null==f||null==h){const e=t.random||(t.rng||i.default)();null==f&&(f=s=[1|e[0],e[1],e[2],e[3],e[4],e[5]]),null==h&&(h=a=16383&(e[6]<<8|e[7]))}let d=void 0!==t.msecs?t.msecs:Date.now(),p=void 0!==t.nsecs?t.nsecs:c+1;const g=d-u+(p-c)/1e4;if(g<0&&void 0===t.clockseq&&(h=h+1&16383),(g<0||d>u)&&void 0===t.nsecs&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");u=d,c=p,a=h,d+=122192928e5;const v=(1e4*(268435455&d)+p)%4294967296;l[r++]=v>>>24&255,l[r++]=v>>>16&255,l[r++]=v>>>8&255,l[r++]=255&v;const y=d/4294967296*1e4&268435455;l[r++]=y>>>8&255,l[r++]=255&y,l[r++]=y>>>24&15|16,l[r++]=y>>>16&255,l[r++]=h>>>8|128,l[r++]=255&h;for(let t=0;t<6;++t)l[r+t]=f[t];return e||(0,o.unsafeStringify)(l)}},8237:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=o(n(7925)),i=o(n(4163));function o(t){return t&&t.__esModule?t:{default:t}}var s=(0,r.default)("v3",48,i.default);e.default=s},7925:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.URL=e.DNS=void 0,e.default=function(t,e,n){function r(t,r,s,a){var u;if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));const e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e}(t)),"string"==typeof r&&(r=(0,o.default)(r)),16!==(null===(u=r)||void 0===u?void 0:u.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+t.length);if(c.set(r),c.set(t,r.length),c=n(c),c[6]=15&c[6]|e,c[8]=63&c[8]|128,s){a=a||0;for(let t=0;t<16;++t)s[a+t]=c[t];return s}return(0,i.unsafeStringify)(c)}try{r.name=t}catch(t){}return r.DNS=s,r.URL=a,r};var r,i=n(4008),o=(r=n(8222))&&r.__esModule?r:{default:r};const s="6ba7b810-9dad-11d1-80b4-00c04fd430c8";e.DNS=s;const a="6ba7b811-9dad-11d1-80b4-00c04fd430c8";e.URL=a},5355:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=s(n(4790)),i=s(n(3319)),o=n(4008);function s(t){return t&&t.__esModule?t:{default:t}}e.default=function(t,e,n){if(r.default.randomUUID&&!e&&!t)return r.default.randomUUID();const s=(t=t||{}).random||(t.rng||i.default)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=s[t];return e}return(0,o.unsafeStringify)(s)}},3764:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=o(n(7925)),i=o(n(3757));function o(t){return t&&t.__esModule?t:{default:t}}var s=(0,r.default)("v5",80,i.default);e.default=s},6435:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(58))&&r.__esModule?r:{default:r};e.default=function(t){return"string"==typeof t&&i.default.test(t)}},8464:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(6435))&&r.__esModule?r:{default:r};e.default=function(t){if(!(0,i.default)(t))throw TypeError("Invalid UUID");return parseInt(t.slice(14,15),16)}},3336:t=>{"use strict";t.exports=$},8419:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hasCORS=void 0;let n=!1;try{n="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){}e.hasCORS=n},5754:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decode=e.encode=void 0,e.encode=function(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e},e.decode=function(t){let e={},n=t.split("&");for(let t=0,r=n.length;t<r;t++){let r=n[t].split("=");e[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return e}},5222:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parse=void 0;const n=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];e.parse=function(t){const e=t,i=t.indexOf("["),o=t.indexOf("]");-1!=i&&-1!=o&&(t=t.substring(0,i)+t.substring(i,o).replace(/:/g,";")+t.substring(o,t.length));let s=n.exec(t||""),a={},u=14;for(;u--;)a[r[u]]=s[u]||"";return-1!=i&&-1!=o&&(a.source=e,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=function(t,e){const n=e.replace(/\/{2,9}/g,"/").split("/");return"/"!=e.slice(0,1)&&0!==e.length||n.splice(0,1),"/"==e.slice(-1)&&n.splice(n.length-1,1),n}(0,a.path),a.queryKey=function(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(t,e,r){e&&(n[e]=r)})),n}(0,a.query),a}},8726:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.yeast=e.decode=e.encode=void 0;const n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),r={};let i,o=0,s=0;function a(t){let e="";do{e=n[t%64]+e,t=Math.floor(t/64)}while(t>0);return e}for(e.encode=a,e.decode=function(t){let e=0;for(s=0;s<t.length;s++)e=64*e+r[t.charAt(s)];return e},e.yeast=function(){const t=a(+new Date);return t!==i?(o=0,i=t):t+"."+a(o++)};s<64;s++)r[n[s]]=s},6242:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.globalThisShim=void 0,e.globalThisShim="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")()},4679:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.nextTick=e.parse=e.installTimerFunctions=e.transports=e.Transport=e.protocol=e.Socket=void 0;const r=n(3481);Object.defineProperty(e,"Socket",{enumerable:!0,get:function(){return r.Socket}}),e.protocol=r.Socket.protocol;var i=n(9870);Object.defineProperty(e,"Transport",{enumerable:!0,get:function(){return i.Transport}});var o=n(7385);Object.defineProperty(e,"transports",{enumerable:!0,get:function(){return o.transports}});var s=n(9622);Object.defineProperty(e,"installTimerFunctions",{enumerable:!0,get:function(){return s.installTimerFunctions}});var a=n(5222);Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return a.parse}});var u=n(5552);Object.defineProperty(e,"nextTick",{enumerable:!0,get:function(){return u.nextTick}})},3481:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Socket=void 0;const i=n(7385),o=n(9622),s=n(5754),a=n(5222),u=r(n(4802)),c=n(5260),l=n(1373),f=(0,u.default)("engine.io-client:socket");class h extends c.Emitter{constructor(t,e={}){super(),this.writeBuffer=[],t&&"object"==typeof t&&(e=t,t=null),t?(t=(0,a.parse)(t),e.hostname=t.host,e.secure="https"===t.protocol||"wss"===t.protocol,e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=(0,a.parse)(e.host).host),(0,o.installTimerFunctions)(this,e),this.secure=null!=e.secure?e.secure:"undefined"!=typeof location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=e.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=e.transports||["polling","websocket"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},e),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=(0,s.decode)(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){f('creating transport "%s"',t);const e=Object.assign({},this.opts.query);e.EIO=l.protocol,e.transport=t,this.id&&(e.sid=this.id);const n=Object.assign({},this.opts.transportOptions[t],this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return f("options: %j",n),new i.transports[t](n)}open(){let t;if(this.opts.rememberUpgrade&&h.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(t){return f("error while creating transport: %s",t),this.transports.shift(),void this.open()}t.open(),this.setTransport(t)}setTransport(t){f("setting transport %s",t.name),this.transport&&(f("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(t=>this.onClose("transport close",t)))}probe(t){f('probing transport "%s"',t);let e=this.createTransport(t),n=!1;h.priorWebsocketSuccess=!1;const r=()=>{n||(f('probe transport "%s" opened',t),e.send([{type:"ping",data:"probe"}]),e.once("packet",(r=>{if(!n)if("pong"===r.type&&"probe"===r.data){if(f('probe transport "%s" pong',t),this.upgrading=!0,this.emitReserved("upgrading",e),!e)return;h.priorWebsocketSuccess="websocket"===e.name,f('pausing current transport "%s"',this.transport.name),this.transport.pause((()=>{n||"closed"!==this.readyState&&(f("changing transport and sending upgrade packet"),c(),this.setTransport(e),e.send([{type:"upgrade"}]),this.emitReserved("upgrade",e),e=null,this.upgrading=!1,this.flush())}))}else{f('probe transport "%s" failed',t);const n=new Error("probe error");n.transport=e.name,this.emitReserved("upgradeError",n)}})))};function i(){n||(n=!0,c(),e.close(),e=null)}const o=n=>{const r=new Error("probe error: "+n);r.transport=e.name,i(),f('probe transport "%s" failed because of error: %s',t,n),this.emitReserved("upgradeError",r)};function s(){o("transport closed")}function a(){o("socket closed")}function u(t){e&&t.name!==e.name&&(f('"%s" works - aborting "%s"',t.name,e.name),i())}const c=()=>{e.removeListener("open",r),e.removeListener("error",o),e.removeListener("close",s),this.off("close",a),this.off("upgrading",u)};e.once("open",r),e.once("error",o),e.once("close",s),this.once("close",a),this.once("upgrading",u),e.open()}onOpen(){if(f("socket open"),this.readyState="open",h.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade){f("starting upgrade probes");let t=0;const e=this.upgrades.length;for(;t<e;t++)this.probe(this.upgrades[t])}}onPacket(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(f('socket receive: type "%s", data "%s"',t.type,t.data),this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data)}else f('packet received with socket readyState "%s"',this.readyState)}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((()=>{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();f("flushing %d packets in socket",t.length),this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let e=0;e<this.writeBuffer.length;e++){const n=this.writeBuffer[e].data;if(n&&(t+=(0,o.byteLength)(n)),e>0&&t>this.maxPayload)return f("only send %d out of %d packets",e,this.writeBuffer.length),this.writeBuffer.slice(0,e);t+=2}return f("payload size is %d (max: %d)",t,this.maxPayload),this.writeBuffer}write(t,e,n){return this.sendPacket("message",t,e,n),this}send(t,e,n){return this.sendPacket("message",t,e,n),this}sendPacket(t,e,n,r){if("function"==typeof e&&(r=e,e=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const i={type:t,data:e,options:n};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),r&&this.once("flush",r),this.flush()}close(){const t=()=>{this.onClose("forced close"),f("socket closing - telling transport to close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),t()},n=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():t()})):this.upgrading?n():t()),this}onError(t){f("socket error %j",t),h.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,e){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(f('socket close with reason: "%s"',t),this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,e),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const e=[];let n=0;const r=t.length;for(;n<r;n++)~this.transports.indexOf(t[n])&&e.push(t[n]);return e}}e.Socket=h,h.protocol=l.protocol},9870:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Transport=void 0;const i=n(1373),o=n(5260),s=n(9622),a=(0,r(n(4802)).default)("engine.io-client:transport");class u extends Error{constructor(t,e,n){super(t),this.description=e,this.context=n,this.type="TransportError"}}class c extends o.Emitter{constructor(t){super(),this.writable=!1,(0,s.installTimerFunctions)(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,e,n){return super.emitReserved("error",new u(t,e,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(t){"open"===this.readyState?this.write(t):a("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const e=(0,i.decodePacket)(t,this.socket.binaryType);this.onPacket(e)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}}e.Transport=c},7385:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.transports=void 0;const r=n(484),i=n(1308);e.transports={websocket:i.WS,polling:r.Polling}},484:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Request=e.Polling=void 0;const i=n(9870),o=r(n(4802)),s=n(8726),a=n(5754),u=n(1373),c=n(6666),l=n(5260),f=n(9622),h=n(6242),d=(0,o.default)("engine.io-client:polling");function p(){}const g=null!=new c.XHR({xdomain:!1}).responseType;class v extends i.Transport{constructor(t){if(super(t),this.polling=!1,"undefined"!=typeof location){const e="https:"===location.protocol;let n=location.port;n||(n=e?"443":"80"),this.xd="undefined"!=typeof location&&t.hostname!==location.hostname||n!==t.port,this.xs=t.secure!==e}const e=t&&t.forceBase64;this.supportsBinary=g&&!e}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const e=()=>{d("paused"),this.readyState="paused",t()};if(this.polling||!this.writable){let t=0;this.polling&&(d("we are currently polling - waiting to pause"),t++,this.once("pollComplete",(function(){d("pre-pause polling complete"),--t||e()}))),this.writable||(d("we are currently writing - waiting to pause"),t++,this.once("drain",(function(){d("pre-pause writing complete"),--t||e()})))}else e()}poll(){d("polling"),this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){d("polling got data %s",t),(0,u.decodePayload)(t,this.socket.binaryType).forEach((t=>{if("opening"===this.readyState&&"open"===t.type&&this.onOpen(),"close"===t.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(t)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState?this.poll():d('ignoring poll - transport state "%s"',this.readyState))}doClose(){const t=()=>{d("writing close packet"),this.write([{type:"close"}])};"open"===this.readyState?(d("transport open - closing"),t()):(d("transport not open - deferring close"),this.once("open",t))}write(t){this.writable=!1,(0,u.encodePayload)(t,(t=>{this.doWrite(t,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){let t=this.query||{};const e=this.opts.secure?"https":"http";let n="";!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=(0,s.yeast)()),this.supportsBinary||t.sid||(t.b64=1),this.opts.port&&("https"===e&&443!==Number(this.opts.port)||"http"===e&&80!==Number(this.opts.port))&&(n=":"+this.opts.port);const r=(0,a.encode)(t);return e+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new y(this.uri(),t)}doWrite(t,e){const n=this.request({method:"POST",data:t});n.on("success",e),n.on("error",((t,e)=>{this.onError("xhr post error",t,e)}))}doPoll(){d("xhr poll");const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",((t,e)=>{this.onError("xhr poll error",t,e)})),this.pollXhr=t}}e.Polling=v;class y extends l.Emitter{constructor(t,e){super(),(0,f.installTimerFunctions)(this,e),this.opts=e,this.method=e.method||"GET",this.uri=t,this.async=!1!==e.async,this.data=void 0!==e.data?e.data:null,this.create()}create(){const t=(0,f.pick)(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const e=this.xhr=new c.XHR(t);try{d("xhr open %s: %s",this.method,this.uri),e.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){e.setDisableHeaderCheck&&e.setDisableHeaderCheck(!0);for(let t in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(t)&&e.setRequestHeader(t,this.opts.extraHeaders[t])}}catch(t){}if("POST"===this.method)try{e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{e.setRequestHeader("Accept","*/*")}catch(t){}"withCredentials"in e&&(e.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(e.timeout=this.opts.requestTimeout),e.onreadystatechange=()=>{4===e.readyState&&(200===e.status||1223===e.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof e.status?e.status:0)}),0))},d("xhr data %s",this.data),e.send(this.data)}catch(t){return void this.setTimeoutFn((()=>{this.onError(t)}),0)}"undefined"!=typeof document&&(this.index=y.requestsCount++,y.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=p,t)try{this.xhr.abort()}catch(t){}"undefined"!=typeof document&&delete y.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;null!==t&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(e.Request=y,y.requestsCount=0,y.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",m);else if("function"==typeof addEventListener){const t="onpagehide"in h.globalThisShim?"pagehide":"unload";addEventListener(t,m,!1)}function m(){for(let t in y.requests)y.requests.hasOwnProperty(t)&&y.requests[t].abort()}},5552:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defaultBinaryType=e.usingBrowserWebSocket=e.WebSocket=e.nextTick=void 0;const r=n(6242);e.nextTick="function"==typeof Promise&&"function"==typeof Promise.resolve?t=>Promise.resolve().then(t):(t,e)=>e(t,0),e.WebSocket=r.globalThisShim.WebSocket||r.globalThisShim.MozWebSocket,e.usingBrowserWebSocket=!0,e.defaultBinaryType="arraybuffer"},1308:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.WS=void 0;const i=n(9870),o=n(5754),s=n(8726),a=n(9622),u=n(5552),c=r(n(4802)),l=n(1373),f=(0,c.default)("engine.io-client:websocket"),h="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class d extends i.Transport{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),e=this.opts.protocols,n=h?{}:(0,a.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=u.usingBrowserWebSocket&&!h?e?new u.WebSocket(t,e):new u.WebSocket(t):new u.WebSocket(t,e,n)}catch(t){return this.emitReserved("error",t)}this.ws.binaryType=this.socket.binaryType||u.defaultBinaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let e=0;e<t.length;e++){const n=t[e],r=e===t.length-1;(0,l.encodePacket)(n,this.supportsBinary,(t=>{const e={};!u.usingBrowserWebSocket&&(n.options&&(e.compress=n.options.compress),this.opts.perMessageDeflate)&&("string"==typeof t?Buffer.byteLength(t):t.length)<this.opts.perMessageDeflate.threshold&&(e.compress=!1);try{u.usingBrowserWebSocket?this.ws.send(t):this.ws.send(t,e)}catch(t){f("websocket closed before onclose event")}r&&(0,u.nextTick)((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const e=this.opts.secure?"wss":"ws";let n="";this.opts.port&&("wss"===e&&443!==Number(this.opts.port)||"ws"===e&&80!==Number(this.opts.port))&&(n=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=(0,s.yeast)()),this.supportsBinary||(t.b64=1);const r=(0,o.encode)(t);return e+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}check(){return!!u.WebSocket}}e.WS=d},6666:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.XHR=void 0;const r=n(8419),i=n(6242);e.XHR=function(t){const e=t.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!e||r.hasCORS))return new XMLHttpRequest}catch(t){}if(!e)try{return new(i.globalThisShim[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}},9622:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.byteLength=e.installTimerFunctions=e.pick=void 0;const r=n(6242);e.pick=function(t,...e){return e.reduce(((e,n)=>(t.hasOwnProperty(n)&&(e[n]=t[n]),e)),{})};const i=r.globalThisShim.setTimeout,o=r.globalThisShim.clearTimeout;e.installTimerFunctions=function(t,e){e.useNativeTimers?(t.setTimeoutFn=i.bind(r.globalThisShim),t.clearTimeoutFn=o.bind(r.globalThisShim)):(t.setTimeoutFn=r.globalThisShim.setTimeout.bind(r.globalThisShim),t.clearTimeoutFn=r.globalThisShim.clearTimeout.bind(r.globalThisShim))},e.byteLength=function(t){return"string"==typeof t?function(t){let e=0,n=0;for(let r=0,i=t.length;r<i;r++)e=t.charCodeAt(r),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}(t):Math.ceil(1.33*(t.byteLength||t.size))}},3087:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ERROR_PACKET=e.PACKET_TYPES_REVERSE=e.PACKET_TYPES=void 0;const n=Object.create(null);e.PACKET_TYPES=n,n.open="0",n.close="1",n.ping="2",n.pong="3",n.message="4",n.upgrade="5",n.noop="6";const r=Object.create(null);e.PACKET_TYPES_REVERSE=r,Object.keys(n).forEach((t=>{r[n[t]]=t})),e.ERROR_PACKET={type:"error",data:"parser error"}},2469:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decode=e.encode=void 0;const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let t=0;t<64;t++)r[n.charCodeAt(t)]=t;e.encode=t=>{let e,r=new Uint8Array(t),i=r.length,o="";for(e=0;e<i;e+=3)o+=n[r[e]>>2],o+=n[(3&r[e])<<4|r[e+1]>>4],o+=n[(15&r[e+1])<<2|r[e+2]>>6],o+=n[63&r[e+2]];return i%3==2?o=o.substring(0,o.length-1)+"=":i%3==1&&(o=o.substring(0,o.length-2)+"=="),o},e.decode=t=>{let e,n,i,o,s,a=.75*t.length,u=t.length,c=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);const l=new ArrayBuffer(a),f=new Uint8Array(l);for(e=0;e<u;e+=4)n=r[t.charCodeAt(e)],i=r[t.charCodeAt(e+1)],o=r[t.charCodeAt(e+2)],s=r[t.charCodeAt(e+3)],f[c++]=n<<2|i>>4,f[c++]=(15&i)<<4|o>>2,f[c++]=(3&o)<<6|63&s;return l}},7572:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(3087),i=n(2469),o="function"==typeof ArrayBuffer,s=(t,e)=>{if(o){const n=(0,i.decode)(t);return a(n,e)}return{base64:!0,data:t}},a=(t,e)=>"blob"===e&&t instanceof ArrayBuffer?new Blob([t]):t;e.default=(t,e)=>{if("string"!=typeof t)return{type:"message",data:a(t,e)};const n=t.charAt(0);return"b"===n?{type:"message",data:s(t.substring(1),e)}:r.PACKET_TYPES_REVERSE[n]?t.length>1?{type:r.PACKET_TYPES_REVERSE[n],data:t.substring(1)}:{type:r.PACKET_TYPES_REVERSE[n]}:r.ERROR_PACKET}},3908:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(3087),i="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),o="function"==typeof ArrayBuffer,s=(t,e)=>{const n=new FileReader;return n.onload=function(){const t=n.result.split(",")[1];e("b"+(t||""))},n.readAsDataURL(t)};e.default=({type:t,data:e},n,a)=>{return i&&e instanceof Blob?n?a(e):s(e,a):o&&(e instanceof ArrayBuffer||(u=e,"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(u):u&&u.buffer instanceof ArrayBuffer))?n?a(e):s(new Blob([e]),a):a(r.PACKET_TYPES[t]+(e||""));var u}},1373:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodePayload=e.decodePacket=e.encodePayload=e.encodePacket=e.protocol=void 0;const r=n(3908);e.encodePacket=r.default;const i=n(7572);e.decodePacket=i.default;const o=String.fromCharCode(30);e.encodePayload=(t,e)=>{const n=t.length,i=new Array(n);let s=0;t.forEach(((t,a)=>{(0,r.default)(t,!1,(t=>{i[a]=t,++s===n&&e(i.join(o))}))}))},e.decodePayload=(t,e)=>{const n=t.split(o),r=[];for(let t=0;t<n.length;t++){const o=(0,i.default)(n[t],e);if(r.push(o),"error"===o.type)break}return r},e.protocol=4},5159:(t,e)=>{"use strict";function n(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Object.defineProperty(e,"__esModule",{value:!0}),e.Backoff=void 0,e.Backoff=n,n.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-n:t+n}return 0|Math.min(t,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(t){this.ms=t},n.prototype.setMax=function(t){this.max=t},n.prototype.setJitter=function(t){this.jitter=t}},7046:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.connect=e.io=e.Socket=e.Manager=e.protocol=void 0;const i=n(3084),o=n(4168);Object.defineProperty(e,"Manager",{enumerable:!0,get:function(){return o.Manager}});const s=n(8312);Object.defineProperty(e,"Socket",{enumerable:!0,get:function(){return s.Socket}});const a=r(n(3669)).default("socket.io-client"),u={};function c(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};const n=i.url(t,e.path||"/socket.io"),r=n.source,s=n.id,c=n.path,l=u[s]&&c in u[s].nsps;let f;return e.forceNew||e["force new connection"]||!1===e.multiplex||l?(a("ignoring socket cache for %s",r),f=new o.Manager(r,e)):(u[s]||(a("new io instance for %s",r),u[s]=new o.Manager(r,e)),f=u[s]),n.query&&!e.query&&(e.query=n.queryKey),f.socket(n.path,e)}e.io=c,e.connect=c,e.default=c,Object.assign(c,{Manager:o.Manager,Socket:s.Socket,io:c,connect:c});var l=n(4514);Object.defineProperty(e,"protocol",{enumerable:!0,get:function(){return l.protocol}}),t.exports=c},4168:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Manager=void 0;const a=n(4679),u=n(8312),c=o(n(4514)),l=n(7149),f=n(5159),h=n(5260),d=s(n(3669)).default("socket.io-client:manager");class p extends h.Emitter{constructor(t,e){var n;super(),this.nsps={},this.subs=[],t&&"object"==typeof t&&(e=t,t=void 0),(e=e||{}).path=e.path||"/socket.io",this.opts=e,a.installTimerFunctions(this,e),this.reconnection(!1!==e.reconnection),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(n=e.randomizationFactor)&&void 0!==n?n:.5),this.backoff=new f.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==e.timeout?2e4:e.timeout),this._readyState="closed",this.uri=t;const r=e.parser||c;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==e.autoConnect,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return void 0===t?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var e;return void 0===t?this._reconnectionDelay:(this._reconnectionDelay=t,null===(e=this.backoff)||void 0===e||e.setMin(t),this)}randomizationFactor(t){var e;return void 0===t?this._randomizationFactor:(this._randomizationFactor=t,null===(e=this.backoff)||void 0===e||e.setJitter(t),this)}reconnectionDelayMax(t){var e;return void 0===t?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,null===(e=this.backoff)||void 0===e||e.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(t){if(d("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;d("opening %s",this.uri),this.engine=new a.Socket(this.uri,this.opts);const e=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=l.on(e,"open",(function(){n.onopen(),t&&t()})),i=l.on(e,"error",(e=>{d("error"),n.cleanup(),n._readyState="closed",this.emitReserved("error",e),t?t(e):n.maybeReconnectOnOpen()}));if(!1!==this._timeout){const t=this._timeout;d("connect attempt will timeout after %d",t),0===t&&r();const n=this.setTimeoutFn((()=>{d("connect attempt timed out after %d",t),r(),e.close(),e.emit("error",new Error("timeout"))}),t);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}return this.subs.push(r),this.subs.push(i),this}connect(t){return this.open(t)}onopen(){d("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(l.on(t,"ping",this.onping.bind(this)),l.on(t,"data",this.ondata.bind(this)),l.on(t,"error",this.onerror.bind(this)),l.on(t,"close",this.onclose.bind(this)),l.on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(t){this.onclose("parse error",t)}}ondecoded(t){a.nextTick((()=>{this.emitReserved("packet",t)}),this.setTimeoutFn)}onerror(t){d("error",t),this.emitReserved("error",t)}socket(t,e){let n=this.nsps[t];return n?this._autoConnect&&!n.active&&n.connect():(n=new u.Socket(this,t,e),this.nsps[t]=n),n}_destroy(t){const e=Object.keys(this.nsps);for(const t of e)if(this.nsps[t].active)return void d("socket %s is still active, skipping close",t);this._close()}_packet(t){d("writing packet %j",t);const e=this.encoder.encode(t);for(let n=0;n<e.length;n++)this.engine.write(e[n],t.options)}cleanup(){d("cleanup"),this.subs.forEach((t=>t())),this.subs.length=0,this.decoder.destroy()}_close(){d("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,e){d("closed due to %s",t),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)d("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const e=this.backoff.duration();d("will wait %dms before reconnect attempt",e),this._reconnecting=!0;const n=this.setTimeoutFn((()=>{t.skipReconnect||(d("attempting reconnect"),this.emitReserved("reconnect_attempt",t.backoff.attempts),t.skipReconnect||t.open((e=>{e?(d("reconnect attempt error"),t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",e)):(d("reconnect success"),t.onreconnect())})))}),e);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}e.Manager=p},7149:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.on=void 0,e.on=function(t,e,n){return t.on(e,n),function(){t.off(e,n)}}},8312:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Socket=void 0;const i=n(4514),o=n(7149),s=n(5260),a=r(n(3669)).default("socket.io-client:socket"),u=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class c extends s.Emitter{constructor(t,e,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=e,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[o.on(t,"open",this.onopen.bind(this)),o.on(t,"packet",this.onpacket.bind(this)),o.on(t,"error",this.onerror.bind(this)),o.on(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...e){if(u.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(e.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(e),this;const n={type:i.PacketType.EVENT,data:e,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"==typeof e[e.length-1]){const t=this.ids++;a("emitting packet with ack id %d",t);const r=e.pop();this._registerAckCallback(t,r),n.id=t}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return!this.flags.volatile||r&&this.connected?this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n):a("discard packet as the transport is not currently writable"),this.flags={},this}_registerAckCallback(t,e){var n;const r=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===r)return void(this.acks[t]=e);const i=this.io.setTimeoutFn((()=>{delete this.acks[t];for(let e=0;e<this.sendBuffer.length;e++)this.sendBuffer[e].id===t&&(a("removing packet with ack id %d from the buffer",t),this.sendBuffer.splice(e,1));a("event with ack id %d has timed out after %d ms",t,r),e.call(this,new Error("operation has timed out"))}),r);this.acks[t]=(...t)=>{this.io.clearTimeoutFn(i),e.apply(this,[null,...t])}}emitWithAck(t,...e){const n=void 0!==this.flags.timeout||void 0!==this._opts.ackTimeout;return new Promise(((r,i)=>{e.push(((t,e)=>n?t?i(t):r(e):r(t))),this.emit(t,...e)}))}_addToQueue(t){let e;"function"==typeof t[t.length-1]&&(e=t.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push(((t,...r)=>{if(n===this._queue[0])return null!==t?n.tryCount>this._opts.retries&&(a("packet [%d] is discarded after %d tries",n.id,n.tryCount),this._queue.shift(),e&&e(t)):(a("packet [%d] was successfully sent",n.id),this._queue.shift(),e&&e(null,...r)),n.pending=!1,this._drainQueue()})),this._queue.push(n),this._drainQueue()}_drainQueue(t=!1){if(a("draining queue"),!this.connected||0===this._queue.length)return;const e=this._queue[0];!e.pending||t?(e.pending=!0,e.tryCount++,a("sending packet [%d] (try n°%d)",e.id,e.tryCount),this.flags=e.flags,this.emit.apply(this,e.args)):a("packet [%d] has already been sent and is waiting for an ack",e.id)}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){a("transport is open - connecting"),"function"==typeof this.auth?this.auth((t=>{this._sendConnectPacket(t)})):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:i.PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,e){a("close (%s)",t),this.connected=!1,delete this.id,this.emitReserved("disconnect",t,e)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case i.PacketType.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case i.PacketType.EVENT:case i.PacketType.BINARY_EVENT:this.onevent(t);break;case i.PacketType.ACK:case i.PacketType.BINARY_ACK:this.onack(t);break;case i.PacketType.DISCONNECT:this.ondisconnect();break;case i.PacketType.CONNECT_ERROR:this.destroy();const e=new Error(t.data.message);e.data=t.data.data,this.emitReserved("connect_error",e)}}onevent(t){const e=t.data||[];a("emitting event %j",e),null!=t.id&&(a("attaching ack callback to event"),e.push(this.ack(t.id))),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const e=this._anyListeners.slice();for(const n of e)n.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&"string"==typeof t[t.length-1]&&(this._lastOffset=t[t.length-1])}ack(t){const e=this;let n=!1;return function(...r){n||(n=!0,a("sending ack %j",r),e.packet({type:i.PacketType.ACK,id:t,data:r}))}}onack(t){const e=this.acks[t.id];"function"==typeof e?(a("calling ack %s with %j",t.id,t.data),e.apply(this,t.data),delete this.acks[t.id]):a("bad ack %s",t.id)}onconnect(t,e){a("socket connected with id %s",t),this.id=t,this.recovered=e&&this._pid===e,this._pid=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach((t=>this.emitEvent(t))),this.receiveBuffer=[],this.sendBuffer.forEach((t=>{this.notifyOutgoingListeners(t),this.packet(t)})),this.sendBuffer=[]}ondisconnect(){a("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((t=>t())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(a("performing disconnect (%s)",this.nsp),this.packet({type:i.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const e=this._anyListeners;for(let n=0;n<e.length;n++)if(t===e[n])return e.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const e=this._anyOutgoingListeners;for(let n=0;n<e.length;n++)if(t===e[n])return e.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const e=this._anyOutgoingListeners.slice();for(const n of e)n.apply(this,t.data)}}}e.Socket=c},3084:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.url=void 0;const i=n(4679),o=r(n(3669)).default("socket.io-client:url");e.url=function(t,e="",n){let r=t;n=n||"undefined"!=typeof location&&location,null==t&&(t=n.protocol+"//"+n.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?n.protocol+t:n.host+t),/^(https?|wss?):\/\//.test(t)||(o("protocol-less url %s",t),t=void 0!==n?n.protocol+"//"+t:"https://"+t),o("parse %s",t),r=i.parse(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+e,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}},4880:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.reconstructPacket=e.deconstructPacket=void 0;const r=n(665);function i(t,e){if(!t)return t;if((0,r.isBinary)(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}if(Array.isArray(t)){const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=i(t[r],e);return n}if("object"==typeof t&&!(t instanceof Date)){const n={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=i(t[r],e));return n}return t}function o(t,e){if(!t)return t;if(t&&!0===t._placeholder){if("number"==typeof t.num&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=o(t[n],e);else if("object"==typeof t)for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=o(t[n],e));return t}e.deconstructPacket=function(t){const e=[],n=t.data,r=t;return r.data=i(n,e),r.attachments=e.length,{packet:r,buffers:e}},e.reconstructPacket=function(t,e){return t.data=o(t.data,e),delete t.attachments,t}},4514:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Decoder=e.Encoder=e.PacketType=e.protocol=void 0;const r=n(5260),i=n(4880),o=n(665),s=(0,n(1618).default)("socket.io-parser");var a;e.protocol=5,function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"}(a=e.PacketType||(e.PacketType={})),e.Encoder=class{constructor(t){this.replacer=t}encode(t){return s("encoding packet %j",t),t.type!==a.EVENT&&t.type!==a.ACK||!(0,o.hasBinary)(t)?[this.encodeAsString(t)]:this.encodeAsBinary({type:t.type===a.EVENT?a.BINARY_EVENT:a.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id})}encodeAsString(t){let e=""+t.type;return t.type!==a.BINARY_EVENT&&t.type!==a.BINARY_ACK||(e+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(e+=t.nsp+","),null!=t.id&&(e+=t.id),null!=t.data&&(e+=JSON.stringify(t.data,this.replacer)),s("encoded %j as %s",t,e),e}encodeAsBinary(t){const e=(0,i.deconstructPacket)(t),n=this.encodeAsString(e.packet),r=e.buffers;return r.unshift(n),r}};class u extends r.Emitter{constructor(t){super(),this.reviver=t}add(t){let e;if("string"==typeof t){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");e=this.decodeString(t);const n=e.type===a.BINARY_EVENT;n||e.type===a.BINARY_ACK?(e.type=n?a.EVENT:a.ACK,this.reconstructor=new c(e),0===e.attachments&&super.emitReserved("decoded",e)):super.emitReserved("decoded",e)}else{if(!(0,o.isBinary)(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");e=this.reconstructor.takeBinaryData(t),e&&(this.reconstructor=null,super.emitReserved("decoded",e))}}decodeString(t){let e=0;const n={type:Number(t.charAt(0))};if(void 0===a[n.type])throw new Error("unknown packet type "+n.type);if(n.type===a.BINARY_EVENT||n.type===a.BINARY_ACK){const r=e+1;for(;"-"!==t.charAt(++e)&&e!=t.length;);const i=t.substring(r,e);if(i!=Number(i)||"-"!==t.charAt(e))throw new Error("Illegal attachments");n.attachments=Number(i)}if("/"===t.charAt(e+1)){const r=e+1;for(;++e&&","!==t.charAt(e)&&e!==t.length;);n.nsp=t.substring(r,e)}else n.nsp="/";const r=t.charAt(e+1);if(""!==r&&Number(r)==r){const r=e+1;for(;++e;){const n=t.charAt(e);if(null==n||Number(n)!=n){--e;break}if(e===t.length)break}n.id=Number(t.substring(r,e+1))}if(t.charAt(++e)){const r=this.tryParse(t.substr(e));if(!u.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return s("decoded %s as %j",t,n),n}tryParse(t){try{return JSON.parse(t,this.reviver)}catch(t){return!1}}static isPayloadValid(t,e){switch(t){case a.CONNECT:return"object"==typeof e;case a.DISCONNECT:return void 0===e;case a.CONNECT_ERROR:return"string"==typeof e||"object"==typeof e;case a.EVENT:case a.BINARY_EVENT:return Array.isArray(e)&&("string"==typeof e[0]||"number"==typeof e[0]);case a.ACK:case a.BINARY_ACK:return Array.isArray(e)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}e.Decoder=u;class c{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const t=(0,i.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}},665:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hasBinary=e.isBinary=void 0;const n="function"==typeof ArrayBuffer,r=Object.prototype.toString,i="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===r.call(Blob),o="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===r.call(File);function s(t){return n&&(t instanceof ArrayBuffer||(t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer)(t))||i&&t instanceof Blob||o&&t instanceof File}e.isBinary=s,e.hasBinary=function t(e,n){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(t(e[n]))return!0;return!1}if(s(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return t(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return!0;return!1}},5260:(t,e,n)=>{"use strict";function r(t){if(t)return function(t){for(var e in r.prototype)t[e]=r.prototype[e];return t}(t)}n.r(e),n.d(e,{Emitter:()=>r}),r.prototype.on=r.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},r.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+t];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;i<r.length;i++)if((n=r[i])===e||n.fn===e){r.splice(i,1);break}return 0===r.length&&delete this._callbacks["$"+t],this},r.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){r=0;for(var i=(n=n.slice(0)).length;r<i;++r)n[r].apply(this,e)}return this},r.prototype.emitReserved=r.prototype.emit,r.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},r.prototype.hasListeners=function(t){return!!this.listeners(t).length}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={id:r,loaded:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),n(2174)})();
\ No newline at end of file
+(()=>{var t={4802:(t,e,n)=>{e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(r++,"%c"===t&&(i=r))})),e.splice(i,0,n)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),t},e.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=n(804)(e);const{formatters:r}=t.exports;r.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},804:(t,e,n)=>{t.exports=function(t){function e(t){let n,i,o,s=null;function a(...t){if(!a.enabled)return;const r=a,i=Number(new Date),o=i-(n||i);r.diff=o,r.prev=n,r.curr=i,n=i,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let s=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";s++;const o=e.formatters[i];if("function"==typeof o){const e=t[s];n=o.call(r,e),t.splice(s,1),s--}return n})),e.formatArgs.call(r,t),(r.log||e.log).apply(r,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=r,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==e.namespaces&&(i=e.namespaces,o=e.enabled(t)),o),set:t=>{s=t}}),"function"==typeof e.init&&e.init(a),a}function r(t,n){const r=e(this.namespace+(void 0===n?":":n)+t);return r.log=this.log,r}function i(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){const t=[...e.names.map(i),...e.skips.map(i).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let n;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const r=("string"==typeof t?t:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(t=r[n].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.slice(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1},e.humanize=n(810),e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((n=>{e[n]=t[n]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let n=0;for(let e=0;e<t.length;e++)n=(n<<5)-n+t.charCodeAt(e),n|=0;return e.colors[Math.abs(n)%e.colors.length]},e.enable(e.load()),e}},810:t=>{var e=1e3,n=60*e,r=60*n,i=24*r;function o(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"s":"")}t.exports=function(t,s){s=s||{};var a,u,c=typeof t;if("string"===c&&t.length>0)return function(t){if(!((t=String(t)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*r;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(t);if("number"===c&&isFinite(t))return s.long?(a=t,(u=Math.abs(a))>=i?o(a,u,i,"day"):u>=r?o(a,u,r,"hour"):u>=n?o(a,u,n,"minute"):u>=e?o(a,u,e,"second"):a+" ms"):function(t){var o=Math.abs(t);return o>=i?Math.round(t/i)+"d":o>=r?Math.round(t/r)+"h":o>=n?Math.round(t/n)+"m":o>=e?Math.round(t/e)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},6486:function(t,e,n){var r;t=n.nmd(t),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",u=32,c=128,l=1/0,f=9007199254740991,h=NaN,d=4294967295,p=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",u],["partialRight",64],["rearg",256]],g="[object Arguments]",v="[object Array]",y="[object Boolean]",m="[object Date]",_="[object Error]",b="[object Function]",C="[object GeneratorFunction]",w="[object Map]",k="[object Number]",E="[object Object]",S="[object Promise]",x="[object RegExp]",A="[object Set]",O="[object String]",T="[object Symbol]",F="[object WeakMap]",j="[object ArrayBuffer]",P="[object DataView]",$="[object Float32Array]",R="[object Float64Array]",M="[object Int8Array]",L="[object Int16Array]",N="[object Int32Array]",D="[object Uint8Array]",I="[object Uint8ClampedArray]",B="[object Uint16Array]",q="[object Uint32Array]",U=/\b__p \+= '';/g,H=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,z=/&(?:amp|lt|gt|quot|#39);/g,V=/[&<>"']/g,Y=RegExp(z.source),K=RegExp(V.source),G=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,nt=RegExp(et.source),rt=/^\s+/,it=/\s/,ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,st=/\{\n\/\* \[wrapped with (.+)\] \*/,at=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ct=/[()=,{}\[\]\/\s]/,lt=/\\(\\)?/g,ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ht=/\w*$/,dt=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,gt=/^\[object .+?Constructor\]$/,vt=/^0o[0-7]+$/i,yt=/^(?:0|[1-9]\d*)$/,mt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_t=/($^)/,bt=/['\n\r\u2028\u2029\\]/g,Ct="\\ud800-\\udfff",wt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",kt="\\u2700-\\u27bf",Et="a-z\\xdf-\\xf6\\xf8-\\xff",St="A-Z\\xc0-\\xd6\\xd8-\\xde",xt="\\ufe0e\\ufe0f",At="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ot="["+Ct+"]",Tt="["+At+"]",Ft="["+wt+"]",jt="\\d+",Pt="["+kt+"]",$t="["+Et+"]",Rt="[^"+Ct+At+jt+kt+Et+St+"]",Mt="\\ud83c[\\udffb-\\udfff]",Lt="[^"+Ct+"]",Nt="(?:\\ud83c[\\udde6-\\uddff]){2}",Dt="[\\ud800-\\udbff][\\udc00-\\udfff]",It="["+St+"]",Bt="\\u200d",qt="(?:"+$t+"|"+Rt+")",Ut="(?:"+It+"|"+Rt+")",Ht="(?:['’](?:d|ll|m|re|s|t|ve))?",Wt="(?:['’](?:D|LL|M|RE|S|T|VE))?",zt="(?:"+Ft+"|"+Mt+")?",Vt="["+xt+"]?",Yt=Vt+zt+"(?:"+Bt+"(?:"+[Lt,Nt,Dt].join("|")+")"+Vt+zt+")*",Kt="(?:"+[Pt,Nt,Dt].join("|")+")"+Yt,Gt="(?:"+[Lt+Ft+"?",Ft,Nt,Dt,Ot].join("|")+")",Jt=RegExp("['’]","g"),Xt=RegExp(Ft,"g"),Zt=RegExp(Mt+"(?="+Mt+")|"+Gt+Yt,"g"),Qt=RegExp([It+"?"+$t+"+"+Ht+"(?="+[Tt,It,"$"].join("|")+")",Ut+"+"+Wt+"(?="+[Tt,It+qt,"$"].join("|")+")",It+"?"+qt+"+"+Ht,It+"+"+Wt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",jt,Kt].join("|"),"g"),te=RegExp("["+Bt+Ct+wt+xt+"]"),ee=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],re=-1,ie={};ie[$]=ie[R]=ie[M]=ie[L]=ie[N]=ie[D]=ie[I]=ie[B]=ie[q]=!0,ie[g]=ie[v]=ie[j]=ie[y]=ie[P]=ie[m]=ie[_]=ie[b]=ie[w]=ie[k]=ie[E]=ie[x]=ie[A]=ie[O]=ie[F]=!1;var oe={};oe[g]=oe[v]=oe[j]=oe[P]=oe[y]=oe[m]=oe[$]=oe[R]=oe[M]=oe[L]=oe[N]=oe[w]=oe[k]=oe[E]=oe[x]=oe[A]=oe[O]=oe[T]=oe[D]=oe[I]=oe[B]=oe[q]=!0,oe[_]=oe[b]=oe[F]=!1;var se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ae=parseFloat,ue=parseInt,ce="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,le="object"==typeof self&&self&&self.Object===Object&&self,fe=ce||le||Function("return this")(),he=e&&!e.nodeType&&e,de=he&&t&&!t.nodeType&&t,pe=de&&de.exports===he,ge=pe&&ce.process,ve=function(){try{return de&&de.require&&de.require("util").types||ge&&ge.binding&&ge.binding("util")}catch(t){}}(),ye=ve&&ve.isArrayBuffer,me=ve&&ve.isDate,_e=ve&&ve.isMap,be=ve&&ve.isRegExp,Ce=ve&&ve.isSet,we=ve&&ve.isTypedArray;function ke(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ee(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var s=t[i];e(r,s,n(s),t)}return r}function Se(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function xe(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Ae(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Oe(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}function Te(t,e){return!(null==t||!t.length)&&Ie(t,e,0)>-1}function Fe(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function je(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function Pe(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function $e(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function Re(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function Me(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Le=He("length");function Ne(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function De(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function Ie(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):De(t,qe,n)}function Be(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}function qe(t){return t!=t}function Ue(t,e){var n=null==t?0:t.length;return n?Ve(t,e)/n:h}function He(t){return function(e){return null==e?i:e[t]}}function We(t){return function(e){return null==t?i:t[e]}}function ze(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}function Ve(t,e){for(var n,r=-1,o=t.length;++r<o;){var s=e(t[r]);s!==i&&(n=n===i?s:n+s)}return n}function Ye(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Ke(t){return t?t.slice(0,hn(t)+1).replace(rt,""):t}function Ge(t){return function(e){return t(e)}}function Je(t,e){return je(e,(function(e){return t[e]}))}function Xe(t,e){return t.has(e)}function Ze(t,e){for(var n=-1,r=t.length;++n<r&&Ie(e,t[n],0)>-1;);return n}function Qe(t,e){for(var n=t.length;n--&&Ie(e,t[n],0)>-1;);return n}var tn=We({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),en=We({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function nn(t){return"\\"+se[t]}function rn(t){return te.test(t)}function on(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function sn(t,e){return function(n){return t(e(n))}}function an(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var s=t[n];s!==e&&s!==a||(t[n]=a,o[i++]=n)}return o}function un(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function cn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function ln(t){return rn(t)?function(t){for(var e=Zt.lastIndex=0;Zt.test(t);)++e;return e}(t):Le(t)}function fn(t){return rn(t)?function(t){return t.match(Zt)||[]}(t):function(t){return t.split("")}(t)}function hn(t){for(var e=t.length;e--&&it.test(t.charAt(e)););return e}var dn=We({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),pn=function t(e){var n,r=(e=null==e?fe:pn.defaults(fe.Object(),e,pn.pick(fe,ne))).Array,it=e.Date,Ct=e.Error,wt=e.Function,kt=e.Math,Et=e.Object,St=e.RegExp,xt=e.String,At=e.TypeError,Ot=r.prototype,Tt=wt.prototype,Ft=Et.prototype,jt=e["__core-js_shared__"],Pt=Tt.toString,$t=Ft.hasOwnProperty,Rt=0,Mt=(n=/[^.]+$/.exec(jt&&jt.keys&&jt.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Lt=Ft.toString,Nt=Pt.call(Et),Dt=fe._,It=St("^"+Pt.call($t).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Bt=pe?e.Buffer:i,qt=e.Symbol,Ut=e.Uint8Array,Ht=Bt?Bt.allocUnsafe:i,Wt=sn(Et.getPrototypeOf,Et),zt=Et.create,Vt=Ft.propertyIsEnumerable,Yt=Ot.splice,Kt=qt?qt.isConcatSpreadable:i,Gt=qt?qt.iterator:i,Zt=qt?qt.toStringTag:i,te=function(){try{var t=uo(Et,"defineProperty");return t({},"",{}),t}catch(t){}}(),se=e.clearTimeout!==fe.clearTimeout&&e.clearTimeout,ce=it&&it.now!==fe.Date.now&&it.now,le=e.setTimeout!==fe.setTimeout&&e.setTimeout,he=kt.ceil,de=kt.floor,ge=Et.getOwnPropertySymbols,ve=Bt?Bt.isBuffer:i,Le=e.isFinite,We=Ot.join,gn=sn(Et.keys,Et),vn=kt.max,yn=kt.min,mn=it.now,_n=e.parseInt,bn=kt.random,Cn=Ot.reverse,wn=uo(e,"DataView"),kn=uo(e,"Map"),En=uo(e,"Promise"),Sn=uo(e,"Set"),xn=uo(e,"WeakMap"),An=uo(Et,"create"),On=xn&&new xn,Tn={},Fn=No(wn),jn=No(kn),Pn=No(En),$n=No(Sn),Rn=No(xn),Mn=qt?qt.prototype:i,Ln=Mn?Mn.valueOf:i,Nn=Mn?Mn.toString:i;function Dn(t){if(ta(t)&&!Hs(t)&&!(t instanceof Un)){if(t instanceof qn)return t;if($t.call(t,"__wrapped__"))return Do(t)}return new qn(t)}var In=function(){function t(){}return function(e){if(!Qs(e))return{};if(zt)return zt(e);t.prototype=e;var n=new t;return t.prototype=i,n}}();function Bn(){}function qn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=i}function Un(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Hn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Wn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function zn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Vn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new zn;++e<n;)this.add(t[e])}function Yn(t){var e=this.__data__=new Wn(t);this.size=e.size}function Kn(t,e){var n=Hs(t),r=!n&&Us(t),i=!n&&!r&&Ys(t),o=!n&&!r&&!i&&ua(t),s=n||r||i||o,a=s?Ye(t.length,xt):[],u=a.length;for(var c in t)!e&&!$t.call(t,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||vo(c,u))||a.push(c);return a}function Gn(t){var e=t.length;return e?t[zr(0,e-1)]:i}function Jn(t,e){return Po(xi(t),or(e,0,t.length))}function Xn(t){return Po(xi(t))}function Zn(t,e,n){(n!==i&&!Is(t[e],n)||n===i&&!(e in t))&&rr(t,e,n)}function Qn(t,e,n){var r=t[e];$t.call(t,e)&&Is(r,n)&&(n!==i||e in t)||rr(t,e,n)}function tr(t,e){for(var n=t.length;n--;)if(Is(t[n][0],e))return n;return-1}function er(t,e,n,r){return lr(t,(function(t,i,o){e(r,t,n(t),o)})),r}function nr(t,e){return t&&Ai(e,Fa(e),t)}function rr(t,e,n){"__proto__"==e&&te?te(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ir(t,e){for(var n=-1,o=e.length,s=r(o),a=null==t;++n<o;)s[n]=a?i:Sa(t,e[n]);return s}function or(t,e,n){return t==t&&(n!==i&&(t=t<=n?t:n),e!==i&&(t=t>=e?t:e)),t}function sr(t,e,n,r,o,s){var a,u=1&e,c=2&e,l=4&e;if(n&&(a=o?n(t,r,o,s):n(t)),a!==i)return a;if(!Qs(t))return t;var f=Hs(t);if(f){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&$t.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!u)return xi(t,a)}else{var h=fo(t),d=h==b||h==C;if(Ys(t))return bi(t,u);if(h==E||h==g||d&&!o){if(a=c||d?{}:po(t),!u)return c?function(t,e){return Ai(t,lo(t),e)}(t,function(t,e){return t&&Ai(e,ja(e),t)}(a,t)):function(t,e){return Ai(t,co(t),e)}(t,nr(a,t))}else{if(!oe[h])return o?t:{};a=function(t,e,n){var r,i=t.constructor;switch(e){case j:return Ci(t);case y:case m:return new i(+t);case P:return function(t,e){var n=e?Ci(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case $:case R:case M:case L:case N:case D:case I:case B:case q:return wi(t,n);case w:return new i;case k:case O:return new i(t);case x:return function(t){var e=new t.constructor(t.source,ht.exec(t));return e.lastIndex=t.lastIndex,e}(t);case A:return new i;case T:return r=t,Ln?Et(Ln.call(r)):{}}}(t,h,u)}}s||(s=new Yn);var p=s.get(t);if(p)return p;s.set(t,a),oa(t)?t.forEach((function(r){a.add(sr(r,e,n,r,t,s))})):ea(t)&&t.forEach((function(r,i){a.set(i,sr(r,e,n,i,t,s))}));var v=f?i:(l?c?eo:to:c?ja:Fa)(t);return Se(v||t,(function(r,i){v&&(r=t[i=r]),Qn(a,i,sr(r,e,n,i,t,s))})),a}function ar(t,e,n){var r=n.length;if(null==t)return!r;for(t=Et(t);r--;){var o=n[r],s=e[o],a=t[o];if(a===i&&!(o in t)||!s(a))return!1}return!0}function ur(t,e,n){if("function"!=typeof t)throw new At(o);return Oo((function(){t.apply(i,n)}),e)}function cr(t,e,n,r){var i=-1,o=Te,s=!0,a=t.length,u=[],c=e.length;if(!a)return u;n&&(e=je(e,Ge(n))),r?(o=Fe,s=!1):e.length>=200&&(o=Xe,s=!1,e=new Vn(e));t:for(;++i<a;){var l=t[i],f=null==n?l:n(l);if(l=r||0!==l?l:0,s&&f==f){for(var h=c;h--;)if(e[h]===f)continue t;u.push(l)}else o(e,f,r)||u.push(l)}return u}Dn.templateSettings={escape:G,evaluate:J,interpolate:X,variable:"",imports:{_:Dn}},Dn.prototype=Bn.prototype,Dn.prototype.constructor=Dn,qn.prototype=In(Bn.prototype),qn.prototype.constructor=qn,Un.prototype=In(Bn.prototype),Un.prototype.constructor=Un,Hn.prototype.clear=function(){this.__data__=An?An(null):{},this.size=0},Hn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Hn.prototype.get=function(t){var e=this.__data__;if(An){var n=e[t];return n===s?i:n}return $t.call(e,t)?e[t]:i},Hn.prototype.has=function(t){var e=this.__data__;return An?e[t]!==i:$t.call(e,t)},Hn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=An&&e===i?s:e,this},Wn.prototype.clear=function(){this.__data__=[],this.size=0},Wn.prototype.delete=function(t){var e=this.__data__,n=tr(e,t);return!(n<0||(n==e.length-1?e.pop():Yt.call(e,n,1),--this.size,0))},Wn.prototype.get=function(t){var e=this.__data__,n=tr(e,t);return n<0?i:e[n][1]},Wn.prototype.has=function(t){return tr(this.__data__,t)>-1},Wn.prototype.set=function(t,e){var n=this.__data__,r=tr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},zn.prototype.clear=function(){this.size=0,this.__data__={hash:new Hn,map:new(kn||Wn),string:new Hn}},zn.prototype.delete=function(t){var e=so(this,t).delete(t);return this.size-=e?1:0,e},zn.prototype.get=function(t){return so(this,t).get(t)},zn.prototype.has=function(t){return so(this,t).has(t)},zn.prototype.set=function(t,e){var n=so(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Vn.prototype.add=Vn.prototype.push=function(t){return this.__data__.set(t,s),this},Vn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.clear=function(){this.__data__=new Wn,this.size=0},Yn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Yn.prototype.get=function(t){return this.__data__.get(t)},Yn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Wn){var r=n.__data__;if(!kn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new zn(r)}return n.set(t,e),this.size=n.size,this};var lr=Fi(mr),fr=Fi(_r,!0);function hr(t,e){var n=!0;return lr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function dr(t,e,n){for(var r=-1,o=t.length;++r<o;){var s=t[r],a=e(s);if(null!=a&&(u===i?a==a&&!aa(a):n(a,u)))var u=a,c=s}return c}function pr(t,e){var n=[];return lr(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function gr(t,e,n,r,i){var o=-1,s=t.length;for(n||(n=go),i||(i=[]);++o<s;){var a=t[o];e>0&&n(a)?e>1?gr(a,e-1,n,r,i):Pe(i,a):r||(i[i.length]=a)}return i}var vr=ji(),yr=ji(!0);function mr(t,e){return t&&vr(t,e,Fa)}function _r(t,e){return t&&yr(t,e,Fa)}function br(t,e){return Oe(e,(function(e){return Js(t[e])}))}function Cr(t,e){for(var n=0,r=(e=vi(e,t)).length;null!=t&&n<r;)t=t[Lo(e[n++])];return n&&n==r?t:i}function wr(t,e,n){var r=e(t);return Hs(t)?r:Pe(r,n(t))}function kr(t){return null==t?t===i?"[object Undefined]":"[object Null]":Zt&&Zt in Et(t)?function(t){var e=$t.call(t,Zt),n=t[Zt];try{t[Zt]=i;var r=!0}catch(t){}var o=Lt.call(t);return r&&(e?t[Zt]=n:delete t[Zt]),o}(t):function(t){return Lt.call(t)}(t)}function Er(t,e){return t>e}function Sr(t,e){return null!=t&&$t.call(t,e)}function xr(t,e){return null!=t&&e in Et(t)}function Ar(t,e,n){for(var o=n?Fe:Te,s=t[0].length,a=t.length,u=a,c=r(a),l=1/0,f=[];u--;){var h=t[u];u&&e&&(h=je(h,Ge(e))),l=yn(h.length,l),c[u]=!n&&(e||s>=120&&h.length>=120)?new Vn(u&&h):i}h=t[0];var d=-1,p=c[0];t:for(;++d<s&&f.length<l;){var g=h[d],v=e?e(g):g;if(g=n||0!==g?g:0,!(p?Xe(p,v):o(f,v,n))){for(u=a;--u;){var y=c[u];if(!(y?Xe(y,v):o(t[u],v,n)))continue t}p&&p.push(v),f.push(g)}}return f}function Or(t,e,n){var r=null==(t=So(t,e=vi(e,t)))?t:t[Lo(Go(e))];return null==r?i:ke(r,t,n)}function Tr(t){return ta(t)&&kr(t)==g}function Fr(t,e,n,r,o){return t===e||(null==t||null==e||!ta(t)&&!ta(e)?t!=t&&e!=e:function(t,e,n,r,o,s){var a=Hs(t),u=Hs(e),c=a?v:fo(t),l=u?v:fo(e),f=(c=c==g?E:c)==E,h=(l=l==g?E:l)==E,d=c==l;if(d&&Ys(t)){if(!Ys(e))return!1;a=!0,f=!1}if(d&&!f)return s||(s=new Yn),a||ua(t)?Zi(t,e,n,r,o,s):function(t,e,n,r,i,o,s){switch(n){case P:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case j:return!(t.byteLength!=e.byteLength||!o(new Ut(t),new Ut(e)));case y:case m:case k:return Is(+t,+e);case _:return t.name==e.name&&t.message==e.message;case x:case O:return t==e+"";case w:var a=on;case A:var u=1&r;if(a||(a=un),t.size!=e.size&&!u)return!1;var c=s.get(t);if(c)return c==e;r|=2,s.set(t,e);var l=Zi(a(t),a(e),r,i,o,s);return s.delete(t),l;case T:if(Ln)return Ln.call(t)==Ln.call(e)}return!1}(t,e,c,n,r,o,s);if(!(1&n)){var p=f&&$t.call(t,"__wrapped__"),b=h&&$t.call(e,"__wrapped__");if(p||b){var C=p?t.value():t,S=b?e.value():e;return s||(s=new Yn),o(C,S,n,r,s)}}return!!d&&(s||(s=new Yn),function(t,e,n,r,o,s){var a=1&n,u=to(t),c=u.length;if(c!=to(e).length&&!a)return!1;for(var l=c;l--;){var f=u[l];if(!(a?f in e:$t.call(e,f)))return!1}var h=s.get(t),d=s.get(e);if(h&&d)return h==e&&d==t;var p=!0;s.set(t,e),s.set(e,t);for(var g=a;++l<c;){var v=t[f=u[l]],y=e[f];if(r)var m=a?r(y,v,f,e,t,s):r(v,y,f,t,e,s);if(!(m===i?v===y||o(v,y,n,r,s):m)){p=!1;break}g||(g="constructor"==f)}if(p&&!g){var _=t.constructor,b=e.constructor;_==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof b&&b instanceof b||(p=!1)}return s.delete(t),s.delete(e),p}(t,e,n,r,o,s))}(t,e,n,r,Fr,o))}function jr(t,e,n,r){var o=n.length,s=o,a=!r;if(null==t)return!s;for(t=Et(t);o--;){var u=n[o];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<s;){var c=(u=n[o])[0],l=t[c],f=u[1];if(a&&u[2]){if(l===i&&!(c in t))return!1}else{var h=new Yn;if(r)var d=r(l,f,c,t,e,h);if(!(d===i?Fr(f,l,3,r,h):d))return!1}}return!0}function Pr(t){return!(!Qs(t)||(e=t,Mt&&Mt in e))&&(Js(t)?It:gt).test(No(t));var e}function $r(t){return"function"==typeof t?t:null==t?nu:"object"==typeof t?Hs(t)?Dr(t[0],t[1]):Nr(t):fu(t)}function Rr(t){if(!Co(t))return gn(t);var e=[];for(var n in Et(t))$t.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Mr(t,e){return t<e}function Lr(t,e){var n=-1,i=zs(t)?r(t.length):[];return lr(t,(function(t,r,o){i[++n]=e(t,r,o)})),i}function Nr(t){var e=ao(t);return 1==e.length&&e[0][2]?ko(e[0][0],e[0][1]):function(n){return n===t||jr(n,t,e)}}function Dr(t,e){return mo(t)&&wo(e)?ko(Lo(t),e):function(n){var r=Sa(n,t);return r===i&&r===e?xa(n,t):Fr(e,r,3)}}function Ir(t,e,n,r,o){t!==e&&vr(e,(function(s,a){if(o||(o=new Yn),Qs(s))!function(t,e,n,r,o,s,a){var u=xo(t,n),c=xo(e,n),l=a.get(c);if(l)Zn(t,n,l);else{var f=s?s(u,c,n+"",t,e,a):i,h=f===i;if(h){var d=Hs(c),p=!d&&Ys(c),g=!d&&!p&&ua(c);f=c,d||p||g?Hs(u)?f=u:Vs(u)?f=xi(u):p?(h=!1,f=bi(c,!0)):g?(h=!1,f=wi(c,!0)):f=[]:ra(c)||Us(c)?(f=u,Us(u)?f=va(u):Qs(u)&&!Js(u)||(f=po(c))):h=!1}h&&(a.set(c,f),o(f,c,r,s,a),a.delete(c)),Zn(t,n,f)}}(t,e,a,n,Ir,r,o);else{var u=r?r(xo(t,a),s,a+"",t,e,o):i;u===i&&(u=s),Zn(t,a,u)}}),ja)}function Br(t,e){var n=t.length;if(n)return vo(e+=e<0?n:0,n)?t[e]:i}function qr(t,e,n){e=e.length?je(e,(function(t){return Hs(t)?function(e){return Cr(e,1===t.length?t[0]:t)}:t})):[nu];var r=-1;e=je(e,Ge(oo()));var i=Lr(t,(function(t,n,i){var o=je(e,(function(e){return e(t)}));return{criteria:o,index:++r,value:t}}));return function(t,e){var r=t.length;for(t.sort((function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,s=i.length,a=n.length;++r<s;){var u=ki(i[r],o[r]);if(u)return r>=a?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}));r--;)t[r]=t[r].value;return t}(i)}function Ur(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var s=e[r],a=Cr(t,s);n(a,s)&&Jr(o,vi(s,t),a)}return o}function Hr(t,e,n,r){var i=r?Be:Ie,o=-1,s=e.length,a=t;for(t===e&&(e=xi(e)),n&&(a=je(t,Ge(n)));++o<s;)for(var u=0,c=e[o],l=n?n(c):c;(u=i(a,l,u,r))>-1;)a!==t&&Yt.call(a,u,1),Yt.call(t,u,1);return t}function Wr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;vo(i)?Yt.call(t,i,1):ui(t,i)}}return t}function zr(t,e){return t+de(bn()*(e-t+1))}function Vr(t,e){var n="";if(!t||e<1||e>f)return n;do{e%2&&(n+=t),(e=de(e/2))&&(t+=t)}while(e);return n}function Yr(t,e){return To(Eo(t,e,nu),t+"")}function Kr(t){return Gn(Ia(t))}function Gr(t,e){var n=Ia(t);return Po(n,or(e,0,n.length))}function Jr(t,e,n,r){if(!Qs(t))return t;for(var o=-1,s=(e=vi(e,t)).length,a=s-1,u=t;null!=u&&++o<s;){var c=Lo(e[o]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return t;if(o!=a){var f=u[c];(l=r?r(f,c,u):i)===i&&(l=Qs(f)?f:vo(e[o+1])?[]:{})}Qn(u,c,l),u=u[c]}return t}var Xr=On?function(t,e){return On.set(t,e),t}:nu,Zr=te?function(t,e){return te(t,"toString",{configurable:!0,enumerable:!1,value:Qa(e),writable:!0})}:nu;function Qr(t){return Po(Ia(t))}function ti(t,e,n){var i=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var s=r(o);++i<o;)s[i]=t[i+e];return s}function ei(t,e){var n;return lr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function ni(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var o=r+i>>>1,s=t[o];null!==s&&!aa(s)&&(n?s<=e:s<e)?r=o+1:i=o}return i}return ri(t,e,nu,n)}function ri(t,e,n,r){var o=0,s=null==t?0:t.length;if(0===s)return 0;for(var a=(e=n(e))!=e,u=null===e,c=aa(e),l=e===i;o<s;){var f=de((o+s)/2),h=n(t[f]),d=h!==i,p=null===h,g=h==h,v=aa(h);if(a)var y=r||g;else y=l?g&&(r||d):u?g&&d&&(r||!p):c?g&&d&&!p&&(r||!v):!p&&!v&&(r?h<=e:h<e);y?o=f+1:s=f}return yn(s,4294967294)}function ii(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var s=t[n],a=e?e(s):s;if(!n||!Is(a,u)){var u=a;o[i++]=0===s?0:s}}return o}function oi(t){return"number"==typeof t?t:aa(t)?h:+t}function si(t){if("string"==typeof t)return t;if(Hs(t))return je(t,si)+"";if(aa(t))return Nn?Nn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ai(t,e,n){var r=-1,i=Te,o=t.length,s=!0,a=[],u=a;if(n)s=!1,i=Fe;else if(o>=200){var c=e?null:Vi(t);if(c)return un(c);s=!1,i=Xe,u=new Vn}else u=e?[]:a;t:for(;++r<o;){var l=t[r],f=e?e(l):l;if(l=n||0!==l?l:0,s&&f==f){for(var h=u.length;h--;)if(u[h]===f)continue t;e&&u.push(f),a.push(l)}else i(u,f,n)||(u!==a&&u.push(f),a.push(l))}return a}function ui(t,e){return null==(t=So(t,e=vi(e,t)))||delete t[Lo(Go(e))]}function ci(t,e,n,r){return Jr(t,e,n(Cr(t,e)),r)}function li(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?ti(t,r?0:o,r?o+1:i):ti(t,r?o+1:0,r?i:o)}function fi(t,e){var n=t;return n instanceof Un&&(n=n.value()),$e(e,(function(t,e){return e.func.apply(e.thisArg,Pe([t],e.args))}),n)}function hi(t,e,n){var i=t.length;if(i<2)return i?ai(t[0]):[];for(var o=-1,s=r(i);++o<i;)for(var a=t[o],u=-1;++u<i;)u!=o&&(s[o]=cr(s[o]||a,t[u],e,n));return ai(gr(s,1),e,n)}function di(t,e,n){for(var r=-1,o=t.length,s=e.length,a={};++r<o;){var u=r<s?e[r]:i;n(a,t[r],u)}return a}function pi(t){return Vs(t)?t:[]}function gi(t){return"function"==typeof t?t:nu}function vi(t,e){return Hs(t)?t:mo(t,e)?[t]:Mo(ya(t))}var yi=Yr;function mi(t,e,n){var r=t.length;return n=n===i?r:n,!e&&n>=r?t:ti(t,e,n)}var _i=se||function(t){return fe.clearTimeout(t)};function bi(t,e){if(e)return t.slice();var n=t.length,r=Ht?Ht(n):new t.constructor(n);return t.copy(r),r}function Ci(t){var e=new t.constructor(t.byteLength);return new Ut(e).set(new Ut(t)),e}function wi(t,e){var n=e?Ci(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function ki(t,e){if(t!==e){var n=t!==i,r=null===t,o=t==t,s=aa(t),a=e!==i,u=null===e,c=e==e,l=aa(e);if(!u&&!l&&!s&&t>e||s&&a&&c&&!u&&!l||r&&a&&c||!n&&c||!o)return 1;if(!r&&!s&&!l&&t<e||l&&n&&o&&!r&&!s||u&&n&&o||!a&&o||!c)return-1}return 0}function Ei(t,e,n,i){for(var o=-1,s=t.length,a=n.length,u=-1,c=e.length,l=vn(s-a,0),f=r(c+l),h=!i;++u<c;)f[u]=e[u];for(;++o<a;)(h||o<s)&&(f[n[o]]=t[o]);for(;l--;)f[u++]=t[o++];return f}function Si(t,e,n,i){for(var o=-1,s=t.length,a=-1,u=n.length,c=-1,l=e.length,f=vn(s-u,0),h=r(f+l),d=!i;++o<f;)h[o]=t[o];for(var p=o;++c<l;)h[p+c]=e[c];for(;++a<u;)(d||o<s)&&(h[p+n[a]]=t[o++]);return h}function xi(t,e){var n=-1,i=t.length;for(e||(e=r(i));++n<i;)e[n]=t[n];return e}function Ai(t,e,n,r){var o=!n;n||(n={});for(var s=-1,a=e.length;++s<a;){var u=e[s],c=r?r(n[u],t[u],u,n,t):i;c===i&&(c=t[u]),o?rr(n,u,c):Qn(n,u,c)}return n}function Oi(t,e){return function(n,r){var i=Hs(n)?Ee:er,o=e?e():{};return i(n,t,oo(r,2),o)}}function Ti(t){return Yr((function(e,n){var r=-1,o=n.length,s=o>1?n[o-1]:i,a=o>2?n[2]:i;for(s=t.length>3&&"function"==typeof s?(o--,s):i,a&&yo(n[0],n[1],a)&&(s=o<3?i:s,o=1),e=Et(e);++r<o;){var u=n[r];u&&t(e,u,r,s)}return e}))}function Fi(t,e){return function(n,r){if(null==n)return n;if(!zs(n))return t(n,r);for(var i=n.length,o=e?i:-1,s=Et(n);(e?o--:++o<i)&&!1!==r(s[o],o,s););return n}}function ji(t){return function(e,n,r){for(var i=-1,o=Et(e),s=r(e),a=s.length;a--;){var u=s[t?a:++i];if(!1===n(o[u],u,o))break}return e}}function Pi(t){return function(e){var n=rn(e=ya(e))?fn(e):i,r=n?n[0]:e.charAt(0),o=n?mi(n,1).join(""):e.slice(1);return r[t]()+o}}function $i(t){return function(e){return $e(Ja(Ua(e).replace(Jt,"")),t,"")}}function Ri(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=In(t.prototype),r=t.apply(n,e);return Qs(r)?r:n}}function Mi(t){return function(e,n,r){var o=Et(e);if(!zs(e)){var s=oo(n,3);e=Fa(e),n=function(t){return s(o[t],t,o)}}var a=t(e,n,r);return a>-1?o[s?e[a]:a]:i}}function Li(t){return Qi((function(e){var n=e.length,r=n,s=qn.prototype.thru;for(t&&e.reverse();r--;){var a=e[r];if("function"!=typeof a)throw new At(o);if(s&&!u&&"wrapper"==ro(a))var u=new qn([],!0)}for(r=u?r:n;++r<n;){var c=ro(a=e[r]),l="wrapper"==c?no(a):i;u=l&&_o(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?u[ro(l[0])].apply(u,l[3]):1==a.length&&_o(a)?u[c]():u.thru(a)}return function(){var t=arguments,r=t[0];if(u&&1==t.length&&Hs(r))return u.plant(r).value();for(var i=0,o=n?e[i].apply(this,t):r;++i<n;)o=e[i].call(this,o);return o}}))}function Ni(t,e,n,o,s,a,u,l,f,h){var d=e&c,p=1&e,g=2&e,v=24&e,y=512&e,m=g?i:Ri(t);return function c(){for(var _=arguments.length,b=r(_),C=_;C--;)b[C]=arguments[C];if(v)var w=io(c),k=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(b,w);if(o&&(b=Ei(b,o,s,v)),a&&(b=Si(b,a,u,v)),_-=k,v&&_<h){var E=an(b,w);return Wi(t,e,Ni,c.placeholder,n,b,E,l,f,h-_)}var S=p?n:this,x=g?S[t]:t;return _=b.length,l?b=function(t,e){for(var n=t.length,r=yn(e.length,n),o=xi(t);r--;){var s=e[r];t[r]=vo(s,n)?o[s]:i}return t}(b,l):y&&_>1&&b.reverse(),d&&f<_&&(b.length=f),this&&this!==fe&&this instanceof c&&(x=m||Ri(x)),x.apply(S,b)}}function Di(t,e){return function(n,r){return function(t,e,n,r){return mr(t,(function(t,i,o){e(r,n(t),i,o)})),r}(n,t,e(r),{})}}function Ii(t,e){return function(n,r){var o;if(n===i&&r===i)return e;if(n!==i&&(o=n),r!==i){if(o===i)return r;"string"==typeof n||"string"==typeof r?(n=si(n),r=si(r)):(n=oi(n),r=oi(r)),o=t(n,r)}return o}}function Bi(t){return Qi((function(e){return e=je(e,Ge(oo())),Yr((function(n){var r=this;return t(e,(function(t){return ke(t,r,n)}))}))}))}function qi(t,e){var n=(e=e===i?" ":si(e)).length;if(n<2)return n?Vr(e,t):e;var r=Vr(e,he(t/ln(e)));return rn(e)?mi(fn(r),0,t).join(""):r.slice(0,t)}function Ui(t){return function(e,n,o){return o&&"number"!=typeof o&&yo(e,n,o)&&(n=o=i),e=ha(e),n===i?(n=e,e=0):n=ha(n),function(t,e,n,i){for(var o=-1,s=vn(he((e-t)/(n||1)),0),a=r(s);s--;)a[i?s:++o]=t,t+=n;return a}(e,n,o=o===i?e<n?1:-1:ha(o),t)}}function Hi(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=ga(e),n=ga(n)),t(e,n)}}function Wi(t,e,n,r,o,s,a,c,l,f){var h=8&e;e|=h?u:64,4&(e&=~(h?64:u))||(e&=-4);var d=[t,e,o,h?s:i,h?a:i,h?i:s,h?i:a,c,l,f],p=n.apply(i,d);return _o(t)&&Ao(p,d),p.placeholder=r,Fo(p,t,e)}function zi(t){var e=kt[t];return function(t,n){if(t=ga(t),(n=null==n?0:yn(da(n),292))&&Le(t)){var r=(ya(t)+"e").split("e");return+((r=(ya(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Vi=Sn&&1/un(new Sn([,-0]))[1]==l?function(t){return new Sn(t)}:au;function Yi(t){return function(e){var n=fo(e);return n==w?on(e):n==A?cn(e):function(t,e){return je(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Ki(t,e,n,s,l,f,h,d){var p=2&e;if(!p&&"function"!=typeof t)throw new At(o);var g=s?s.length:0;if(g||(e&=-97,s=l=i),h=h===i?h:vn(da(h),0),d=d===i?d:da(d),g-=l?l.length:0,64&e){var v=s,y=l;s=l=i}var m=p?i:no(t),_=[t,e,n,s,l,v,y,f,h,d];if(m&&function(t,e){var n=t[1],r=e[1],i=n|r,o=i<131,s=r==c&&8==n||r==c&&256==n&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!o&&!s)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var u=e[3];if(u){var l=t[3];t[3]=l?Ei(l,u,e[4]):u,t[4]=l?an(t[3],a):e[4]}(u=e[5])&&(l=t[5],t[5]=l?Si(l,u,e[6]):u,t[6]=l?an(t[5],a):e[6]),(u=e[7])&&(t[7]=u),r&c&&(t[8]=null==t[8]?e[8]:yn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i}(_,m),t=_[0],e=_[1],n=_[2],s=_[3],l=_[4],!(d=_[9]=_[9]===i?p?0:t.length:vn(_[9]-g,0))&&24&e&&(e&=-25),e&&1!=e)b=8==e||16==e?function(t,e,n){var o=Ri(t);return function s(){for(var a=arguments.length,u=r(a),c=a,l=io(s);c--;)u[c]=arguments[c];var f=a<3&&u[0]!==l&&u[a-1]!==l?[]:an(u,l);return(a-=f.length)<n?Wi(t,e,Ni,s.placeholder,i,u,f,i,i,n-a):ke(this&&this!==fe&&this instanceof s?o:t,this,u)}}(t,e,d):e!=u&&33!=e||l.length?Ni.apply(i,_):function(t,e,n,i){var o=1&e,s=Ri(t);return function e(){for(var a=-1,u=arguments.length,c=-1,l=i.length,f=r(l+u),h=this&&this!==fe&&this instanceof e?s:t;++c<l;)f[c]=i[c];for(;u--;)f[c++]=arguments[++a];return ke(h,o?n:this,f)}}(t,e,n,s);else var b=function(t,e,n){var r=1&e,i=Ri(t);return function e(){return(this&&this!==fe&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,n);return Fo((m?Xr:Ao)(b,_),t,e)}function Gi(t,e,n,r){return t===i||Is(t,Ft[n])&&!$t.call(r,n)?e:t}function Ji(t,e,n,r,o,s){return Qs(t)&&Qs(e)&&(s.set(e,t),Ir(t,e,i,Ji,s),s.delete(e)),t}function Xi(t){return ra(t)?i:t}function Zi(t,e,n,r,o,s){var a=1&n,u=t.length,c=e.length;if(u!=c&&!(a&&c>u))return!1;var l=s.get(t),f=s.get(e);if(l&&f)return l==e&&f==t;var h=-1,d=!0,p=2&n?new Vn:i;for(s.set(t,e),s.set(e,t);++h<u;){var g=t[h],v=e[h];if(r)var y=a?r(v,g,h,e,t,s):r(g,v,h,t,e,s);if(y!==i){if(y)continue;d=!1;break}if(p){if(!Me(e,(function(t,e){if(!Xe(p,e)&&(g===t||o(g,t,n,r,s)))return p.push(e)}))){d=!1;break}}else if(g!==v&&!o(g,v,n,r,s)){d=!1;break}}return s.delete(t),s.delete(e),d}function Qi(t){return To(Eo(t,i,Wo),t+"")}function to(t){return wr(t,Fa,co)}function eo(t){return wr(t,ja,lo)}var no=On?function(t){return On.get(t)}:au;function ro(t){for(var e=t.name+"",n=Tn[e],r=$t.call(Tn,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function io(t){return($t.call(Dn,"placeholder")?Dn:t).placeholder}function oo(){var t=Dn.iteratee||ru;return t=t===ru?$r:t,arguments.length?t(arguments[0],arguments[1]):t}function so(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function ao(t){for(var e=Fa(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,wo(i)]}return e}function uo(t,e){var n=function(t,e){return null==t?i:t[e]}(t,e);return Pr(n)?n:i}var co=ge?function(t){return null==t?[]:(t=Et(t),Oe(ge(t),(function(e){return Vt.call(t,e)})))}:pu,lo=ge?function(t){for(var e=[];t;)Pe(e,co(t)),t=Wt(t);return e}:pu,fo=kr;function ho(t,e,n){for(var r=-1,i=(e=vi(e,t)).length,o=!1;++r<i;){var s=Lo(e[r]);if(!(o=null!=t&&n(t,s)))break;t=t[s]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&Zs(i)&&vo(s,i)&&(Hs(t)||Us(t))}function po(t){return"function"!=typeof t.constructor||Co(t)?{}:In(Wt(t))}function go(t){return Hs(t)||Us(t)||!!(Kt&&t&&t[Kt])}function vo(t,e){var n=typeof t;return!!(e=null==e?f:e)&&("number"==n||"symbol"!=n&&yt.test(t))&&t>-1&&t%1==0&&t<e}function yo(t,e,n){if(!Qs(n))return!1;var r=typeof e;return!!("number"==r?zs(n)&&vo(e,n.length):"string"==r&&e in n)&&Is(n[e],t)}function mo(t,e){if(Hs(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!aa(t))||Q.test(t)||!Z.test(t)||null!=e&&t in Et(e)}function _o(t){var e=ro(t),n=Dn[e];if("function"!=typeof n||!(e in Un.prototype))return!1;if(t===n)return!0;var r=no(n);return!!r&&t===r[0]}(wn&&fo(new wn(new ArrayBuffer(1)))!=P||kn&&fo(new kn)!=w||En&&fo(En.resolve())!=S||Sn&&fo(new Sn)!=A||xn&&fo(new xn)!=F)&&(fo=function(t){var e=kr(t),n=e==E?t.constructor:i,r=n?No(n):"";if(r)switch(r){case Fn:return P;case jn:return w;case Pn:return S;case $n:return A;case Rn:return F}return e});var bo=jt?Js:gu;function Co(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ft)}function wo(t){return t==t&&!Qs(t)}function ko(t,e){return function(n){return null!=n&&n[t]===e&&(e!==i||t in Et(n))}}function Eo(t,e,n){return e=vn(e===i?t.length-1:e,0),function(){for(var i=arguments,o=-1,s=vn(i.length-e,0),a=r(s);++o<s;)a[o]=i[e+o];o=-1;for(var u=r(e+1);++o<e;)u[o]=i[o];return u[e]=n(a),ke(t,this,u)}}function So(t,e){return e.length<2?t:Cr(t,ti(e,0,-1))}function xo(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Ao=jo(Xr),Oo=le||function(t,e){return fe.setTimeout(t,e)},To=jo(Zr);function Fo(t,e,n){var r=e+"";return To(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(ot,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Se(p,(function(n){var r="_."+n[0];e&n[1]&&!Te(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(st);return e?e[1].split(at):[]}(r),n)))}function jo(t){var e=0,n=0;return function(){var r=mn(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(i,arguments)}}function Po(t,e){var n=-1,r=t.length,o=r-1;for(e=e===i?r:e;++n<e;){var s=zr(n,o),a=t[s];t[s]=t[n],t[n]=a}return t.length=e,t}var $o,Ro,Mo=($o=$s((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(tt,(function(t,n,r,i){e.push(r?i.replace(lt,"$1"):n||t)})),e}),(function(t){return 500===Ro.size&&Ro.clear(),t})),Ro=$o.cache,$o);function Lo(t){if("string"==typeof t||aa(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function No(t){if(null!=t){try{return Pt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Do(t){if(t instanceof Un)return t.clone();var e=new qn(t.__wrapped__,t.__chain__);return e.__actions__=xi(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Io=Yr((function(t,e){return Vs(t)?cr(t,gr(e,1,Vs,!0)):[]})),Bo=Yr((function(t,e){var n=Go(e);return Vs(n)&&(n=i),Vs(t)?cr(t,gr(e,1,Vs,!0),oo(n,2)):[]})),qo=Yr((function(t,e){var n=Go(e);return Vs(n)&&(n=i),Vs(t)?cr(t,gr(e,1,Vs,!0),i,n):[]}));function Uo(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:da(n);return i<0&&(i=vn(r+i,0)),De(t,oo(e,3),i)}function Ho(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r-1;return n!==i&&(o=da(n),o=n<0?vn(r+o,0):yn(o,r-1)),De(t,oo(e,3),o,!0)}function Wo(t){return null!=t&&t.length?gr(t,1):[]}function zo(t){return t&&t.length?t[0]:i}var Vo=Yr((function(t){var e=je(t,pi);return e.length&&e[0]===t[0]?Ar(e):[]})),Yo=Yr((function(t){var e=Go(t),n=je(t,pi);return e===Go(n)?e=i:n.pop(),n.length&&n[0]===t[0]?Ar(n,oo(e,2)):[]})),Ko=Yr((function(t){var e=Go(t),n=je(t,pi);return(e="function"==typeof e?e:i)&&n.pop(),n.length&&n[0]===t[0]?Ar(n,i,e):[]}));function Go(t){var e=null==t?0:t.length;return e?t[e-1]:i}var Jo=Yr(Xo);function Xo(t,e){return t&&t.length&&e&&e.length?Hr(t,e):t}var Zo=Qi((function(t,e){var n=null==t?0:t.length,r=ir(t,e);return Wr(t,je(e,(function(t){return vo(t,n)?+t:t})).sort(ki)),r}));function Qo(t){return null==t?t:Cn.call(t)}var ts=Yr((function(t){return ai(gr(t,1,Vs,!0))})),es=Yr((function(t){var e=Go(t);return Vs(e)&&(e=i),ai(gr(t,1,Vs,!0),oo(e,2))})),ns=Yr((function(t){var e=Go(t);return e="function"==typeof e?e:i,ai(gr(t,1,Vs,!0),i,e)}));function rs(t){if(!t||!t.length)return[];var e=0;return t=Oe(t,(function(t){if(Vs(t))return e=vn(t.length,e),!0})),Ye(e,(function(e){return je(t,He(e))}))}function is(t,e){if(!t||!t.length)return[];var n=rs(t);return null==e?n:je(n,(function(t){return ke(e,i,t)}))}var os=Yr((function(t,e){return Vs(t)?cr(t,e):[]})),ss=Yr((function(t){return hi(Oe(t,Vs))})),as=Yr((function(t){var e=Go(t);return Vs(e)&&(e=i),hi(Oe(t,Vs),oo(e,2))})),us=Yr((function(t){var e=Go(t);return e="function"==typeof e?e:i,hi(Oe(t,Vs),i,e)})),cs=Yr(rs),ls=Yr((function(t){var e=t.length,n=e>1?t[e-1]:i;return n="function"==typeof n?(t.pop(),n):i,is(t,n)}));function fs(t){var e=Dn(t);return e.__chain__=!0,e}function hs(t,e){return e(t)}var ds=Qi((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,o=function(e){return ir(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Un&&vo(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:hs,args:[o],thisArg:i}),new qn(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(i),t}))):this.thru(o)})),ps=Oi((function(t,e,n){$t.call(t,n)?++t[n]:rr(t,n,1)})),gs=Mi(Uo),vs=Mi(Ho);function ys(t,e){return(Hs(t)?Se:lr)(t,oo(e,3))}function ms(t,e){return(Hs(t)?xe:fr)(t,oo(e,3))}var _s=Oi((function(t,e,n){$t.call(t,n)?t[n].push(e):rr(t,n,[e])})),bs=Yr((function(t,e,n){var i=-1,o="function"==typeof e,s=zs(t)?r(t.length):[];return lr(t,(function(t){s[++i]=o?ke(e,t,n):Or(t,e,n)})),s})),Cs=Oi((function(t,e,n){rr(t,n,e)}));function ws(t,e){return(Hs(t)?je:Lr)(t,oo(e,3))}var ks=Oi((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Es=Yr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&yo(t,e[0],e[1])?e=[]:n>2&&yo(e[0],e[1],e[2])&&(e=[e[0]]),qr(t,gr(e,1),[])})),Ss=ce||function(){return fe.Date.now()};function xs(t,e,n){return e=n?i:e,e=t&&null==e?t.length:e,Ki(t,c,i,i,i,i,e)}function As(t,e){var n;if("function"!=typeof e)throw new At(o);return t=da(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=i),n}}var Os=Yr((function(t,e,n){var r=1;if(n.length){var i=an(n,io(Os));r|=u}return Ki(t,r,e,n,i)})),Ts=Yr((function(t,e,n){var r=3;if(n.length){var i=an(n,io(Ts));r|=u}return Ki(e,r,t,n,i)}));function Fs(t,e,n){var r,s,a,u,c,l,f=0,h=!1,d=!1,p=!0;if("function"!=typeof t)throw new At(o);function g(e){var n=r,o=s;return r=s=i,f=e,u=t.apply(o,n)}function v(t){var n=t-l;return l===i||n>=e||n<0||d&&t-f>=a}function y(){var t=Ss();if(v(t))return m(t);c=Oo(y,function(t){var n=e-(t-l);return d?yn(n,a-(t-f)):n}(t))}function m(t){return c=i,p&&r?g(t):(r=s=i,u)}function _(){var t=Ss(),n=v(t);if(r=arguments,s=this,l=t,n){if(c===i)return function(t){return f=t,c=Oo(y,e),h?g(t):u}(l);if(d)return _i(c),c=Oo(y,e),g(l)}return c===i&&(c=Oo(y,e)),u}return e=ga(e)||0,Qs(n)&&(h=!!n.leading,a=(d="maxWait"in n)?vn(ga(n.maxWait)||0,e):a,p="trailing"in n?!!n.trailing:p),_.cancel=function(){c!==i&&_i(c),f=0,r=l=s=c=i},_.flush=function(){return c===i?u:m(Ss())},_}var js=Yr((function(t,e){return ur(t,1,e)})),Ps=Yr((function(t,e,n){return ur(t,ga(e)||0,n)}));function $s(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new At(o);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new($s.Cache||zn),n}function Rs(t){if("function"!=typeof t)throw new At(o);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}$s.Cache=zn;var Ms=yi((function(t,e){var n=(e=1==e.length&&Hs(e[0])?je(e[0],Ge(oo())):je(gr(e,1),Ge(oo()))).length;return Yr((function(r){for(var i=-1,o=yn(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return ke(t,this,r)}))})),Ls=Yr((function(t,e){var n=an(e,io(Ls));return Ki(t,u,i,e,n)})),Ns=Yr((function(t,e){var n=an(e,io(Ns));return Ki(t,64,i,e,n)})),Ds=Qi((function(t,e){return Ki(t,256,i,i,i,e)}));function Is(t,e){return t===e||t!=t&&e!=e}var Bs=Hi(Er),qs=Hi((function(t,e){return t>=e})),Us=Tr(function(){return arguments}())?Tr:function(t){return ta(t)&&$t.call(t,"callee")&&!Vt.call(t,"callee")},Hs=r.isArray,Ws=ye?Ge(ye):function(t){return ta(t)&&kr(t)==j};function zs(t){return null!=t&&Zs(t.length)&&!Js(t)}function Vs(t){return ta(t)&&zs(t)}var Ys=ve||gu,Ks=me?Ge(me):function(t){return ta(t)&&kr(t)==m};function Gs(t){if(!ta(t))return!1;var e=kr(t);return e==_||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ra(t)}function Js(t){if(!Qs(t))return!1;var e=kr(t);return e==b||e==C||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Xs(t){return"number"==typeof t&&t==da(t)}function Zs(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=f}function Qs(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ta(t){return null!=t&&"object"==typeof t}var ea=_e?Ge(_e):function(t){return ta(t)&&fo(t)==w};function na(t){return"number"==typeof t||ta(t)&&kr(t)==k}function ra(t){if(!ta(t)||kr(t)!=E)return!1;var e=Wt(t);if(null===e)return!0;var n=$t.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Pt.call(n)==Nt}var ia=be?Ge(be):function(t){return ta(t)&&kr(t)==x},oa=Ce?Ge(Ce):function(t){return ta(t)&&fo(t)==A};function sa(t){return"string"==typeof t||!Hs(t)&&ta(t)&&kr(t)==O}function aa(t){return"symbol"==typeof t||ta(t)&&kr(t)==T}var ua=we?Ge(we):function(t){return ta(t)&&Zs(t.length)&&!!ie[kr(t)]},ca=Hi(Mr),la=Hi((function(t,e){return t<=e}));function fa(t){if(!t)return[];if(zs(t))return sa(t)?fn(t):xi(t);if(Gt&&t[Gt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Gt]());var e=fo(t);return(e==w?on:e==A?un:Ia)(t)}function ha(t){return t?(t=ga(t))===l||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function da(t){var e=ha(t),n=e%1;return e==e?n?e-n:e:0}function pa(t){return t?or(da(t),0,d):0}function ga(t){if("number"==typeof t)return t;if(aa(t))return h;if(Qs(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Qs(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ke(t);var n=pt.test(t);return n||vt.test(t)?ue(t.slice(2),n?2:8):dt.test(t)?h:+t}function va(t){return Ai(t,ja(t))}function ya(t){return null==t?"":si(t)}var ma=Ti((function(t,e){if(Co(e)||zs(e))Ai(e,Fa(e),t);else for(var n in e)$t.call(e,n)&&Qn(t,n,e[n])})),_a=Ti((function(t,e){Ai(e,ja(e),t)})),ba=Ti((function(t,e,n,r){Ai(e,ja(e),t,r)})),Ca=Ti((function(t,e,n,r){Ai(e,Fa(e),t,r)})),wa=Qi(ir),ka=Yr((function(t,e){t=Et(t);var n=-1,r=e.length,o=r>2?e[2]:i;for(o&&yo(e[0],e[1],o)&&(r=1);++n<r;)for(var s=e[n],a=ja(s),u=-1,c=a.length;++u<c;){var l=a[u],f=t[l];(f===i||Is(f,Ft[l])&&!$t.call(t,l))&&(t[l]=s[l])}return t})),Ea=Yr((function(t){return t.push(i,Ji),ke($a,i,t)}));function Sa(t,e,n){var r=null==t?i:Cr(t,e);return r===i?n:r}function xa(t,e){return null!=t&&ho(t,e,xr)}var Aa=Di((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Lt.call(e)),t[e]=n}),Qa(nu)),Oa=Di((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Lt.call(e)),$t.call(t,e)?t[e].push(n):t[e]=[n]}),oo),Ta=Yr(Or);function Fa(t){return zs(t)?Kn(t):Rr(t)}function ja(t){return zs(t)?Kn(t,!0):function(t){if(!Qs(t))return function(t){var e=[];if(null!=t)for(var n in Et(t))e.push(n);return e}(t);var e=Co(t),n=[];for(var r in t)("constructor"!=r||!e&&$t.call(t,r))&&n.push(r);return n}(t)}var Pa=Ti((function(t,e,n){Ir(t,e,n)})),$a=Ti((function(t,e,n,r){Ir(t,e,n,r)})),Ra=Qi((function(t,e){var n={};if(null==t)return n;var r=!1;e=je(e,(function(e){return e=vi(e,t),r||(r=e.length>1),e})),Ai(t,eo(t),n),r&&(n=sr(n,7,Xi));for(var i=e.length;i--;)ui(n,e[i]);return n})),Ma=Qi((function(t,e){return null==t?{}:function(t,e){return Ur(t,e,(function(e,n){return xa(t,n)}))}(t,e)}));function La(t,e){if(null==t)return{};var n=je(eo(t),(function(t){return[t]}));return e=oo(e),Ur(t,n,(function(t,n){return e(t,n[0])}))}var Na=Yi(Fa),Da=Yi(ja);function Ia(t){return null==t?[]:Je(t,Fa(t))}var Ba=$i((function(t,e,n){return e=e.toLowerCase(),t+(n?qa(e):e)}));function qa(t){return Ga(ya(t).toLowerCase())}function Ua(t){return(t=ya(t))&&t.replace(mt,tn).replace(Xt,"")}var Ha=$i((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Wa=$i((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),za=Pi("toLowerCase"),Va=$i((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Ya=$i((function(t,e,n){return t+(n?" ":"")+Ga(e)})),Ka=$i((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Ga=Pi("toUpperCase");function Ja(t,e,n){return t=ya(t),(e=n?i:e)===i?function(t){return ee.test(t)}(t)?function(t){return t.match(Qt)||[]}(t):function(t){return t.match(ut)||[]}(t):t.match(e)||[]}var Xa=Yr((function(t,e){try{return ke(t,i,e)}catch(t){return Gs(t)?t:new Ct(t)}})),Za=Qi((function(t,e){return Se(e,(function(e){e=Lo(e),rr(t,e,Os(t[e],t))})),t}));function Qa(t){return function(){return t}}var tu=Li(),eu=Li(!0);function nu(t){return t}function ru(t){return $r("function"==typeof t?t:sr(t,1))}var iu=Yr((function(t,e){return function(n){return Or(n,t,e)}})),ou=Yr((function(t,e){return function(n){return Or(t,n,e)}}));function su(t,e,n){var r=Fa(e),i=br(e,r);null!=n||Qs(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=br(e,Fa(e)));var o=!(Qs(n)&&"chain"in n&&!n.chain),s=Js(t);return Se(i,(function(n){var r=e[n];t[n]=r,s&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=xi(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Pe([this.value()],arguments))})})),t}function au(){}var uu=Bi(je),cu=Bi(Ae),lu=Bi(Me);function fu(t){return mo(t)?He(Lo(t)):function(t){return function(e){return Cr(e,t)}}(t)}var hu=Ui(),du=Ui(!0);function pu(){return[]}function gu(){return!1}var vu,yu=Ii((function(t,e){return t+e}),0),mu=zi("ceil"),_u=Ii((function(t,e){return t/e}),1),bu=zi("floor"),Cu=Ii((function(t,e){return t*e}),1),wu=zi("round"),ku=Ii((function(t,e){return t-e}),0);return Dn.after=function(t,e){if("function"!=typeof e)throw new At(o);return t=da(t),function(){if(--t<1)return e.apply(this,arguments)}},Dn.ary=xs,Dn.assign=ma,Dn.assignIn=_a,Dn.assignInWith=ba,Dn.assignWith=Ca,Dn.at=wa,Dn.before=As,Dn.bind=Os,Dn.bindAll=Za,Dn.bindKey=Ts,Dn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Hs(t)?t:[t]},Dn.chain=fs,Dn.chunk=function(t,e,n){e=(n?yo(t,e,n):e===i)?1:vn(da(e),0);var o=null==t?0:t.length;if(!o||e<1)return[];for(var s=0,a=0,u=r(he(o/e));s<o;)u[a++]=ti(t,s,s+=e);return u},Dn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},Dn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=r(t-1),n=arguments[0],i=t;i--;)e[i-1]=arguments[i];return Pe(Hs(n)?xi(n):[n],gr(e,1))},Dn.cond=function(t){var e=null==t?0:t.length,n=oo();return t=e?je(t,(function(t){if("function"!=typeof t[1])throw new At(o);return[n(t[0]),t[1]]})):[],Yr((function(n){for(var r=-1;++r<e;){var i=t[r];if(ke(i[0],this,n))return ke(i[1],this,n)}}))},Dn.conforms=function(t){return function(t){var e=Fa(t);return function(n){return ar(n,t,e)}}(sr(t,1))},Dn.constant=Qa,Dn.countBy=ps,Dn.create=function(t,e){var n=In(t);return null==e?n:nr(n,e)},Dn.curry=function t(e,n,r){var o=Ki(e,8,i,i,i,i,i,n=r?i:n);return o.placeholder=t.placeholder,o},Dn.curryRight=function t(e,n,r){var o=Ki(e,16,i,i,i,i,i,n=r?i:n);return o.placeholder=t.placeholder,o},Dn.debounce=Fs,Dn.defaults=ka,Dn.defaultsDeep=Ea,Dn.defer=js,Dn.delay=Ps,Dn.difference=Io,Dn.differenceBy=Bo,Dn.differenceWith=qo,Dn.drop=function(t,e,n){var r=null==t?0:t.length;return r?ti(t,(e=n||e===i?1:da(e))<0?0:e,r):[]},Dn.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?ti(t,0,(e=r-(e=n||e===i?1:da(e)))<0?0:e):[]},Dn.dropRightWhile=function(t,e){return t&&t.length?li(t,oo(e,3),!0,!0):[]},Dn.dropWhile=function(t,e){return t&&t.length?li(t,oo(e,3),!0):[]},Dn.fill=function(t,e,n,r){var o=null==t?0:t.length;return o?(n&&"number"!=typeof n&&yo(t,e,n)&&(n=0,r=o),function(t,e,n,r){var o=t.length;for((n=da(n))<0&&(n=-n>o?0:o+n),(r=r===i||r>o?o:da(r))<0&&(r+=o),r=n>r?0:pa(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},Dn.filter=function(t,e){return(Hs(t)?Oe:pr)(t,oo(e,3))},Dn.flatMap=function(t,e){return gr(ws(t,e),1)},Dn.flatMapDeep=function(t,e){return gr(ws(t,e),l)},Dn.flatMapDepth=function(t,e,n){return n=n===i?1:da(n),gr(ws(t,e),n)},Dn.flatten=Wo,Dn.flattenDeep=function(t){return null!=t&&t.length?gr(t,l):[]},Dn.flattenDepth=function(t,e){return null!=t&&t.length?gr(t,e=e===i?1:da(e)):[]},Dn.flip=function(t){return Ki(t,512)},Dn.flow=tu,Dn.flowRight=eu,Dn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},Dn.functions=function(t){return null==t?[]:br(t,Fa(t))},Dn.functionsIn=function(t){return null==t?[]:br(t,ja(t))},Dn.groupBy=_s,Dn.initial=function(t){return null!=t&&t.length?ti(t,0,-1):[]},Dn.intersection=Vo,Dn.intersectionBy=Yo,Dn.intersectionWith=Ko,Dn.invert=Aa,Dn.invertBy=Oa,Dn.invokeMap=bs,Dn.iteratee=ru,Dn.keyBy=Cs,Dn.keys=Fa,Dn.keysIn=ja,Dn.map=ws,Dn.mapKeys=function(t,e){var n={};return e=oo(e,3),mr(t,(function(t,r,i){rr(n,e(t,r,i),t)})),n},Dn.mapValues=function(t,e){var n={};return e=oo(e,3),mr(t,(function(t,r,i){rr(n,r,e(t,r,i))})),n},Dn.matches=function(t){return Nr(sr(t,1))},Dn.matchesProperty=function(t,e){return Dr(t,sr(e,1))},Dn.memoize=$s,Dn.merge=Pa,Dn.mergeWith=$a,Dn.method=iu,Dn.methodOf=ou,Dn.mixin=su,Dn.negate=Rs,Dn.nthArg=function(t){return t=da(t),Yr((function(e){return Br(e,t)}))},Dn.omit=Ra,Dn.omitBy=function(t,e){return La(t,Rs(oo(e)))},Dn.once=function(t){return As(2,t)},Dn.orderBy=function(t,e,n,r){return null==t?[]:(Hs(e)||(e=null==e?[]:[e]),Hs(n=r?i:n)||(n=null==n?[]:[n]),qr(t,e,n))},Dn.over=uu,Dn.overArgs=Ms,Dn.overEvery=cu,Dn.overSome=lu,Dn.partial=Ls,Dn.partialRight=Ns,Dn.partition=ks,Dn.pick=Ma,Dn.pickBy=La,Dn.property=fu,Dn.propertyOf=function(t){return function(e){return null==t?i:Cr(t,e)}},Dn.pull=Jo,Dn.pullAll=Xo,Dn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Hr(t,e,oo(n,2)):t},Dn.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?Hr(t,e,i,n):t},Dn.pullAt=Zo,Dn.range=hu,Dn.rangeRight=du,Dn.rearg=Ds,Dn.reject=function(t,e){return(Hs(t)?Oe:pr)(t,Rs(oo(e,3)))},Dn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=oo(e,3);++r<o;){var s=t[r];e(s,r,t)&&(n.push(s),i.push(r))}return Wr(t,i),n},Dn.rest=function(t,e){if("function"!=typeof t)throw new At(o);return Yr(t,e=e===i?e:da(e))},Dn.reverse=Qo,Dn.sampleSize=function(t,e,n){return e=(n?yo(t,e,n):e===i)?1:da(e),(Hs(t)?Jn:Gr)(t,e)},Dn.set=function(t,e,n){return null==t?t:Jr(t,e,n)},Dn.setWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:Jr(t,e,n,r)},Dn.shuffle=function(t){return(Hs(t)?Xn:Qr)(t)},Dn.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&yo(t,e,n)?(e=0,n=r):(e=null==e?0:da(e),n=n===i?r:da(n)),ti(t,e,n)):[]},Dn.sortBy=Es,Dn.sortedUniq=function(t){return t&&t.length?ii(t):[]},Dn.sortedUniqBy=function(t,e){return t&&t.length?ii(t,oo(e,2)):[]},Dn.split=function(t,e,n){return n&&"number"!=typeof n&&yo(t,e,n)&&(e=n=i),(n=n===i?d:n>>>0)?(t=ya(t))&&("string"==typeof e||null!=e&&!ia(e))&&!(e=si(e))&&rn(t)?mi(fn(t),0,n):t.split(e,n):[]},Dn.spread=function(t,e){if("function"!=typeof t)throw new At(o);return e=null==e?0:vn(da(e),0),Yr((function(n){var r=n[e],i=mi(n,0,e);return r&&Pe(i,r),ke(t,this,i)}))},Dn.tail=function(t){var e=null==t?0:t.length;return e?ti(t,1,e):[]},Dn.take=function(t,e,n){return t&&t.length?ti(t,0,(e=n||e===i?1:da(e))<0?0:e):[]},Dn.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?ti(t,(e=r-(e=n||e===i?1:da(e)))<0?0:e,r):[]},Dn.takeRightWhile=function(t,e){return t&&t.length?li(t,oo(e,3),!1,!0):[]},Dn.takeWhile=function(t,e){return t&&t.length?li(t,oo(e,3)):[]},Dn.tap=function(t,e){return e(t),t},Dn.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new At(o);return Qs(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Fs(t,e,{leading:r,maxWait:e,trailing:i})},Dn.thru=hs,Dn.toArray=fa,Dn.toPairs=Na,Dn.toPairsIn=Da,Dn.toPath=function(t){return Hs(t)?je(t,Lo):aa(t)?[t]:xi(Mo(ya(t)))},Dn.toPlainObject=va,Dn.transform=function(t,e,n){var r=Hs(t),i=r||Ys(t)||ua(t);if(e=oo(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:Qs(t)&&Js(o)?In(Wt(t)):{}}return(i?Se:mr)(t,(function(t,r,i){return e(n,t,r,i)})),n},Dn.unary=function(t){return xs(t,1)},Dn.union=ts,Dn.unionBy=es,Dn.unionWith=ns,Dn.uniq=function(t){return t&&t.length?ai(t):[]},Dn.uniqBy=function(t,e){return t&&t.length?ai(t,oo(e,2)):[]},Dn.uniqWith=function(t,e){return e="function"==typeof e?e:i,t&&t.length?ai(t,i,e):[]},Dn.unset=function(t,e){return null==t||ui(t,e)},Dn.unzip=rs,Dn.unzipWith=is,Dn.update=function(t,e,n){return null==t?t:ci(t,e,gi(n))},Dn.updateWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:ci(t,e,gi(n),r)},Dn.values=Ia,Dn.valuesIn=function(t){return null==t?[]:Je(t,ja(t))},Dn.without=os,Dn.words=Ja,Dn.wrap=function(t,e){return Ls(gi(e),t)},Dn.xor=ss,Dn.xorBy=as,Dn.xorWith=us,Dn.zip=cs,Dn.zipObject=function(t,e){return di(t||[],e||[],Qn)},Dn.zipObjectDeep=function(t,e){return di(t||[],e||[],Jr)},Dn.zipWith=ls,Dn.entries=Na,Dn.entriesIn=Da,Dn.extend=_a,Dn.extendWith=ba,su(Dn,Dn),Dn.add=yu,Dn.attempt=Xa,Dn.camelCase=Ba,Dn.capitalize=qa,Dn.ceil=mu,Dn.clamp=function(t,e,n){return n===i&&(n=e,e=i),n!==i&&(n=(n=ga(n))==n?n:0),e!==i&&(e=(e=ga(e))==e?e:0),or(ga(t),e,n)},Dn.clone=function(t){return sr(t,4)},Dn.cloneDeep=function(t){return sr(t,5)},Dn.cloneDeepWith=function(t,e){return sr(t,5,e="function"==typeof e?e:i)},Dn.cloneWith=function(t,e){return sr(t,4,e="function"==typeof e?e:i)},Dn.conformsTo=function(t,e){return null==e||ar(t,e,Fa(e))},Dn.deburr=Ua,Dn.defaultTo=function(t,e){return null==t||t!=t?e:t},Dn.divide=_u,Dn.endsWith=function(t,e,n){t=ya(t),e=si(e);var r=t.length,o=n=n===i?r:or(da(n),0,r);return(n-=e.length)>=0&&t.slice(n,o)==e},Dn.eq=Is,Dn.escape=function(t){return(t=ya(t))&&K.test(t)?t.replace(V,en):t},Dn.escapeRegExp=function(t){return(t=ya(t))&&nt.test(t)?t.replace(et,"\\$&"):t},Dn.every=function(t,e,n){var r=Hs(t)?Ae:hr;return n&&yo(t,e,n)&&(e=i),r(t,oo(e,3))},Dn.find=gs,Dn.findIndex=Uo,Dn.findKey=function(t,e){return Ne(t,oo(e,3),mr)},Dn.findLast=vs,Dn.findLastIndex=Ho,Dn.findLastKey=function(t,e){return Ne(t,oo(e,3),_r)},Dn.floor=bu,Dn.forEach=ys,Dn.forEachRight=ms,Dn.forIn=function(t,e){return null==t?t:vr(t,oo(e,3),ja)},Dn.forInRight=function(t,e){return null==t?t:yr(t,oo(e,3),ja)},Dn.forOwn=function(t,e){return t&&mr(t,oo(e,3))},Dn.forOwnRight=function(t,e){return t&&_r(t,oo(e,3))},Dn.get=Sa,Dn.gt=Bs,Dn.gte=qs,Dn.has=function(t,e){return null!=t&&ho(t,e,Sr)},Dn.hasIn=xa,Dn.head=zo,Dn.identity=nu,Dn.includes=function(t,e,n,r){t=zs(t)?t:Ia(t),n=n&&!r?da(n):0;var i=t.length;return n<0&&(n=vn(i+n,0)),sa(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Ie(t,e,n)>-1},Dn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:da(n);return i<0&&(i=vn(r+i,0)),Ie(t,e,i)},Dn.inRange=function(t,e,n){return e=ha(e),n===i?(n=e,e=0):n=ha(n),function(t,e,n){return t>=yn(e,n)&&t<vn(e,n)}(t=ga(t),e,n)},Dn.invoke=Ta,Dn.isArguments=Us,Dn.isArray=Hs,Dn.isArrayBuffer=Ws,Dn.isArrayLike=zs,Dn.isArrayLikeObject=Vs,Dn.isBoolean=function(t){return!0===t||!1===t||ta(t)&&kr(t)==y},Dn.isBuffer=Ys,Dn.isDate=Ks,Dn.isElement=function(t){return ta(t)&&1===t.nodeType&&!ra(t)},Dn.isEmpty=function(t){if(null==t)return!0;if(zs(t)&&(Hs(t)||"string"==typeof t||"function"==typeof t.splice||Ys(t)||ua(t)||Us(t)))return!t.length;var e=fo(t);if(e==w||e==A)return!t.size;if(Co(t))return!Rr(t).length;for(var n in t)if($t.call(t,n))return!1;return!0},Dn.isEqual=function(t,e){return Fr(t,e)},Dn.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:i)?n(t,e):i;return r===i?Fr(t,e,i,n):!!r},Dn.isError=Gs,Dn.isFinite=function(t){return"number"==typeof t&&Le(t)},Dn.isFunction=Js,Dn.isInteger=Xs,Dn.isLength=Zs,Dn.isMap=ea,Dn.isMatch=function(t,e){return t===e||jr(t,e,ao(e))},Dn.isMatchWith=function(t,e,n){return n="function"==typeof n?n:i,jr(t,e,ao(e),n)},Dn.isNaN=function(t){return na(t)&&t!=+t},Dn.isNative=function(t){if(bo(t))throw new Ct("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Pr(t)},Dn.isNil=function(t){return null==t},Dn.isNull=function(t){return null===t},Dn.isNumber=na,Dn.isObject=Qs,Dn.isObjectLike=ta,Dn.isPlainObject=ra,Dn.isRegExp=ia,Dn.isSafeInteger=function(t){return Xs(t)&&t>=-9007199254740991&&t<=f},Dn.isSet=oa,Dn.isString=sa,Dn.isSymbol=aa,Dn.isTypedArray=ua,Dn.isUndefined=function(t){return t===i},Dn.isWeakMap=function(t){return ta(t)&&fo(t)==F},Dn.isWeakSet=function(t){return ta(t)&&"[object WeakSet]"==kr(t)},Dn.join=function(t,e){return null==t?"":We.call(t,e)},Dn.kebabCase=Ha,Dn.last=Go,Dn.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=da(n))<0?vn(r+o,0):yn(o,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):De(t,qe,o,!0)},Dn.lowerCase=Wa,Dn.lowerFirst=za,Dn.lt=ca,Dn.lte=la,Dn.max=function(t){return t&&t.length?dr(t,nu,Er):i},Dn.maxBy=function(t,e){return t&&t.length?dr(t,oo(e,2),Er):i},Dn.mean=function(t){return Ue(t,nu)},Dn.meanBy=function(t,e){return Ue(t,oo(e,2))},Dn.min=function(t){return t&&t.length?dr(t,nu,Mr):i},Dn.minBy=function(t,e){return t&&t.length?dr(t,oo(e,2),Mr):i},Dn.stubArray=pu,Dn.stubFalse=gu,Dn.stubObject=function(){return{}},Dn.stubString=function(){return""},Dn.stubTrue=function(){return!0},Dn.multiply=Cu,Dn.nth=function(t,e){return t&&t.length?Br(t,da(e)):i},Dn.noConflict=function(){return fe._===this&&(fe._=Dt),this},Dn.noop=au,Dn.now=Ss,Dn.pad=function(t,e,n){t=ya(t);var r=(e=da(e))?ln(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return qi(de(i),n)+t+qi(he(i),n)},Dn.padEnd=function(t,e,n){t=ya(t);var r=(e=da(e))?ln(t):0;return e&&r<e?t+qi(e-r,n):t},Dn.padStart=function(t,e,n){t=ya(t);var r=(e=da(e))?ln(t):0;return e&&r<e?qi(e-r,n)+t:t},Dn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),_n(ya(t).replace(rt,""),e||0)},Dn.random=function(t,e,n){if(n&&"boolean"!=typeof n&&yo(t,e,n)&&(e=n=i),n===i&&("boolean"==typeof e?(n=e,e=i):"boolean"==typeof t&&(n=t,t=i)),t===i&&e===i?(t=0,e=1):(t=ha(t),e===i?(e=t,t=0):e=ha(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var o=bn();return yn(t+o*(e-t+ae("1e-"+((o+"").length-1))),e)}return zr(t,e)},Dn.reduce=function(t,e,n){var r=Hs(t)?$e:ze,i=arguments.length<3;return r(t,oo(e,4),n,i,lr)},Dn.reduceRight=function(t,e,n){var r=Hs(t)?Re:ze,i=arguments.length<3;return r(t,oo(e,4),n,i,fr)},Dn.repeat=function(t,e,n){return e=(n?yo(t,e,n):e===i)?1:da(e),Vr(ya(t),e)},Dn.replace=function(){var t=arguments,e=ya(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Dn.result=function(t,e,n){var r=-1,o=(e=vi(e,t)).length;for(o||(o=1,t=i);++r<o;){var s=null==t?i:t[Lo(e[r])];s===i&&(r=o,s=n),t=Js(s)?s.call(t):s}return t},Dn.round=wu,Dn.runInContext=t,Dn.sample=function(t){return(Hs(t)?Gn:Kr)(t)},Dn.size=function(t){if(null==t)return 0;if(zs(t))return sa(t)?ln(t):t.length;var e=fo(t);return e==w||e==A?t.size:Rr(t).length},Dn.snakeCase=Va,Dn.some=function(t,e,n){var r=Hs(t)?Me:ei;return n&&yo(t,e,n)&&(e=i),r(t,oo(e,3))},Dn.sortedIndex=function(t,e){return ni(t,e)},Dn.sortedIndexBy=function(t,e,n){return ri(t,e,oo(n,2))},Dn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=ni(t,e);if(r<n&&Is(t[r],e))return r}return-1},Dn.sortedLastIndex=function(t,e){return ni(t,e,!0)},Dn.sortedLastIndexBy=function(t,e,n){return ri(t,e,oo(n,2),!0)},Dn.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=ni(t,e,!0)-1;if(Is(t[n],e))return n}return-1},Dn.startCase=Ya,Dn.startsWith=function(t,e,n){return t=ya(t),n=null==n?0:or(da(n),0,t.length),e=si(e),t.slice(n,n+e.length)==e},Dn.subtract=ku,Dn.sum=function(t){return t&&t.length?Ve(t,nu):0},Dn.sumBy=function(t,e){return t&&t.length?Ve(t,oo(e,2)):0},Dn.template=function(t,e,n){var r=Dn.templateSettings;n&&yo(t,e,n)&&(e=i),t=ya(t),e=ba({},e,r,Gi);var o,s,a=ba({},e.imports,r.imports,Gi),u=Fa(a),c=Je(a,u),l=0,f=e.interpolate||_t,h="__p += '",d=St((e.escape||_t).source+"|"+f.source+"|"+(f===X?ft:_t).source+"|"+(e.evaluate||_t).source+"|$","g"),p="//# sourceURL="+($t.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++re+"]")+"\n";t.replace(d,(function(e,n,r,i,a,u){return r||(r=i),h+=t.slice(l,u).replace(bt,nn),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),a&&(s=!0,h+="';\n"+a+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=u+e.length,e})),h+="';\n";var g=$t.call(e,"variable")&&e.variable;if(g){if(ct.test(g))throw new Ct("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(s?h.replace(U,""):h).replace(H,"$1").replace(W,"$1;"),h="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var v=Xa((function(){return wt(u,p+"return "+h).apply(i,c)}));if(v.source=h,Gs(v))throw v;return v},Dn.times=function(t,e){if((t=da(t))<1||t>f)return[];var n=d,r=yn(t,d);e=oo(e),t-=d;for(var i=Ye(r,e);++n<t;)e(n);return i},Dn.toFinite=ha,Dn.toInteger=da,Dn.toLength=pa,Dn.toLower=function(t){return ya(t).toLowerCase()},Dn.toNumber=ga,Dn.toSafeInteger=function(t){return t?or(da(t),-9007199254740991,f):0===t?t:0},Dn.toString=ya,Dn.toUpper=function(t){return ya(t).toUpperCase()},Dn.trim=function(t,e,n){if((t=ya(t))&&(n||e===i))return Ke(t);if(!t||!(e=si(e)))return t;var r=fn(t),o=fn(e);return mi(r,Ze(r,o),Qe(r,o)+1).join("")},Dn.trimEnd=function(t,e,n){if((t=ya(t))&&(n||e===i))return t.slice(0,hn(t)+1);if(!t||!(e=si(e)))return t;var r=fn(t);return mi(r,0,Qe(r,fn(e))+1).join("")},Dn.trimStart=function(t,e,n){if((t=ya(t))&&(n||e===i))return t.replace(rt,"");if(!t||!(e=si(e)))return t;var r=fn(t);return mi(r,Ze(r,fn(e))).join("")},Dn.truncate=function(t,e){var n=30,r="...";if(Qs(e)){var o="separator"in e?e.separator:o;n="length"in e?da(e.length):n,r="omission"in e?si(e.omission):r}var s=(t=ya(t)).length;if(rn(t)){var a=fn(t);s=a.length}if(n>=s)return t;var u=n-ln(r);if(u<1)return r;var c=a?mi(a,0,u).join(""):t.slice(0,u);if(o===i)return c+r;if(a&&(u+=c.length-u),ia(o)){if(t.slice(u).search(o)){var l,f=c;for(o.global||(o=St(o.source,ya(ht.exec(o))+"g")),o.lastIndex=0;l=o.exec(f);)var h=l.index;c=c.slice(0,h===i?u:h)}}else if(t.indexOf(si(o),u)!=u){var d=c.lastIndexOf(o);d>-1&&(c=c.slice(0,d))}return c+r},Dn.unescape=function(t){return(t=ya(t))&&Y.test(t)?t.replace(z,dn):t},Dn.uniqueId=function(t){var e=++Rt;return ya(t)+e},Dn.upperCase=Ka,Dn.upperFirst=Ga,Dn.each=ys,Dn.eachRight=ms,Dn.first=zo,su(Dn,(vu={},mr(Dn,(function(t,e){$t.call(Dn.prototype,e)||(vu[e]=t)})),vu),{chain:!1}),Dn.VERSION="4.17.21",Se(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Dn[t].placeholder=Dn})),Se(["drop","take"],(function(t,e){Un.prototype[t]=function(n){n=n===i?1:vn(da(n),0);var r=this.__filtered__&&!e?new Un(this):this.clone();return r.__filtered__?r.__takeCount__=yn(n,r.__takeCount__):r.__views__.push({size:yn(n,d),type:t+(r.__dir__<0?"Right":"")}),r},Un.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Se(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Un.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:oo(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Se(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Un.prototype[t]=function(){return this[n](1).value()[0]}})),Se(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Un.prototype[t]=function(){return this.__filtered__?new Un(this):this[n](1)}})),Un.prototype.compact=function(){return this.filter(nu)},Un.prototype.find=function(t){return this.filter(t).head()},Un.prototype.findLast=function(t){return this.reverse().find(t)},Un.prototype.invokeMap=Yr((function(t,e){return"function"==typeof t?new Un(this):this.map((function(n){return Or(n,t,e)}))})),Un.prototype.reject=function(t){return this.filter(Rs(oo(t)))},Un.prototype.slice=function(t,e){t=da(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Un(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==i&&(n=(e=da(e))<0?n.dropRight(-e):n.take(e-t)),n)},Un.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Un.prototype.toArray=function(){return this.take(d)},mr(Un.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),o=Dn[r?"take"+("last"==e?"Right":""):e],s=r||/^find/.test(e);o&&(Dn.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,u=e instanceof Un,c=a[0],l=u||Hs(e),f=function(t){var e=o.apply(Dn,Pe([t],a));return r&&h?e[0]:e};l&&n&&"function"==typeof c&&1!=c.length&&(u=l=!1);var h=this.__chain__,d=!!this.__actions__.length,p=s&&!h,g=u&&!d;if(!s&&l){e=g?e:new Un(this);var v=t.apply(e,a);return v.__actions__.push({func:hs,args:[f],thisArg:i}),new qn(v,h)}return p&&g?t.apply(this,a):(v=this.thru(f),p?r?v.value()[0]:v.value():v)})})),Se(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Ot[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Dn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Hs(i)?i:[],t)}return this[n]((function(n){return e.apply(Hs(n)?n:[],t)}))}})),mr(Un.prototype,(function(t,e){var n=Dn[e];if(n){var r=n.name+"";$t.call(Tn,r)||(Tn[r]=[]),Tn[r].push({name:e,func:n})}})),Tn[Ni(i,2).name]=[{name:"wrapper",func:i}],Un.prototype.clone=function(){var t=new Un(this.__wrapped__);return t.__actions__=xi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=xi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=xi(this.__views__),t},Un.prototype.reverse=function(){if(this.__filtered__){var t=new Un(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Un.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Hs(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],s=o.size;switch(o.type){case"drop":t+=s;break;case"dropRight":e-=s;break;case"take":e=yn(e,t+s);break;case"takeRight":t=vn(t,e-s)}}return{start:t,end:e}}(0,i,this.__views__),s=o.start,a=o.end,u=a-s,c=r?a:s-1,l=this.__iteratees__,f=l.length,h=0,d=yn(u,this.__takeCount__);if(!n||!r&&i==u&&d==u)return fi(t,this.__actions__);var p=[];t:for(;u--&&h<d;){for(var g=-1,v=t[c+=e];++g<f;){var y=l[g],m=y.iteratee,_=y.type,b=m(v);if(2==_)v=b;else if(!b){if(1==_)continue t;break t}}p[h++]=v}return p},Dn.prototype.at=ds,Dn.prototype.chain=function(){return fs(this)},Dn.prototype.commit=function(){return new qn(this.value(),this.__chain__)},Dn.prototype.next=function(){this.__values__===i&&(this.__values__=fa(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?i:this.__values__[this.__index__++]}},Dn.prototype.plant=function(t){for(var e,n=this;n instanceof Bn;){var r=Do(n);r.__index__=0,r.__values__=i,e?o.__wrapped__=r:e=r;var o=r;n=n.__wrapped__}return o.__wrapped__=t,e},Dn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Un){var e=t;return this.__actions__.length&&(e=new Un(this)),(e=e.reverse()).__actions__.push({func:hs,args:[Qo],thisArg:i}),new qn(e,this.__chain__)}return this.thru(Qo)},Dn.prototype.toJSON=Dn.prototype.valueOf=Dn.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Dn.prototype.first=Dn.prototype.head,Gt&&(Dn.prototype[Gt]=function(){return this}),Dn}();fe._=pn,(r=function(){return pn}.call(e,n,e,t))===i||(t.exports=r)}.call(this)},3669:(t,e,n)=>{e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(r++,"%c"===t&&(i=r))})),e.splice(i,0,n)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),t},e.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=n(9231)(e);const{formatters:r}=t.exports;r.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},9231:(t,e,n)=>{t.exports=function(t){function e(t){let n,i,o,s=null;function a(...t){if(!a.enabled)return;const r=a,i=Number(new Date),o=i-(n||i);r.diff=o,r.prev=n,r.curr=i,n=i,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let s=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";s++;const o=e.formatters[i];if("function"==typeof o){const e=t[s];n=o.call(r,e),t.splice(s,1),s--}return n})),e.formatArgs.call(r,t),(r.log||e.log).apply(r,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=r,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==e.namespaces&&(i=e.namespaces,o=e.enabled(t)),o),set:t=>{s=t}}),"function"==typeof e.init&&e.init(a),a}function r(t,n){const r=e(this.namespace+(void 0===n?":":n)+t);return r.log=this.log,r}function i(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){const t=[...e.names.map(i),...e.skips.map(i).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let n;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const r=("string"==typeof t?t:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(t=r[n].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.slice(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1},e.humanize=n(4241),e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((n=>{e[n]=t[n]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let n=0;for(let e=0;e<t.length;e++)n=(n<<5)-n+t.charCodeAt(e),n|=0;return e.colors[Math.abs(n)%e.colors.length]},e.enable(e.load()),e}},4241:t=>{var e=1e3,n=60*e,r=60*n,i=24*r;function o(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"s":"")}t.exports=function(t,s){s=s||{};var a,u,c=typeof t;if("string"===c&&t.length>0)return function(t){if(!((t=String(t)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*r;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(t);if("number"===c&&isFinite(t))return s.long?(a=t,(u=Math.abs(a))>=i?o(a,u,i,"day"):u>=r?o(a,u,r,"hour"):u>=n?o(a,u,n,"minute"):u>=e?o(a,u,e,"second"):a+" ms"):function(t){var o=Math.abs(t);return o>=i?Math.round(t/i)+"d":o>=r?Math.round(t/r)+"h":o>=n?Math.round(t/n)+"m":o>=e?Math.round(t/e)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},1618:(t,e,n)=>{e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(r++,"%c"===t&&(i=r))})),e.splice(i,0,n)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),t},e.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=n(5224)(e);const{formatters:r}=t.exports;r.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},5224:(t,e,n)=>{t.exports=function(t){function e(t){let n,i,o,s=null;function a(...t){if(!a.enabled)return;const r=a,i=Number(new Date),o=i-(n||i);r.diff=o,r.prev=n,r.curr=i,n=i,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let s=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";s++;const o=e.formatters[i];if("function"==typeof o){const e=t[s];n=o.call(r,e),t.splice(s,1),s--}return n})),e.formatArgs.call(r,t),(r.log||e.log).apply(r,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=r,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==e.namespaces&&(i=e.namespaces,o=e.enabled(t)),o),set:t=>{s=t}}),"function"==typeof e.init&&e.init(a),a}function r(t,n){const r=e(this.namespace+(void 0===n?":":n)+t);return r.log=this.log,r}function i(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){const t=[...e.names.map(i),...e.skips.map(i).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let n;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const r=("string"==typeof t?t:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(t=r[n].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.slice(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1},e.humanize=n(8896),e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((n=>{e[n]=t[n]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let n=0;for(let e=0;e<t.length;e++)n=(n<<5)-n+t.charCodeAt(e),n|=0;return e.colors[Math.abs(n)%e.colors.length]},e.enable(e.load()),e}},8896:t=>{var e=1e3,n=60*e,r=60*n,i=24*r;function o(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"s":"")}t.exports=function(t,s){s=s||{};var a,u,c=typeof t;if("string"===c&&t.length>0)return function(t){if(!((t=String(t)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*r;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(t);if("number"===c&&isFinite(t))return s.long?(a=t,(u=Math.abs(a))>=i?o(a,u,i,"day"):u>=r?o(a,u,r,"hour"):u>=n?o(a,u,n,"minute"):u>=e?o(a,u,e,"second"):a+" ms"):function(t){var o=Math.abs(t);return o>=i?Math.round(t/i)+"d":o>=r?Math.round(t/r)+"h":o>=n?Math.round(t/n)+"m":o>=e?Math.round(t/e)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},9336:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.configureChat=void 0;const i=r(n(3336));let o;function s(t){(0,i.default)("#chat-messages").html(t.map((t=>`<div class="chat-message" title="${new Date(parseInt(t.sentAt))}" id="${t.id}">\n    <span class="from">${t.from}</span>\n    <span class="message">${t.msg}</span>\n    </div>`)).join("\n")),(0,i.default)("#chat-messages").scrollTop((0,i.default)("#chat-messages")[0].scrollHeight)}function a(t){(0,i.default)("#chat-messages").append(`<div class="chat-message" title="${new Date(parseInt(t.sentAt))}" id="${t.id}">\n                             <span class="from">${t.from}</span>\n                             <span class="message">${t.msg}</span>\n                             </div>`),(0,i.default)("#chat-messages").scrollTop((0,i.default)("#chat-messages")[0].scrollHeight)}e.configureChat=function(t){o=t,o.on("chathistory",s),o.on("chat",a),(0,i.default)("#chat-form").on("submit",(t=>{t.preventDefault(),t.stopPropagation();const e=(0,i.default)("#message").val().toString();e.length>0&&(o.emit("chat",e),(0,i.default)("#message").val(""))})),console.log("Chat Configured")}},3253:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CustomEventManager=void 0,e.CustomEventManager=class{constructor(){this.events={}}on(t,e){this.events[t]||(this.events[t]=[]),this.events[t].push(e)}emit(t,e=[]){this.events[t]&&this.events[t].forEach((t=>t.apply(null,e)))}}},5862:function(t,e){"use strict";var n=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};function r(){return localStorage.getItem("authToken")}Object.defineProperty(e,"__esModule",{value:!0}),e.http=e.authToken=void 0,e.authToken=r,e.http={get:t=>n(void 0,void 0,void 0,(function*(){return(yield fetch(t,{headers:{"x-authtoken":r()}})).json()})),post:(t,e)=>n(void 0,void 0,void 0,(function*(){return(yield fetch(t,{method:"post",body:JSON.stringify(e),headers:{"x-authtoken":r(),"content-type":"application/json"}})).json()}))}},2174:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e},s=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const u=n(7046),c=a(n(3336)),l=n(4738),f=n(5862),h=n(3253),d=n(7429),p=n(6486),g=n(9502),v=n(9336),y=n(1916),m=o(n(7355)),_=new(n(8182).TimeManager),b=new Map,C=new h.CustomEventManager,w=(0,u.io)({extraHeaders:{"x-authtoken":(0,f.authToken)()}});function k(){const t=_.gradientName(),e=(0,c.default)("body");e.removeClass(Array.from(e[0].classList)).addClass(t),_.isNight()&&e.addClass("night")}function E(t){return`<img src="/assets/img/${t}.png" class="icon">`}function S(t,e,n,r=!0){let i=0;e>0&&(i=Math.floor(t/e*100));const o=r?`${i}% - `:"";return`<div class="progress-bar" style="background: linear-gradient(to right, ${n}, ${n} ${i}%, transparent ${i}%, transparent)" title="${o}${t}/${e}">${o}${t}/${e}</div>`}function x(t,e,n,r){let i=0;e>0&&(i=Math.floor(t/e*100)),(0,c.default)(`#${n}`).css("background",`linear-gradient(to right, ${r}, ${r} ${i}%, transparent ${i}%, transparent)`).attr("title",`${i}% - ${t}/${e}`).html(`${t}/${e} - ${i}%`)}function A(){const t=b.get("player");(0,c.default)("#username").html(`${t.username}, level ${t.level} ${t.profession}`),x(t.hp,(0,l.maxHp)(t.constitution,t.level),"hp-bar","#ff7070"),x(t.exp,(0,l.expToLevel)(t.level+1),"exp-bar","#5997f9"),["strength","constitution","dexterity","intelligence","hp","exp"].forEach((e=>{(0,c.default)(`.${e}`).html(t[e])})),(0,c.default)(".maxHp").html((0,l.maxHp)(t.constitution,t.level).toString()),(0,c.default)(".expToLevel").html((0,l.expToLevel)(t.level+1).toString()),(0,c.default)(".gold").html(t.gold.toLocaleString()),"session"===t.account_type&&(0,c.default)("#signup-prompt").html('<p>Hey there! It looks like you\'re using a SESSION account. This allows you to play with away, but the account is tied to your current device, and will be lost if you ever clear your cookies.</p><p>\n          <form id="signup">\n            <div class="form-group">\n              <label>Username:</label>\n              <input type="text" name="username">\n            </div>\n            <div class="form-group">\n              <label>Password:</label>\n              <input type="password" name="password">\n            </div>\n            <button type="submit" class="success">Create your Account</button>\n            <button type="button" id="login">Login To Existing Account</button>\n          </form></p>').removeClass("hidden"),(0,c.default)("#extra-inventory-info").html(T())}function O(t,e="error"){let n=(0,d.v4)();(0,c.default)("#alerts").append(`<div class="alert ${e}" id="alert-${n}">${t}</div>`),setTimeout((()=>{(0,c.default)(`#alert-${n}`).remove()}),3e3)}function T(){const t=b.get("player");let e='<table id="stat-breakdown">';return l.StatDef.forEach((n=>{e+=`<tr>\n      <th>${n.display}</th>\n      <td class="${n.id}">\n        ${t[n.id]}\n        ${t.stat_points?function(t){return`<button class="increase-stat emit-event" data-event="spend-stat-point" data-args="${t.id}">+</button>`}(n):""}\n      </td>\n    </tr>`})),e+=`<tr><th>Stat Points</th><td class="stat_points">${t.stat_points}</td></tr>`,e+="</table>",e}function F(t){return t.map((t=>function(t,e){return`<div class="store-list">\n    <div>\n      <img src="https://via.placeholder.com/64x64">\n    </div>\n    <div class="details">\n      <div class="name">${t.name}</div>\n      <div class="requirements">\n      ${t.requirements.level?P("LVL",t.requirements.level):""}\n      ${t.requirements.strength?P("STR",t.requirements.strength):""}\n      ${t.requirements.constitution?P("CON",t.requirements.constitution):""}\n      ${t.requirements.dexterity?P("DEX",t.requirements.dexterity):""}\n      ${t.requirements.intelligence?P("INT",t.requirements.intelligence):""}\n      ${P("PRF",t.profession)}\n      </div>\n      <div class="stat-mods">\n      ${t.boosts.strength?$("STR",t.boosts.strength):""}\n      ${t.boosts.constitution?$("CON",t.boosts.constitution):""}\n      ${t.boosts.dexterity?$("DEX",t.boosts.dexterity):""}\n      ${t.boosts.intelligence?$("INT",t.boosts.intelligence):""}\n      ${t.boosts.damage?$("DMG",t.boosts.damage):""}\n      ${t.boosts.damage_mitigation?$("MIT",t.boosts.damage_mitigation.toString())+"%":""}\n      ${["WEAPON","SPELL"].includes(t.type)?"":S(t.currentAp,t.maxAp,"#7be67b")}\n      </div>\n      ${t.hasOwnProperty("id")?`<div>${t.cost.toLocaleString()}G</div>`:""}\n    </div>\n    <div class="store-actions">\n      ${(t=>t.is_equipped?`<button type="button" class="unequip-item error" data-id="${t.item_id}">Unequip</button>`:"ANY_HAND"===t.equipment_slot?`<button type="button" class="equip-item" data-id="${t.item_id}" data-slot="LEFT_HAND">Equip L</button>\n          <button type="button" class="equip-item" data-id="${t.item_id}" data-slot="RIGHT_HAND">Equip R</button>`:"LEFT_HAND"===t.equipment_slot?`<button type="button" class="equip-item" data-id="${t.item_id}" data-slot="${t.equipment_slot}">Equip Left</button>`:"RIGHT_HAND"===t.equipment_slot?`<button type="button" class="equip-item" data-id="${t.item_id}" data-slot="${t.equipment_slot}">Equip Right</button>`:(t.equipment_slot,`<button type="button" class="equip-item" data-id="${t.item_id}" data-slot="${t.equipment_slot}">Equip</button>`))(t)}\n    </div>\n    </div>`}(t))).join("\n")}function j(t){(0,c.default)("#explore").css({"background-image":`linear-gradient(to left top, rgba(255,255,255,0) 0%,rgb(255,255,255) 100%), linear-gradient(to left, rgba(255, 255, 255, 0) 0%, rgb(255, 255, 255) 100%), url("/assets/img/map/${t}.jpeg")`})}function P(t,e,n){let r="";return n&&(r=n>=e?"success":"error"),`<span class="requirement-title">${t}</span>: <span class="requirement-value ${r}">${e.toLocaleString()}</span>`}function $(t,e){let n="";return"number"==typeof e&&(n=e>0?"+":"-"),`<span class="requirement-title">${t}</span>: <span class="requirement-value ${"number"==typeof e?e>0?"success":"error":""}">${n}${e}</span>`}function R(t){const e=Math.floor(t.hp/t.maxHp*100);return`<div id="fight-container">\n    <div id="defender-info">\n      <div class="avatar-container">\n        <img id="avatar" src="https://via.placeholder.com/64x64">\n      </div>\n      <div id="defender-stat-bars">\n        <div id="defender-name">${t.name}</div>\n        <div class="progress-bar" id="defender-hp-bar" style="background: linear-gradient(to right, red, red ${e}%, transparent ${e}%, transparent)" title="${e}% - ${t.hp}/${t.maxHp}">${e}% - ${t.hp} / ${t.maxHp}</div>\n      </div>\n    </div>\n    <div id="fight-actions">\n      <select id="fight-target">\n        <option value="head">Head</option>\n        <option value="body">Body</option>\n        <option value="arms">Arms</option>\n        <option value="legs">Legs</option>\n      </select>\n      <button type="button" class="fight-action" data-action="attack">Attack</button>\n      <button type="button" class="fight-action" data-action="cast">Cast</button>\n      <button type="button" class="fight-action" data-action="flee">Flee</button>\n    </div>\n    <div id="fight-results"></div>\n  </div>`}function M(t,e="explore"){return s(this,void 0,void 0,(function*(){if(b.get("player").hp<=0)C.emit("alert",[{type:"error",text:"You don't have enough HP to go looking for a fight"}]);else{b.set("last-selected-monster",t);try{const n=yield f.http.post("/fight",{monsterId:t,fightTrigger:e});(0,c.default)("#map").html(R(n))}catch(t){C.emit("alert",[{type:"error",text:"Sorry, you can't start that fight"}])}}}))}(0,v.configureChat)(w),k(),setInterval(k,6e4),w.on("connect",(()=>{console.log(`Connected: ${w.id}`)})),w.on("ready",(function(){console.log("Server connection verified"),w.emit("inventory"),(0,c.default)("nav a").first().click()})),w.on("server-stats",(t=>{(0,c.default)("#server-stats").html(`${t.onlinePlayers} players online`)})),(0,p.each)(m,(t=>{console.log(`Binding Event ${t.eventName}`),t instanceof y.SocketEvent?w.on(t.eventName,t.handler.bind(null,{cache:b,socket:w,events:C})):console.log("Skipped binding",t)})),w.on("calc:ap",(t=>{var e,n,r,i,o,s,a,u;const{ap:l}=t,f=`\n  <div>\n    ${E("helm")}\n    ${S((null===(e=l.HEAD)||void 0===e?void 0:e.currentAp)||0,(null===(n=l.HEAD)||void 0===n?void 0:n.maxAp)||0,"#7be67b")}\n  </div>\n  <div>\n    ${E("arms")}\n    ${S((null===(r=l.ARMS)||void 0===r?void 0:r.currentAp)||0,(null===(i=l.ARMS)||void 0===i?void 0:i.maxAp)||0,"#7be67b")}\n  </div>\n  <div>\n    ${E("chest")}\n    ${S((null===(o=l.CHEST)||void 0===o?void 0:o.currentAp)||0,(null===(s=l.CHEST)||void 0===s?void 0:s.maxAp)||0,"#7be67b")}\n  </div>\n  <div>\n    ${E("legs")}\n    ${S((null===(a=l.LEGS)||void 0===a?void 0:a.currentAp)||0,(null===(u=l.LEGS)||void 0===u?void 0:u.maxAp)||0,"#7be67b")}\n  </div>\n  `;(0,c.default)("#ap-bar").html(f)})),C.on("tab:skills",(()=>{(0,c.default)("#skills").html(""),w.emit("skills")})),w.on("skills",(t=>{let e=`<table id="skill-list">\n  ${t.skills.map((t=>{const e=g.Skills.get(t.id),n=t.exp/e.expToLevel(t.level+1);return`\n    <tr>\n    <td class="skill-level">${t.level.toLocaleString()}</td>\n    <td class="skill-description" title="Total Exp: ${t.exp.toLocaleString()}/${e.expToLevel(t.level+1).toLocaleString()}">\n      <span class="skill-exp">${(100*n).toPrecision(2)}% to next level</span>\n      <b>${e.display}</b>\n      <p>${e.description}</p>\n    </td>\n    </tr>\n    `})).join("\n")}\n  </table>`;(0,c.default)("#skills").html(e)})),C.on("alert",(t=>{O(t.text,t.type)})),w.on("alert",(t=>{C.emit("alert",[t])})),w.on("init",(t=>{(0,c.default)("#version").html(`v${t.version}`)})),w.on("authToken",(t=>{console.log(`recv auth token ${t}`),localStorage.setItem("authToken",t)})),w.on("player",(t=>{b.set("player",t),A()})),(0,c.default)("nav a").on("click",(t=>s(void 0,void 0,void 0,(function*(){t.preventDefault(),t.stopPropagation(),yield function(){return s(this,void 0,void 0,(function*(){const t=yield f.http.get("/state");b.set("state",t)}))}();const e=b.get("state"),n=(0,c.default)(`#${(0,c.default)(t.target).data("container")}`);let r=(0,c.default)(t.target).data("section");["skills","inventory"].includes(r)&&null!==(null==e?void 0:e.fight)&&(O("You are currently in a fight","error"),r="explore"),n.find(".tab").removeClass("active"),(0,c.default)(`#${r}`).addClass("active"),"Settings"!==t.target.innerHTML&&((0,c.default)(t.target).closest("nav").find("a").removeClass("active"),(0,c.default)(`nav a[data-section=${r}]`).addClass("active")),C.emit(`tab:${r}`)})))),C.on("tab:inventory",(()=>{w.emit("inventory")})),(0,c.default)("body").on("click","nav.filter",(t=>{t.preventDefault(),t.stopPropagation();const e=(0,c.default)(t.target),n=e.data("filter");(0,c.default)(".filter-result").removeClass("active").addClass("hidden"),(0,c.default)(`#filter_${n}`).addClass("active").removeClass("hidden"),e.closest("nav").find("a").removeClass("active"),e.addClass("active"),b.set("active-inventory-section",n)})),w.on("inventory",(t=>{b.get("player");const e=b.get("active-inventory-section")||"ARMOUR",n={ARMOUR:[],WEAPON:[],SPELL:[]};t.inventory.forEach((t=>{n[t.type].push(t)}));const r=`\n  <div id="inventory-page">\n    <div id="character-summary">\n    ${function(t){const e="https://via.placeholder.com/64x64",n=t.filter((t=>t.is_equipped)).reduce(((t,e)=>(t[e.equipment_slot]=e,t)),{});return`\n  <table id="character-equipment-placement">\n  <tr>\n    <td>\n    </td>\n    <td style="background-image: url('${e}');" title="${n.HEAD?n.HEAD.name:"Empty"}">\n    ${n.HEAD?n.HEAD.name:"HEAD"}\n    </td>\n    <td style="background-image: url('${e}');" title="${n.ARMS?n.ARMS.name:"Empty"}">\n    ${n.ARMS?n.ARMS.name:"ARMS"}\n    </td>\n  </tr>\n  <tr>\n    <td style="background-image: url('${e}');" title="${n.LEFT_HAND?n.LEFT_HAND.name:n.TWO_HANDED?n.TWO_HANDED.name:""}">\n    ${n.LEFT_HAND?n.LEFT_HAND.name:n.TWO_HANDED?n.TWO_HANDED.name:"L_HAND"}\n    </td>\n    <td style="background-image: url('${e}');" title="${n.CHEST?n.CHEST.name:""}">\n    ${n.CHEST?n.CHEST.name:"CHEST"}\n    </td>\n    <td style="background-image: url('${e}');" title="${n.RIGHT_HAND?n.RIGHT_HAND.name:n.TWO_HANDED?n.TWO_HANDED.name:""}">\n    ${n.RIGHT_HAND?n.RIGHT_HAND.name:n.TWO_HANDED?n.TWO_HANDED.name:"R_HAND"}\n    </td>\n  </tr>\n  <tr>\n    <td>\n    </td>\n    <td style="background-image: url('${e}');" title="${n.LEGS?n.LEGS.name:""}">\n    ${n.LEGS?n.LEGS.name:"LEGS"}\n    </td>\n    <td>\n    </td>\n  </tr>\n  </table>\n  `}(t.inventory)}\n      <div id="extra-inventory-info">\n        ${T()}\n      </div>\n    </div>\n    <div id="inventory-section">\n      <nav class="filter">\n        <a href="#" data-filter="ARMOUR" class="${"ARMOUR"===e?"active":""}">Armour</a>\n        <a href="#" data-filter="WEAPON" class="${"WEAPON"===e?"active":""}">Weapons</a>\n        <a href="#" data-filter="SPELL" class="${"SPELL"===e?"active":""}">Spells</a>\n      </nav>\n      <div class="inventory-listing">\n        <div class="filter-result ${"ARMOUR"===e?"active":"hidden"}" id="filter_ARMOUR">\n          ${F(n.ARMOUR)}\n        </div>\n        <div class="filter-result ${"WEAPON"===e?"active":"hidden"}" id="filter_WEAPON">\n          ${F(n.WEAPON)}\n        </div>\n        <div class="filter-result ${"SPELL"===e?"active":"hidden"}" id="filter_SPELL">\n          ${F(n.SPELL)}\n        </div>\n      </div>\n    </div>\n  </div>\n  `;(0,c.default)("#inventory").html(r)})),(0,c.default)("body").on("click",".equip-item",(t=>{t.preventDefault(),t.stopPropagation();const e=(0,c.default)(t.target),n=e.data("id"),r=e.data("slot");w.emit("equip",{id:n,slot:r})})),(0,c.default)("body").on("click",".unequip-item",(t=>{t.preventDefault(),t.stopPropagation(),w.emit("unequip",{id:(0,c.default)(t.target).data("id")})})),C.on("renderMap",(function(t){return s(this,void 0,void 0,(function*(){if(!t&&b.has("currentMapHTML"))return void(0,c.default)("#map").html(b.get("currentMapHTML"));t||console.error("oh no.. this got triggered without any city data"),j(t.city.id);const e={SERVICES:[],STORES:[],EXPLORE:[]};t.locations.forEach((t=>{e[t.type].push(`<a href="#" class="city-emit-event" data-event="${t.event_name}" data-args="${t.id}">${t.name}</a>`)}));let n=`<h1>${t.city.name}</h1>\n  <div class="city-details">`;e.SERVICES.length&&(n+=`<div><h3>Services</h3>${e.SERVICES.join("<br>")}</div>`),e.STORES.length&&(n+=`<div><h3>Stores</h3>${e.STORES.join("<br>")}</div>`),e.EXPLORE.length&&(n+=`<div><h3>Explore</h3>${e.EXPLORE.join("<br>")}</div>`),n+=`\n    <div>\n      <h3>Travel</h3>\n      ${t.paths.map((t=>`<a href="#" class="city-emit-event" data-event="city:travel" data-args="${t.ending_city}">${t.ending_city_name}</a>`)).join("<br>")}\n    </div>\n  </div>\n  `,b.set("currentMapHTML",n),(0,c.default)("#map").html(n)}))})),w.on("city:stores",(t=>{let e=`<div class="shop-inventory-listing">\n  ${t.map((t=>function(t,e){const n=b.get("player");return`<div class="store-list">\n    <div>\n      <img src="https://via.placeholder.com/64x64">\n    </div>\n    <div class="details">\n      <div class="name">${t.name}${"TWO_HANDED"===t.equipment_slot?" (2H)":""}</div>\n      <div class="requirements">\n      ${t.requirements.level?P("LVL",t.requirements.level,n.level):""}\n      ${t.requirements.strength?P("STR",t.requirements.strength,n.strength):""}\n      ${t.requirements.constitution?P("CON",t.requirements.constitution,n.constitution):""}\n      ${t.requirements.dexterity?P("DEX",t.requirements.dexterity,n.dexterity):""}\n      ${t.requirements.intelligence?P("INT",t.requirements.intelligence,n.intelligence):""}\n      ${P("PRF",t.profession)}\n      </div>\n      <div class="stat-mods">\n      ${t.boosts.strength?$("STR",t.boosts.strength):""}\n      ${t.boosts.constitution?$("CON",t.boosts.constitution):""}\n      ${t.boosts.dexterity?$("DEX",t.boosts.dexterity):""}\n      ${t.boosts.intelligence?$("INT",t.boosts.intelligence):""}\n      ${t.boosts.damage?$(t.affectedSkills.includes("restoration_magic")?"HP":"DMG",t.boosts.damage):""}\n      ${t.boosts.damage_mitigation?$("MIT",t.boosts.damage_mitigation.toString())+"%":""}\n      ${["WEAPON","SPELL"].includes(t.type)?"":$("AP",t.maxAp.toString())}\n      </div>\n      ${t.hasOwnProperty("id")?`<div>${t.cost.toLocaleString()}G</div>`:""}\n    </div>\n    <div class="store-actions">\n      ${r=t,`<button type="button" class="purchase-item" data-id="${r.id}" data-type="${r.type}" data-equipment-slot="${r.equipment_slot}" data-cost="${r.cost}">Buy</button>`}\n    </div>\n    </div>`;var r}(t))).join("\n")}\n  </div>\n  `;(0,c.default)("#map").html(e)})),(0,c.default)("body").on("click",".purchase-item",(t=>{t.preventDefault(),t.stopPropagation();const e=b.get("player"),n=parseInt((0,c.default)(t.target).data("cost")),r=(0,c.default)(t.target).data("id");e.gold<n?C.emit("alert",[{type:"error",text:"You don't have enough gold!"}]):((0,c.default)(t.target).data("type"),w.emit("purchase",{id:r}))})),(0,c.default)("body").on("click",".emit-event",(t=>{const e=(0,c.default)(t.target),n=e.data("event"),r=e.data("args");console.log(`Sending event ${n}`,{args:r}),w.emit(n,{args:r})})),(0,c.default)("body").on("click",".city-emit-event",(t=>{const e=(0,c.default)(t.target),n=e.data("event"),r=e.data("args");console.log(`Sending event ${n}`,{args:r}),w.emit(n,{args:r})})),(0,c.default)("body").on("click",".emit-event-internal",(t=>{var e;const n=(0,c.default)(t.target),r=n.data("event"),i=null===(e=n.data("args"))||void 0===e?void 0:e.toString().split("|");console.log(`Trigger internal event [${r}]`),C.emit(r,i)})),w.on("explore:fights",(t=>{const e=b.get("last-selected-monster");if(t.length){let n=`<form id="fight-selector"><select id="monster-selector">\n    ${t.map((t=>`<option value="${t.id}" ${e==t.id?"selected":""}>${t.name}</option>`)).join("\n")}\n    </select> <button type="submit">Fight</button></option>`;(0,c.default)("#map").html(n)}})),C.on("tab:explore",(()=>s(void 0,void 0,void 0,(function*(){const t=b.get("state");if(b.get("player").hp<=0||!t.fight&&!t.travel){let e;(!b.has("currentMapHTML")||b.get("player").hp<=0)&&(e=yield f.http.get(`/city/${b.get("player").city_id}`)),C.emit("renderMap",[e,t.travel])}else t.fight?(j(t.closestTown),(0,c.default)("#map").html(R(t.fight))):t.travel&&C.emit("renderTravel",[t.travel])})))),C.on("renderTravel",(function(t){j(t.closestTown);let e='<button class="emit-event" data-event="travel:step">Keep Walking</button>';t.things.length?(e+=`<button class="emit-event-internal" data-event="startFight" data-args="${t.things[0].id}|travel">Fight</button>`,e+=`<p>You see a ${t.things[0].name}.</p>`):t.walkingText&&(e+=`<p>${t.walkingText}</p>`),(0,c.default)("#map").html(e)})),w.on("updatePlayer",(t=>{b.set("player",t),A()})),w.on("fight-over",(t=>{const{roundData:e,monsters:n}=t;b.set("player",e.player),A(),(0,c.default)("#map").html(R(e.monster));let r=e.roundDetails.map((t=>`<div>${t}</div>`));if("player"===e.winner&&(r.push(`<div>You defeated the ${e.monster.name}!</div>`),e.rewards.gold&&r.push(`<div>You gained ${e.rewards.gold} gold`),e.rewards.exp&&r.push(`<div>You gained ${e.rewards.exp} exp`),e.rewards.levelIncrease&&r.push(`<div>You gained a level! ${e.player.level}`)),0===e.player.hp)r.push("<p>You were killed...</p>"),r.push('<p><button class="emit-event-internal" data-event="tab:explore" data-args="">Back to Town</button></p>');else switch(e.fightTrigger){case"explore":if(n.length){const t=b.get("last-selected-monster");r.unshift(`<h2>Fight Again</h2><form id="fight-selector"><select id="monster-selector">\n            ${n.map((e=>`<option value="${e.id}" ${t==e.id?"selected":""}>${e.name}</option>`)).join("\n")}\n            </select> <button type="submit">Fight</button></option>\n          </select></form><hr>`)}break;case"travel":r.push('<p><button class="emit-event" data-event="travel:step">Keep Walking</button></p>');break;default:console.error(`Unknown fight trigger [${e.fightTrigger}]`,e)}(0,c.default)("#fight-results").html(r.join("\n")),(0,c.default)("#fight-actions").html("")})),w.on("fight-round",(t=>{(0,c.default)(".fight-action").prop("disabled",!1),b.set("player",t.player),A(),(0,c.default)("#map").html(R(t.monster)),(0,c.default)("#fight-results").html(t.roundDetails.map((t=>`<div>${t}</div>`)).join("\n"))})),C.on("startFight",M),(0,c.default)("body").on("submit","#fight-selector",(t=>s(void 0,void 0,void 0,(function*(){t.preventDefault(),t.stopPropagation();const e=(0,c.default)("#monster-selector option:selected").val();e?M(e.toString()):console.error(`Invalid monster id [${e}]`)})))),(0,c.default)("body").on("click",".fight-action",(t=>{t.preventDefault(),t.stopPropagation();const e=(0,c.default)(t.target).data("action"),n=(0,c.default)("#fight-target option:selected").val();(0,c.default)(".fight-action").prop("disabled",!0),w.emit("fight",{action:e,target:n})})),(0,c.default)("body").on("submit","#signup",(t=>s(void 0,void 0,void 0,(function*(){t.preventDefault(),t.stopPropagation();const e={};(0,c.default)(t.target).serializeArray().forEach((t=>e[t.name]=t.value));const n=yield f.http.post("/signup",e);n.error?C.emit("alert",[{type:"error",text:n.error}]):(b.set("player",n.player),A(),(0,c.default)("#signup-prompt").remove())})))),(0,c.default)("body").on("click","#login",(t=>s(void 0,void 0,void 0,(function*(){t.preventDefault(),t.stopPropagation();const e={};if((0,c.default)(t.target).closest("form").serializeArray().forEach((t=>e[t.name]=t.value)),e.username&&e.password){const t=yield f.http.post("/login",e);t.error?C.emit("alert",[{type:"error",text:t.error}]):(localStorage.setItem("authToken",t.player.id),window.location.reload())}})))),(0,c.default)("body").on("click","#logout",(t=>s(void 0,void 0,void 0,(function*(){t.preventDefault(),t.stopPropagation();let e=!1;const n=b.get("player");e=!/^Player[\d]+$/.test(n.username)||!!confirm("Are you sure? You will not be able to retrieve this character unless you set up an email/password"),e&&(w.emit("logout"),localStorage.clear(),window.location.reload())}))))},1916:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SocketEvent=void 0,e.SocketEvent=class{constructor(t,e){this.eventName=t,this.handler=e}}},7355:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(5127),e),i(n(6041),e),i(n(9261),e)},9261:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.displayHealerDetauls=void 0;const i=n(1916),o=r(n(3336));e.displayHealerDetauls=new i.SocketEvent("city:service:healer",((t,e)=>{(0,o.default)("#map").html(e.text)}))},5127:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.professionChangeRogue=e.professionChangeMage=e.professionChangeWarrior=e.professionRecruiter=void 0;const i=n(1916),o=r(n(3336)),s=n(9554);function a(t,e){(0,o.default)("#map").html(e.text)}e.professionRecruiter=new i.SocketEvent(s.EVENT_NAME,a),e.professionChangeWarrior=new i.SocketEvent(`${s.EVENT_NAME}:warrior`,a),e.professionChangeMage=new i.SocketEvent(`${s.EVENT_NAME}:mage`,a),e.professionChangeRogue=new i.SocketEvent(`${s.EVENT_NAME}:rogue`,a)},9554:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EVENT_NAME=void 0,e.EVENT_NAME="city:services:profession_recruitor_windcross"},6041:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.renderCity=e.travel=void 0;const i=n(1916);e.travel=new i.SocketEvent("city:travel",((t,e)=>{t.events.emit("renderTravel",[e])})),e.renderCity=new i.SocketEvent("city:display",((t,e)=>r(void 0,void 0,void 0,(function*(){t.cache.delete("currentMapHTML"),t.events.emit("renderMap",[e])}))))},4738:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StatDef=e.expToLevel=e.maxHp=void 0;const r=n(1407);e.maxHp=function(t,e){return Math.ceil(1.3*(t+e))},e.expToLevel=function(t){return t<10?10*t-10:13*t},e.StatDef=new Map,e.StatDef.set(r.Stat.strength,{id:r.Stat.strength,display:"Strength",abbrv:"STR"}),e.StatDef.set(r.Stat.constitution,{id:r.Stat.constitution,display:"Constitution",abbrv:"CON"}),e.StatDef.set(r.Stat.dexterity,{id:r.Stat.dexterity,display:"Dexterity",abbrv:"DEX"}),e.StatDef.set(r.Stat.intelligence,{id:r.Stat.intelligence,display:"Intelligence",abbrv:"INT"})},9502:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Skills=void 0,e.Skills=new Map,e.Skills.set("bladed",{id:"bladed",display:"Bladed Weapon Mastery",description:"Improves Bladed Weapon damage",effect:t=>t.level/100,expToLevel:t=>1e3*t}),e.Skills.set("blunt",{id:"blunt",display:"Blunt Weapons Mastery",description:"Improves Blunt Weapon damage",effect:t=>t.level/100,expToLevel:t=>1e3*t}),e.Skills.set("destruction_magic",{id:"destruction_magic",display:"Destruction Magic Mastery",description:"Improves Destruction Magic damage",effect:t=>t.level/100,expToLevel:t=>1e3*t}),e.Skills.set("restoration_magic",{id:"restoration_magic",display:"Restoration Magic Mastery",description:"Improves effectiveness of Restoration Magic",effect:t=>t.level/100,expToLevel:t=>1e3*t}),e.Skills.set("one_handed_mastery",{id:"one_handed_mastery",display:"One Handed Weapon Mastery",description:"Improves effectiveness when fighting using one-handed weapons",effect:t=>t.level/100,expToLevel:t=>1e3*t}),e.Skills.set("two_handed_mastery",{id:"two_handed_mastery",display:"Two Handed Weapon Mastery",description:"Improves effectiveness when fighting using two-handed weapons",effect:t=>t.level/100,expToLevel:t=>1e3*t})},1407:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.Stat=void 0,(n=e.Stat||(e.Stat={})).strength="strength",n.constitution="constitution",n.dexterity="dexterity",n.intelligence="intelligence"},8182:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TimeManager=void 0,e.TimeManager=class{constructor(t=60){this.dayLength=t,this.scaleFactor=30,this.dayLengthAsMS=60*t*1e3}dayScaleFactor(){return this.dayLength/30}getTimePeriod(){return this.isDawn()?"dawn":this.isMorning()?"morning":this.isAfternoon()?"afternoon":this.isEvening()?"evening":this.isNight()?"night":void 0}now(){return Math.floor((new Date).getMinutes()/this.dayScaleFactor())}gradientName(){const t=this.now();return`sky-gradient-${t<10?"0":""}${t}`}isNight(){const t=this.now();return t>=0&&t<=5||t>=26&&t<=29}isDawn(){const t=this.now();return t>=6&&t<=10}isMorning(){const t=this.now();return t>=11&&t<=15}isAfternoon(){const t=this.now();return t>=16&&t<=20}isEvening(){const t=this.now();return t>=21&&t<=25}}},7429:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NIL",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"v1",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"v3",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"v4",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"v5",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"validate",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return u.default}});var r=h(n(3990)),i=h(n(8237)),o=h(n(5355)),s=h(n(3764)),a=h(n(6314)),u=h(n(8464)),c=h(n(6435)),l=h(n(4008)),f=h(n(8222));function h(t){return t&&t.__esModule?t:{default:t}}},4163:(t,e)=>{"use strict";function n(t){return 14+(t+64>>>9<<4)+1}function r(t,e){const n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function i(t,e,n,i,o,s){return r((a=r(r(e,t),r(i,s)))<<(u=o)|a>>>32-u,n);var a,u}function o(t,e,n,r,o,s,a){return i(e&n|~e&r,t,e,o,s,a)}function s(t,e,n,r,o,s,a){return i(e&r|n&~r,t,e,o,s,a)}function a(t,e,n,r,o,s,a){return i(e^n^r,t,e,o,s,a)}function u(t,e,n,r,o,s,a){return i(n^(e|~r),t,e,o,s,a)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=function(t){if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n)}return function(t){const e=[],n=32*t.length,r="0123456789abcdef";for(let i=0;i<n;i+=8){const n=t[i>>5]>>>i%32&255,o=parseInt(r.charAt(n>>>4&15)+r.charAt(15&n),16);e.push(o)}return e}(function(t,e){t[e>>5]|=128<<e%32,t[n(e)-1]=e;let i=1732584193,c=-271733879,l=-1732584194,f=271733878;for(let e=0;e<t.length;e+=16){const n=i,h=c,d=l,p=f;i=o(i,c,l,f,t[e],7,-680876936),f=o(f,i,c,l,t[e+1],12,-389564586),l=o(l,f,i,c,t[e+2],17,606105819),c=o(c,l,f,i,t[e+3],22,-1044525330),i=o(i,c,l,f,t[e+4],7,-176418897),f=o(f,i,c,l,t[e+5],12,1200080426),l=o(l,f,i,c,t[e+6],17,-1473231341),c=o(c,l,f,i,t[e+7],22,-45705983),i=o(i,c,l,f,t[e+8],7,1770035416),f=o(f,i,c,l,t[e+9],12,-1958414417),l=o(l,f,i,c,t[e+10],17,-42063),c=o(c,l,f,i,t[e+11],22,-1990404162),i=o(i,c,l,f,t[e+12],7,1804603682),f=o(f,i,c,l,t[e+13],12,-40341101),l=o(l,f,i,c,t[e+14],17,-1502002290),c=o(c,l,f,i,t[e+15],22,1236535329),i=s(i,c,l,f,t[e+1],5,-165796510),f=s(f,i,c,l,t[e+6],9,-1069501632),l=s(l,f,i,c,t[e+11],14,643717713),c=s(c,l,f,i,t[e],20,-373897302),i=s(i,c,l,f,t[e+5],5,-701558691),f=s(f,i,c,l,t[e+10],9,38016083),l=s(l,f,i,c,t[e+15],14,-660478335),c=s(c,l,f,i,t[e+4],20,-405537848),i=s(i,c,l,f,t[e+9],5,568446438),f=s(f,i,c,l,t[e+14],9,-1019803690),l=s(l,f,i,c,t[e+3],14,-187363961),c=s(c,l,f,i,t[e+8],20,1163531501),i=s(i,c,l,f,t[e+13],5,-1444681467),f=s(f,i,c,l,t[e+2],9,-51403784),l=s(l,f,i,c,t[e+7],14,1735328473),c=s(c,l,f,i,t[e+12],20,-1926607734),i=a(i,c,l,f,t[e+5],4,-378558),f=a(f,i,c,l,t[e+8],11,-2022574463),l=a(l,f,i,c,t[e+11],16,1839030562),c=a(c,l,f,i,t[e+14],23,-35309556),i=a(i,c,l,f,t[e+1],4,-1530992060),f=a(f,i,c,l,t[e+4],11,1272893353),l=a(l,f,i,c,t[e+7],16,-155497632),c=a(c,l,f,i,t[e+10],23,-1094730640),i=a(i,c,l,f,t[e+13],4,681279174),f=a(f,i,c,l,t[e],11,-358537222),l=a(l,f,i,c,t[e+3],16,-722521979),c=a(c,l,f,i,t[e+6],23,76029189),i=a(i,c,l,f,t[e+9],4,-640364487),f=a(f,i,c,l,t[e+12],11,-421815835),l=a(l,f,i,c,t[e+15],16,530742520),c=a(c,l,f,i,t[e+2],23,-995338651),i=u(i,c,l,f,t[e],6,-198630844),f=u(f,i,c,l,t[e+7],10,1126891415),l=u(l,f,i,c,t[e+14],15,-1416354905),c=u(c,l,f,i,t[e+5],21,-57434055),i=u(i,c,l,f,t[e+12],6,1700485571),f=u(f,i,c,l,t[e+3],10,-1894986606),l=u(l,f,i,c,t[e+10],15,-1051523),c=u(c,l,f,i,t[e+1],21,-2054922799),i=u(i,c,l,f,t[e+8],6,1873313359),f=u(f,i,c,l,t[e+15],10,-30611744),l=u(l,f,i,c,t[e+6],15,-1560198380),c=u(c,l,f,i,t[e+13],21,1309151649),i=u(i,c,l,f,t[e+4],6,-145523070),f=u(f,i,c,l,t[e+11],10,-1120210379),l=u(l,f,i,c,t[e+2],15,718787259),c=u(c,l,f,i,t[e+9],21,-343485551),i=r(i,n),c=r(c,h),l=r(l,d),f=r(f,p)}return[i,c,l,f]}(function(t){if(0===t.length)return[];const e=8*t.length,r=new Uint32Array(n(e));for(let n=0;n<e;n+=8)r[n>>5]|=(255&t[n/8])<<n%32;return r}(t),8*t.length))}},4790:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};e.default=n},6314:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default="00000000-0000-0000-0000-000000000000"},8222:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(6435))&&r.__esModule?r:{default:r};e.default=function(t){if(!(0,i.default)(t))throw TypeError("Invalid UUID");let e;const n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n}},58:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},3319:(t,e)=>{"use strict";let n;Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(r)};const r=new Uint8Array(16)},3757:(t,e)=>{"use strict";function n(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:case 3:return e^n^r;case 2:return e&n^e&r^n&r}}function r(t,e){return t<<e|t>>>32-e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=function(t){const e=[1518500249,1859775393,2400959708,3395469782],i=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);const o=t.length/4+2,s=Math.ceil(o/16),a=new Array(s);for(let e=0;e<s;++e){const n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=t[64*e+4*r]<<24|t[64*e+4*r+1]<<16|t[64*e+4*r+2]<<8|t[64*e+4*r+3];a[e]=n}a[s-1][14]=8*(t.length-1)/Math.pow(2,32),a[s-1][14]=Math.floor(a[s-1][14]),a[s-1][15]=8*(t.length-1)&4294967295;for(let t=0;t<s;++t){const o=new Uint32Array(80);for(let e=0;e<16;++e)o[e]=a[t][e];for(let t=16;t<80;++t)o[t]=r(o[t-3]^o[t-8]^o[t-14]^o[t-16],1);let s=i[0],u=i[1],c=i[2],l=i[3],f=i[4];for(let t=0;t<80;++t){const i=Math.floor(t/20),a=r(s,5)+n(i,u,c,l)+f+e[i]+o[t]>>>0;f=l,l=c,c=r(u,30)>>>0,u=s,s=a}i[0]=i[0]+s>>>0,i[1]=i[1]+u>>>0,i[2]=i[2]+c>>>0,i[3]=i[3]+l>>>0,i[4]=i[4]+f>>>0}return[i[0]>>24&255,i[0]>>16&255,i[0]>>8&255,255&i[0],i[1]>>24&255,i[1]>>16&255,i[1]>>8&255,255&i[1],i[2]>>24&255,i[2]>>16&255,i[2]>>8&255,255&i[2],i[3]>>24&255,i[3]>>16&255,i[3]>>8&255,255&i[3],i[4]>>24&255,i[4]>>16&255,i[4]>>8&255,255&i[4]]}},4008:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.unsafeStringify=s;var r,i=(r=n(6435))&&r.__esModule?r:{default:r};const o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));function s(t,e=0){return(o[t[e+0]]+o[t[e+1]]+o[t[e+2]]+o[t[e+3]]+"-"+o[t[e+4]]+o[t[e+5]]+"-"+o[t[e+6]]+o[t[e+7]]+"-"+o[t[e+8]]+o[t[e+9]]+"-"+o[t[e+10]]+o[t[e+11]]+o[t[e+12]]+o[t[e+13]]+o[t[e+14]]+o[t[e+15]]).toLowerCase()}e.default=function(t,e=0){const n=s(t,e);if(!(0,i.default)(n))throw TypeError("Stringified UUID is invalid");return n}},3990:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(3319))&&r.__esModule?r:{default:r},o=n(4008);let s,a,u=0,c=0;e.default=function(t,e,n){let r=e&&n||0;const l=e||new Array(16);let f=(t=t||{}).node||s,h=void 0!==t.clockseq?t.clockseq:a;if(null==f||null==h){const e=t.random||(t.rng||i.default)();null==f&&(f=s=[1|e[0],e[1],e[2],e[3],e[4],e[5]]),null==h&&(h=a=16383&(e[6]<<8|e[7]))}let d=void 0!==t.msecs?t.msecs:Date.now(),p=void 0!==t.nsecs?t.nsecs:c+1;const g=d-u+(p-c)/1e4;if(g<0&&void 0===t.clockseq&&(h=h+1&16383),(g<0||d>u)&&void 0===t.nsecs&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");u=d,c=p,a=h,d+=122192928e5;const v=(1e4*(268435455&d)+p)%4294967296;l[r++]=v>>>24&255,l[r++]=v>>>16&255,l[r++]=v>>>8&255,l[r++]=255&v;const y=d/4294967296*1e4&268435455;l[r++]=y>>>8&255,l[r++]=255&y,l[r++]=y>>>24&15|16,l[r++]=y>>>16&255,l[r++]=h>>>8|128,l[r++]=255&h;for(let t=0;t<6;++t)l[r+t]=f[t];return e||(0,o.unsafeStringify)(l)}},8237:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=o(n(7925)),i=o(n(4163));function o(t){return t&&t.__esModule?t:{default:t}}var s=(0,r.default)("v3",48,i.default);e.default=s},7925:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.URL=e.DNS=void 0,e.default=function(t,e,n){function r(t,r,s,a){var u;if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));const e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e}(t)),"string"==typeof r&&(r=(0,o.default)(r)),16!==(null===(u=r)||void 0===u?void 0:u.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+t.length);if(c.set(r),c.set(t,r.length),c=n(c),c[6]=15&c[6]|e,c[8]=63&c[8]|128,s){a=a||0;for(let t=0;t<16;++t)s[a+t]=c[t];return s}return(0,i.unsafeStringify)(c)}try{r.name=t}catch(t){}return r.DNS=s,r.URL=a,r};var r,i=n(4008),o=(r=n(8222))&&r.__esModule?r:{default:r};const s="6ba7b810-9dad-11d1-80b4-00c04fd430c8";e.DNS=s;const a="6ba7b811-9dad-11d1-80b4-00c04fd430c8";e.URL=a},5355:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=s(n(4790)),i=s(n(3319)),o=n(4008);function s(t){return t&&t.__esModule?t:{default:t}}e.default=function(t,e,n){if(r.default.randomUUID&&!e&&!t)return r.default.randomUUID();const s=(t=t||{}).random||(t.rng||i.default)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=s[t];return e}return(0,o.unsafeStringify)(s)}},3764:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=o(n(7925)),i=o(n(3757));function o(t){return t&&t.__esModule?t:{default:t}}var s=(0,r.default)("v5",80,i.default);e.default=s},6435:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(58))&&r.__esModule?r:{default:r};e.default=function(t){return"string"==typeof t&&i.default.test(t)}},8464:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(6435))&&r.__esModule?r:{default:r};e.default=function(t){if(!(0,i.default)(t))throw TypeError("Invalid UUID");return parseInt(t.slice(14,15),16)}},3336:t=>{"use strict";t.exports=$},8419:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hasCORS=void 0;let n=!1;try{n="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){}e.hasCORS=n},5754:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decode=e.encode=void 0,e.encode=function(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e},e.decode=function(t){let e={},n=t.split("&");for(let t=0,r=n.length;t<r;t++){let r=n[t].split("=");e[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return e}},5222:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parse=void 0;const n=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];e.parse=function(t){const e=t,i=t.indexOf("["),o=t.indexOf("]");-1!=i&&-1!=o&&(t=t.substring(0,i)+t.substring(i,o).replace(/:/g,";")+t.substring(o,t.length));let s=n.exec(t||""),a={},u=14;for(;u--;)a[r[u]]=s[u]||"";return-1!=i&&-1!=o&&(a.source=e,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=function(t,e){const n=e.replace(/\/{2,9}/g,"/").split("/");return"/"!=e.slice(0,1)&&0!==e.length||n.splice(0,1),"/"==e.slice(-1)&&n.splice(n.length-1,1),n}(0,a.path),a.queryKey=function(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(t,e,r){e&&(n[e]=r)})),n}(0,a.query),a}},8726:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.yeast=e.decode=e.encode=void 0;const n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),r={};let i,o=0,s=0;function a(t){let e="";do{e=n[t%64]+e,t=Math.floor(t/64)}while(t>0);return e}for(e.encode=a,e.decode=function(t){let e=0;for(s=0;s<t.length;s++)e=64*e+r[t.charAt(s)];return e},e.yeast=function(){const t=a(+new Date);return t!==i?(o=0,i=t):t+"."+a(o++)};s<64;s++)r[n[s]]=s},6242:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.globalThisShim=void 0,e.globalThisShim="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")()},4679:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.nextTick=e.parse=e.installTimerFunctions=e.transports=e.Transport=e.protocol=e.Socket=void 0;const r=n(3481);Object.defineProperty(e,"Socket",{enumerable:!0,get:function(){return r.Socket}}),e.protocol=r.Socket.protocol;var i=n(9870);Object.defineProperty(e,"Transport",{enumerable:!0,get:function(){return i.Transport}});var o=n(7385);Object.defineProperty(e,"transports",{enumerable:!0,get:function(){return o.transports}});var s=n(9622);Object.defineProperty(e,"installTimerFunctions",{enumerable:!0,get:function(){return s.installTimerFunctions}});var a=n(5222);Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return a.parse}});var u=n(5552);Object.defineProperty(e,"nextTick",{enumerable:!0,get:function(){return u.nextTick}})},3481:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Socket=void 0;const i=n(7385),o=n(9622),s=n(5754),a=n(5222),u=r(n(4802)),c=n(5260),l=n(1373),f=(0,u.default)("engine.io-client:socket");class h extends c.Emitter{constructor(t,e={}){super(),this.writeBuffer=[],t&&"object"==typeof t&&(e=t,t=null),t?(t=(0,a.parse)(t),e.hostname=t.host,e.secure="https"===t.protocol||"wss"===t.protocol,e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=(0,a.parse)(e.host).host),(0,o.installTimerFunctions)(this,e),this.secure=null!=e.secure?e.secure:"undefined"!=typeof location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=e.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=e.transports||["polling","websocket"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},e),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=(0,s.decode)(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){f('creating transport "%s"',t);const e=Object.assign({},this.opts.query);e.EIO=l.protocol,e.transport=t,this.id&&(e.sid=this.id);const n=Object.assign({},this.opts.transportOptions[t],this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return f("options: %j",n),new i.transports[t](n)}open(){let t;if(this.opts.rememberUpgrade&&h.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(t){return f("error while creating transport: %s",t),this.transports.shift(),void this.open()}t.open(),this.setTransport(t)}setTransport(t){f("setting transport %s",t.name),this.transport&&(f("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(t=>this.onClose("transport close",t)))}probe(t){f('probing transport "%s"',t);let e=this.createTransport(t),n=!1;h.priorWebsocketSuccess=!1;const r=()=>{n||(f('probe transport "%s" opened',t),e.send([{type:"ping",data:"probe"}]),e.once("packet",(r=>{if(!n)if("pong"===r.type&&"probe"===r.data){if(f('probe transport "%s" pong',t),this.upgrading=!0,this.emitReserved("upgrading",e),!e)return;h.priorWebsocketSuccess="websocket"===e.name,f('pausing current transport "%s"',this.transport.name),this.transport.pause((()=>{n||"closed"!==this.readyState&&(f("changing transport and sending upgrade packet"),c(),this.setTransport(e),e.send([{type:"upgrade"}]),this.emitReserved("upgrade",e),e=null,this.upgrading=!1,this.flush())}))}else{f('probe transport "%s" failed',t);const n=new Error("probe error");n.transport=e.name,this.emitReserved("upgradeError",n)}})))};function i(){n||(n=!0,c(),e.close(),e=null)}const o=n=>{const r=new Error("probe error: "+n);r.transport=e.name,i(),f('probe transport "%s" failed because of error: %s',t,n),this.emitReserved("upgradeError",r)};function s(){o("transport closed")}function a(){o("socket closed")}function u(t){e&&t.name!==e.name&&(f('"%s" works - aborting "%s"',t.name,e.name),i())}const c=()=>{e.removeListener("open",r),e.removeListener("error",o),e.removeListener("close",s),this.off("close",a),this.off("upgrading",u)};e.once("open",r),e.once("error",o),e.once("close",s),this.once("close",a),this.once("upgrading",u),e.open()}onOpen(){if(f("socket open"),this.readyState="open",h.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade){f("starting upgrade probes");let t=0;const e=this.upgrades.length;for(;t<e;t++)this.probe(this.upgrades[t])}}onPacket(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(f('socket receive: type "%s", data "%s"',t.type,t.data),this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data)}else f('packet received with socket readyState "%s"',this.readyState)}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((()=>{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();f("flushing %d packets in socket",t.length),this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let e=0;e<this.writeBuffer.length;e++){const n=this.writeBuffer[e].data;if(n&&(t+=(0,o.byteLength)(n)),e>0&&t>this.maxPayload)return f("only send %d out of %d packets",e,this.writeBuffer.length),this.writeBuffer.slice(0,e);t+=2}return f("payload size is %d (max: %d)",t,this.maxPayload),this.writeBuffer}write(t,e,n){return this.sendPacket("message",t,e,n),this}send(t,e,n){return this.sendPacket("message",t,e,n),this}sendPacket(t,e,n,r){if("function"==typeof e&&(r=e,e=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const i={type:t,data:e,options:n};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),r&&this.once("flush",r),this.flush()}close(){const t=()=>{this.onClose("forced close"),f("socket closing - telling transport to close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),t()},n=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():t()})):this.upgrading?n():t()),this}onError(t){f("socket error %j",t),h.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,e){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(f('socket close with reason: "%s"',t),this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,e),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const e=[];let n=0;const r=t.length;for(;n<r;n++)~this.transports.indexOf(t[n])&&e.push(t[n]);return e}}e.Socket=h,h.protocol=l.protocol},9870:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Transport=void 0;const i=n(1373),o=n(5260),s=n(9622),a=(0,r(n(4802)).default)("engine.io-client:transport");class u extends Error{constructor(t,e,n){super(t),this.description=e,this.context=n,this.type="TransportError"}}class c extends o.Emitter{constructor(t){super(),this.writable=!1,(0,s.installTimerFunctions)(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,e,n){return super.emitReserved("error",new u(t,e,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(t){"open"===this.readyState?this.write(t):a("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const e=(0,i.decodePacket)(t,this.socket.binaryType);this.onPacket(e)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}}e.Transport=c},7385:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.transports=void 0;const r=n(484),i=n(1308);e.transports={websocket:i.WS,polling:r.Polling}},484:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Request=e.Polling=void 0;const i=n(9870),o=r(n(4802)),s=n(8726),a=n(5754),u=n(1373),c=n(6666),l=n(5260),f=n(9622),h=n(6242),d=(0,o.default)("engine.io-client:polling");function p(){}const g=null!=new c.XHR({xdomain:!1}).responseType;class v extends i.Transport{constructor(t){if(super(t),this.polling=!1,"undefined"!=typeof location){const e="https:"===location.protocol;let n=location.port;n||(n=e?"443":"80"),this.xd="undefined"!=typeof location&&t.hostname!==location.hostname||n!==t.port,this.xs=t.secure!==e}const e=t&&t.forceBase64;this.supportsBinary=g&&!e}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const e=()=>{d("paused"),this.readyState="paused",t()};if(this.polling||!this.writable){let t=0;this.polling&&(d("we are currently polling - waiting to pause"),t++,this.once("pollComplete",(function(){d("pre-pause polling complete"),--t||e()}))),this.writable||(d("we are currently writing - waiting to pause"),t++,this.once("drain",(function(){d("pre-pause writing complete"),--t||e()})))}else e()}poll(){d("polling"),this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){d("polling got data %s",t),(0,u.decodePayload)(t,this.socket.binaryType).forEach((t=>{if("opening"===this.readyState&&"open"===t.type&&this.onOpen(),"close"===t.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(t)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState?this.poll():d('ignoring poll - transport state "%s"',this.readyState))}doClose(){const t=()=>{d("writing close packet"),this.write([{type:"close"}])};"open"===this.readyState?(d("transport open - closing"),t()):(d("transport not open - deferring close"),this.once("open",t))}write(t){this.writable=!1,(0,u.encodePayload)(t,(t=>{this.doWrite(t,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){let t=this.query||{};const e=this.opts.secure?"https":"http";let n="";!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=(0,s.yeast)()),this.supportsBinary||t.sid||(t.b64=1),this.opts.port&&("https"===e&&443!==Number(this.opts.port)||"http"===e&&80!==Number(this.opts.port))&&(n=":"+this.opts.port);const r=(0,a.encode)(t);return e+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new y(this.uri(),t)}doWrite(t,e){const n=this.request({method:"POST",data:t});n.on("success",e),n.on("error",((t,e)=>{this.onError("xhr post error",t,e)}))}doPoll(){d("xhr poll");const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",((t,e)=>{this.onError("xhr poll error",t,e)})),this.pollXhr=t}}e.Polling=v;class y extends l.Emitter{constructor(t,e){super(),(0,f.installTimerFunctions)(this,e),this.opts=e,this.method=e.method||"GET",this.uri=t,this.async=!1!==e.async,this.data=void 0!==e.data?e.data:null,this.create()}create(){const t=(0,f.pick)(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const e=this.xhr=new c.XHR(t);try{d("xhr open %s: %s",this.method,this.uri),e.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){e.setDisableHeaderCheck&&e.setDisableHeaderCheck(!0);for(let t in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(t)&&e.setRequestHeader(t,this.opts.extraHeaders[t])}}catch(t){}if("POST"===this.method)try{e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{e.setRequestHeader("Accept","*/*")}catch(t){}"withCredentials"in e&&(e.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(e.timeout=this.opts.requestTimeout),e.onreadystatechange=()=>{4===e.readyState&&(200===e.status||1223===e.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof e.status?e.status:0)}),0))},d("xhr data %s",this.data),e.send(this.data)}catch(t){return void this.setTimeoutFn((()=>{this.onError(t)}),0)}"undefined"!=typeof document&&(this.index=y.requestsCount++,y.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=p,t)try{this.xhr.abort()}catch(t){}"undefined"!=typeof document&&delete y.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;null!==t&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(e.Request=y,y.requestsCount=0,y.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",m);else if("function"==typeof addEventListener){const t="onpagehide"in h.globalThisShim?"pagehide":"unload";addEventListener(t,m,!1)}function m(){for(let t in y.requests)y.requests.hasOwnProperty(t)&&y.requests[t].abort()}},5552:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defaultBinaryType=e.usingBrowserWebSocket=e.WebSocket=e.nextTick=void 0;const r=n(6242);e.nextTick="function"==typeof Promise&&"function"==typeof Promise.resolve?t=>Promise.resolve().then(t):(t,e)=>e(t,0),e.WebSocket=r.globalThisShim.WebSocket||r.globalThisShim.MozWebSocket,e.usingBrowserWebSocket=!0,e.defaultBinaryType="arraybuffer"},1308:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.WS=void 0;const i=n(9870),o=n(5754),s=n(8726),a=n(9622),u=n(5552),c=r(n(4802)),l=n(1373),f=(0,c.default)("engine.io-client:websocket"),h="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class d extends i.Transport{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),e=this.opts.protocols,n=h?{}:(0,a.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=u.usingBrowserWebSocket&&!h?e?new u.WebSocket(t,e):new u.WebSocket(t):new u.WebSocket(t,e,n)}catch(t){return this.emitReserved("error",t)}this.ws.binaryType=this.socket.binaryType||u.defaultBinaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let e=0;e<t.length;e++){const n=t[e],r=e===t.length-1;(0,l.encodePacket)(n,this.supportsBinary,(t=>{const e={};!u.usingBrowserWebSocket&&(n.options&&(e.compress=n.options.compress),this.opts.perMessageDeflate)&&("string"==typeof t?Buffer.byteLength(t):t.length)<this.opts.perMessageDeflate.threshold&&(e.compress=!1);try{u.usingBrowserWebSocket?this.ws.send(t):this.ws.send(t,e)}catch(t){f("websocket closed before onclose event")}r&&(0,u.nextTick)((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const e=this.opts.secure?"wss":"ws";let n="";this.opts.port&&("wss"===e&&443!==Number(this.opts.port)||"ws"===e&&80!==Number(this.opts.port))&&(n=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=(0,s.yeast)()),this.supportsBinary||(t.b64=1);const r=(0,o.encode)(t);return e+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}check(){return!!u.WebSocket}}e.WS=d},6666:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.XHR=void 0;const r=n(8419),i=n(6242);e.XHR=function(t){const e=t.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!e||r.hasCORS))return new XMLHttpRequest}catch(t){}if(!e)try{return new(i.globalThisShim[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}},9622:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.byteLength=e.installTimerFunctions=e.pick=void 0;const r=n(6242);e.pick=function(t,...e){return e.reduce(((e,n)=>(t.hasOwnProperty(n)&&(e[n]=t[n]),e)),{})};const i=r.globalThisShim.setTimeout,o=r.globalThisShim.clearTimeout;e.installTimerFunctions=function(t,e){e.useNativeTimers?(t.setTimeoutFn=i.bind(r.globalThisShim),t.clearTimeoutFn=o.bind(r.globalThisShim)):(t.setTimeoutFn=r.globalThisShim.setTimeout.bind(r.globalThisShim),t.clearTimeoutFn=r.globalThisShim.clearTimeout.bind(r.globalThisShim))},e.byteLength=function(t){return"string"==typeof t?function(t){let e=0,n=0;for(let r=0,i=t.length;r<i;r++)e=t.charCodeAt(r),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}(t):Math.ceil(1.33*(t.byteLength||t.size))}},3087:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ERROR_PACKET=e.PACKET_TYPES_REVERSE=e.PACKET_TYPES=void 0;const n=Object.create(null);e.PACKET_TYPES=n,n.open="0",n.close="1",n.ping="2",n.pong="3",n.message="4",n.upgrade="5",n.noop="6";const r=Object.create(null);e.PACKET_TYPES_REVERSE=r,Object.keys(n).forEach((t=>{r[n[t]]=t})),e.ERROR_PACKET={type:"error",data:"parser error"}},2469:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decode=e.encode=void 0;const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let t=0;t<64;t++)r[n.charCodeAt(t)]=t;e.encode=t=>{let e,r=new Uint8Array(t),i=r.length,o="";for(e=0;e<i;e+=3)o+=n[r[e]>>2],o+=n[(3&r[e])<<4|r[e+1]>>4],o+=n[(15&r[e+1])<<2|r[e+2]>>6],o+=n[63&r[e+2]];return i%3==2?o=o.substring(0,o.length-1)+"=":i%3==1&&(o=o.substring(0,o.length-2)+"=="),o},e.decode=t=>{let e,n,i,o,s,a=.75*t.length,u=t.length,c=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);const l=new ArrayBuffer(a),f=new Uint8Array(l);for(e=0;e<u;e+=4)n=r[t.charCodeAt(e)],i=r[t.charCodeAt(e+1)],o=r[t.charCodeAt(e+2)],s=r[t.charCodeAt(e+3)],f[c++]=n<<2|i>>4,f[c++]=(15&i)<<4|o>>2,f[c++]=(3&o)<<6|63&s;return l}},7572:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(3087),i=n(2469),o="function"==typeof ArrayBuffer,s=(t,e)=>{if(o){const n=(0,i.decode)(t);return a(n,e)}return{base64:!0,data:t}},a=(t,e)=>"blob"===e&&t instanceof ArrayBuffer?new Blob([t]):t;e.default=(t,e)=>{if("string"!=typeof t)return{type:"message",data:a(t,e)};const n=t.charAt(0);return"b"===n?{type:"message",data:s(t.substring(1),e)}:r.PACKET_TYPES_REVERSE[n]?t.length>1?{type:r.PACKET_TYPES_REVERSE[n],data:t.substring(1)}:{type:r.PACKET_TYPES_REVERSE[n]}:r.ERROR_PACKET}},3908:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(3087),i="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),o="function"==typeof ArrayBuffer,s=(t,e)=>{const n=new FileReader;return n.onload=function(){const t=n.result.split(",")[1];e("b"+(t||""))},n.readAsDataURL(t)};e.default=({type:t,data:e},n,a)=>{return i&&e instanceof Blob?n?a(e):s(e,a):o&&(e instanceof ArrayBuffer||(u=e,"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(u):u&&u.buffer instanceof ArrayBuffer))?n?a(e):s(new Blob([e]),a):a(r.PACKET_TYPES[t]+(e||""));var u}},1373:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodePayload=e.decodePacket=e.encodePayload=e.encodePacket=e.protocol=void 0;const r=n(3908);e.encodePacket=r.default;const i=n(7572);e.decodePacket=i.default;const o=String.fromCharCode(30);e.encodePayload=(t,e)=>{const n=t.length,i=new Array(n);let s=0;t.forEach(((t,a)=>{(0,r.default)(t,!1,(t=>{i[a]=t,++s===n&&e(i.join(o))}))}))},e.decodePayload=(t,e)=>{const n=t.split(o),r=[];for(let t=0;t<n.length;t++){const o=(0,i.default)(n[t],e);if(r.push(o),"error"===o.type)break}return r},e.protocol=4},5159:(t,e)=>{"use strict";function n(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Object.defineProperty(e,"__esModule",{value:!0}),e.Backoff=void 0,e.Backoff=n,n.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-n:t+n}return 0|Math.min(t,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(t){this.ms=t},n.prototype.setMax=function(t){this.max=t},n.prototype.setJitter=function(t){this.jitter=t}},7046:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.connect=e.io=e.Socket=e.Manager=e.protocol=void 0;const i=n(3084),o=n(4168);Object.defineProperty(e,"Manager",{enumerable:!0,get:function(){return o.Manager}});const s=n(8312);Object.defineProperty(e,"Socket",{enumerable:!0,get:function(){return s.Socket}});const a=r(n(3669)).default("socket.io-client"),u={};function c(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};const n=i.url(t,e.path||"/socket.io"),r=n.source,s=n.id,c=n.path,l=u[s]&&c in u[s].nsps;let f;return e.forceNew||e["force new connection"]||!1===e.multiplex||l?(a("ignoring socket cache for %s",r),f=new o.Manager(r,e)):(u[s]||(a("new io instance for %s",r),u[s]=new o.Manager(r,e)),f=u[s]),n.query&&!e.query&&(e.query=n.queryKey),f.socket(n.path,e)}e.io=c,e.connect=c,e.default=c,Object.assign(c,{Manager:o.Manager,Socket:s.Socket,io:c,connect:c});var l=n(4514);Object.defineProperty(e,"protocol",{enumerable:!0,get:function(){return l.protocol}}),t.exports=c},4168:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Manager=void 0;const a=n(4679),u=n(8312),c=o(n(4514)),l=n(7149),f=n(5159),h=n(5260),d=s(n(3669)).default("socket.io-client:manager");class p extends h.Emitter{constructor(t,e){var n;super(),this.nsps={},this.subs=[],t&&"object"==typeof t&&(e=t,t=void 0),(e=e||{}).path=e.path||"/socket.io",this.opts=e,a.installTimerFunctions(this,e),this.reconnection(!1!==e.reconnection),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(n=e.randomizationFactor)&&void 0!==n?n:.5),this.backoff=new f.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==e.timeout?2e4:e.timeout),this._readyState="closed",this.uri=t;const r=e.parser||c;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==e.autoConnect,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return void 0===t?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var e;return void 0===t?this._reconnectionDelay:(this._reconnectionDelay=t,null===(e=this.backoff)||void 0===e||e.setMin(t),this)}randomizationFactor(t){var e;return void 0===t?this._randomizationFactor:(this._randomizationFactor=t,null===(e=this.backoff)||void 0===e||e.setJitter(t),this)}reconnectionDelayMax(t){var e;return void 0===t?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,null===(e=this.backoff)||void 0===e||e.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(t){if(d("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;d("opening %s",this.uri),this.engine=new a.Socket(this.uri,this.opts);const e=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=l.on(e,"open",(function(){n.onopen(),t&&t()})),i=l.on(e,"error",(e=>{d("error"),n.cleanup(),n._readyState="closed",this.emitReserved("error",e),t?t(e):n.maybeReconnectOnOpen()}));if(!1!==this._timeout){const t=this._timeout;d("connect attempt will timeout after %d",t),0===t&&r();const n=this.setTimeoutFn((()=>{d("connect attempt timed out after %d",t),r(),e.close(),e.emit("error",new Error("timeout"))}),t);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}return this.subs.push(r),this.subs.push(i),this}connect(t){return this.open(t)}onopen(){d("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(l.on(t,"ping",this.onping.bind(this)),l.on(t,"data",this.ondata.bind(this)),l.on(t,"error",this.onerror.bind(this)),l.on(t,"close",this.onclose.bind(this)),l.on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(t){this.onclose("parse error",t)}}ondecoded(t){a.nextTick((()=>{this.emitReserved("packet",t)}),this.setTimeoutFn)}onerror(t){d("error",t),this.emitReserved("error",t)}socket(t,e){let n=this.nsps[t];return n?this._autoConnect&&!n.active&&n.connect():(n=new u.Socket(this,t,e),this.nsps[t]=n),n}_destroy(t){const e=Object.keys(this.nsps);for(const t of e)if(this.nsps[t].active)return void d("socket %s is still active, skipping close",t);this._close()}_packet(t){d("writing packet %j",t);const e=this.encoder.encode(t);for(let n=0;n<e.length;n++)this.engine.write(e[n],t.options)}cleanup(){d("cleanup"),this.subs.forEach((t=>t())),this.subs.length=0,this.decoder.destroy()}_close(){d("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,e){d("closed due to %s",t),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)d("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const e=this.backoff.duration();d("will wait %dms before reconnect attempt",e),this._reconnecting=!0;const n=this.setTimeoutFn((()=>{t.skipReconnect||(d("attempting reconnect"),this.emitReserved("reconnect_attempt",t.backoff.attempts),t.skipReconnect||t.open((e=>{e?(d("reconnect attempt error"),t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",e)):(d("reconnect success"),t.onreconnect())})))}),e);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}e.Manager=p},7149:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.on=void 0,e.on=function(t,e,n){return t.on(e,n),function(){t.off(e,n)}}},8312:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Socket=void 0;const i=n(4514),o=n(7149),s=n(5260),a=r(n(3669)).default("socket.io-client:socket"),u=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class c extends s.Emitter{constructor(t,e,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=e,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[o.on(t,"open",this.onopen.bind(this)),o.on(t,"packet",this.onpacket.bind(this)),o.on(t,"error",this.onerror.bind(this)),o.on(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...e){if(u.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(e.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(e),this;const n={type:i.PacketType.EVENT,data:e,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"==typeof e[e.length-1]){const t=this.ids++;a("emitting packet with ack id %d",t);const r=e.pop();this._registerAckCallback(t,r),n.id=t}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return!this.flags.volatile||r&&this.connected?this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n):a("discard packet as the transport is not currently writable"),this.flags={},this}_registerAckCallback(t,e){var n;const r=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===r)return void(this.acks[t]=e);const i=this.io.setTimeoutFn((()=>{delete this.acks[t];for(let e=0;e<this.sendBuffer.length;e++)this.sendBuffer[e].id===t&&(a("removing packet with ack id %d from the buffer",t),this.sendBuffer.splice(e,1));a("event with ack id %d has timed out after %d ms",t,r),e.call(this,new Error("operation has timed out"))}),r);this.acks[t]=(...t)=>{this.io.clearTimeoutFn(i),e.apply(this,[null,...t])}}emitWithAck(t,...e){const n=void 0!==this.flags.timeout||void 0!==this._opts.ackTimeout;return new Promise(((r,i)=>{e.push(((t,e)=>n?t?i(t):r(e):r(t))),this.emit(t,...e)}))}_addToQueue(t){let e;"function"==typeof t[t.length-1]&&(e=t.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push(((t,...r)=>{if(n===this._queue[0])return null!==t?n.tryCount>this._opts.retries&&(a("packet [%d] is discarded after %d tries",n.id,n.tryCount),this._queue.shift(),e&&e(t)):(a("packet [%d] was successfully sent",n.id),this._queue.shift(),e&&e(null,...r)),n.pending=!1,this._drainQueue()})),this._queue.push(n),this._drainQueue()}_drainQueue(t=!1){if(a("draining queue"),!this.connected||0===this._queue.length)return;const e=this._queue[0];!e.pending||t?(e.pending=!0,e.tryCount++,a("sending packet [%d] (try n°%d)",e.id,e.tryCount),this.flags=e.flags,this.emit.apply(this,e.args)):a("packet [%d] has already been sent and is waiting for an ack",e.id)}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){a("transport is open - connecting"),"function"==typeof this.auth?this.auth((t=>{this._sendConnectPacket(t)})):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:i.PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,e){a("close (%s)",t),this.connected=!1,delete this.id,this.emitReserved("disconnect",t,e)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case i.PacketType.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case i.PacketType.EVENT:case i.PacketType.BINARY_EVENT:this.onevent(t);break;case i.PacketType.ACK:case i.PacketType.BINARY_ACK:this.onack(t);break;case i.PacketType.DISCONNECT:this.ondisconnect();break;case i.PacketType.CONNECT_ERROR:this.destroy();const e=new Error(t.data.message);e.data=t.data.data,this.emitReserved("connect_error",e)}}onevent(t){const e=t.data||[];a("emitting event %j",e),null!=t.id&&(a("attaching ack callback to event"),e.push(this.ack(t.id))),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const e=this._anyListeners.slice();for(const n of e)n.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&"string"==typeof t[t.length-1]&&(this._lastOffset=t[t.length-1])}ack(t){const e=this;let n=!1;return function(...r){n||(n=!0,a("sending ack %j",r),e.packet({type:i.PacketType.ACK,id:t,data:r}))}}onack(t){const e=this.acks[t.id];"function"==typeof e?(a("calling ack %s with %j",t.id,t.data),e.apply(this,t.data),delete this.acks[t.id]):a("bad ack %s",t.id)}onconnect(t,e){a("socket connected with id %s",t),this.id=t,this.recovered=e&&this._pid===e,this._pid=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach((t=>this.emitEvent(t))),this.receiveBuffer=[],this.sendBuffer.forEach((t=>{this.notifyOutgoingListeners(t),this.packet(t)})),this.sendBuffer=[]}ondisconnect(){a("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((t=>t())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(a("performing disconnect (%s)",this.nsp),this.packet({type:i.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const e=this._anyListeners;for(let n=0;n<e.length;n++)if(t===e[n])return e.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const e=this._anyOutgoingListeners;for(let n=0;n<e.length;n++)if(t===e[n])return e.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const e=this._anyOutgoingListeners.slice();for(const n of e)n.apply(this,t.data)}}}e.Socket=c},3084:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.url=void 0;const i=n(4679),o=r(n(3669)).default("socket.io-client:url");e.url=function(t,e="",n){let r=t;n=n||"undefined"!=typeof location&&location,null==t&&(t=n.protocol+"//"+n.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?n.protocol+t:n.host+t),/^(https?|wss?):\/\//.test(t)||(o("protocol-less url %s",t),t=void 0!==n?n.protocol+"//"+t:"https://"+t),o("parse %s",t),r=i.parse(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+e,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}},4880:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.reconstructPacket=e.deconstructPacket=void 0;const r=n(665);function i(t,e){if(!t)return t;if((0,r.isBinary)(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}if(Array.isArray(t)){const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=i(t[r],e);return n}if("object"==typeof t&&!(t instanceof Date)){const n={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=i(t[r],e));return n}return t}function o(t,e){if(!t)return t;if(t&&!0===t._placeholder){if("number"==typeof t.num&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=o(t[n],e);else if("object"==typeof t)for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=o(t[n],e));return t}e.deconstructPacket=function(t){const e=[],n=t.data,r=t;return r.data=i(n,e),r.attachments=e.length,{packet:r,buffers:e}},e.reconstructPacket=function(t,e){return t.data=o(t.data,e),delete t.attachments,t}},4514:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Decoder=e.Encoder=e.PacketType=e.protocol=void 0;const r=n(5260),i=n(4880),o=n(665),s=(0,n(1618).default)("socket.io-parser");var a;e.protocol=5,function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"}(a=e.PacketType||(e.PacketType={})),e.Encoder=class{constructor(t){this.replacer=t}encode(t){return s("encoding packet %j",t),t.type!==a.EVENT&&t.type!==a.ACK||!(0,o.hasBinary)(t)?[this.encodeAsString(t)]:this.encodeAsBinary({type:t.type===a.EVENT?a.BINARY_EVENT:a.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id})}encodeAsString(t){let e=""+t.type;return t.type!==a.BINARY_EVENT&&t.type!==a.BINARY_ACK||(e+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(e+=t.nsp+","),null!=t.id&&(e+=t.id),null!=t.data&&(e+=JSON.stringify(t.data,this.replacer)),s("encoded %j as %s",t,e),e}encodeAsBinary(t){const e=(0,i.deconstructPacket)(t),n=this.encodeAsString(e.packet),r=e.buffers;return r.unshift(n),r}};class u extends r.Emitter{constructor(t){super(),this.reviver=t}add(t){let e;if("string"==typeof t){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");e=this.decodeString(t);const n=e.type===a.BINARY_EVENT;n||e.type===a.BINARY_ACK?(e.type=n?a.EVENT:a.ACK,this.reconstructor=new c(e),0===e.attachments&&super.emitReserved("decoded",e)):super.emitReserved("decoded",e)}else{if(!(0,o.isBinary)(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");e=this.reconstructor.takeBinaryData(t),e&&(this.reconstructor=null,super.emitReserved("decoded",e))}}decodeString(t){let e=0;const n={type:Number(t.charAt(0))};if(void 0===a[n.type])throw new Error("unknown packet type "+n.type);if(n.type===a.BINARY_EVENT||n.type===a.BINARY_ACK){const r=e+1;for(;"-"!==t.charAt(++e)&&e!=t.length;);const i=t.substring(r,e);if(i!=Number(i)||"-"!==t.charAt(e))throw new Error("Illegal attachments");n.attachments=Number(i)}if("/"===t.charAt(e+1)){const r=e+1;for(;++e&&","!==t.charAt(e)&&e!==t.length;);n.nsp=t.substring(r,e)}else n.nsp="/";const r=t.charAt(e+1);if(""!==r&&Number(r)==r){const r=e+1;for(;++e;){const n=t.charAt(e);if(null==n||Number(n)!=n){--e;break}if(e===t.length)break}n.id=Number(t.substring(r,e+1))}if(t.charAt(++e)){const r=this.tryParse(t.substr(e));if(!u.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return s("decoded %s as %j",t,n),n}tryParse(t){try{return JSON.parse(t,this.reviver)}catch(t){return!1}}static isPayloadValid(t,e){switch(t){case a.CONNECT:return"object"==typeof e;case a.DISCONNECT:return void 0===e;case a.CONNECT_ERROR:return"string"==typeof e||"object"==typeof e;case a.EVENT:case a.BINARY_EVENT:return Array.isArray(e)&&("string"==typeof e[0]||"number"==typeof e[0]);case a.ACK:case a.BINARY_ACK:return Array.isArray(e)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}e.Decoder=u;class c{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const t=(0,i.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}},665:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hasBinary=e.isBinary=void 0;const n="function"==typeof ArrayBuffer,r=Object.prototype.toString,i="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===r.call(Blob),o="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===r.call(File);function s(t){return n&&(t instanceof ArrayBuffer||(t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer)(t))||i&&t instanceof Blob||o&&t instanceof File}e.isBinary=s,e.hasBinary=function t(e,n){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(t(e[n]))return!0;return!1}if(s(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return t(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return!0;return!1}},5260:(t,e,n)=>{"use strict";function r(t){if(t)return function(t){for(var e in r.prototype)t[e]=r.prototype[e];return t}(t)}n.r(e),n.d(e,{Emitter:()=>r}),r.prototype.on=r.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},r.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+t];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;i<r.length;i++)if((n=r[i])===e||n.fn===e){r.splice(i,1);break}return 0===r.length&&delete this._callbacks["$"+t],this},r.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){r=0;for(var i=(n=n.slice(0)).length;r<i;++r)n[r].apply(this,e)}return this},r.prototype.emitReserved=r.prototype.emit,r.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},r.prototype.hasListeners=function(t){return!!this.listeners(t).length}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={id:r,loaded:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),n(2174)})();
\ No newline at end of file
index 82d1a5230258c4945d6fca728de7dcb50de4cb62..8e3274ac299aa4091240816bcd32c9f1e0873e7b 100644 (file)
@@ -27,7 +27,7 @@
         </div>
       </section>
       <nav>
         </div>
       </section>
       <nav>
-        <li><a href="#" data-section="inventory" data-container="main-nav" class="active">Profile</a></li>
+        <li><a href="#" data-section="inventory" data-container="main-nav">Profile</a></li>
         <li><a href="#" data-section="skills" data-container="main-nav">Skills</a></li>
         <li><a href="#" data-section="explore" data-container="main-nav">Explore</a></li>
       </nav>
         <li><a href="#" data-section="skills" data-container="main-nav">Skills</a></li>
         <li><a href="#" data-section="explore" data-container="main-nav">Explore</a></li>
       </nav>
@@ -38,7 +38,7 @@
       <div id="alerts"></div>
 
       <div id="main-nav">
       <div id="alerts"></div>
 
       <div id="main-nav">
-        <section id="inventory" class="tab active">INVENTORY</section>
+        <section id="inventory" class="tab">INVENTORY</section>
         <section id="skills" class="tab">SKILLS</section>
         <section id="explore" class="tab">
           <div id="map"></div>
         <section id="skills" class="tab">SKILLS</section>
         <section id="explore" class="tab">
           <div id="map"></div>
index 37201c8c933c545f1f84b77af83498fb7fd90ede..2e1bfbaed0c32d6761b7854d1b08bc01f84b8079 100644 (file)
@@ -46,12 +46,13 @@ export async function createPaths(): Promise<void> {
     base('Paths').select().eachPage(async (records, next) => {
       await db('paths').insert(records.map(r => {
         stats.paths++;
     base('Paths').select().eachPage(async (records, next) => {
       await db('paths').insert(records.map(r => {
         stats.paths++;
-        console.log(`Path from ${r.fields['Starting City Name'][0]} => ${r.fields['Ending City Name'][0]}`);
+        console.log(`Path from ${r.fields['Starting City Name'][0]} => ${r.fields['Ending City Name'][0]} (${r.fields.distance})`);
         return {
           starting_city: r.fields.starting_city_id[0],
         return {
           starting_city: r.fields.starting_city_id[0],
-          ending_city: r.fields.ending_city_id[0]
+          ending_city: r.fields.ending_city_id[0],
+          distance: parseInt(r.fields.distance?.toString() || '20')
         }
         }
-      })).onConflict(['starting_city', 'ending_city']).ignore();
+      })).onConflict(['starting_city', 'ending_city']).merge();
 
       next();
     }).finally(() => {
 
       next();
     }).finally(() => {
index 8d16cea8335e45f3abe2a082de2f30239b5d1220..b1a3445d0757c92ef7c9e67b17b0553b01e556e5 100644 (file)
@@ -3,7 +3,7 @@ import $ from 'jquery';
 import {expToLevel, maxHp, Player, StatDef, StatDisplay} from '../shared/player';
 import { authToken, http } from './http';
 import { CustomEventManager } from './events';
 import {expToLevel, maxHp, Player, StatDef, StatDisplay} from '../shared/player';
 import { authToken, http } from './http';
 import { CustomEventManager } from './events';
-import {Fight, MonsterForFight, MonsterForList} from '../shared/monsters';
+import {Fight, FightTrigger, MonsterForFight, MonsterForList} from '../shared/monsters';
 import {FightRound} from '../shared/fight';
 import { City, Location, LocationType, Path } from '../shared/map'
 import { v4 as uuid } from 'uuid';
 import {FightRound} from '../shared/fight';
 import { City, Location, LocationType, Path } from '../shared/map'
 import { v4 as uuid } from 'uuid';
@@ -15,6 +15,7 @@ import { configureChat } from './chat';
 import { SocketEvent } from './socket-event.client';
 import * as EventList from '../events/client';
 import { TimeManager } from '../shared/time';
 import { SocketEvent } from './socket-event.client';
 import * as EventList from '../events/client';
 import { TimeManager } from '../shared/time';
+import { TravelDTO } from '../events/travel/shared';
 
 
 const time = new TimeManager();
 
 
 const time = new TimeManager();
@@ -115,10 +116,7 @@ socket.on('connect', () => {
   console.log(`Connected: ${socket.id}`);
 });
 
   console.log(`Connected: ${socket.id}`);
 });
 
-socket.on('ready', () => {
-  console.log('Server connection verified');
-  socket.emit('inventory');
-});
+socket.on('ready', bootstrap);
 
 socket.on('server-stats', (data: {onlinePlayers: number}) => {
   $('#server-stats').html(`${data.onlinePlayers} players online`);
 
 socket.on('server-stats', (data: {onlinePlayers: number}) => {
   $('#server-stats').html(`${data.onlinePlayers} players online`);
@@ -187,14 +185,17 @@ socket.on('skills', (data: {skills: Skill[]}) => {
   $('#skills').html(html);
 });
 
   $('#skills').html(html);
 });
 
-events.on('alert', (data: {type: string, text: string}) => {
+function Alert(text: string, type: string = 'error') {
   let id = uuid();
   let id = uuid();
-  $('#alerts').append(`<div class="alert ${data.type}" id="alert-${id}">${data.text}</div>`);
+  $('#alerts').append(`<div class="alert ${type}" id="alert-${id}">${text}</div>`);
 
   setTimeout(() => {
     $(`#alert-${id}`).remove();
   }, 3000);
 
   setTimeout(() => {
     $(`#alert-${id}`).remove();
   }, 3000);
+}
 
 
+events.on('alert', (data: {type: string, text: string}) => {
+  Alert(data.text, data.type);
 });
 
 socket.on('alert', data => {
 });
 
 socket.on('alert', data => {
@@ -216,24 +217,44 @@ socket.on('player', (player: Player) => {
   updatePlayer();
 });
 
   updatePlayer();
 });
 
+async function fetchState() {
+  const res = await http.get('/state');
+  cache.set('state', res);
+}
 
 
-$('nav a').on('click', e => {
+$('nav a').on('click', async e => {
   e.preventDefault();
   e.stopPropagation();
 
   e.preventDefault();
   e.stopPropagation();
 
+  const tabsDisabledInFight = [
+    'skills',
+    'inventory'
+  ];
+
+  await fetchState();
+  const state = cache.get('state');
 
   const $tabContainer = $(`#${$(e.target).data('container')}`);
 
   const $tabContainer = $(`#${$(e.target).data('container')}`);
+  let tabSection = $(e.target).data('section');
+
+  if(tabsDisabledInFight.includes(tabSection) && state?.fight !== null) {
+    Alert('You are currently in a fight', 'error');
+    // we want to force users over to the explore tab 
+    // if they are currently in a fight and trying to 
+    // access a disabled section
+    tabSection = 'explore';
+  }
 
   $tabContainer.find('.tab').removeClass('active');
 
 
   $tabContainer.find('.tab').removeClass('active');
 
-  $(`#${$(e.target).data('section')}`).addClass('active');
+  $(`#${tabSection}`).addClass('active');
 
   if(e.target.innerHTML !== 'Settings') {
     $(e.target).closest('nav').find('a').removeClass('active');
 
   if(e.target.innerHTML !== 'Settings') {
     $(e.target).closest('nav').find('a').removeClass('active');
-    $(e.target).addClass('active');
+    $(`nav a[data-section=${tabSection}]`).addClass('active');
   }
 
   }
 
-  events.emit(`tab:${$(e.target).data('section')}`);
+  events.emit(`tab:${tabSection}`);
 });
 
 events.on('tab:inventory', () => {
 });
 
 events.on('tab:inventory', () => {
@@ -416,8 +437,14 @@ $('body').on('click', '.unequip-item', e => {
   socket.emit('unequip', { id: $(e.target).data('id') });
 });
 
   socket.emit('unequip', { id: $(e.target).data('id') });
 });
 
+function setMapBackground(city_id: number) {
+  $('#explore').css({
+    'background-image': `linear-gradient(to left top, rgba(255,255,255,0) 0%,rgb(255,255,255) 100%), linear-gradient(to left, rgba(255, 255, 255, 0) 0%, rgb(255, 255, 255) 100%), url("/assets/img/map/${city_id}.jpeg")`
+  });
+}
+
 events.on('renderMap', async function renderMap(data: { city: City, locations: Location[], paths: Path[]}) {
 events.on('renderMap', async function renderMap(data: { city: City, locations: Location[], paths: Path[]}) {
-  if(!data || cache.has('currentMapHTML')) {
+  if(!data && cache.has('currentMapHTML')) {
     $('#map').html(cache.get('currentMapHTML'));
     return;
   }
     $('#map').html(cache.get('currentMapHTML'));
     return;
   }
@@ -426,10 +453,7 @@ events.on('renderMap', async function renderMap(data: { city: City, locations: L
     console.error('oh no.. this got triggered without any city data');
   }
 
     console.error('oh no.. this got triggered without any city data');
   }
 
-  $('#explore').css({
-    'background-image': `linear-gradient(to left top, rgba(255,255,255,0) 0%,rgb(255,255,255) 100%), linear-gradient(to left, rgba(255, 255, 255, 0) 0%, rgb(255, 255, 255) 100%), url("/assets/img/map/${data.city.id}.jpeg")`
-  });
-
+  setMapBackground(data.city.id);
 
   const servicesParsed: Record<LocationType, string[]> = {
     'SERVICES': [],
 
   const servicesParsed: Record<LocationType, string[]> = {
     'SERVICES': [],
@@ -481,7 +505,7 @@ function renderStatBoost(name: string, val: number | string): string {
   if(typeof val === 'number') {
     valSign = val > 0 ? '+' : '-';
   }
   if(typeof val === 'number') {
     valSign = val > 0 ? '+' : '-';
   }
-  return `<span class="requirement-title">${name}</span>: <span class="requirement-value ${typeof val === 'number' && val > 0 ? "success": "error"}">${valSign}${val}</span>`;
+  return `<span class="requirement-title">${name}</span>: <span class="requirement-value ${typeof val === 'number' ? (val > 0 ? "success": "error") : ""}">${valSign}${val}</span>`;
 }
 
 function renderInventoryItem(item: EquippedItemDetails , action: (item: EquippedItemDetails) => string): string {
 }
 
 function renderInventoryItem(item: EquippedItemDetails , action: (item: EquippedItemDetails) => string): string {
@@ -505,7 +529,7 @@ function renderInventoryItem(item: EquippedItemDetails , action: (item: Equipped
       ${item.boosts.dexterity ? renderStatBoost('DEX', item.boosts.dexterity) : ''}
       ${item.boosts.intelligence ? renderStatBoost('INT', item.boosts.intelligence) : ''}
       ${item.boosts.damage ? renderStatBoost('DMG', item.boosts.damage) : ''}
       ${item.boosts.dexterity ? renderStatBoost('DEX', item.boosts.dexterity) : ''}
       ${item.boosts.intelligence ? renderStatBoost('INT', item.boosts.intelligence) : ''}
       ${item.boosts.damage ? renderStatBoost('DMG', item.boosts.damage) : ''}
-      ${item.boosts.damage_mitigation ? renderStatBoost('MIT', item.boosts.damage_mitigation)+'%' : ''}
+      ${item.boosts.damage_mitigation ? renderStatBoost('MIT', item.boosts.damage_mitigation.toString())+'%' : ''}
       ${['WEAPON','SPELL'].includes(item.type) ? '': generateProgressBar(item.currentAp, item.maxAp, '#7be67b')}
       </div>
       ${item.hasOwnProperty('id') ? `<div>${item.cost.toLocaleString()}G</div>` : ''}
       ${['WEAPON','SPELL'].includes(item.type) ? '': generateProgressBar(item.currentAp, item.maxAp, '#7be67b')}
       </div>
       ${item.hasOwnProperty('id') ? `<div>${item.cost.toLocaleString()}G</div>` : ''}
@@ -538,8 +562,8 @@ function renderShopItem(item: ShopItem, action: (item: ShopItem) => string): str
       ${item.boosts.dexterity ? renderStatBoost('DEX', item.boosts.dexterity) : ''}
       ${item.boosts.intelligence ? renderStatBoost('INT', item.boosts.intelligence) : ''}
       ${item.boosts.damage ? renderStatBoost(item.affectedSkills.includes('restoration_magic') ? 'HP' : 'DMG', item.boosts.damage) : ''}
       ${item.boosts.dexterity ? renderStatBoost('DEX', item.boosts.dexterity) : ''}
       ${item.boosts.intelligence ? renderStatBoost('INT', item.boosts.intelligence) : ''}
       ${item.boosts.damage ? renderStatBoost(item.affectedSkills.includes('restoration_magic') ? 'HP' : 'DMG', item.boosts.damage) : ''}
-      ${item.boosts.damage_mitigation ? renderStatBoost('MIT', item.boosts.damage_mitigation)+'%' : ''}
-      ${['WEAPON','SPELL'].includes(item.type) ? '' : renderStatBoost('AP', item.maxAp)}
+      ${item.boosts.damage_mitigation ? renderStatBoost('MIT', item.boosts.damage_mitigation.toString())+'%' : ''}
+      ${['WEAPON','SPELL'].includes(item.type) ? '' : renderStatBoost('AP', item.maxAp.toString())}
       </div>
       ${item.hasOwnProperty('id') ? `<div>${item.cost.toLocaleString()}G</div>` : ''}
     </div>
       </div>
       ${item.hasOwnProperty('id') ? `<div>${item.cost.toLocaleString()}G</div>` : ''}
     </div>
@@ -609,6 +633,16 @@ $('body').on('click', '.city-emit-event', e => {
   socket.emit(eventName, { args });
 });
 
   socket.emit(eventName, { args });
 });
 
+$('body').on('click', '.emit-event-internal', e => {
+  const $el = $(e.target);
+
+  const eventName = $el.data('event');
+  const args: string[] = $el.data('args')?.toString().split('|');
+
+  console.log(`Trigger internal event [${eventName}]`);
+  events.emit(eventName, args);
+});
+
 
 socket.on('explore:fights', (monsters: MonsterForList[]) => {
   const lastSelectedMonster = cache.get('last-selected-monster');
 
 socket.on('explore:fights', (monsters: MonsterForList[]) => {
   const lastSelectedMonster = cache.get('last-selected-monster');
@@ -624,21 +658,48 @@ socket.on('explore:fights', (monsters: MonsterForList[]) => {
 });
 
 events.on('tab:explore', async () => {
 });
 
 events.on('tab:explore', async () => {
-  const res = await http.get('/fight');
-  if(!res) {
+  const state = cache.get('state');
+  if(cache.get('player').hp <= 0 || (!state.fight && !state.travel)) {
     // get the details of the city
     // render the map!
     let data: {city: City, locations: Location[], paths: Path[]};
     // get the details of the city
     // render the map!
     let data: {city: City, locations: Location[], paths: Path[]};
-    if(!cache.has(('currentMapHTML'))) {
+    if(!cache.has(('currentMapHTML')) || cache.get('player').hp <= 0) {
       data = await http.get(`/city/${cache.get('player').city_id}`);
     }
       data = await http.get(`/city/${cache.get('player').city_id}`);
     }
-    events.emit('renderMap', [data]);
+    events.emit('renderMap', [data, state.travel]);
+
   }
   }
-  else {
-    $('#map').html(renderFight(res));
+  else if(state.fight) {
+    setMapBackground(state.closestTown);
+    $('#map').html(renderFight(state.fight));
+  }
+  else if(state.travel) {
+    // render TRAVEL
+    events.emit('renderTravel', [state.travel]);
   }
 });
 
   }
 });
 
+function renderTravel(data: TravelDTO) {
+  setMapBackground(data.closestTown);
+  let html = `<button class="emit-event" data-event="travel:step">Keep Walking</button>`;
+
+
+  if(data.things.length) {
+    // ok you found something, for now we only support 
+    // monsters, but eventually that will change
+    html += `<button class="emit-event-internal" data-event="startFight" data-args="${data.things[0].id}|travel">Fight</button>`;
+    html += `<p>You see a ${data.things[0].name}.</p>`;
+
+  }
+  else if(data.walkingText) {
+    html += `<p>${data.walkingText}</p>`;
+  }
+
+  $('#map').html(html);
+}
+
+events.on('renderTravel', renderTravel);
+
 function renderFight(monster: MonsterForFight | Fight) {
   const hpPercent = Math.floor((monster.hp / monster.maxHp) * 100);
 
 function renderFight(monster: MonsterForFight | Fight) {
   const hpPercent = Math.floor((monster.hp / monster.maxHp) * 100);
 
@@ -696,17 +757,36 @@ socket.on('fight-over', (data: {roundData: FightRound, monsters: MonsterForFight
     }
   }
 
     }
   }
 
-  if(monsters.length) {
-    const lastSelectedMonster = cache.get('last-selected-monster');
-    // put this above the fight details
-    html.unshift(`<h2>Fight Again</h2><form id="fight-selector"><select id="monster-selector">
-      ${monsters.map(monster => {
-        return `<option value="${monster.id}" ${lastSelectedMonster == monster.id ? 'selected': ''}>${monster.name}</option>`;
-      }).join("\n")}
-      </select> <button type="submit">Fight</button></option>
-    </select></form><hr>`);
+  if(roundData.player.hp === 0) {
+    // prompt to return to town and don't let them do anything
+    html.push(`<p>You were killed...</p>`);
+    html.push('<p><button class="emit-event-internal" data-event="tab:explore" data-args="">Back to Town</button></p>');
+  }
+  else {
+    switch(roundData.fightTrigger) {
+      case 'explore':
+        if(monsters.length) {
+          const lastSelectedMonster = cache.get('last-selected-monster');
+          // put this above the fight details
+          html.unshift(`<h2>Fight Again</h2><form id="fight-selector"><select id="monster-selector">
+            ${monsters.map(monster => {
+              return `<option value="${monster.id}" ${lastSelectedMonster == monster.id ? 'selected': ''}>${monster.name}</option>`;
+            }).join("\n")}
+            </select> <button type="submit">Fight</button></option>
+          </select></form><hr>`);
+        }
+      break;
+      case 'travel':
+        html.push(`<p><button class="emit-event" data-event="travel:step">Keep Walking</button></p>`);
+      break;
+      default:
+        console.error(`Unknown fight trigger [${roundData.fightTrigger}]`, roundData);
+      break;
+    }
   }
 
   }
 
+
+
   $('#fight-results').html(html.join("\n"));
   $('#fight-actions').html('');
 
   $('#fight-results').html(html.join("\n"));
   $('#fight-actions').html('');
 
@@ -722,10 +802,7 @@ socket.on('fight-round', (data: FightRound) => {
   $('#fight-results').html(data.roundDetails.map(d => `<div>${d}</div>`).join("\n"));
 });
 
   $('#fight-results').html(data.roundDetails.map(d => `<div>${d}</div>`).join("\n"));
 });
 
-$('body').on('submit', '#fight-selector', async e => {
-  e.preventDefault();
-  e.stopPropagation();
-
+async function startFight(monsterId: string, fightTrigger: FightTrigger = 'explore') {
   // check your HP first
   if(cache.get('player').hp <= 0) {
     events.emit('alert', [{
   // check your HP first
   if(cache.get('player').hp <= 0) {
     events.emit('alert', [{
@@ -735,13 +812,12 @@ $('body').on('submit', '#fight-selector', async e => {
     return;
   }
 
     return;
   }
 
-  const monsterId = $('#monster-selector option:selected').val();
-
   cache.set('last-selected-monster', monsterId);
 
   try {
     const monster: MonsterForFight = await http.post('/fight', {
       monsterId,
   cache.set('last-selected-monster', monsterId);
 
   try {
     const monster: MonsterForFight = await http.post('/fight', {
       monsterId,
+      fightTrigger
     });
 
     $('#map').html(renderFight(monster));
     });
 
     $('#map').html(renderFight(monster));
@@ -752,7 +828,22 @@ $('body').on('submit', '#fight-selector', async e => {
       text: 'Sorry, you can\'t start that fight'
     }]);
   }
       text: 'Sorry, you can\'t start that fight'
     }]);
   }
+}
+
+events.on('startFight', startFight);
+
+$('body').on('submit', '#fight-selector', async e => {
+  e.preventDefault();
+  e.stopPropagation();
 
 
+  const monsterId = $('#monster-selector option:selected').val();
+
+  if(monsterId) {
+    startFight(monsterId.toString());
+  }
+  else {
+    console.error(`Invalid monster id [${monsterId}]`);
+  }
 
 });
 
 
 });
 
@@ -838,3 +929,9 @@ $('body').on('click', '#logout', async e => {
   }
 
 });
   }
 
 });
+
+function bootstrap() {
+  console.log('Server connection verified');
+  socket.emit('inventory');
+  $('nav a').first().click();
+}
index e3f363491a4750126f978d991f4bfd858882eb89..df8fb8ad80b6003193e8c9fb1b30d1bd8fde6a68 100644 (file)
@@ -163,6 +163,7 @@ export const heal: SocketEvent = {
 
 
     text.push(`<p>${getText('heal_successful', service, city)}</p>`);
 
 
     text.push(`<p>${getText('heal_successful', service, city)}</p>`);
+    text.push('<p><button class="emit-event-internal" data-event="tab:explore">Back to Town</button></p>');
     api.socket.emit('city:service:healer', {
       text: text.join("\n")
     });
     api.socket.emit('city:service:healer', {
       text: text.join("\n")
     });
index 9bc2832146bdc21b95174b7e5c56273cc327511c..df11e92c043a43edc624b1b692d16247048f8323 100644 (file)
@@ -1,11 +1,18 @@
 import {SocketEvent} from "../../client/socket-event.client";
 import {SocketEvent} from "../../client/socket-event.client";
-import { DTO } from './shared';
+import $ from 'jquery';
+import { TravelDTO } from './shared';
 
 export const travel: SocketEvent = new SocketEvent(
   'city:travel',
 
 export const travel: SocketEvent = new SocketEvent(
   'city:travel',
-  (api, data: DTO) => {
+  (api, data) => {
+    api.events.emit('renderTravel',[data as TravelDTO]);
+  }
+);
+
+export const renderCity: SocketEvent = new SocketEvent(
+  'city:display',
+  async (api, data) => {
     api.cache.delete('currentMapHTML');
     api.events.emit('renderMap', [data]);
     api.cache.delete('currentMapHTML');
     api.events.emit('renderMap', [data]);
-
   }
   }
-);
+)
index 32b8a0bba04e30e9b0f1fe3e128e6426c8cf23f5..b7c3b423d20e74dc2460ae08cfd95f9ff7e501dd 100644 (file)
@@ -1,16 +1,25 @@
 import {movePlayer, updatePlayer} from "../../server/player";
 import {movePlayer, updatePlayer} from "../../server/player";
-import {getCityDetails, getAllServices, getAllPaths} from "../../server/map";
+import {getCityDetails, getAllServices, getAllPaths, travel, getTravelPlan, stepForward, completeTravel} from "../../server/map";
 import {SocketEvent} from "../../server/socket-event.server";
 import {SocketEvent} from "../../server/socket-event.server";
+import { sample, random } from 'lodash';
+import { createFight, getRandomMonster, loadMonster } from "../../server/monster";
 
 
-export const travel: SocketEvent = {
+export const explore: SocketEvent = {
   eventName: 'city:travel',
   handler: async (api, data: { args: string }) => {
   eventName: 'city:travel',
   handler: async (api, data: { args: string }) => {
+    if(api.player.hp <= 0) {
+      api.socket.emit('alert', {
+        type: 'error',
+        text: 'Sorry, you need some HP to start your travel'
+      });
+      return;
+    }
+
     const destinationCity = parseInt(data.args);
 
     const destinationCity = parseInt(data.args);
 
-    console.log(`${api.player.username} attempting travel to ${destinationCity}`);
 
     if(!destinationCity || isNaN(destinationCity)) {
 
     if(!destinationCity || isNaN(destinationCity)) {
-      console.log('Bad input!');
+      console.log(`Invalid destination city [${destinationCity}]`);
       return;
     }
 
       return;
     }
 
@@ -18,28 +27,80 @@ export const travel: SocketEvent = {
       const city = await getCityDetails(destinationCity);
 
       if(!city) {
       const city = await getCityDetails(destinationCity);
 
       if(!city) {
-        console.log('Bad city input');
-        // do nothing.. not a real place
+        console.log(`Invalid destination city [${destinationCity}]`);
         return;
       }
 
         return;
       }
 
-      api.player.city_id = city.id;
+      console.log(`${api.player.username} attempting travel to ${city.name}`);
+      const travelPlan = await travel(api.player, city.id);
+
+      api.socket.emit('city:travel', {
+        things: [],
+        closestTown: api.player.city_id,
+        walkingText: ''
+      });
+    }
+    catch(e) {
+      console.log(e);
+    }
+  }
+}
+
+const walkingText: string[] = [
+  'You take a step forward',
+  'You keep moving'
+];
+
+export const nextStep: SocketEvent = {
+  eventName: 'travel:step',
+  handler: async (api, data: { args: string }) => {
+    const travelPlan = await getTravelPlan(api.player.id);
+
+    if(!travelPlan) {
+      return;
+    }
 
 
-      await movePlayer(city.id, api.player.id);
+    travelPlan.current_position++;
+    if(travelPlan.current_position >= travelPlan.total_distance) {
+      const travel = await completeTravel(api.player.id);
 
 
-      const [locations, paths] = await Promise.all([
-        getAllServices(city.id),
-        getAllPaths(city.id)
+      api.player.city_id = travel.destination_id;
+      await movePlayer(travel.destination_id, api.player.id);
+
+      const [city, locations, paths] = await Promise.all([
+        getCityDetails(travel.destination_id),
+        getAllServices(travel.destination_id),
+        getAllPaths(travel.destination_id)
       ]);
 
       ]);
 
-      api.socket.emit('city:travel', {
+      api.socket.emit('city:display', {
         city,
         locations,
         paths
       });
     }
         city,
         locations,
         paths
       });
     }
-    catch(e) {
-      console.log(e);
+    else {
+      // update existing plan..
+      // decide if they will run into anything
+      const travelPlan = await stepForward(api.player.id);
+
+      const closest: number = (travelPlan.current_position / travelPlan.total_distance) > 0.5 ? travelPlan.destination_id : travelPlan.source_id;
+
+      // @TODO send back monsters
+      const chanceToSeeMonster = random(0, 100);
+      // 20% chance to see monster
+      const things: any[] = [];
+      if(chanceToSeeMonster < 20 || true) {
+        const monster = await getRandomMonster([closest]);
+        things.push(monster);
+      }
+
+      // send back NOTHING!
+      api.socket.emit('city:travel', {
+        things,
+        closestTown: closest,
+        walkingText: sample(walkingText)
+      });
     }
   }
     }
   }
-}
+};
index 6a82c19c8e1f8133db251b5331cdadd3eb13d1d8..fac8f9f61aa4f6d961b97429fd82c0c74f9b1997 100644 (file)
@@ -5,3 +5,9 @@ export type DTO = {
   locations: Location[],
   paths: Path[]
 }
   locations: Location[],
   paths: Path[]
 }
+
+export type TravelDTO = {
+  things: any[],
+  walkingText: string,
+  closestTown: number;
+}
index 885e49b809b121e1e3a6c15f3c71f95bfc56c369..fb4492a66eda08740d3fd74d3ab753f6d41fc498 100644 (file)
@@ -10,15 +10,14 @@ import { loadPlayer, createPlayer, updatePlayer } from './player';
 import * as _ from 'lodash';
 import {broadcastMessage, Message} from '../shared/message';
 import {expToLevel, maxHp, Player} from '../shared/player';
 import * as _ from 'lodash';
 import {broadcastMessage, Message} from '../shared/message';
 import {expToLevel, maxHp, Player} from '../shared/player';
-import { professionList } from '../shared/profession';
 import {clearFight, createFight, getMonsterList, loadMonster, loadMonsterFromFight, loadMonsterWithFaction, saveFightState} from './monster';
 import {FightRound} from '../shared/fight';
 import {addInventoryItem, deleteInventoryItem, getEquippedItems, getInventory, updateAp} from './inventory';
 import {clearFight, createFight, getMonsterList, loadMonster, loadMonsterFromFight, loadMonsterWithFaction, saveFightState} from './monster';
 import {FightRound} from '../shared/fight';
 import {addInventoryItem, deleteInventoryItem, getEquippedItems, getInventory, updateAp} from './inventory';
-import {MonsterForFight} from '../shared/monsters';
+import {FightTrigger, MonsterForFight} from '../shared/monsters';
 import {getShopItem } from './shopItem';
 import {EquippedItemDetails} from '../shared/equipped';
 import {ArmourEquipmentSlot, EquipmentSlot} from '../shared/inventory';
 import {getShopItem } from './shopItem';
 import {EquippedItemDetails} from '../shared/equipped';
 import {ArmourEquipmentSlot, EquipmentSlot} from '../shared/inventory';
-import { getAllPaths, getAllServices, getCityDetails } from './map';
+import { clearTravelPlan, getAllPaths, getAllServices, getCityDetails, getTravelPlan, travel } from './map';
 import { signup, login } from './auth';
 import {db} from './lib/db';
 import { getPlayerSkills, getPlayerSkillsAsObject, updatePlayerSkills } from './skills';
 import { signup, login } from './auth';
 import {db} from './lib/db';
 import { getPlayerSkills, getPlayerSkillsAsObject, updatePlayerSkills } from './skills';
@@ -42,7 +41,7 @@ app.use(express.json());
 
 const io = new Server(server);
 
 
 const io = new Server(server);
 
-const cache: Record<string, any> = {};
+const cache = new Map<string, any>();
 const chatHistory: Message[] = [];
 
 function calcAp(inventoryItem: EquippedItemDetails[], socket: Socket) {
 const chatHistory: Message[] = [];
 
 function calcAp(inventoryItem: EquippedItemDetails[], socket: Socket) {
@@ -70,7 +69,7 @@ setTimeout(setServerStats, 5000);
 io.on('connection', async socket => {
   logger.log(`socket ${socket.id} connected, authToken: ${socket.handshake.headers['x-authtoken']}`);
 
 io.on('connection', async socket => {
   logger.log(`socket ${socket.id} connected, authToken: ${socket.handshake.headers['x-authtoken']}`);
 
-  const authToken = socket.handshake.headers['x-authtoken'].toString() === 'null' ? null : socket.handshake.headers['x-authtoken'].toString();
+  let authToken = socket.handshake.headers['x-authtoken'].toString() === 'null' ? null : socket.handshake.headers['x-authtoken'].toString();
 
   let player: Player;
   if(authToken) {
 
   let player: Player;
   if(authToken) {
@@ -80,12 +79,17 @@ io.on('connection', async socket => {
   if(!player) {
     logger.log(`Creating player`);
     player = await createPlayer();
   if(!player) {
     logger.log(`Creating player`);
     player = await createPlayer();
+    authToken = player.id;
+    socket.handshake.headers['x-authtoken'] = authToken;
   }
 
   }
 
-  cache[`token:${player.id}`] = socket.id;
-
   logger.log(`Socket [${socket.id}] auth token: ${player.id}`);
 
   logger.log(`Socket [${socket.id}] auth token: ${player.id}`);
 
+  // ref to get the socket id for a particular player
+  cache.set(`socket:${player.id}`, socket.id);
+  // ref to get the player object
+  cache.set(`token:${player.id}`, player);
+
   socket.emit('init', {
     version
   });
   socket.emit('init', {
     version
   });
@@ -131,7 +135,14 @@ io.on('connection', async socket => {
         }
       }
       else {
         }
       }
       else {
-        message = broadcastMessage(player.username, msg);
+        const authToken = socket.handshake.headers['x-authtoken'];
+        if(cache.has(`token:${authToken}`)) {
+          const player = cache.get(`token:${authToken}`);
+          message = broadcastMessage(player.username, msg);
+        }
+        else {
+          logger.log(`Missing cache for [token:${authToken}]`);
+        }
       }
 
       if(message) {
       }
 
       if(message) {
@@ -139,13 +150,21 @@ io.on('connection', async socket => {
         chatHistory.slice(-10);
         io.emit('chat', message);
       }
         chatHistory.slice(-10);
         io.emit('chat', message);
       }
+      else {
+        logger.log(`Unset message`);
+      }
     }
   });
 
   socket.on('purchase', async (data) => {
     }
   });
 
   socket.on('purchase', async (data) => {
+    const authToken = socket.handshake.headers['x-authtoken'];
+    if(!cache.has(`token:${authToken}`)) {
+      return;
+    }
+    const player = cache.get(`token:${authToken}`);
     const shopItem = await getShopItem(data.id);
 
     const shopItem = await getShopItem(data.id);
 
-    if(shopItem) {
+    if(shopItem && player) {
       if(player.gold < shopItem.cost) {
         socket.emit('alert', {
           type: 'error',
       if(player.gold < shopItem.cost) {
         socket.emit('alert', {
           type: 'error',
@@ -165,7 +184,6 @@ io.on('connection', async socket => {
 
       socket.emit('updatePlayer', player);
     }
 
       socket.emit('updatePlayer', player);
     }
-
   });
 
   _.each(EventList, event => {
   });
 
   _.each(EventList, event => {
@@ -179,11 +197,19 @@ io.on('connection', async socket => {
   });
 
   socket.on('skills', async () => {
   });
 
   socket.on('skills', async () => {
+    const player = cache.get(`token:${socket.handshake.headers['x-authtoken']}`);
+    if(!player) {
+      return;
+    }
     const skills = await getPlayerSkills(player.id);
     socket.emit('skills', {skills});
   });
 
   socket.on('inventory', async () => {
     const skills = await getPlayerSkills(player.id);
     socket.emit('skills', {skills});
   });
 
   socket.on('inventory', async () => {
+    const player = cache.get(`token:${socket.handshake.headers['x-authtoken']}`);
+    if(!player) {
+      return;
+    }
     const inventory = await getInventory(player.id);
     socket.emit('inventory', {
       inventory
     const inventory = await getInventory(player.id);
     socket.emit('inventory', {
       inventory
@@ -192,16 +218,29 @@ io.on('connection', async socket => {
 
   socket.on('logout', async () => {
     // clear this player from the cache!
 
   socket.on('logout', async () => {
     // clear this player from the cache!
-    console.log(`Player ${player.username} logged out`);
+    const player = cache.get(`token:${socket.handshake.headers['x-authtoken']}`);
+    if(player) {
+      logger.log(`Player ${player.username} logged out`);
+    }
+    else {
+      logger.log(`Invalid user logout`);
+    }
   });
 
   socket.on('fight', async (data: {action: 'attack' | 'cast' | 'flee', target: 'head' | 'body' | 'arms' | 'legs'}) => {
   });
 
   socket.on('fight', async (data: {action: 'attack' | 'cast' | 'flee', target: 'head' | 'body' | 'arms' | 'legs'}) => {
+    const authToken = `token:${socket.handshake.headers['x-authtoken']}`;
+    const player = cache.get(authToken);
+    if(!player) {
+      logger.log(`Invalid token for fight`)
+      return;
+    }
     const monster = await loadMonsterWithFaction(player.id);
     const playerSkills = await getPlayerSkillsAsObject(player.id);
     const roundData: FightRound = {
       monster,
       player,
       winner: 'in-progress',
     const monster = await loadMonsterWithFaction(player.id);
     const playerSkills = await getPlayerSkillsAsObject(player.id);
     const roundData: FightRound = {
       monster,
       player,
       winner: 'in-progress',
+      fightTrigger: monster.fight_trigger,
       roundDetails: [],
       rewards: {
         exp: 0,
       roundDetails: [],
       rewards: {
         exp: 0,
@@ -321,77 +360,36 @@ io.on('connection', async socket => {
     const playerFinalHeal = Math.floor(boost.hp + hpHealAfterMasteries);
 
     roundData.roundDetails.push(`You targeted the monsters ${data.target.toUpperCase()} with ${attackType} damage!`);
     const playerFinalHeal = Math.floor(boost.hp + hpHealAfterMasteries);
 
     roundData.roundDetails.push(`You targeted the monsters ${data.target.toUpperCase()} with ${attackType} damage!`);
-    if(data.target === 'arms') {
-      if(monster.armsAp > 0) {
-        monster.armsAp -= playerFinalDamage;
-
-        roundData.roundDetails.push(`You dealt ${playerFinalDamage} damage to their armour`);
-        if(monster.armsAp < 0) {
-
-          roundData.roundDetails.push(`You destroyed the ${monster.name}'s armour!'`);
-          roundData.roundDetails.push(`You dealt ${monster.armsAp * -1} damage to their HP`);
-          monster.hp += monster.armsAp;
-          monster.armsAp = 0;
-        }
-      }
-      else {
-        roundData.roundDetails.push(`You hit the ${monster.name} for ${playerFinalDamage} damage.`);
-        monster.hp -= playerFinalDamage;
-      }
-    }
-    else if (data.target === 'head') {
-      if(monster.helmAp > 0) {
-        monster.helmAp -= playerFinalDamage;
-
-        roundData.roundDetails.push(`You dealt ${playerFinalDamage} damage to their armour`);
-        if(monster.helmAp < 0) {
-
-          roundData.roundDetails.push(`You destroyed the ${monster.name}'s armour!'`);
-          roundData.roundDetails.push(`You dealt ${monster.armsAp * 1} damage to their HP`);
-          monster.hp += monster.helmAp;
-          monster.helmAp = 0;
-        }
-      }
-      else {
-        roundData.roundDetails.push(`You hit the ${monster.name} for ${playerFinalDamage} damage.`);
-        monster.hp -= playerFinalDamage;
-      }
+    let armourKey: string;
+    switch(data.target) {
+      case 'arms':
+        armourKey = 'armsAp';
+      break;
+      case 'head':
+        armourKey = 'helmAp';
+      break;
+      case 'legs':
+        armourKey = 'legsAp';
+      break;
+      case 'body':
+        armourKey = 'chestAp';
+      break;
     }
     }
-    else if(data.target === 'legs') {
-      if(monster.legsAp > 0) {
-        monster.legsAp -= playerFinalDamage;
 
 
-        roundData.roundDetails.push(`You dealt ${playerFinalDamage} damage to their armour`);
-        if(monster.legsAp < 0) {
+    if(monster[armourKey] && monster[armourKey] > 0) {
+      monster[armourKey] -= playerFinalDamage;
 
 
-          roundData.roundDetails.push(`You destroyed the ${monster.name}'s armour!'`);
-          roundData.roundDetails.push(`You dealt ${monster.legsAp * 1} damage to their HP`);
-          monster.hp += monster.legsAp;
-          monster.legsAp = 0;
-        }
-      }
-      else {
-        roundData.roundDetails.push(`You hit the ${monster.name} for ${playerFinalDamage} damage.`);
-        monster.hp -= playerFinalDamage;
+      roundData.roundDetails.push(`You dealt ${playerFinalDamage} damage to their armour`);
+      if(monster[armourKey] < 0) {
+        roundData.roundDetails.push(`You destroyed the ${monster.name}'s armour!'`);
+        roundData.roundDetails.push(`You dealt ${monster[armourKey] * -1} damage to their HP`);
+        monster.hp += monster[armourKey];
+        monster[armourKey] = 0;
       }
     }
     else {
       }
     }
     else {
-      if(monster.chestAp > 0) {
-        monster.chestAp -= playerFinalDamage;
-
-        roundData.roundDetails.push(`You dealt ${playerFinalDamage} damage to their armour`);
-
-        if(monster.chestAp < 0) {
-          roundData.roundDetails.push(`You destroyed the ${monster.name}'s armour!'`);
-          roundData.roundDetails.push(`You dealt ${monster.chestAp * 1} damage to their HP`);
-          monster.hp += monster.chestAp;
-          monster.chestAp = 0;
-        }
-      }
-      else {
-        roundData.roundDetails.push(`You hit the ${monster.name} for ${playerFinalDamage} damage.`);
-        monster.hp -= playerFinalDamage;
-      }
+      roundData.roundDetails.push(`You hit the ${monster.name} for ${playerFinalDamage} damage.`);
+      monster.hp -= playerFinalDamage;
     }
 
     if(monster.hp <= 0) {
     }
 
     if(monster.hp <= 0) {
@@ -420,21 +418,25 @@ io.on('connection', async socket => {
 
         player.hp = maxHp(player.constitution, player.level);
       }
 
         player.hp = maxHp(player.constitution, player.level);
       }
-      // get the monster location!
-      const rawMonster = await loadMonster(monster.ref_id);
-      const monsterList  = await getMonsterList(rawMonster.location_id);
-      potentialMonsters = monsterList.map(monster => {
-        return {
-          id: monster.id,
-          name: monster.name,
-          level: monster.level,
-          hp: monster.hp,
-          maxHp: monster.maxHp
-        }
-      });
+      // get the monster location if it was an EXPLORED fight
+      if(roundData.fightTrigger === 'explore') {
+        const rawMonster = await loadMonster(monster.ref_id);
+        const monsterList  = await getMonsterList(rawMonster.location_id);
+        potentialMonsters = monsterList.map(monster => {
+          return {
+            id: monster.id,
+            name: monster.name,
+            level: monster.level,
+            hp: monster.hp,
+            maxHp: monster.maxHp,
+            fight_trigger: 'explore'
+          }
+        });
+      }
 
       await clearFight(player.id);
       await updatePlayer(player);
 
       await clearFight(player.id);
       await updatePlayer(player);
+      cache.set(authToken, player);
       socket.emit('fight-over', {roundData, monsters: potentialMonsters});
       return;
     }
       socket.emit('fight-over', {roundData, monsters: potentialMonsters});
       return;
     }
@@ -484,6 +486,9 @@ io.on('connection', async socket => {
 
       await clearFight(player.id);
       await updatePlayer(player);
 
       await clearFight(player.id);
       await updatePlayer(player);
+      await clearTravelPlan(player.id);
+
+      cache.set(authToken, player);
 
       socket.emit('fight-over', {roundData, monsters: []});
       return;
 
       socket.emit('fight-over', {roundData, monsters: []});
       return;
@@ -491,6 +496,7 @@ io.on('connection', async socket => {
 
     await updatePlayer(player);
     await saveFightState(player.id, monster);
 
     await updatePlayer(player);
     await saveFightState(player.id, monster);
+    cache.set(authToken, player);
 
     calcAp(equippedItems, socket);
     socket.emit('fight-round', roundData);
 
     calcAp(equippedItems, socket);
     socket.emit('fight-round', roundData);
@@ -526,9 +532,10 @@ app.get('/city/:id', async (req: Request, res: Response) => {
   res.json({city, locations, paths});
 });
 
   res.json({city, locations, paths});
 });
 
-app.get('/fight', authEndpoint, async (req: Request, res: Response) => {
+app.get('/state', authEndpoint, async (req: Request, res: Response) => {
   const authToken = req.headers['x-authtoken'].toString();
   const player: Player = await loadPlayer(authToken)
   const authToken = req.headers['x-authtoken'].toString();
   const player: Player = await loadPlayer(authToken)
+  let closestTown: number = player.city_id;
 
   if(!player) {
     logger.log(`Couldnt find player with id ${authToken}`);
 
   if(!player) {
     logger.log(`Couldnt find player with id ${authToken}`);
@@ -537,10 +544,48 @@ app.get('/fight', authEndpoint, async (req: Request, res: Response) => {
 
   const fight = await loadMonsterFromFight(player.id);
 
 
   const fight = await loadMonsterFromFight(player.id);
 
-  res.json(fight || null);
+  // check if the player is exploring somewhere!
+  const travelPlan = await getTravelPlan(player.id);
+
+  if(travelPlan) {
+    closestTown = (travelPlan.current_position / travelPlan.total_distance) > 0.5 ? travelPlan.source_id : travelPlan.destination_id;
+  }
+  
+  const state = {
+    fight: fight || null,
+    closestTown,
+    travel: travelPlan ? {
+      things: [],
+      closestTown,
+      walkingText: 'You keep walking...'
+    } : null
+  };
+
+  res.json(state);
 
 });
 
 
 });
 
+app.post('/travel', authEndpoint, async (req: Request, res: Response) => {
+  const authToken = req.headers['x-authtoken'].toString();
+  const player: Player = await loadPlayer(authToken)
+  const destination_id = parseInt(req.body.destination_id);
+
+  if(!player) {
+    logger.log(`Couldnt find player with id ${authToken}`);
+    return res.sendStatus(400);
+  }
+
+  if(!destination_id || isNaN(destination_id)) {
+    logger.log(`Invalid destination_id [${req.body.destination_id}]`);
+    return res.sendStatus(400);
+  }
+
+  const travelPlan = travel(player, req.body.destination_id);
+
+  res.json(travelPlan);
+});
+
+
 app.post('/fight', authEndpoint, async (req: Request, res: Response) => {
   const authToken = req.headers['x-authtoken'].toString();
   const player: Player = await loadPlayer(authToken)
 app.post('/fight', authEndpoint, async (req: Request, res: Response) => {
   const authToken = req.headers['x-authtoken'].toString();
   const player: Player = await loadPlayer(authToken)
@@ -556,12 +601,19 @@ app.post('/fight', authEndpoint, async (req: Request, res: Response) => {
   }
 
   const monsterId: number = req.body.monsterId;
   }
 
   const monsterId: number = req.body.monsterId;
+  const fightTrigger: FightTrigger = req.body.fightTrigger;
+
 
   if(!monsterId) {
     logger.log(`Missing monster Id ${monsterId}`);
     return res.sendStatus(400);
   }
 
 
   if(!monsterId) {
     logger.log(`Missing monster Id ${monsterId}`);
     return res.sendStatus(400);
   }
 
+  if(!fightTrigger || !['travel', 'explore'].includes(fightTrigger)) {
+    logger.log(`Invalid fight trigger [${fightTrigger}]`);
+    return res.sendStatus(400);
+  }
+
   const monster = await loadMonster(monsterId);
 
   if(!monster) {
   const monster = await loadMonster(monsterId);
 
   if(!monster) {
@@ -569,14 +621,15 @@ app.post('/fight', authEndpoint, async (req: Request, res: Response) => {
     return res.sendStatus(400);
   }
 
     return res.sendStatus(400);
   }
 
-  const fight = await createFight(player.id, monster);
+  const fight = await createFight(player.id, monster, fightTrigger);
 
   const data: MonsterForFight = {
     id: fight.id,
     hp: fight.hp,
     maxHp: fight.maxHp,
     name: fight.name,
 
   const data: MonsterForFight = {
     id: fight.id,
     hp: fight.hp,
     maxHp: fight.maxHp,
     name: fight.name,
-    level: fight.level
+    level: fight.level,
+    fight_trigger: fight.fight_trigger
   };
   res.json(data);
 });
   };
   res.json(data);
 });
@@ -593,7 +646,7 @@ app.post('/signup', async (req: Request, res: Response) => {
 
   try {
     const player = await loadPlayer(authToken.toString());
 
   try {
     const player = await loadPlayer(authToken.toString());
-    console.log(`Attempted claim for ${player.username}`);
+    logger.log(`Attempted claim for ${player.username}`);
 
     await signup(authToken.toString(), username, password);
 
 
     await signup(authToken.toString(), username, password);
 
@@ -602,7 +655,7 @@ app.post('/signup', async (req: Request, res: Response) => {
       username: username
     });
 
       username: username
     });
 
-    console.log(`Player claimed ${player.username} => ${username}`);
+    logger.log(`Player claimed ${player.username} => ${username}`);
 
     io.emit('chat', broadcastMessage('server', `${player.username} is now ${username}`));
 
 
     io.emit('chat', broadcastMessage('server', `${player.username} is now ${username}`));
 
@@ -614,7 +667,7 @@ app.post('/signup', async (req: Request, res: Response) => {
     });
   }
   catch(e) {
     });
   }
   catch(e) {
-    console.log(e);
+    logger.log(e);
     if(e?.constraint === 'players_username_unique') {
       res.send({
         error: 'That username is already taken.'
     if(e?.constraint === 'players_username_unique') {
       res.send({
         error: 'That username is already taken.'
index 98e40c2f2f399c1da1c023fb016a915aad28fb07..67cd225305b781d85f83d7c9a9fde7efe099dc05 100644 (file)
@@ -1,5 +1,8 @@
 import { City, Location, Path } from "../shared/map";
 import { City, Location, Path } from "../shared/map";
+import type { Player } from '../shared/player';
+import type { Travel } from '../shared/travel';
 import { db } from './lib/db';
 import { db } from './lib/db';
+import { random } from 'lodash';
 
 export async function getAllServices(city_id: number): Promise<Location[]> {
   return db.select('*')
 
 export async function getAllServices(city_id: number): Promise<Location[]> {
   return db.select('*')
@@ -38,3 +41,65 @@ export async function getAllPaths(city_id: number): Promise<Path[]> {
 export async function getCityDetails(city_id: number): Promise<City> {
   return db.first().select('*').from<City>('cities').where({id: city_id});
 }
 export async function getCityDetails(city_id: number): Promise<City> {
   return db.first().select('*').from<City>('cities').where({id: city_id});
 }
+
+export async function travel(player: Player, dest_id: number): Promise<Travel> {
+  const city = await getCityDetails(dest_id);
+  const path = await db.first().select('*').from('paths').where({
+    starting_city: player.city_id,
+    ending_city: dest_id
+  });
+  if(!city) {
+    throw new Error('Invalid destination city');
+  }
+  if(!path) {
+    throw new Error(`Invalid path ${player.city_id} => ${dest_id}`);
+  }
+
+  const deviation = Math.floor(path.distance * (random(3,10)/100));
+  const steps = random(path.distance - deviation, path.distance + deviation);
+
+  const rows = await db('travel').insert({
+    player_id: player.id,
+    source_id: player.city_id,
+    destination_id: dest_id,
+    total_distance: steps
+  }).returning('*');
+
+  if(rows.length !== 1) {
+    console.log(rows);
+    throw new Error('Unexpected response when creating travel');
+  }
+
+  return rows[0] as Travel;
+}
+
+export async function stepForward(player_id: string): Promise<Travel> {
+  const rows = await db('travel').increment('current_position').returning('*');
+
+  if(rows.length !== 1) {
+    console.log(rows);
+    throw new Error('Unexpected response when moving');
+  }
+
+  return rows[0] as Travel;
+}
+
+export async function clearTravelPlan(player_id: string): Promise<Travel> {
+  return completeTravel(player_id);
+}
+
+export async function completeTravel(player_id: string): Promise<Travel> {
+  const rows = await db('travel').where({player_id}).delete().returning('*');
+  if(rows.length !== 1) {
+    console.log(rows);
+    throw new Error('Unexpected response when moving');
+  }
+
+  return rows[0] as Travel;
+}
+
+export async function getTravelPlan(player_id: string): Promise<Travel> {
+  return db.select('*').first().from<Travel>('travel').where({
+    player_id
+  });
+}
index afdbe54bd7a55de9bcf5f89e9520a7cc4a435dc6..1d5f0fd44608e0d49b23e1761eea528c31a260f9 100644 (file)
@@ -1,5 +1,5 @@
 import { db } from './lib/db';
 import { db } from './lib/db';
-import { Fight, Monster, MonsterWithFaction } from '../shared/monsters';
+import { Fight, Monster, MonsterWithFaction, MonsterForList, FightTrigger } from '../shared/monsters';
 import { TimePeriod, TimeManager } from '../shared/time';
 
 const time = new TimeManager();
 import { TimePeriod, TimeManager } from '../shared/time';
 
 const time = new TimeManager();
@@ -60,7 +60,7 @@ export async function saveFightState(authToken: string, monster: Fight) {
   });
 }
 
   });
 }
 
-export async function createFight(playerId: string, monster: Monster): Promise<Fight> {
+export async function createFight(playerId: string, monster: Monster, fightTrigger: FightTrigger): Promise<Fight> {
   const res = await db('fight').insert({
     player_id: playerId,
     name: monster.name,
   const res = await db('fight').insert({
     player_id: playerId,
     name: monster.name,
@@ -77,12 +77,24 @@ export async function createFight(playerId: string, monster: Monster): Promise<F
     legsAp: monster.legsAp,
     armsAp: monster.armsAp,
     maxHp: monster.maxHp,
     legsAp: monster.legsAp,
     armsAp: monster.armsAp,
     maxHp: monster.maxHp,
-    ref_id: monster.id
+    ref_id: monster.id,
+    fight_trigger: fightTrigger
   }).returning<Fight[]>('*');
 
   return res.pop();
 }
 
   }).returning<Fight[]>('*');
 
   return res.pop();
 }
 
+/**
+ * Given a list of cities, it will return a monster that 
+ * exists in any of the exploration zones with every monster 
+ * having an equal probability of appearing
+ */
+export async function getRandomMonster(city_id: number[]): Promise<MonsterForList> {
+  const res = await db.raw('select id,name,level from monsters where location_id in (select id from locations where city_id in (?)) order by random() limit 1', [city_id.join(',')])
+
+  return res.rows[0] as MonsterForList;
+}
+
 export async function clearFight(authToken: string) {
   return db('fight').where({
     player_id: authToken
 export async function clearFight(authToken: string) {
   return db('fight').where({
     player_id: authToken
index 2adc735933e232da0b2d6619cd791c561468ad7e..d0f7b97e226977c44c3b13fd7cea8756a2545856 100644 (file)
@@ -1,4 +1,4 @@
-import {MonsterWithFaction} from "./monsters"
+import {FightTrigger, MonsterWithFaction} from "./monsters"
 import {Player} from "./player"
 
 export type FightReward = {
 import {Player} from "./player"
 
 export type FightReward = {
@@ -10,6 +10,7 @@ export type FightReward = {
 export type FightRound = {
   monster: MonsterWithFaction,
   player: Player,
 export type FightRound = {
   monster: MonsterWithFaction,
   player: Player,
+  fightTrigger: FightTrigger,
   winner: 'player' | 'monster' | 'in-progress',
   rewards: FightReward,
   roundDetails: string[]
   winner: 'player' | 'monster' | 'in-progress',
   rewards: FightReward,
   roundDetails: string[]
index 1bf84dc0bb9fbcde3a36591af66cc5e6cec2e22a..015771f86a0dc2a6c08130bc7a7a7080bc6d07ac 100644 (file)
@@ -19,4 +19,5 @@ export type Path = {
   ending_city: number;
   starting_city_name: string;
   ending_city_name: string;
   ending_city: number;
   starting_city_name: string;
   ending_city_name: string;
+  distance: number;
 }
 }
index af704d8bc6a0cbdba47d13120ceb211e06761181..c2a5fce70ae561dbb82fdd86d08de9b7d51e30ee 100644 (file)
@@ -27,10 +27,13 @@ export type MonsterForList = {
   level: number;
 }
 
   level: number;
 }
 
+export type FightTrigger = 'explore' | 'travel';
+
 export type Fight = Omit<Monster, 'id' | 'faction_id' | 'location_id'> & { 
   id: string,
   player_id: string,
   ref_id: number
 export type Fight = Omit<Monster, 'id' | 'faction_id' | 'location_id'> & { 
   id: string,
   player_id: string,
   ref_id: number
+  fight_trigger: FightTrigger
 };
 
 export type MonsterWithFaction = Fight & {
 };
 
 export type MonsterWithFaction = Fight & {
@@ -44,4 +47,5 @@ export type MonsterForFight = {
   maxHp: number;
   name: string;
   level: number;
   maxHp: number;
   name: string;
   level: number;
+  fight_trigger: FightTrigger;
 }
 }
diff --git a/src/shared/travel.ts b/src/shared/travel.ts
new file mode 100644 (file)
index 0000000..2c5911f
--- /dev/null
@@ -0,0 +1,7 @@
+export type Travel = {
+  player_id: string;
+  source_id: number;
+  destination_id: number;
+  total_distance: number;
+  current_position: number;
+}